File Exchange

image thumbnail

Euler–Lagrange equation

version 1.0.0.1 (2.72 MB) by

Solve Euler–Lagrange equation automatically.

11 Downloads

Updated

View License

# Information #
You will be able to obtain dynamic system equation automatically when you define energies.

# Required Products #
* MATLAB
* Symbolic Math Toolbox (MuPAD)

# MATLAB Release #
MATLAB 8.1 (R2013a)

Comments and Ratings (3)

Seyhan Özen

Zhiyuan

Zhiyuan (view profile)

Hi Hitoshi,

Great sharing, and I really like your work.

The might be an error when you take partial derivative of q.

For example after
tmpeq2 := subs(tmpeq0, repeqL1 ):
The diff(th(t),t) was also replaced by diff(q, t), which would be wrongly evaluated to be zero.

One way to solve this, first use
tmpeq2 := subs(tmpeq0, repeqL2, repeqL1);
after the partial derivative of tmpeq2, then use
subs( term2, inveqL1, inveqL2);

This won't be an issue if diff(th(t),t) and th(t) are not multiplied together in the Kinematic energy term, but it would if they are, like in the case in file Step10.

Also in Step10, a tiny typo for bar2's y-position:cos(th1(t)) should be sin(th1(t)).

Thanks for sharing.

Best regards,
Zhiyuan Zuo

Updates

1.0.0.1

Updated license

MATLAB Release
MATLAB 8.1 (R2013a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video