MATLAB Repeat the projectile exercise we did in lecture (result in demos- symPro
ID: 3573255 • Letter: M
Question
MATLAB
Repeat the projectile exercise we did in lecture (result in demos- symProj.m) this time with fully parameterized symbolic functions. Example dx = vo * t * cos (ang) becomes dx (vo, t, ang) = v0 * t * cos (ang) and must be done for dy, dist, and distAng
The demo it is refering to is as follows
syms v0 t ang g
dx = v0 * t * cos(ang)
dy = v0 * t * sin(ang) - 1/2 * g * t^2
tt = solve(dy, t)
dist = subs(dx, t, tt(2))
distAng = subs(dist, {v0, g}, {98, 9.8})
% Bonus Calculus stuff
diff(distAng)
solve(ans)
Explanation / Answer
syms v0 t ang g
dx(v0,t,ang) = v0 * t * cos(ang)
dy(v0,t,ang) = v0 * t * sin(ang) - 1/2 * g * t^2
tt = solve(dy, t)
dist(v0,t,ang) = subs(dx, t, tt(2))
distAng(v0,t,ang) = subs(dist, {v0, g}, {98, 9.8})
% Bonus Calculus stuff
diff(distAng)
%solve(ans)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.