Am I doing this correctly? Projectile code
1 次查看(过去 30 天)
显示 更早的评论
Hi, I just was hoping to double check these results I'm getting, because I'm worried they may be off. These are the formulas/variables I was meant to use:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154480/image.png)
And then, using symbolic toolbox, I created a code to solve for V and Theta:
f1 = sym('1600 = -1/2*9.81*10^2 + V*sin(Theta)*10 + 0')
f2 = sym('1200 = V*cos(Theta)*10 + 0')
result = solve(f1,f2,'V','Theta')
V = result.V
Theta = result.Theta
Valid Initial Velocity, Vo = 241.04336 (m/s)
Valid Launch Angle, θ = 1.04969
I was then meant to check my results by plotting them with vectors. This is the part I am worried about, as I don't know much about physics, so I don't know if this looks right. Any and all help appreciated, thank you.
time = 0:1:10;
y = -1/2*9.81*time.^2 + 241.04336*sin(1.04969)*time - 1600;
x = 241.04336*cos(1.04969)*time - 1200;
plot(x,y)
title('Projectile')
ylabel('Projectile Height (m)')
xlabel('Projectile Range (m)')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154481/image.png)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!