swiftset ([info]swiftset) wrote in [info]mathematics,
@ 2008-10-19 17:21:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
I'd like to solve this system analytically if possible:

dx/dt = v - x/r
dy/dt = -y/r

where r = sqrt(x^2+y^2) as usual, and v is a constant. Converting to polar coordinates didn't help: I got

dr/dt = v cos(theta) - 1
dtheta/dt = -v r sin(theta)/(1 + r^2 sin(theta)^2)

which looks ugly. Mathematica hasn't been able to help with either formulation.

Any ideas on how to proceed?



(Post a new comment)


[info]improvedhuman
2008-10-20 01:37 am UTC (link)
Perhaps find dy/dx and solve that way?

(Reply to this)


[info]elengul
2008-10-20 01:57 am UTC (link)
At first glance, I don't think this has a closed form solution. I'm pretty certain that you'll need to do this numerically (like a 4th order Runge-Kutta should be fine). I'll take a look at it later tomorrow evening, though, as I could be wrong.

(Reply to this)


[info]astarcambiata
2008-10-20 02:52 am UTC (link)
The problem with this ODE system is that there simply are too many, highly different solutions which satisfy it.

In fact, pick any function θ:R-->[0,2π], θ(t), and there exists a solution to your DE of the form:
x=vt-∫ cos θ(t) dt
y=-∫ sin θ(t) dt

I found this by considering a more general case of what you provided for an equation, wherein both the x and y derivatives with respect to t had constants, so I could consider a curve γ:R-->R2 such that:
dγ/dt=v-γ/|γ|,
where v is a constant vector. The term γ/|γ| is a vector on the unit circle, and thus a function of angle, which in turn depends on the parameter t.

(Reply to this) (Thread)


[info]astarcambiata
2008-10-20 02:58 am UTC (link)
PS: The solution to the more general case is then:
γ=vt - ∫ Θ(t) dt,
where Θ=γ/|γ|.

You can check that for any choice of t-differentiable Θ, the function γ is a solution of the DE simply by taking the derivative with respect to t.

(Reply to this) (Parent)(Thread)


[info]swiftset
2008-10-20 04:13 am UTC (link)
This doesn't satisfy the DEs.

(Reply to this) (Parent)(Thread)


[info]astarcambiata
2008-10-20 04:50 am UTC (link)
How so?

I suppose I should have been a little more careful: the choice of Θ=γ/|γ| has some limitations beyond merely being unit length, but in general you can choose a wide variety of functions θ(t) so that Θ = icos θ(t)+jsin θ(t) will work, though it is only true that Θ has a closed form integral for very special &theta(t).

If γ=vt - ∫ γ/|γ| dt, then
dγ/dt=d/dt(vt - ∫ γ/|γ| dt)=v - d/dtγ/|γ dt
And by the fundamental theorem of calculus then one should recover:
dγ/dt=v - γ/|γ|. To get your DE's let v = i+0j, and γ(t)=ix(t)+jy(t).

A case which is definitely manageable: choose &theta(t)=ωt, where ω is some real number. You can then integrate, and by letting γ(t) = r(t)Θ(t), see what conditions must be true about ω, t, and the constant of integration for it to make any sense.

(Reply to this) (Parent)(Thread)

Ooops
[info]astarcambiata
2008-10-20 05:05 am UTC (link)
There should be a constant in front of the i where it says "To get your DE's..."

(Reply to this) (Parent)


[info]currytastegrit
2008-10-22 12:28 pm UTC (link)
We certainly can't plug in any just any old t-differentiable Θ: just try Θ constant in a different direction to v and you'll see that Θ=γ/|γ| doesn't hold for all t. On the other hand, if we insist that Θ satisfies Θ=γ/|γ| for all t, then all we've done is rewrite the differential equation as an integral equation.

(Reply to this) (Parent)(Thread)


[info]currytastegrit
2008-10-22 04:32 pm UTC (link)
Θ constant in a different direction to v

Oops, that actually does work! Take Θ(t)=wt for w linearly independent of v and you get the result I claimed above.

(Reply to this) (Parent)


