Summary
These are what I've discovered (in V13.1):
Method -> Automatic
Method -> "EvaluateIntegrals"
Method -> "InactiveIntegrals" (* same as Automatic? *)
Method -> {"Events", "MaxEvents" -> n}
Method -> "Holonomic"
I don't believe they can be mixed. If you do, what happens varies. Either DSolve
returns unevaluated or the combination is treated as Automatic
. For instance, Method -> {"EvaluateIntegrals", {"Events", "MaxEvents" -> 3}}
is treated as Automatic
in "Events"
example and leads to unevaluated DSolve[]
in the other examples below. Method parsing does not seem to be as robust as in NDSolve
or NIntegrate
(probably why IncludeSingularSolutions
is a separate option and not a Method
option).
Method -> "EvaluateIntegrals"
The following takes 400+ sec. and produces the same answer as
Method -> Automatic
, with unevaluated integrals, in this case:
DSolve[x^2 y''[x] + xy'[x] + y[x] == Exp[4 Log [x]], y[x], x,
Method -> "EvaluateIntegrals"]
Method -> "InactiveIntegrals"
Method -> "InactiveIntegrals"
seems the same as Method -> Automatic
, and allows Inactive[]
integrals, but does not force them. The following takes around 0.35 sec. with either option setting and produces the same result
DSolve[x^2 y''[x] + xy'[x] + y[x] == Exp[4 Log [x]], y[x], x,
Method -> "InactiveIntegrals"]
The foregoing examples are adapted from Help!!! DSolve is coming out weirdly
Method -> {"Events", "MaxEvents" -> 3}
The following is adapted from the docs for DSolve
and without the "MaxEvents"
constraint produces a Piecewise
solution with five cases.
eqns = {y'[t] == z[t], z'[t] == -10, y[0] == 1, z[0] == 0};
events = {WhenEvent[y[t] == 0,
{y[t] -> 0, z[t] -> -(70/100) z[t]}]};
sol = DSolve[Join[eqns, events], {y[t], z[t]}, {t, 0, 2},
Method -> {"Events", "MaxEvents" -> 3}]
DSolve::maxev: The maximum number of events has been reached. The currently computed solution has been returned.
(* output: Piecewise with three cases *)
Method -> "Holonomic"
For linear equations, it produces a DifferentialRoot
:
DSolve[y'[x] == y[x], y, x, Method -> "Holonomic"]
(*
{{y -> DifferentialRoot[
Function[{\[FormalY], \[FormalX]},
{-\[FormalY][\[FormalX]] + \[FormalY]'[\[FormalX]] == 0,
\[FormalY][0] == C[1]}]]}}
*)
Unceremoniously fails on nonlinear equations:
DSolve[y'[x] == y[x]^2, y, x, Method -> "Holonomic"]
(*
DSolve[Derivative[1][y][x] == y[x]^2, y, x, Method -> "Holonomic"]
*)
"EvaluateIntegrals" | "InactiveIntegrals" | "Holonomic" | Automatic
are the ones I know.... $\endgroup$DSolve[x^2 y''[x] + xy'[x] + y[x] == Exp[4 Log [x]], y[x], x, Method -> "EvaluateIntegrals"]
takes 400+ sec. and produces the same answer asDSolve[x^2 y''[x] + xy'[x] + y[x] == Exp[4 Log [x]], y[x], x]
in around 0.35 sec."InactiveIntegrals"
seems the same asAutomatic
, and allowsInactive[]
integrals, but does not force them. (Example from mathematica.stackexchange.com/questions/258268/…) $\endgroup$eqns = {y'[t] == z[t], z'[t] == -10, y[0] == 1, z[0] == 0}; events = {WhenEvent[y[t] == 0, {y[t] -> 0, z[t] -> -(70/100) z[t]}]}; sol = DSolve[Join[eqns, events], {y[t], z[t]}, {t, 0, 2}, Method -> {"Events", "MaxEvents" -> 3}]
$\endgroup$