- #1

- 90

- 3

[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 :

Code:

```
for i = 1:1000
V(i+1) = V(i)-(1.*s) ;
X(i+1) = V(i);
end
```

If I change it to:

Code:

```
for i = 1:1000
V(i+1) = V(i)-(X(i).*s) ;
X(i+1) = V(i);
end
```