Keep the negative value while squaring

7 次查看(过去 30 天)
Acc_Rocket(t) = (Thrust - weight - drag*Velocity(t)^2)./mass;
when the velocity is negative, the drag should be positive, but squaring the velocity makes the drag negative again, is there a way to make the velocity value keep its negative sign even when squared.

采纳的回答

James Tursa
James Tursa 2020-3-2
Change this
Velocity(t)^2
to this
abs(Velocity(t)) * Velocity(t)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statics and Dynamics 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by