I need to solve and plot time, acceleration, velocity, and dsiplacement using a force equation that is in terms of Velocity.

6 次查看(过去 30 天)
I would like to have time as my input and A,V,S as outputs. The changing acceleration causes the real headache. Here is my current code but I dont beleive that it is calculating the way that it should. I am using this to find quarter mile time and speed and 0-60 time .
Power = 125*(10^3); %kW
af = 2.21; %frontal area
m = 1407.497; %mass of the vehicle
rho = 1.225; %density of air
cd = .30; %Coeff of Drag res
cr = .03; %Coeff of roll res
g = 9.81; %gravity
t = 0:.1:40;
v = a.*t
F = (Power./v) - .5*rho*(v.^2)*af*cd - cr*m*g;
a = F/m;
S = v.*t +1/2*a*t.^2;
  1 个评论
James Tursa
James Tursa 2019-2-20
This is typically done in a loop, where you incrementally integrate acceleration into velocity, and velocity into position. You can't do it the way you currently have coded. E.g., that v = a.*t line will not work at all since you don't know "a" at that point.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by