[info]astarcambiata
2008-10-22 09:44 pm UTC (link)
I didn't phrase the last sentence of that comment clearly: when I refered to t-differential Θ i meant functions of the form in the line I had written above (so Θ(t) is always a unit vector).
And as to your second remark, that's sorta my original point. The differential equation has no closed form solutions, it can only be rewritten as an integral equation admitting closed form solutions for very particular choices of constraints on the function Θ. But there are so many ways to choose Θ such that γ satisfies the DE that no one general solution could ever be written.

I played around with it for a few minutes using complex numbers for ease, and there are certainly a variety of curves which satisfy the original, depending on the constraints placed on direction. One solution is a cycloid, others asymptotically approach the path vt.

(Reply to this) (Parent)


[info]currytastegrit
2008-10-22 12:15 pm UTC (link)
When I plug these into the differential equation I just get unsimplifiable garbage. Besides, doesn't the Picard-Lindelöf theorem guarantee the uniqueness of all solutions not passing through the origin?

(Reply to this) (Parent)(Thread)


[info]astarcambiata
2008-10-22 10:01 pm UTC (link)
I don't think that applies here for the following reason: the DE system could be adjusted into a single ODE in the complex plane: dγ/dt=v-arg(γ). Picard Lindelöf requires a DE of the form dγ/dt=f(t,γ) with initial conditions γ(t0)=γ0, t bounded. The function arg(γ) is not well defined. Moreover, the DE gives at best ambiguous information about the length and direction of the tangent vector, and certainly fails to provide sufficient information to uniquely determine the modulus of γ(t). At best it constrains the curvature of the path in a particular way, but many curves still meet the standards.

(Reply to this) (Parent)(Thread)


[info]currytastegrit
2008-10-23 06:58 am UTC (link)
We have (dx/dt,dy/dt)=f(x,y) where f : R2 -> R is smooth on the complement of the origin. The Picard-Lindelöf theorem therefore applies for all initial conditions other than (x,y)=(0,0). Consequently solutions are unique locally in space and time for all initial conditions other than the origin. Can you show me a mistake in this reasoning?

Your solution just doesn't work, unless I've misunderstood something on a fundamental level. Take Θ(t)=(cos t, sin t) with initial condition (1,0). We get γ(t) = (v1t+sin t, v2 - cos t). But then we no longer have Θ=γ/|γ| for all t because the vectors (v1t+sin t, v2 - cos t) and (cos t, sin t) point in different directions for almost all t. This contradicts what you posted above. Besides, it's obvious by inspection that the line γ(t) = c.v is invariant under the differential equation and so γ(t) = (v1t+sin t, v2 - cos t) cannot be a solution because it intersects this line transversely and therefore cannot satisfy the differential equation at the time when it crosses the line!

(Reply to this) (Parent)(Thread)


[info]currytastegrit
2008-10-23 07:07 am UTC (link)
Sorry, that should read "(v1t + sin t, v2t - cos t)"

(Reply to this) (Parent)


[info]dlakelan
2008-10-20 02:57 am UTC (link)
can you restrict the validity of your solution to some region of interest, and get an approximate analytical solution for that reason? Use a taylor series expansion in r, or theta, or something like that?

What are your initial conditions?

have you tried doing some numerical solutions in mathematica, and seeing how it behaves?

perhaps use a spectral approach with orthogonal polynomials or something along those lines to get an analytic approximation?

just some thoughts

(Reply to this) (Thread)


[info]moosehead_beer
2008-10-20 07:56 am UTC (link)
I tried doing the first bit you suggested, below, and it ran into problems.

What's the spectral stuff thingy? How's that work? I've never heard of that.

(Reply to this) (Parent)(Thread)


[info]dlakelan
2008-10-20 03:30 pm UTC (link)
spectral method: represent the solution by a sum of terms each of which is orthogonal to the other in a certain inner product on functions (for example, a fourier series, or a chebyshev series). Then your best approximation is one where the integrated squared error in the differential equation is minimized. If you can't integrate the system analytically in Mathematica, you can use an approach called collocation, where you pick a set of samples where you set the error at these locations algebraically to zero and solve the set of equations that way.

For more info there's an excellent book by John Boyd available online (he's linked from the first reference at the wikipedia link)

http://en.wikipedia.org/wiki/Spectral_method

(Reply to this) (Parent)


