- #1
Maxo
- 160
- 1
Grεετings!
I have some questions about a physics problem. I would appreciate some help with understanding this.
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.
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:
[tex]\vec{a} = \vec{F}/m = -k\cdot \vec{v} = -k\cdot(v_{x},v_{y})\ with \ k=1[/tex]
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 [tex]\vec{a} = -\vec{v}[/tex] 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:
Second try
The first one is wrong, as it looks (almost) exactly like the plot where air resistance is neglected. The second one I'm not really sure about, since it does give a plot which gives a shorter x-displacement for the 20 and the 40 degree projectile which one would expect, but unfortunately it gives a longer x-displacement for the 60 degree projectile which seems wrong.
Can anyone see what might be wrong?
I have some questions about a physics problem. I would appreciate some help with understanding this.
Homework Statement
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.
Homework 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:
[tex]\vec{a} = \vec{F}/m = -k\cdot \vec{v} = -k\cdot(v_{x},v_{y})\ with \ k=1[/tex]
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 [tex]\vec{a} = -\vec{v}[/tex] 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:
[COLOR="Green"]% Note that variables x and y are vectors of the x and y location of the projectile[/COLOR]
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)); [COLOR="DarkGreen"]% angle(1) being equal to the number of radians corresponding to 20 degrees[/COLOR]
fv20y = fv20 * sin(angle(1));
a20x = -fv20x;
a20y = -fv20y;
x20 = vix .* t + (1/2) * a20x .* t.^2; [COLOR="DarkGreen"]% vix and viy being equal to 10*cos(angle(1)) and 10*sin(angle(1))[/COLOR]
% y20 = viy .* t + (1/2) * (-9.81 - a20y) .* t.^2;
plot(x20,y20,'k');
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) * (-9.81 - a20y) .* t.^2;
plot(x20,y20,'k');
The first one is wrong, as it looks (almost) exactly like the plot where air resistance is neglected. The second one I'm not really sure about, since it does give a plot which gives a shorter x-displacement for the 20 and the 40 degree projectile which one would expect, but unfortunately it gives a longer x-displacement for the 60 degree projectile which seems wrong.
Can anyone see what might be wrong?
Last edited: