loicva

15 Reputation

One Badge

8 years, 201 days

MaplePrimes Activity


These are replies submitted by loicva

@John Fredsted Thank you so much for all your help, it works perfectly!

@John Fredsted I am trying to solve the Lagrange equation to obtain the equations of motion of my system. There are 2 terms:

One where I derive L with respect to a angular velocity (this works), like diff( theta2(t),t) and one where L is derived with respect to an angle, for example theta2(t). 

My Lagrange term is very big so I won't post it here but let's consider this:

L= 

the derivative to theta2(t) should be:

But if I do:

expr := eval(L,theta2(t) = u);
expr := diff(expr,u);
expr := eval(expr,u = theta2(t));

 

Then Maple replaces all the theta2's by u. It also replaces the theta2 in 

which represents the angular velocity, not the angle. And it results in zero because maple thinks you take the derivative of u to d/dt which is zero.

@John Fredsted Thank you for the answer!

I tried the first one and it worked, however if I try to do the same but now taking the derivative relative to theta2(t) in the example given it results to zero, because it replaced the theta2(2) in diff(theta2(t),t) by u, and this is not what is supposed to happen. This results in expr = 0.

Do you know how you keep this from happening?

Again, thank you so much for the answer!

 

 

Page 1 of 1