-1

I am learning how to use wxMaxima to solve differential equations, but I encounter problems already with very simple ODEs. If, for example, I want to solve the logistic differential equation and use ode2:

diffeq: 'diff(S,t)=g*S*(1-S/K);
ode2(diffeq,S,t);

Maxima returns

(log(S-K)-log(S))/g=t+%c

And I don't know why Maxima does not solve for S(t) or how I can obtain a simple solution in the form of S(t)= xxx. I tried to use logexpand() etc. but cannot get rid of the log(). Is there a way to obtain a more straightforward solution, or, can someone recommend another free software to work with differential equations?

Thank you!

Inopinans
  • 43
  • 4

1 Answers1

1

I can convince Maxima to produce a more directly usable form of the solution, with a little prodding. I'll let you decide whether this is useful.

(%i1) eq: (log(S-K)-log(S))/g=t+%c;
                  log(S - K) - log(S)
(%o1)             ------------------- = t + %c
                           g
(%i2) logcontract (%);
                           S - K
                       log(-----)
                             S
(%o2)                  ---------- = t + %c
                           g
(%i3) map (exp, %);
                           S - K
                       log(-----)
                             S
                       ----------
                           g          t + %c
(%o3)                %e           = %e
(%i4) lhs(%)^g = rhs(%)^g;
                      S - K     g (t + %c)
(%o4)                 ----- = %e
                        S
(%i5) solve (%, S);
                                  K
(%o5)               [S = - ----------------]
                             g t + %c g
                           %e           - 1

As for other software, you can try Sympy (sympy.org). I don't know anything about how it handles differential equations.

Robert Dodier
  • 16,905
  • 2
  • 31
  • 48