Wikipedia:Reference desk/Archives/Mathematics/2012 June 2

= June 2 =

it's thirty years since I took Diff.Eq.
and I've never used it since, and I didn't get this far anyway.

I want to find a function u(t) such that $$u(0)=0$$ and $$2(u')^2 = 3+\cos(2u)$$. How do I go about it?

(For an artwork based on the lemniscate of Bernoulli, I want a parametrization such that the path "speed" is constant.)

I'll be happy with the first few nonzero terms of a Fourier series. —Tamfang (talk) 02:09, 2 June 2012 (UTC)


 * You could just throw it on Wolfram Alpha. It gives solutions in terms of Jacobi's amplitude function, though... I couldn't get it to give anything more.
 * I've just played around with the parametric equations given in the article for the lemniscate, and they're a pretty decent approximation of constant speed. Can't you use that? &mdash; Kieff | Talk 02:27, 2 June 2012 (UTC)


 * It varies by a factor of √2. It's usable, yes, but my design will look that much better if most of that variation is squashed.  I've been fiddling with $$u(t) = t + a \sin(2t) + b \sin(4t)$$, which is pretty good, but I thought why not try for whole hog? —Tamfang (talk) 02:58, 2 June 2012 (UTC)


 * You could also go the easy way and numerically approximate the total length of the curve by exhaustion to the desired precision. Then divide that arclength into smaller steps of the desirable resolution, and use these step sizes to "walk" the parameter t until you reach each step size, then store that value of t. Do this for the whole curve and you'll have a bunch of t values that will be approximately the same distance from each other on the curve. This is pretty easy to do and it'll only require a lookup on the table. For even greater precision, you can throw in some interpolation for intermediate values. Point being, closed forms for normalized parametrizations of curves are not really necessary and there are simpler methods to do it if you just want to use it somewhere. I've done it several times. &mdash; Kieff | Talk 19:00, 2 June 2012 (UTC)
 * I'm considering something similar, yes. —Tamfang (talk) 19:35, 2 June 2012 (UTC)
 * It works surprisingly well. —Tamfang (talk) 17:10, 3 June 2012 (UTC)


 * We also have an article Numerical methods for ordinary differential equations... It might be of some use too... --Martynas Patasius (talk) 00:49, 3 June 2012 (UTC)


 * Try $$u(t) = 1.1981407859366775\ t + 0.08626709480287766 \sin(2.3962743565815936\ t) + 0.0018673707746179953 \sin(2\cdot2.3962743565815936\ t)$$ (it's very good even without the last term). -- Meni Rosenfeld (talk) 19:21, 2 June 2012 (UTC)


 * Good heavens. How did you come up with that?  —Tamfang (talk) 19:50, 2 June 2012 (UTC)
 * Taking the nonelementary closed form expression of the function as a starting point, I first found the period by using Mathematica to numerically solve $$u(2T)-2u(T)+u(0)=0$$ (choosing the correct root by inspection). Then the linear coefficient is $$\frac{u(T)-u(0)}{T}$$. After correcting for the period and the linear term, I ended up with a simple periodic function for which I computed the Fourier series.
 * PS the way to solve differential equations which involve only u' and u is to first write it as $$\frac{du}{dt}=\sqrt{\frac{3+\cos(2u)}{2}}$$ which means $$\frac{dt}{du}=\sqrt{\frac{2}{3+\cos(2u)}}$$. You can then find t as a function of u by integrating, and then u as a function of t by inverting. In this case both these operations result in nonelementary functions. -- Meni Rosenfeld (talk) 20:02, 2 June 2012 (UTC)