Am Dienstag, den 12.10.2010, 17:54 +0100 schrieb Jaime Villate:
> On Tue, 2010-10-12 at 00:50 +0200, Dieter Kaiser wrote:
> > At first the example from the testsuite which I think has a wrong
> > result:
> > 'diff(y,x,2)+y*('diff(y,x,1))^3 = 0;
> > I will not present the calculation to show that the expected answer is
> > wrong, but I will show that the following is a correct answer for the
> > initial problem y(0)=0 and y'(0)=2:
> >
> > sol:(y^3+3*y)/6=x
>
> I agree, ode2 is working fine in this example, while ic2 is failing. If
> you want to see another way to arrive at the correct solution, here it
> is:
> (%i1) display2d: false$
> (%i2) eq: 'diff(y,x,2)+y*('diff(y,x,1))^3 = 0$
> (%i3) sol: ode2(eq,y,x);
> (%o3) (y^3+6*%k1*y)/6 = x+%k2
> (%i4) depends(y,x)$
> (%i5) sold: first(solve(diff(sol,x),diff(y,x)));
> (%o5) 'diff(y,x,1) = 2/(y^2+2*%k1)
> (%i6) solve( ev(sold, y=0, 'diff(y,x)=2));
> (%o6) [%k1 = 1/2]
> (%i7) ev(sol,%);
> (%o7) (y^3+3*y)/6 = x+%k2
> (%i8) solve( ev(%,x=0,y=0));
> (%o8) [%k2 = 0]
> (%i9) ev(sol,%o6,%o8);
> (%o9) (y^3+3*y)/6 = x
Yes, this shows again the correct solution. I have calculated the
correct results simply by hand. The equations are easy to solve.
Meanwhile I have committed a patch to ic2 to get the correct results for
the example from above. Because of the work on ic2 I had a look at ic1
too. Here I have replaced the function subst with at. at does a
substitution too, but can also handle integrals, limits, ...
Dieter Kaiser