(づ•ᴥ•)づ┬─┬

Notes

Using a curve as an attracting manifold

This is a math post.

I was wondering how easy it is to build a dynamical system with a user-defined attracting curve, e.g., a sine wave. You pick a point and if it starts on the curve, then it remains there, otherwise it smoothly gets attracted to the curve as t increases.

I don't recall where I first saw this, but I think it's a standard construction.

Let's say f: is our function and the curve of interest is (x,y), where y=f(x). Since we want to build a dynamical system, we will assume that x and y depend on t0. To simplify matters, we assume x=1, i.e., constant speed on the x axis and movement from left to right. Now we just need to find the right behavior for y.

How to get y to behave the way we want?

We can first define u:=y(t)f(x(t)). We would want u(t) to be decreasing when u(t)>0 and increasing when u(t)<0. An easy way to do this: fix a k>0 and require that

u=ku

which is an ODE with solution u(t)=exp(kt)u(0). This immediately gives

x(t)=x0+t,y(t)=f(x0+t)+(y0f(x0))ekt.

As time passes, y(t) "forgets" the initial deviation and behaves like f(x). How quickly that happens depends on the magnitude of k.

And so we indeed have a deviation that keeps

x˙=1,y˙=f(x)k(yf(x)),

with target manifold y=f(x) (here f(x)=sinx+12sin(2x)).

constant_k_field

In the plot above, the white curve is f. The rest of the colorful curves are the trajectories of random points -- over time they converge to f(x) (as they should, by construction). You can also see the vector field as little arrows -- this shows how a point should move over time.

Extending to variable gain k(x)

We can also let k be a function of x:

y˙=f(x)k(x)(yf(x)).

The same deviation variable satisfies

u˙=k(x(t))u,x(t)=x0+t,

so

u(t)=u(0)exp(0tk(x0+s)ds),

which means:

y(t)=f(x0+t)+(y0f(x0))exp(0tk(x0+s)ds).

In this case the memory of the initial deviation does not have to go away, i.e., we could pick k so that we never quite stabilize.

Extending to generic curves in n

As long as the curve is reasonable (smooth and without sharp corners), we can define a vector field that has the curve as a stable manifold. That more or less follows the previous ideas.

Find the manifold given the vector field

What if we have a vector field F:nn and we want to find the attracting manifold? We will assume F is a smooth vector field, e.g., C1.

First of all, given a point z0n, z will evolve according to the ODE

z=F(z),z(0)=z0.

This uniquely identifies the trajectory z(t).

We now want to find u:n such that u(z)=0 can identify the attracting manifold. To do this, we first set u to behave like before on the trajectories, i.e., pick k>0 and

du(z(t))dt=ku.

We would like to incorporate F in this (cause it controls how the trajectories move). If we use chain rule on du/dt (and since z=F) and re-arrange:

F·u+ku=0.

This is a transport PDE for u! We can solve it with the method of characteristics. The solution is

u=Φ(ξ)exp(kt),

where ξ identifies the characteristic we are on and Φ is some arbitrary function, e.g., Φ(ξ)=ξ.

At this point, I asked ChatGPT to write the TeX for the previous example, see below:

Example from before

For our vector field (from before), the characteristics satisfy

x˙=1,y˙=f(x)k(yf(x)).

Since x˙=1, we can use x as the time variable. Then

dydx=f(x)k(yf(x)).

Define the residual along the characteristic,

r(x)=y(x)f(x).

Then

r(x)=y(x)f(x)=kr(x).

So

r(x)=Cekx.

Equivalently,

C=ekx(yf(x)).

This quantity labels the characteristic. Therefore the general solution of the transport PDE is

u(x,y)=ekxΦ(ekx(yf(x))),

where Φ is arbitrary.

Choosing Φ(ξ)=ξ gives

u(x,y)=yf(x),

and therefore the attracting manifold is

u(x,y)=0y=f(x).