In my problem the linear modal is defined as the first term in the series expansion of [itex]\sin(x)[/itex] so:(adsbygoogle = window.adsbygoogle || []).push({});

[tex] \sin(x) = x - \frac{x^{3}}{3!}+\dots [/tex]

[itex]\sin(x) = x[/itex] is the linear modal.

So with this, I then have to write [itex] \frac{d^{2}x}{dt^{2}} = -\sin(x) [/itex] as a system of [itex]x^{\prime}[/itex] and [itex]y^{\prime}[/itex], so:

[tex] x^{\prime} = y [/tex]

[tex] y^{\prime} = \sin(x) [/tex]

I tried the linear modal in Euler's method, with initial conditions X(1) = 1 and V(1)=0 :

Where s is the step size. But apparently I'm supposed to get a circle when I plot V with respect to X which makes sense, but all I get is a straight line.Code (Text):for i = 1:1000

V(i+1) = V(i)-(1.*s) ;

X(i+1) = V(i);

end

If I change it to:

With s=0.8 I get a spiral, which looks like a development but I'm no closer to the circular shape that I am expecting. I think I just need a fresh pair of eyes to see where perhaps an obvious error lies.Code (Text):for i = 1:1000

V(i+1) = V(i)-(X(i).*s) ;

X(i+1) = V(i);

end

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB "Linear Model" of a Pendulum via Euler's Method

Tags:

Have something to add?

Draft saved
Draft deleted

Loading...

Similar Threads for Linear Model Pendulum |
---|

Coding a numerical approximation for a damped pendulum |

Mathematica FeynArts model file |

Converting Simulink model to C code, integration |

**Physics Forums | Science Articles, Homework Help, Discussion**