Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sinusoidal solutions to simple ode's

1 view
Skip to first unread message

JohnF

unread,
Feb 28, 2011, 7:16:17 AM2/28/11
to
I want to solve the following two coupled ode's
for the functions f(x) and g(x), with a,b, and n,m constants,
df(x)/dx = a ( g(x) - m )
dg(x)/dx = -b ( f(x) - n )
Obviously (I think it's obvious), f~sin and g~cos.
Plugging in trial solutions of the form
f = k sin(wx+p) + r
g = l cos(vx+q) + s
with all that k,l,w,v,p,q,r,s junk some new constants
isn't easily solvable (by me) for all those constants.
What's the general form of the solutions for f,g
from the original two ode's? Thanks,
--
John Forkosh ( mailto: j...@f.com where j=john and f=forkosh )

David C. Ullrich

unread,
Feb 28, 2011, 8:29:45 AM2/28/11
to
On Mon, 28 Feb 2011 12:16:17 +0000 (UTC), JohnF
<jo...@please.see.sig.for.email.com> wrote:

>I want to solve the following two coupled ode's
>for the functions f(x) and g(x), with a,b, and n,m constants,
> df(x)/dx = a ( g(x) - m )
> dg(x)/dx = -b ( f(x) - n )
>Obviously (I think it's obvious), f~sin and g~cos.
>Plugging in trial solutions of the form
> f = k sin(wx+p) + r
> g = l cos(vx+q) + s
>with all that k,l,w,v,p,q,r,s junk some new constants
>isn't easily solvable (by me) for all those constants.
>What's the general form of the solutions for f,g
>from the original two ode's? Thanks,

Hint: If you differentiate both sides of the first equation
and then substitute for dg/dx using the second equation
you get a second-order ode involving just f.


Ray Vickson

unread,
Feb 28, 2011, 2:35:39 PM2/28/11
to
On Feb 28, 4:16 am, JohnF <j...@please.see.sig.for.email.com> wrote:
> I want to solve the following two coupled ode's
> for the functions f(x) and g(x), with a,b, and n,m constants,
>   df(x)/dx =  a ( g(x) - m )
>   dg(x)/dx = -b ( f(x) - n )
> Obviously (I think it's obvious), f~sin and g~cos.
> Plugging in trial solutions of the form
>   f = k sin(wx+p) + r
>   g = l cos(vx+q) + s
> with all that k,l,w,v,p,q,r,s junk some new constants
> isn't easily solvable (by me) for all those constants.
> What's the general form of the solutions for f,g
> from the original two ode's? Thanks,

Set F(x) = f(x)-n and G(x) = g(x)-m to get the simpler system F'(x) =
a*G(x) and G'(x) = -b*F(x). If we set Y(x) = column vector(F(x),G(x)
we can write dY/dx = A*Y, where A is the 2x2 matrix A = [[0,a],[-b,0]]
(= [row 1, row 2]). The general solution is given as Y(x) =
exp(x*A)*Y(0), and the matrix exponential is given as
exp(x*A) = [[cosh(u*x),(a/u)*sinh(u*x)],[(-b/u)*sinh(u*x),cosh(u*x)]],
where u = sqrt(-a*b).

Thus, the general solution is:
F(x) = F(0)*cosh(u*x)+(a/u)*G(0)*sinh(u*x) and
G(x) = -(b/u)*F(0)*sinh(u*x) + G(0)*cosh(u*x).

For some (real) values of 'a' and 'b' you will get trig functions as
solutions, but for other values you get hyperbolic functions as
solutions. Also, you can have both types (sin and cos, or sinh and
cosh) present in each of f and g, depending on the initial values of
F(0) = f(0)-n and G(0) = g(0)-m.

Note: I just got the matrix exponential using Maple, but it is easily
obtained by hand. The easiest way is to get F''(x) = -a*b *F(x) =
u^2*F(x), so F(x)~ exp(+-u*x), etc.

R.G. Vickson

JohnF

unread,
Feb 28, 2011, 6:01:23 PM2/28/11
to

Thanks, David. Guess I should have seen that myself.
It immediately gives
f''(x) = a g'(x) = -abf(x) + abn, and completely similarly
g''(x) = -b f'(x) = -abg(x) + abm,
which are both of the form
h''(x) = -kh(x) + l, with k,l constants.
With that pesky l set to l=0, it's trivially
h(x) = h(0)e^{+/- i sqrt{k} x}
but then I unsuccessfully played around trying to deal with l.
Fortunately, I see Ray Vickson's followup post with the answer
to that, too. Thanks again,

JohnF

unread,
Feb 28, 2011, 6:27:38 PM2/28/11
to
Ray Vickson <RGVi...@shaw.ca> wrote:
> F(x) = F(0)*cosh(u*x) + (a/u)*G(0)*sinh(u*x) and

> G(x) = -(b/u)*F(0)*sinh(u*x) + G(0)*cosh(u*x).
>
> For some (real) values of 'a' and 'b' you will get trig functions as
> solutions, but for other values you get hyperbolic functions as
> solutions. Also, you can have both types (sin and cos, or sinh and
> cosh) present in each of f and g, depending on the initial values of
> F(0) = f(0)-n and G(0) = g(0)-m.
>
> Note: I just got the matrix exponential using Maple, but it is easily
> obtained by hand. The easiest way is to get F''(x) = -a*b *F(x) =
> u^2*F(x), so F(x)~ exp(+-u*x), etc.
>
> R.G. Vickson

Thanks so much for the detailed, exhaustive solution, Ray.
That completely solves the problem, which I'd still failed
to see even after David Ullrich's hint. Heck, I even missed
seeing your substitution F(x)=f(x)-n, G(x)=g(x)-m, which should
have been about as obvious as David's hint:). But even given
your substitution, I don't think I'd have completed your
solution (at least not today:).
It looks great! I should have mentioned a,b>0 are both reals
(ditto m,n), so u=i*sqrt(ab) is definitely imaginary.
And along those lines, as per your trig/hyperbolic observations,
I'll be either analyzing that, if I can, or plugging numbers (by
computer) into it otherwise, to determine which regions of the
parameter space are trig. Those are the meaningful solutions.
Thanks so much, again,

JohnF

unread,
Mar 2, 2011, 5:10:50 PM3/2/11
to
> Thanks so much for the detailed solution, Ray.
> That completely solves the problem.

> I should have mentioned a,b>0 are both reals
> so u=i*sqrt(ab) is pure imaginary.

> And along those lines, as per your trig/hyperbolic observations,
> I'll be analyzing that, if I can,

Turns out to be easy, and all trig for imaginary u.
Let c=sqrt(ab) (=-iu), and use the identities
sinh(z)=-i*sin(iz), cosh(z)=cos(iz)
And let's also change the independent variable from x to t,
since those were really time derivatives.
Then your solutions become
f(t) = n + F(0)cos(ct) + (a/c)G(0)sin(ct)
g(t) = m - (b/c)F(0)sin(ct) + G(0)cos(ct)
Both are obviously sinusoidal with the same period T=2pi/c.
And I checked that both both derivatives satisfy
the original equations,
df(t)/dt = -cF(0)sin(ct) + aG(0)cos(ct) = (g(t)-m)(a), since c^2/b=a.
dg(t)/dt = -bF(0)cos(ct) - cG(0)sin(ct) = (f(t)-n)(-b), since c^2/a=b.
And, also obviously, the max/min f's occur, qualitatively, when g=m,
and max/min g's occur when f=n. And the above gives those t's as
df/dt=0 ==> tan(ct) = sqrt(a/b)*G(0)/F(0) = r (i.e., call that r),
dg/dt=0 ==> tan(ct) = -sqrt(b/a)*F(0)/G(0) = -1/r.
Thanks again, Ray and David,

0 new messages