AngouriMath

Navigation

← Back to list of members

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 returns null where it cannot.

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, because derivative(y, x) is 0: a variable does not
depend on x, and the library is right about that.

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.

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

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online