Hi, I am working on an assignment and I am having difficulties with this Eurler method since I am working with vector.

The assignment:

If the aircraft's engine transmits power P to the air, the force of the propellar, Fp, satisfies P=Fpv. Since the force Fp acts in the direction of motion, it can be written in vector form as: (what I have so far)

with(linalg);

v:=Vector(2,1,[vx,vy]); velocity vector

nu:=v->Norm(Vector(v),2); (length of v)

Fd:=-1/2*C*rho*A*nu*v # air resistance

Fl:=1/2*Cl*rho*A*nu*v # liftforce in y direction here v=[-vy,vx]

Fp:=(P/nu^2)*v^2 # power from aircraft

All this adds up to:

F_T:=v->Vector(evalm(Fp/nu(v)^2*v+Fd*nu(v)*v+Fl*nu(v)*zip((x,y)->x*y,v([2,1]),Vector([-1,1]))+Vector(2,1,[0,-m*g]))); # I have tried it and it works

so up til here I am good. It is this next part that I can't seam to get.

Write a routine which uses Euler's method to solve the equation of motion numerically for velocity v(t):

m*dv/dt=F_T(v)

Test the program by trying a plane with intitial velocity [v0,0] such that it maintains this speed when the engines power is P=P0

We have been given an Esolve we can use:

Esolve:=proc(f::procedure,h,x0,y0,N::integer) # Calculates y(x0+n*h) for n=1..N given y0=y(x0) and f(x,y)

local n,y,x;

y[0]:=y0; # Start Value

x:=x0;

for n from 1 to N do

y[n]:= y[n-1]+h*f(y[n-1],x); # Euler's formula

x:=x+h; # Next x

end do;

y;

end proc;

If anyone could help me understand how it works and how to get this to work with vectors I would be very gratefull.