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일

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

카테고리

도움말 센터File Exchange에서 Statics and Dynamics에 대해 자세히 알아보기

제품

태그

질문:

2020년 3월 2일

댓글:

2020년 3월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by