Thursday, 13 July 2017

HOW TO CALCULATE THE TRAJECTORY OF A PROJECTILE ON PAPER AND ON MATLAB





HOW TO CALCULATE IT WITH MATLAB

The matlab function file below shows how to transform the above solution into matlab language. Please note that we converted theta, the angle, from degree to radians by multiplying theta by pi/180




function[hmax,dmax,ttot]= trajectory(V0,theta,g)
%this function calculates the maximum height,total time of travel, and the
%maximum horizontal distance reached by a projectile
%v0=intial velocity
%g= acceleration due to gravity
%hmax= maximum height
%dmax= maximum horizontal distane
%ttot= total time of travel
V0x=V0*cos(theta*pi/180);
V0y= V0*sin(theta*pi/180);
hmax=V0y^2/2*g
ttot= 2*V0y/g
dmax=V0x*ttot 






you can copy and paste the code to a matlab file and supply the input variable of your choice to see how it works


1 comment:

  1. This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. sales velocity formula

    ReplyDelete

RELATED POSTS

HOW TO SOLVE LOGARITHMIC EQUATION ON PAPER AND MATLAB