projectile question (calculate return time and compare them)
1 次查看(过去 30 天)
显示 更早的评论
I Have a question from a textbook![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274509/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274509/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274510/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274511/image.png)
where some equations are written wrong. The correct versions of them are as follows:
v(t)=(-mg/k)+(v0+(mg/k))*(1-exp(-kt/m))
y(t)=-(m-g-t/k)+(m/k)(v0+(mg/k))(1-exp(-kt/m))
for part-c
v_bar = - gt +v0
y_bar = - ((gt^2)/2) + v0t
I do the first and second parts (a, b) as follows. But I am not definitely sure about my results.
In addition to this, I could not create any code for part-c. Please I'm asking for a help to do such type question.
function projectile = max_height( m, k )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
g = 9.8;
v0 = 25;
t = 0:0.1:12;
v = - (m*g/k) + ((v0 + (m * g/k)) * exp(- k * t /m));
y = - (m*g*t/k) +((m/k)*(v0 +(m*g/k))*(1-exp(- k * t /m)));
plot(t,y);
[max_height, t] = max(y)
end
7 个评论
darova
2020-3-1
I believe that you should find it numerically. But velocity will never be 0
MATLAB doesn't know where is the ground
You can use find to find first negative value
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274535/image.png)
plot(t,y);
ix = find(y < 0,1);
hold on
plot(t(ix),y(ix),'or')
hold off
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/274536/image.png)
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!