# Projectile with air resistance

Grεετings! 🙂

I have some questions about a physics problem. I would appreciate some help with understanding this.

1. The problem statement, all variables and given/known data
The task is to plot some graphs for a projectile at different angles, first when neglecting air resistance and then including a formula for air resistance. The projectile initial speed is 10 m/s and you are supposed to plot the projectile movement from three different initial angles: 20 degrees, 40 degrees and 60 degrees.

2. Relevant equations
We are supposed to use a particular formula for air resistance so it has already been given in the task and it looks like this:
$$\vec{a} = \vec{F}/m = -k\cdot \vec{v} = -k\cdot(v_{x},v_{y})\ with \ k=1$$
3. The attempt at a solution
The plots are supposed to be made with MATLAB. I have already solved the task of plotting the projectile movements when neglecting air resistance, but I need some help when doing it with air resistance.

First of all I wonder if I understand the given formula correctly. I haven’t seen a formula for air resistance being written in this way before. When trying to figure it out I would first simplify it, and since k=1 we get simply that $$\vec{a} = -\vec{v}$$ and this would mean that the acceleration in any given point is equal in magnitude to the velocity at that point but opposite in direction. So in the beginning the acceleration would be -10 m/s^2 and in the end it would be +10 m/s^2. Is that a correct interpretation of the formula? I guess this is a possible model to use. But I don’t know how to implement it.

I tried doing it in two ways, but none of them worked as I intended.

First try:

Code:

% Note that variables x and y are vectors of the x and y location of the projectile p20 = polyfit(x,y,2); px = linspace(0,12,100); fp20 = polyval(p20,px); % plot(px,fp20,'k'); % this plot is equal to the one I've plotted when excluding air resistance. v20 = polyder(p20); fv20 = polyval(v20,px); fv20x = fv20 * cos(angle(1)); % angle(1) being equal to the number of radians corresponding to 20 degrees fv20y = fv20 * sin(angle(1)); a20x = -fv20x; a20y = -fv20y; x20 = vix .* t + (1/2) * a20x .* t.^2; % vix and viy being equal to 10*cos(angle(1)) and 10*sin(angle(1)) y20 = viy .* t + (1/2) * a20y .* t.^2; plot(x20,y20,'k');

Second try

Code:

t = linspace(0,2,N); dh = diff(y); dt = diff(t); v = [0 dh./dt]; vx = v * cos(angle(1)); vy = v * cos(angle(1)); a20x = -vx; a20y = -vy; x20 = vix .* t + (1/2) * a20x .* t.^2; y20 = viy .* t + (1/2) * a20y .* t.^2; plot(x20,y20,'k');

But it doesn’t work, although graphs are plotted, they don’t look like they are supposed to. Can anyone see what I’m doing wrong?