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 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