Here's a simple rocket model

>restart;
>m:=t->M*exp(-gamma*t)+M[0]:
>rocket_eq:=m(t)*diff(x(t),t,t)+diff(m(t),t)*u+m(t)*g=0:
>params := [M[0]=0.2, M=1, gamma=10, u=8, g=9.81]:
>rocket_eq:=eval(rocket_eq,params):
>ics:=x(0)=0,D(x)(0)=0:
>sol:=dsolve({rocket_eq,ics},x(t),numeric):
>fv := t0->eval(diff(x(t),t),sol(t0)):
>p1:=plot(fv,0..2, color=red, legend="velocity"):
>fx:=t0->eval(x(t),sol(t0)):
>p2:=plot(fx,0..2,colour=black,legend="position"):
>plots[display]([p1,p2]);

Is there a better way to approach this problem using Maple ?


Please Wait...