Keep the negative value while squaring

12 vues (au cours des 30 derniers jours)
Adam Hunt
Adam Hunt le 2 Mar 2020
Commenté : Adam Hunt le 2 Mar 2020
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.

Réponse acceptée

James Tursa
James Tursa le 2 Mar 2020
Change this
Velocity(t)^2
to this
abs(Velocity(t)) * Velocity(t)
  1 commentaire
Adam Hunt
Adam Hunt le 2 Mar 2020
thankyou, everythings working how it should now

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Statics and Dynamics dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by