Request picture(s) for ODE

123 Views Asked by At

A friend (Dmitry) is teaching ODE and asked me for an example, as we were emailing about a book I bought. He asked for "examples of discrete families of periodic solutions, stable alternating with unstable?" My interpretation is to have the periodic solutions be concentric circles in the plane...

Below I give a graph for $y = \sin \left( x + \sin x \right)$ the blue curve.

I do not believe that i currently have an ODE solver or ODE grapher; the fixed view Wolfram Alpha gives is not helpful. Could someone please post a picture with some solutions of $$ y' = \sin \left( y + \sin y \right) \; \; ,$$ maybe $y(0) = \pi / 2,$ also $y(0) = - \pi / 2 \; \; ?$ These should be, roughly, an arctangent curve and an arccotangent curve.

If it is possible, I would also love to see polar coordinates with $r > 0,$ $$ r' = \sin \left( r + \sin r \right) \; \; ,$$ maybe $r(0) = \pi / 2,$ also $r(0) = 3 \pi / 2 \; \; ?$ In this case, there will be spirals leaving/approaching the constant solutions, too tight to draw...

enter image description here

1

There are 1 best solutions below

7
On BEST ANSWER

Here's the numerical solution I've got using a first order explicit Euler scheme (lazy, I know, but it works well here):

For $y(0)=\pi/2$:

enter image description here

For $y(0)=-\pi/2$:

enter image description here

Here's the code. I do forward propagation from $0$ and then backward propagation from $0$.

x0 <- 0;
xm <- 2*pi;
y0 <- pi/2;
N <- 100;
h <- (xm-x0)/N;
j <- 1;
xj <- 0;
yj <- y0;
x <- 0;
y <- y0;
while(j <= N){
            yj <- yj+ sin(yj+sin(yj))*h;
            xj <- xj+h;
            y <- c(y,yj);
            x <- c(x,xj);
            j <- j+1;
};
plot(x,y,type="l",col="red",xlim=c(-xm,xm),ylim=c(0,yj))
j <- 1;
xj <- 0;
yj <- y0;
x <- 0;
y <- y0;
while(j <= N){
            yj <- yj-sin(yj+sin(yj))*h;
            xj <- xj-h;
            y <- c(y,yj);
            x <- c(x,xj);
            j <- j+1;
};
lines(x,y,col="red")

And the polar case:

For $r(0)=\pi/2$ and $\theta \in [0, 8 \pi]$:

enter image description here

For $r(0)=3\pi/2$ and $\theta \in [0, 8 \pi]$:

enter image description here

Here's the code (it's really the same code, you only need to change the coordinates for plotting):

X <- y*cos(x);
Y <- y*sin(x);
plot(X,Y,type="l",col="purple")

I have also increased $N$ to $500$ to account for the larger range.