Keep the negative value while squaring

11 ビュー (過去 30 日間)
Adam Hunt
Adam Hunt 2020 年 3 月 2 日
コメント済み: Adam Hunt 2020 年 3 月 2 日
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)
  1 件のコメント
Adam Hunt
Adam Hunt 2020 年 3 月 2 日
thankyou, everythings working how it should now

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStatics and Dynamics についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by