
Trying to solve a motion problem using wxMaxima
Posted:
Apr 14, 2014 2:13 PM


An object moves in 3 dimensions so the magnitude of the velocity is v=sqrt(diff(x,u)^2+diff(y,u)^2+diff(z,u)^2); Now I want u to be a function of time, u(t) and compute u(t) symbolically so that the velocity is a constant v. I can find the solution if I use RK but that doesn't get me the symbolic solution. Am I expecting too much from wxMaxima? Maybe I am not using the integrate function right but the iterative RK solution works. At this time I am trying to do some of this manually the hard way.
Here is my RK solution and graphs the I have in 3 wxMaxima cells. You should be able to cut and paste to see what I am trying to do. In actual use x(u),y(u) and z(u) are probably going to be 3rd or 5th order polynomials.
remvalue(all)$ v: 1$ /* The constant speed to maintain */ x: 1*sin(u)$ /* x as a function of u */ y: 1*sin(u+2*%pi/3)$ /* y as a function of u */ z: 2*sin(0.5*u+2*%pi/3)$ /* z as a function of u */ 'diff(u,t)=dudt: v/sqrt(diff(x,u)^2+diff(y,u)^2+diff(z,u)^2); s: rk(dudt,u,0,[t,0,10,0.01])$
tlist: makelist(s[i][1],i,1,length(s))$ ulist: makelist(s[i][2],i,1,length(s))$ xlist: map(lambda([u],''x),ulist)$ ylist: map(lambda([u],''y),ulist)$ zlist: map(lambda([u],''z),ulist)$ wxplot2d([[discrete,tlist,xlist],[discrete,tlist,ylist],[discrete,tlist,zlist]], [legend,"x","y","z"],[xlabel,"time"],[ylabel,"Positions"]);
dudtlist: map(lambda([u],''dudt),ulist)$ dxdt: diff(x,u)*dudt$ dxdtlist: map(lambda([u],''dxdt),ulist)$ dydt: diff(y,u)*dudt$ dydtlist: map(lambda([u],''dydt),ulist)$ dzdt: diff(z,u)*dudt$ dzdtlist: map(lambda([u],''dzdt),ulist)$ speed: sqrt(dxdt^2+dydt^2+dzdt^2)$ speedlist: map(lambda([u],''speed),ulist)$ wxplot2d([[discrete,tlist,dudtlist], [discrete,tlist,dxdtlist], [discrete,tlist,dydtlist], [discrete,tlist,dzdtlist], [discrete,tlist,speedlist]], [legend,"dudt","dxdt","dydt","dzdt","speed"], [xlabel,"time"],[ylabel,"Speed"],['y,1.1*v,1.1*v]);
BTW, I haven't been on the group for about 2 years. I see the same people are still here.
Thanks,
Peter

