       DSolveConstants problem

• To: mathgroup at christensen.cybernetics.net
• Subject: [mg1141] DSolveConstants problem
• From: rich_klopp at qm.sri.com (Richard W. Klopp)
• Date: Wed, 17 May 1995 04:19:21 -0400
• Organization: SRI International

I am (still) having problems with DSolve. As you will see at In: below,
the kernel is brought to its knees when I try to define the integration
constants to be something other than the default C[i].  I am running
version 2.2.2 on a PowerMac 7100/66 and have allocated 5 Megs to the
kernel.
In:=<<Calculus`DSolve`
Define a nonlinear ODE:
In:= r[z] := a z^2 + g
In:= leftside1 = (r[z]^2 + e) D[u[z],{z,2}] +
D[r[z]^2,z] D[u[z],z];
In:= eq1 = (leftside1 == 0)
Out=
2                       2 2
4 a z (g + a z ) u'[z] + (e + (g + a z ) ) u''[z] == 0
Solve the ODE and time how long it takes.
In:= Timing[DSolve[eq1, u[z],z]]
Out=
{26.35 Second, {{u[z] ->

1
C + C Integrate[-------------------------, z]}}
2          2    2  4
e + g  + 2 a g z  + a  z

}
Let's define the same ODE with a new dependent variable.
In:= leftside2 = (r[z]^2 + e) D[v[z],{z,2}] +
D[r[z]^2,z] D[v[z],z];
In:= eq2 = (leftside2 == 0)
Out=
2                       2 2
4 a z (g + a z ) v'[z] + (e + (g + a z ) ) v''[z] == 0

Solve the new ODE and time how long it takes.
***Use a different, non-default integration constant this time.***

In:= Timing[DSolve[eq2, v[z],z,{DSolveConstants->b}]]

******After 15 minutes, I give up!  What's wrong here?*******
Out= \$Aborted

Let's do a simpler problem to make sure we've got the DSolveConstants
syntax right.
In:= eq3 = ( D[w[z],{z,2}] == -2 T )
Out= w''[z] == -2 T
In:= DSolve[eq3,w[z],z,{DSolveConstants -> f}]
Out=
2
{{w[z] -> -(T z ) + f + z f}}
Looks like the syntax is correct.  Let's time it, and the default version.
In:= Timing[DSolve[eq3,w[z],z,{DSolveConstants -> f}]]
Out=
2
{0.116667 Second, {{w[z] -> -(T z ) + f + z f}}}
In:= Timing[DSolve[eq3,w[z],z]]
Out=
2
{0.266667 Second, {{w[z] -> -(T z ) + C + z C}}}
So, what's the problem at In:?  I want to define different constants
because I want to solve several similar ODEs and keep their integration
constants separate.
Thanks for your help,
Rich Klopp
rich_klopp at qm.sri.com

• Prev by Date: Re: Optica?
• Next by Date: Re: CHALLENGE (still more)
• Previous by thread: Correction: Function with attributes Flat and OneIdentity
• Next by thread: Re: CHALLENGE (still more)