Keep the negative value while squaring

9 visualizaciones (últimos 30 días)
Adam Hunt
Adam Hunt el 2 de Mzo. de 2020
Comentada: Adam Hunt el 2 de Mzo. de 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.

Respuesta aceptada

James Tursa
James Tursa el 2 de Mzo. de 2020
Change this
Velocity(t)^2
to this
abs(Velocity(t)) * Velocity(t)
  1 comentario
Adam Hunt
Adam Hunt el 2 de Mzo. de 2020
thankyou, everythings working how it should now

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Statics and Dynamics en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by