Using maxima 5.46 on windows10 64-intel.
Solving 'diff(y,t)=a*(1-y^2/c^2),y,t)
with ode2('diff(y,t)-a*(1-y^2/c^2),y,t)
immediately results in
(c*log(y+c)-c*log(y-c))/(2*a)=t+%c
.
For c>y, especially y=0 (at t=0), the value for log(y-c) is not defined.
But the initial ode results for y=0, t=0 in the simple equation y'(0)=a.
Such I was expecting an ode2 result like
(c*log(c+y)-c*log(c-y))/(2*a)=t+%c
.
Using "assume(c>y)" did not change the misleading (but for y>c correct) result.
I'd assume that maxima forces at least the question "c>y ?" or similar when ode2 solves the ode.
I believe it's because integrate(1/(y-c),x) is log(y-c), the same way that integrate(1/y,y) is log(y). The question here is: should the result of integrate(1/y,y) be log(abs(y)) ?
diff(log(y(t)),t)
produces'diff(y(t),t,1)/y(t)
. But same result is also produced bydiff(log(-y(t)),t)
.Proposal:
Such
integrate('diff(y(t),t,1)/y(t),t)
should ask whethery(t)
is positive or negative and returnlog(y(t))
for "positive" andlog(-y(t))
for "negative".Last edit: Bjørn 2023-03-31