[info]en_ki
2008-10-20 03:26 am UTC (link)
Out of curiosity, where'd you get it? It looks like it's from a physical system, but then the units would not match up, suggesting an error in your model.

(Reply to this) (Thread)


[info]swiftset
2008-10-20 04:13 am UTC (link)
the original equation was from the xkcd comic raptor question: you have a raptor that moves toward you. assuming you move in a straight line, you need only consider the case where you're moving at a constant velocity v along the x-axis, then the equation for the raptor's motion (assuming it moves at unit speed) is

dr/dt = unit vector in direction of (vt, 0) - r

changing to a coordinate system that moves, let
x = v t - r_x
y = r_y

and you get the new system

dx/dt = v - x/r
dy/dt = -y/r

(Reply to this) (Parent)(Thread)


[info]improvedhuman
2008-10-20 04:46 am UTC (link)
Actually raptors were probably adapted to intercepting their prey, and if you were running in a straight line the raptor would be running in a straight line to the point of interception.

(Reply to this) (Parent)(Thread)


[info]swiftset
2008-10-20 05:37 am UTC (link)
har har. my problem, my model :)

there are a lot of different scenarios to consider-- raptors can probably have bursts of increased speed, intelligent prey will try to bob and weave, etc-- but I just want to consider this one for now.

(Reply to this) (Parent)


[info]pseudonoise
2008-10-20 11:22 pm UTC (link)
this one?

(that's the extent of what I can contribute to this discussion).

(Reply to this) (Parent)(Thread)


[info]cheeser1
2008-10-21 01:57 am UTC (link)
You stole the only thing I was going to be able to contribute to this discussion!!!

(Reply to this) (Parent)


[info]llyrfish
2008-10-23 01:42 am UTC (link)
Wait, are you serious? You're solving a system of nonlinear differential equations because a webcomic posted it?

I... I think you might be my hero.

(Reply to this) (Parent)


[info]onhava
2008-10-20 03:44 am UTC (link)
I don't think there's an analytic solution.

(Reply to this)


[info]moosehead_beer
2008-10-20 07:20 am UTC (link)
I tried to use standard phase-plane junk to look at this, since you're most likely not gonna get closed-form solutions (it's a nonlinear system -- they typically don't have them.)

Fixed points (x-dot = 0, y-dot = 0) only exist here when v = 1, and then they're along the entire x-axis. The Jacobian is kinda pretty in polar coordinates:

\[ A = \left[ \begin{array}{ccc} \left(\frac{1-r^2}{r}\right)\cos^2\theta & \frac{\cos\theta\sin\theta}{r} \\ \frac{\cos\theta\sin\theta}{r} & \left(\frac{1-r^2}{r}\right)\sin^2\theta \end{array} \right]\]

It's symmetric, and the trace is independent of θ: $\left(\frac{1-r^2}{r}\right)$. The determinant is also pretty: $\sin^2\theta\cos^2\theta(r^2 - 2)$. Looking along the x-axis, θ is either 0 or 180; so, in any case, everything drops out except for the upper left part of the Jacobian, which becomes $\left(\frac{1-r^2}{r}\right)$. This immediately gives us our two eigenvalues (the other one is always 0.)

If that other eigenvalue were anything else, there's a whole bag of tricks to be used, here. But since it's not, I really have no idea how to handle this. We could get explicit solutions for the linearized system (that's a breeze) -- but they're probably not gonna tell us squat about the real deal. Does anyone know anything about non-isolated fixed points?

(Reply to this)


[info]notquitezeus
2008-10-21 05:31 am UTC (link)
have you tried looking in the laplace domain?

you'd get something like:

sX = v/s-X(s)/R(s)
sY = -Y(s)/R(s)

with R(s)=unpleasant. maybe not so useful after all :-/

(Reply to this)


[info]currytastegrit
2008-10-22 12:31 pm UTC (link)
If Mathematica can't produce a closed-form solution, then in my view it's fairly likely that none exists, and approximately as likely that no-one on here can produce one either. Sorry.

(Reply to this)


[info]swiftset
2008-10-22 07:30 pm UTC (link)
Someone posted a solution to this to my blog (http://www.tangentspace.net/cz/archives/2008/10/raptor-chase/)

I haven't had time to look at it yet, but he's usually right.

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…