Ether Jones <maxima at etherjones.us> writes:
> Why do I have the 2 unresolved constants %k2 and %k1
> at %o5 below?
>
> I can't think of any other initial conditions
> beside 'diff(x,t)=0 and x=0 at t=0
I think that you may have omitted some of the output you get when
running the command. Your transcript follows:
> 'diff(x,t,2) + A*'diff(x,t)^2 + B*'diff(x,t) + D = 0;
>
> ode2(%,x,t);
>
> p;
>
> ic2(%,t=0,x=0,'diff(x,t)=0);
> 2
> dx dx 2 d x
> (%o1) D + -- B + (--) A + --- = 0
> dt dt 2
> dt
> (%i2)
> 2
> Is 4 A D - B positive or negative?
>
> 2
> (t + %k1) sqrt(4 A D - B )
> 2 log(sec(--------------------------)) + t B
> 2
> (%o2) x = %k2 - --------------------------------------------
> 2 A
and mine:
Maxima 5.23post http://maxima.sourceforge.net
using Lisp SBCL 1.0.46.0.debian
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) 'diff(x,t,2) + A*'diff(x,t)^2 + B*'diff(x,t) + D = 0;
2
dx dx 2 d x
(%o1) D + -- B + (--) A + --- = 0
dt dt 2
dt
<snip a mistake>
(%i3) ode2(%o1, x, t);
2
Is 4 A D - B positive or negative?
pos;
2
(t + %k1) sqrt(4 A D - B )
2 log(sec(--------------------------)) + t B
2
(%o3) x = %k2 - --------------------------------------------
2 A
(%i4) ic2(%,t=0,x=0,'diff(x,t)=0);
(%o4) []
(%i5)
The good news is that you can actually solve for %k1 and %k2
yourself. Substituting in zeros for t in %o3 and its derivative, I get
the following pair of equations:
(%i11) ics: [rhs(%o5) = 0, %o10 = 0];
2
%k1 sqrt(4 A D - B )
log(sec(--------------------))
2
(%o11) [%k2 - ------------------------------ = 0,
A
2
2 %k1 sqrt(4 A D - B )
sqrt(4 A D - B ) tan(--------------------) + B = 0]
2
Note that the second is free of %k2. Let d = sqrt(4*A*D-B^2)/2 and then
solve:
(%i15) ratsubst(d, sqrt(4*A*D-B^2)/2, second(ics));
(%o15) B + 2 d tan(%k1 d) = 0
(%i16) solve(%, %k1);
solve: using arc-trig functions to get a solution.
Some solutions will be lost.
B
atan(---)
2 d
(%o16) [%k1 = - ---------]
d
(%i17)
Now, notice that
(%i12) sec(atan(x)), trigreduce;
2
(%o12) sqrt(x + 1)
and, since,
(%i27) ratsubst(d, sqrt(4*A*D-B^2)/2, first(ics));
%k2 A - log(sec(%k1 d))
(%o27) ----------------------- = 0
A
this is going to be quite nice. The displayed form on substituting in is
massive and ugly, but solving you get:
(%i28) solve(%o26, %k2);
2
B
log(---- + 1)
2
4 d
(%o28) [%k2 = -------------]
2 A
Tada!
Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20110321/3cae2d51/attachment.pgp>