AngouriMath
SolveOde(AngouriMath.Entity,AngouriMath.Entity.Variable,AngouriMath.Entity.Variable)
Method (no overloads)
Summary
Solves a first-order linear ordinary differential equation
https://en.wikipedia.org/wiki/Linear_differential_equation by its
integrating factor, or returnsnull where it cannot.
https://en.wikipedia.org/wiki/Linear_differential_equation by its
integrating factor, or returns
Parameter "equation"
The equation, read as equal to zero, written in terms of the unknown function applied
to its variable. The unknown has to be an application —apply(y, x) — rather
than a bare variable, becausederivative(y, x) is 0 : a variable does not
depend onx , and the library is right about that.
to its variable. The unknown has to be an application —
than a bare variable, because
depend on
Parameter "function"
The name of the unknown function, y above.
Parameter "variable"
The name it is a function of, x above.
Returns
The general solution, carrying one arbitrary constant, or null where
the equation is not first-order linear in the unknown, or where either of the two
integrals the method needs has no closed form.
the equation is not first-order linear in the unknown, or where either of the two
integrals the method needs has no closed form.
Example
using System;
using AngouriMath;
using AngouriMath.Extensions;
// y' + y = 1
var equation = "derivative(apply(y, x), x) + apply(y, x) - 1".ToEntity();
Console.WriteLine(MathS.SolveOde(equation, "y", "x"));Prints
1 + C_1 * e ^ (-x)Remarks
Declining is a legitimate answer here and a common one: the method is exact where it
applies, and where either integral does not come out there is no approximation to
offer in its place.y' + y = e^(x^2) is declined for exactly that reason.
#241
applies, and where either integral does not come out there is no approximation to
offer in its place.
#241
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online