|
AngouriMath
|
Use functions from this class More...

Classes | |
| class | Boolean |
| Some operations on booleans are stored here | |
| class | Compute |
| Implements necessary functions for symbolic computation of limits, derivatives and integrals | |
| class | DecimalConst |
| Some non-symbolic constants | |
| class | Diagnostic |
| This class is used for diagnostic and debug of the library itself. | |
| class | ExperimentalFeatures |
| Features that might become stable in the future, but are not guaranteed to do anything useful or correctly at the current moment. | |
| class | Hyperbolic |
| Represents a few hyperbolic functions | |
| class | Matrices |
| Classes and functions related to matrices are defined here | |
| class | Multithreading |
| A few functions convenient to use in industrial projects to keep the system more reliable and distribute computations to other threads | |
| class | Numbers |
| class | NumberTheory |
| Use it in order to explore further number theory | |
| class | Series |
| That is a collection of some series, expressed in a symbolic form | |
| class | Sets |
| Functions and classes related to sets defined here | |
| class | Settings |
| A couple of settings allowing you to set some preferences for AM's algorithms To use these settings the syntax is | |
| class | UnsafeAndInternal |
| You may need it to manually manage some issues. | |
| class | Utils |
| Some additional functions that would be barely ever used by the user, but kept for "just in case" as public | |
Static Public Member Functions | |||||
| static EquationSystem | Equations (params Entity[] equations) | ||||
| Use it to solve systems of equations More... | |||||
| static EquationSystem | Equations (IEnumerable< Entity > equations) | ||||
| Use it to solve systems of equations More... | |||||
| static Set | SolveEquation (Entity equation, Variable var) | ||||
| Solves one equation over one variable More... | |||||
| static Matrix | SolveBooleanTable (Entity expression, params Variable[] variables) | ||||
| Solves a boolean expression. More... | |||||
| static Entity | Sin (Entity a) | ||||
| More... | |||||
| static Entity | Cos (Entity a) | ||||
| More... | |||||
| static Entity | Sec (Entity a) | ||||
| More... | |||||
| static Entity | Cosec (Entity a) | ||||
| More... | |||||
| static Entity | Log (Entity @base, Entity x) | ||||
| More... | |||||
| static Entity | Log (Entity x) | ||||
| This is 10-based logarithm. More... | |||||
| static Entity | Pow (Entity @base, Entity power) | ||||
| More... | |||||
| static Entity | Sqrt (Entity a) | ||||
| Special case of More... | |||||
| static Entity | Cbrt (Entity a) | ||||
| Special case of More... | |||||
| static Entity | Sqr (Entity a) | ||||
| Special case of More... | |||||
| static Entity | Tan (Entity a) | ||||
| More... | |||||
| static Entity | Cotan (Entity a) | ||||
| More... | |||||
| static Entity | Arcsin (Entity a) | ||||
| More... | |||||
| static Entity | Arccos (Entity a) | ||||
| More... | |||||
| static Entity | Arctan (Entity a) | ||||
| More... | |||||
| static Entity | Arccotan (Entity a) | ||||
| More... | |||||
| static Entity | Arcsec (Entity a) | ||||
| More... | |||||
| static Entity | Arccosec (Entity a) | ||||
| More... | |||||
| static Entity | Ln (Entity a) | ||||
| Is a special case of logarithm where the base equals e: More... | |||||
| static Entity | Factorial (Entity a) | ||||
| More... | |||||
| static Entity | Gamma (Entity a) | ||||
| More... | |||||
| static Entity | Signum (Entity a) | ||||
| https://en.wikipedia.org/wiki/Sign_function More... | |||||
| static Entity | Abs (Entity a) | ||||
| https://en.wikipedia.org/wiki/Absolute_value More... | |||||
| static Entity | Negation (Entity a) | ||||
| Boolean negation Wikipedia More... | |||||
| static Entity | Provided (Entity expression, Entity condition) | ||||
| This will be turned into expression if the condition is true, into NaN if condition is false, and remain the same otherwise More... | |||||
| static Entity | Piecewise (IEnumerable< Providedf > cases, Entity? otherwise=null) | ||||
| This is a piecewisely defined function, which turns into a particular definition once there exists a case number N such that case[N].Predicate is turned into true and for all i less than N : case[i].Predicate is turned into false. More... | |||||
| static Entity | Piecewise (params(Entity expression, Entity predicate)[] cases) | ||||
| This is a piecewisely defined function, which turns into a particular definition once there exists a case number N such that case[N].Predicate is turned into true and for all i less than N : case[i].Predicate is turned into false. More... | |||||
| static Entity | Apply (Entity expr, params Entity[] arguments) | ||||
| Applies the list of arguments to the given expression More... | |||||
| static Entity | Lambda (Variable param, Entity body) | ||||
| Returns a lambda with the given parameter and body More... | |||||
| static Entity | Disjunction (Entity a, Entity b) | ||||
| https://en.wikipedia.org/wiki/Logical_disjunction More... | |||||
| static Entity | Conjunction (Entity a, Entity b) | ||||
| https://en.wikipedia.org/wiki/Logical_conjunction More... | |||||
| static Entity | Implication (Entity assumption, Entity conclusion) | ||||
| https://en.wikipedia.org/wiki/Material_implication_(rule_of_inference) More... | |||||
| static Entity | ExclusiveDisjunction (Entity a, Entity b) | ||||
| https://en.wikipedia.org/wiki/Exclusive_or More... | |||||
| static Entity | Equality (Entity a, Entity b) | ||||
| Do NOT confuse it with Equation More... | |||||
| static Entity | GreaterThan (Entity a, Entity b) | ||||
| |||||
| static Entity | LessThan (Entity a, Entity b) | ||||
| |||||
| static Entity | GreaterOrEqualThan (Entity a, Entity b) | ||||
| |||||
| static Entity | LessOrEqualThan (Entity a, Entity b) | ||||
| |||||
| static Set | Union (Entity a, Entity b) | ||||
| |||||
| static Set | Intersection (Entity a, Entity b) | ||||
| |||||
| static Set | SetSubtraction (Entity a, Entity b) | ||||
| |||||
| static Variable | Var (string name) | ||||
| Creates an instance of Variable. More... | |||||
| static Entity | FromString (string expr, bool useCache) | ||||
| Converts a string to an expression More... | |||||
| static Entity | FromString (string expr) | ||||
| Converts a string to an expression More... | |||||
| static ParsingResult | Parse (string source) | ||||
| Parses an expression silently, that is, without throwing an exception. More... | |||||
| static string | ToBaseN (Real num, int N) | ||||
| Translates a Number in base 10 into base N More... | |||||
| static Number.Real | FromBaseN (string num, int N) | ||||
| Translates a number in base N into base 10 More... | |||||
| static string | Latex (ILatexiseable latexiseable) | ||||
| |||||
| static Entity | Det (Matrix m) | ||||
| Finds the determinant of the given matrix. More... | |||||
| static Matrix | Matrix (Entity[,] values) | ||||
| Creates an instance of Entity.Matrix. More... | |||||
| static Matrix | Matrix (int rowCount, int colCount, Func< int, int, Entity > map) | ||||
| Creates an instance of matrix, where each cell's index is mapped to a value with the help of the mapping function. More... | |||||
| static Matrix | Vector (params Entity[] values) | ||||
| Creates an instance of Entity.Matrix that has one column. More... | |||||
| static Matrix | ZeroMatrix (int size) | ||||
| Creates a zero square matrix More... | |||||
| static Matrix | ZeroMatrix (int rowCount, int columnCount) | ||||
| Creates a zero square matrix More... | |||||
| static Matrix | ZeroVector (int size) | ||||
| Creates a zero vector More... | |||||
| static Matrix | Scalar (Entity value) | ||||
| Creates a 1x1 matrix of a given value. More... | |||||
| static Matrix | MatrixFromRows (IEnumerable< Matrix > vectors) | ||||
| Creates a matrix from given rows More... | |||||
| static Matrix | MatrixFromIEnum2x2 (IEnumerable< IEnumerable< Entity >> elements) | ||||
| Creates a matrix from given elements More... | |||||
| static Interval | Interval (Entity left, Entity right) | ||||
| Creates a closed interval (segment) More... | |||||
| static Interval | Interval (Entity left, bool leftClosed, Entity right, bool rightClosed) | ||||
| Creates an interval with custom endings More... | |||||
| static Matrix | IdentityMatrix (int size) | ||||
| Creates a square identity matrix More... | |||||
| static Matrix | IdentityMatrix (int rowCount, int columnCount) | ||||
| Creates a rectangular identity matrix with the given size More... | |||||
| static bool | TryPolynomial (Entity expr, Variable variable, [NotNullWhen(true)] out Entity? dst) | ||||
| Returns an Entity in polynomial order if possible More... | |||||
| static string | ToSympyCode (Entity expr) | ||||
| |||||
| static Entity | Derivative (Entity expr, Entity var) | ||||
| Hangs your Entity to a derivative node (to evaluate instead use Compute.Derivative(Entity, Variable)) More... | |||||
| static Entity | Derivative (Entity expr, Entity var, int power) | ||||
| Hangs your Entity to a derivative node (to evaluate instead use Compute.Derivative(Entity, Variable)) More... | |||||
| static Entity | Integral (Entity expr, Entity var) | ||||
| Hangs your entity to an integral node (to evaluate instead use Compute.Integral(Entity, Variable)) More... | |||||
| static Entity | Integral (Entity expr, Entity var, Entity from, Entity to) | ||||
| Hangs your entity to an integral node (to evaluate instead use Compute.Integral(Entity, Variable)) More... | |||||
| static Entity | Limit (Entity expr, Entity var, Entity dest, ApproachFrom approach=ApproachFrom.BothSides) | ||||
| Hangs your entity to a limit node (to evaluate instead use Compute.Limit(Entity, Variable, Entity)) More... | |||||
Static Public Attributes | |
| static | Variable |
| Creates two instances of Variable. More... | |
| static readonly Real | oo = (Real)(Entity)"+oo" |
| Infinity. More... | |
| static readonly Variable | e = Variable.e |
| The e constant More... | |
| static readonly Complex | i = Complex.ImaginaryOne |
| The imaginary one More... | |
| static readonly Variable | pi = Variable.pi |
| The pi constant More... | |
| static readonly Entity | NaN = Real.NaN |
| NaN represents both "undefined" and "indeterminate". More... | |
| static readonly Matrix | I_1 = IdentityMatrix(1) |
| The square identity matrix of size 1 More... | |
| static readonly Matrix | I_2 = IdentityMatrix(2) |
| The square identity matrix of size 2 More... | |
| static readonly Matrix | I_3 = IdentityMatrix(3) |
| The square identity matrix of size 3 More... | |
| static readonly Matrix | I_4 = IdentityMatrix(4) |
| The square identity matrix of size 4 More... | |
| static readonly Matrix | O_1 = ZeroMatrix(1) |
| The square zero matrix of size 1 More... | |
| static readonly Matrix | O_2 = ZeroMatrix(2) |
| The square zero matrix of size 2 More... | |
| static readonly Matrix | O_3 = ZeroMatrix(3) |
| The square zero matrix of size 3 More... | |
| static readonly Matrix | O_4 = ZeroMatrix(4) |
| The square zero matrix of size 4 More... | |
Use functions from this class
https://en.wikipedia.org/wiki/Absolute_value
| a | Argument node of which Abs function will be taken |
Prints
Applies the list of arguments to the given expression
Prints
| a | Argument node of which arccosine will be taken |
Prints
| a | Argument node of which arccosecant will be taken |
Prints
| a | Argument node of which arccotangent will be taken |
Prints
| a | Argument node of which arcsecant will be taken |
Prints
| a | Argument node of which arcsine will be taken |
Prints
| a | Argument node of which arctangent will be taken |
Prints
https://en.wikipedia.org/wiki/Logical_conjunction
| a | Left argument node of which Conjunction function will be taken |
| b | Right argument node of which Conjunction disjunction function will be taken |
Prints
| a | Argument node of cosine |
Prints
| a | Argument node of cosecant |
Prints
| a | Argument node of which cotangent will be taken |
Prints
Hangs your Entity to a derivative node (to evaluate instead use Compute.Derivative(Entity, Variable))
| expr | Expression to be hung |
| var | Variable over which derivative is taken |
Prints
Hangs your Entity to a derivative node (to evaluate instead use Compute.Derivative(Entity, Variable))
| expr | Expression to be hung |
| var | Variable over which derivative is taken |
| power | Number of times derivative is taken. Only integers will be simplified or evaluated. |
Prints
Finds the determinant of the given matrix.
If the matrix is non-square, returns null
Prints
https://en.wikipedia.org/wiki/Logical_disjunction
| a | The left argument node of which Disjunction function will be taken |
| b | The right argument node of which Disjunction function will be taken |
Prints
Do NOT confuse it with Equation
| a | Left argument node of which Equality function will be taken |
| b | Right argument node of which Equality disjunction function will be taken |
Prints
|
static |
Use it to solve systems of equations
| equations | An array of Entity (or strings) the system consists of |
Prints
|
static |
Use it to solve systems of equations
| equations | A sequence of Entity the system consists of |
Prints
https://en.wikipedia.org/wiki/Exclusive_or
| a | Left argument node of which Exclusive disjunction function will be taken |
| b | Right argument node of which Exclusive disjunction function will be taken |
Prints
|
static |
Translates a number in base N into base 10
| num | A Real in base N to be translated into base 10 |
| N | The base to translate the number from |
Prints
|
static |
Converts a string to an expression
| expr | string expression, for example, "2 * x + 3 + sqrt(x)" |
| useCache | By default is true, it boosts performance if you have multiple uses of the same string, for example, Entity expr = (Entity)"+oo" + "x".Limit("x", "+oo") * "+oo"; First occurance will be parsed, others will be replaced with the cached entity |
Multiple ways to parse an expression.
|
static |
Converts a string to an expression
| expr | string expression, for example, "2 * x + 3 + sqrt(x)" |
Multiple ways to parse an expression.
| a | Argument node of which gamma function will be taken |
Prints
| a | Left argument node of which the greter than or equal node will be taken |
| b | Right argument node of which the greater than or equal node function will be taken |
using System; using static AngouriMath.MathS;
var (x, y) = Var("x", "y");
Console.WriteLine(GreaterThan(x, y)); Console.WriteLine(GreaterThan(6, 5)); Console.WriteLine(GreaterThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessThan(x, y)); Console.WriteLine(LessThan(6, 5)); Console.WriteLine(LessThan(6, 5).EvalBoolean()); Console.WriteLine(LessThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(GreaterOrEqualThan(x, y)); Console.WriteLine(GreaterOrEqualThan(6, 5)); Console.WriteLine(GreaterOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessOrEqualThan(x, y)); Console.WriteLine(LessOrEqualThan(6, 5)); Console.WriteLine(LessOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(LessOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); var statement1 = GreaterThan(Sqr(x), 5); Console.WriteLine(statement1); Console.WriteLine(statement1.Solve("x")); Console.WriteLine("----------------------------------"); var statement2 = GreaterThan(Sqr(x), 16) & LessThan(x, y); Console.WriteLine(statement2); Console.WriteLine(statement2.Solve("x")); Console.WriteLine("----------------------------------"); var statement3 = LessThan(Sqr(x), 16) & GreaterThan(x, 2); Console.WriteLine(statement3); Console.WriteLine(statement3.Solve("x")); Prints x > y 6 > 5 True
x < y 6 < 5 False
x >= y 6 >= 5 True
x <= y 6 <= 5 False
x ^ 2 > 5
x ^ 2 > 16 and x < y
x ^ 2 < 16 and x > 2 (2; 4)
| a | Left argument node of which the greater than node will be taken |
| b | Right argument node of which the greater than node function will be taken |
using System; using static AngouriMath.MathS;
var (x, y) = Var("x", "y");
Console.WriteLine(GreaterThan(x, y)); Console.WriteLine(GreaterThan(6, 5)); Console.WriteLine(GreaterThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessThan(x, y)); Console.WriteLine(LessThan(6, 5)); Console.WriteLine(LessThan(6, 5).EvalBoolean()); Console.WriteLine(LessThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(GreaterOrEqualThan(x, y)); Console.WriteLine(GreaterOrEqualThan(6, 5)); Console.WriteLine(GreaterOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessOrEqualThan(x, y)); Console.WriteLine(LessOrEqualThan(6, 5)); Console.WriteLine(LessOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(LessOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); var statement1 = GreaterThan(Sqr(x), 5); Console.WriteLine(statement1); Console.WriteLine(statement1.Solve("x")); Console.WriteLine("----------------------------------"); var statement2 = GreaterThan(Sqr(x), 16) & LessThan(x, y); Console.WriteLine(statement2); Console.WriteLine(statement2.Solve("x")); Console.WriteLine("----------------------------------"); var statement3 = LessThan(Sqr(x), 16) & GreaterThan(x, 2); Console.WriteLine(statement3); Console.WriteLine(statement3.Solve("x")); Prints x > y 6 > 5 True
x < y 6 < 5 False
x >= y 6 >= 5 True
x <= y 6 <= 5 False
x ^ 2 > 5
x ^ 2 > 16 and x < y
x ^ 2 < 16 and x > 2 (2; 4)
|
static |
Creates a square identity matrix
Prints
|
static |
Creates a rectangular identity matrix with the given size
Prints
https://en.wikipedia.org/wiki/Material_implication_(rule_of_inference)
| assumption | The assumption node |
| conclusion | The conclusion node |
Prints
Hangs your entity to an integral node (to evaluate instead use Compute.Integral(Entity, Variable))
| expr | Expression to be hung |
| var | Variable over which integral is taken |
Prints
Hangs your entity to an integral node (to evaluate instead use Compute.Integral(Entity, Variable))
| expr | Expression to be hung |
| var | Variable over which integral is taken |
| from | The lower bound for integrating |
| to | The upper bound for integrating |
Prints
| a | Left argument node of which the intersection set node will be taken |
| b | Right argument node of which the intersection set node will be taken |
using AngouriMath; using System; using static AngouriMath.Entity.Set; using static AngouriMath.MathS; using static AngouriMath.MathS.Sets;
var set1 = Finite(1, 2, 3); var set2 = Finite(2, 3, 4); var set3 = MathS.Interval(-6, 2); var set4 = new ConditionalSet("x", "100 > x2 > 81"); Console.WriteLine(Union(set1, set2)); Console.WriteLine(Union(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set3)); Console.WriteLine(Union(set1, set3).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set4)); Console.WriteLine(ElementInSet(3, Union(set1, set4))); Console.WriteLine(ElementInSet(3, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(4, Union(set1, set4))); Console.WriteLine(ElementInSet(4, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(9.5, Union(set1, set4))); Console.WriteLine(ElementInSet(9.5, Union(set1, set4)).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set1, set2)); Console.WriteLine(Intersection(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set2, set3)); Console.WriteLine(Intersection(set2, set3).Simplify()); Console.WriteLine("----------------------"); var set5 = MathS.Interval(-3, 11); Console.WriteLine(Intersection(set3, set5)); Console.WriteLine(Intersection(set3, set5).Simplify()); Console.WriteLine(Union(set3, set5)); Console.WriteLine(Union(set3, set5).Simplify()); Console.WriteLine(SetSubtraction(set3, set5)); Console.WriteLine(SetSubtraction(set3, set5).Simplify()); Console.WriteLine("----------------------"); Entity syntax1 = "{ 1, 2, 3 } /\ { 2, 3, 4 }"; Console.WriteLine(syntax1); Console.WriteLine(syntax1.Simplify()); Console.WriteLine("----------------------"); Entity syntax2 = "5 in ([1; +oo) \/ { x : x < -4 })"; Console.WriteLine(syntax2); Console.WriteLine(syntax2.Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C).Simplify()); Prints { 1, 2, 3 } \/ { 2, 3, 4 }
{ 1, 2, 3 } \/ [-6; 2]
{ 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } 3 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } True 4 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } False 19/2 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
{ 1, 2, 3 } /\ { 2, 3, 4 }
{ 2, 3, 4 } /\ [-6; 2]
[-6; 2] /\ [-3; 11] [-3; 2] [-6; 2] \/ [-3; 11] [-6; 11] [-6; 2] \ [-3; 11]
{ 1, 2, 3 } /\ { 2, 3, 4 }
5 in [1; +oo) \/ { x : x < -4 }
{ pi, e, 6, 11/2, 1 + 3i } /\ QQ { 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ RR { pi, e, 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ CC { pi, e, 6, 11/2, 1 + 3i }
Creates a closed interval (segment)
Prints
|
static |
Creates an interval with custom endings
Prints
Returns a lambda with the given parameter and body
Prints
|
static |
| latexiseable | Any element (Entity, Set, etc.) that can be represented in LaTeX |
using System; using AngouriMath; using static AngouriMath.MathS;
Entity expr = "sqrt(a) + integral(sin(x), x)"; Console.WriteLine(expr); Console.WriteLine(Latex(expr)); Entity expr2 = "a / b ^ limit(sin(x) - cosh(y), x, +oo)"; Console.WriteLine(expr2); Console.WriteLine(Latex(expr2)); Prints sqrt(a) + integral(sin(x), x) {a}+ [(x)] dx a / b ^ limit(sin(x) - (e ^ y + e ^ (-y)) / 2, x, +oo) {a}{{b}^{{x } [(x)-{{e}^{y}+{e}^{-y}}{2}]}}
| a | Left argument node of which the less than or equal node will be taken |
| b | Right argument node of which the less than or equal node function will be taken |
using System; using static AngouriMath.MathS;
var (x, y) = Var("x", "y");
Console.WriteLine(GreaterThan(x, y)); Console.WriteLine(GreaterThan(6, 5)); Console.WriteLine(GreaterThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessThan(x, y)); Console.WriteLine(LessThan(6, 5)); Console.WriteLine(LessThan(6, 5).EvalBoolean()); Console.WriteLine(LessThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(GreaterOrEqualThan(x, y)); Console.WriteLine(GreaterOrEqualThan(6, 5)); Console.WriteLine(GreaterOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessOrEqualThan(x, y)); Console.WriteLine(LessOrEqualThan(6, 5)); Console.WriteLine(LessOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(LessOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); var statement1 = GreaterThan(Sqr(x), 5); Console.WriteLine(statement1); Console.WriteLine(statement1.Solve("x")); Console.WriteLine("----------------------------------"); var statement2 = GreaterThan(Sqr(x), 16) & LessThan(x, y); Console.WriteLine(statement2); Console.WriteLine(statement2.Solve("x")); Console.WriteLine("----------------------------------"); var statement3 = LessThan(Sqr(x), 16) & GreaterThan(x, 2); Console.WriteLine(statement3); Console.WriteLine(statement3.Solve("x")); Prints x > y 6 > 5 True
x < y 6 < 5 False
x >= y 6 >= 5 True
x <= y 6 <= 5 False
x ^ 2 > 5
x ^ 2 > 16 and x < y
x ^ 2 < 16 and x > 2 (2; 4)
| a | Left argument node of which the less than node will be taken |
| b | Right argument node of which the less than node function will be taken |
using System; using static AngouriMath.MathS;
var (x, y) = Var("x", "y");
Console.WriteLine(GreaterThan(x, y)); Console.WriteLine(GreaterThan(6, 5)); Console.WriteLine(GreaterThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessThan(x, y)); Console.WriteLine(LessThan(6, 5)); Console.WriteLine(LessThan(6, 5).EvalBoolean()); Console.WriteLine(LessThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(GreaterOrEqualThan(x, y)); Console.WriteLine(GreaterOrEqualThan(6, 5)); Console.WriteLine(GreaterOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(GreaterOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); Console.WriteLine(LessOrEqualThan(x, y)); Console.WriteLine(LessOrEqualThan(6, 5)); Console.WriteLine(LessOrEqualThan(6, 5).EvalBoolean()); Console.WriteLine(LessOrEqualThan(6, 6).EvalBoolean()); Console.WriteLine("----------------------------------"); var statement1 = GreaterThan(Sqr(x), 5); Console.WriteLine(statement1); Console.WriteLine(statement1.Solve("x")); Console.WriteLine("----------------------------------"); var statement2 = GreaterThan(Sqr(x), 16) & LessThan(x, y); Console.WriteLine(statement2); Console.WriteLine(statement2.Solve("x")); Console.WriteLine("----------------------------------"); var statement3 = LessThan(Sqr(x), 16) & GreaterThan(x, 2); Console.WriteLine(statement3); Console.WriteLine(statement3.Solve("x")); Prints x > y 6 > 5 True
x < y 6 < 5 False
x >= y 6 >= 5 True
x <= y 6 <= 5 False
x ^ 2 > 5
x ^ 2 > 16 and x < y
x ^ 2 < 16 and x > 2 (2; 4)
|
static |
Hangs your entity to a limit node (to evaluate instead use Compute.Limit(Entity, Variable, Entity))
| expr | Expression to be hung |
| var | Variable over which limit is taken |
| dest | Where var approaches (could be finite or infinite) |
| approach | From where it approaches |
Prints
Is a special case of logarithm where the base equals e:
| a | Argument node of which natural logarithm will be taken |
Prints
| base | Base node of logarithm |
| x | Argument node of logarithm |
Prints
|
static |
Creates an instance of Entity.Matrix.
| values | A two-dimensional array of values. The first dimension is the row count, the second one is for columns. |
Prints
|
static |
Creates an instance of matrix, where each cell's index is mapped to a value with the help of the mapping function.
| rowCount | The number of rows (corresponds to the first index). |
| colCount | The number of columns (corresponds to the second index). |
| map | The first argument of the mapping function function is the index of row, the second one for the column index. |
Indexing starts from 0.
Prints
|
inlinestatic |
Creates a matrix from given elements
| elements | There should be at least one row. All rows must have the same number of columns |
Prints
Creates a matrix from given rows
| vectors | There should be at least one row. All rows must have the same number of columns |
|
static |
Parses an expression silently, that is, without throwing an exception.
Instead, it returns a Failure in case of encountered errors during parsing.
Multiple ways to parse an expression.
|
static |
This is a piecewisely defined function, which turns into a particular definition once there exists a case number N such that case[N].Predicate is turned into true and for all i less than N : case[i].Predicate is turned into false.
For example, Piecewise(new Providedf(a, b), new Providedf(d, false), new Providedf(f, true)) will remain unchanged, because the first case is uncertain.
Piecewise(new Providedf(a, false), new Providedf(d, false), new Providedf(f, true)) will turn into f
Piecewise(new Providedf(a, false), new Providedf(d, false), new Providedf(f, false)) will turn into NaN
| cases | Cases, each of type Provided. |
| otherwise | An otherwise case. Will be intepreted as otherwise.Provided(true). Optional. |
Prints
|
static |
This is a piecewisely defined function, which turns into a particular definition once there exists a case number N such that case[N].Predicate is turned into true and for all i less than N : case[i].Predicate is turned into false.
For example, Piecewise((a, b), (d, false), (f, true)) will remain unchanged, because the first case is uncertain.
Piecewise((a, false), (d, false), (f, true)) will turn into f
Piecewise((a, false), (d, false), (f, false)) will turn into NaN
| cases | Tuples of two expressions: an expression and a predicate |
Prints
This will be turned into expression if the condition is true, into NaN if condition is false, and remain the same otherwise
| expression | The expression is extracted if the predicate is true |
| condition | Condition when the expression is defined |
Prints
Creates a 1x1 matrix of a given value.
It will be simplified once InnerSimplified or Evaled are addressed
Prints
| a | Argument node of secant |
Prints
| a | Left argument node of which the set subtraction node will be taken That is, the resulting set of set subtraction is necessarily superset of this set |
| b | Right argument node of which the set subtraction set node will be taken That is, there is no element in the resulting set that belong to this one |
using AngouriMath; using System; using static AngouriMath.Entity.Set; using static AngouriMath.MathS; using static AngouriMath.MathS.Sets;
var set1 = Finite(1, 2, 3); var set2 = Finite(2, 3, 4); var set3 = MathS.Interval(-6, 2); var set4 = new ConditionalSet("x", "100 > x2 > 81"); Console.WriteLine(Union(set1, set2)); Console.WriteLine(Union(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set3)); Console.WriteLine(Union(set1, set3).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set4)); Console.WriteLine(ElementInSet(3, Union(set1, set4))); Console.WriteLine(ElementInSet(3, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(4, Union(set1, set4))); Console.WriteLine(ElementInSet(4, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(9.5, Union(set1, set4))); Console.WriteLine(ElementInSet(9.5, Union(set1, set4)).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set1, set2)); Console.WriteLine(Intersection(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set2, set3)); Console.WriteLine(Intersection(set2, set3).Simplify()); Console.WriteLine("----------------------"); var set5 = MathS.Interval(-3, 11); Console.WriteLine(Intersection(set3, set5)); Console.WriteLine(Intersection(set3, set5).Simplify()); Console.WriteLine(Union(set3, set5)); Console.WriteLine(Union(set3, set5).Simplify()); Console.WriteLine(SetSubtraction(set3, set5)); Console.WriteLine(SetSubtraction(set3, set5).Simplify()); Console.WriteLine("----------------------"); Entity syntax1 = "{ 1, 2, 3 } /\ { 2, 3, 4 }"; Console.WriteLine(syntax1); Console.WriteLine(syntax1.Simplify()); Console.WriteLine("----------------------"); Entity syntax2 = "5 in ([1; +oo) \/ { x : x < -4 })"; Console.WriteLine(syntax2); Console.WriteLine(syntax2.Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C).Simplify()); Prints { 1, 2, 3 } \/ { 2, 3, 4 }
{ 1, 2, 3 } \/ [-6; 2]
{ 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } 3 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } True 4 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } False 19/2 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
{ 1, 2, 3 } /\ { 2, 3, 4 }
{ 2, 3, 4 } /\ [-6; 2]
[-6; 2] /\ [-3; 11] [-3; 2] [-6; 2] \/ [-3; 11] [-6; 11] [-6; 2] \ [-3; 11]
{ 1, 2, 3 } /\ { 2, 3, 4 }
5 in [1; +oo) \/ { x : x < -4 }
{ pi, e, 6, 11/2, 1 + 3i } /\ QQ { 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ RR { pi, e, 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ CC { pi, e, 6, 11/2, 1 + 3i }
https://en.wikipedia.org/wiki/Sign_function
| a | Argument node of which Signum function will be taken |
Prints
| a | Argument node of sine |
Prints
|
static |
Solves a boolean expression.
That is, finds all values for variables such that the expression turns into True when evaluated Uses a simple table of truth Use Entity.SolveBoolean(Variable) for smart solving
Solves one equation over one variable
| equation | An equation that is assumed to equal 0 |
| var | Variable whose values we are looking for |
Prints { 1, -1 } { ln(-sqrt(-2) / (-1 - i)) / i / a, ln(sqrt(-2) / (-1 - i)) / i / a }
| a | Argument node of which tangent will be taken |
Prints
|
static |
Translates a Number in base 10 into base N
| num | A Real in base 10 to be translated into base N |
| N | The base to translate the number into |
Prints
|
inlinestatic |
| expr | An Entity representing an expression |
using System; using static AngouriMath.MathS;
var (x, y, a) = Var("x", "y", "a"); var expr = Limit(Integral(Sin(x) / (Cos(x) + Tan(y)), x) / a, y, +oo); Console.WriteLine(expr); Console.WriteLine("----------------------------"); Console.WriteLine(ToSympyCode(expr)); Prints
import sympy
x = sympy.Symbol('x') y = sympy.Symbol('y') a = sympy.Symbol('a')
expr = sympy.limit(sympy.integrate(sympy.sin(x) / (sympy.cos(x) + sympy.tan(y)), x, 1) / a, y, +oo)
|
static |
Returns an Entity in polynomial order if possible
| expr | The unordered Entity |
| variable | The variable of the polynomial |
| dst | The ordered result |
Prints
| a | Left argument node of which the union set node will be taken |
| b | Right argument node of which the union set node will be taken |
using AngouriMath; using System; using static AngouriMath.Entity.Set; using static AngouriMath.MathS; using static AngouriMath.MathS.Sets;
var set1 = Finite(1, 2, 3); var set2 = Finite(2, 3, 4); var set3 = MathS.Interval(-6, 2); var set4 = new ConditionalSet("x", "100 > x2 > 81"); Console.WriteLine(Union(set1, set2)); Console.WriteLine(Union(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set3)); Console.WriteLine(Union(set1, set3).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Union(set1, set4)); Console.WriteLine(ElementInSet(3, Union(set1, set4))); Console.WriteLine(ElementInSet(3, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(4, Union(set1, set4))); Console.WriteLine(ElementInSet(4, Union(set1, set4)).Simplify()); Console.WriteLine(ElementInSet(9.5, Union(set1, set4))); Console.WriteLine(ElementInSet(9.5, Union(set1, set4)).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set1, set2)); Console.WriteLine(Intersection(set1, set2).Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(set2, set3)); Console.WriteLine(Intersection(set2, set3).Simplify()); Console.WriteLine("----------------------"); var set5 = MathS.Interval(-3, 11); Console.WriteLine(Intersection(set3, set5)); Console.WriteLine(Intersection(set3, set5).Simplify()); Console.WriteLine(Union(set3, set5)); Console.WriteLine(Union(set3, set5).Simplify()); Console.WriteLine(SetSubtraction(set3, set5)); Console.WriteLine(SetSubtraction(set3, set5).Simplify()); Console.WriteLine("----------------------"); Entity syntax1 = "{ 1, 2, 3 } /\ { 2, 3, 4 }"; Console.WriteLine(syntax1); Console.WriteLine(syntax1.Simplify()); Console.WriteLine("----------------------"); Entity syntax2 = "5 in ([1; +oo) \/ { x : x < -4 })"; Console.WriteLine(syntax2); Console.WriteLine(syntax2.Simplify()); Console.WriteLine("----------------------"); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), Q).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), R).Simplify()); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C)); Console.WriteLine(Intersection(Finite(pi, e, 6, 5.5m, 1 + 3 * i), C).Simplify()); Prints { 1, 2, 3 } \/ { 2, 3, 4 }
{ 1, 2, 3 } \/ [-6; 2]
{ 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } 3 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } True 4 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 } False 19/2 in { 1, 2, 3 } \/ { x : 100 > x ^ 2 and x ^ 2 > 81 }
{ 1, 2, 3 } /\ { 2, 3, 4 }
{ 2, 3, 4 } /\ [-6; 2]
[-6; 2] /\ [-3; 11] [-3; 2] [-6; 2] \/ [-3; 11] [-6; 11] [-6; 2] \ [-3; 11]
{ 1, 2, 3 } /\ { 2, 3, 4 }
5 in [1; +oo) \/ { x : x < -4 }
{ pi, e, 6, 11/2, 1 + 3i } /\ QQ { 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ RR { pi, e, 6, 11/2 } { pi, e, 6, 11/2, 1 + 3i } /\ CC { pi, e, 6, 11/2, 1 + 3i }
|
static |
Creates an instance of Variable.
| name | The name of the Variable which equality is based on. |
Here are multiple ways to create variables:
Underscore "_" allows indexing. Greek letter names (e. g. "alpha") will be latexised as Greek letter (but other than that, will appear as "alpha" in other places).
Creates an instance of Entity.Matrix that has one column.
| values | The cells of the Entity.Matrix |
Prints
|
static |
Creates a zero square matrix
Prints
|
static |
Creates a zero square matrix
Prints
|
static |
Creates a zero vector
Prints
|
static |
There are multiple constants available. Examples:
Prints
|
static |
There are multiple constants available. Examples:
Prints
|
static |
|
static |
|
static |
|
static |
|
static |
NaN represents both "undefined" and "indeterminate".
Any operation on NaN returns NaN
Let's consider MathS.oo and MathS.NaN.
Prints
See Entity.IsFinite for determining if there are NaNs or infinities inside an expression.
|
static |
|
static |
|
static |
|
static |
|
static |
Infinity.
Recommended to use with a plus or minus trailing.
Let's consider MathS.oo and MathS.NaN.
Prints
See Entity.IsFinite for determining if there are NaNs or infinities inside an expression.
|
static |
There are multiple constants available. Examples:
Prints
|
static |
Creates two instances of Variable.
Creates three instances of Variable.
Here are multiple ways to create variables:
Underscore "_" allows indexing. Greek letter names (e. g. "alpha") will be latexised as Greek letter (but other than that, will appear as "alpha" in other places).
Here are multiple ways to create variables:
Underscore "_" allows indexing. Greek letter names (e. g. "alpha") will be latexised as Greek letter (but other than that, will appear as "alpha" in other places).
Here are multiple ways to create variables:
Underscore "_" allows indexing. Greek letter names (e. g. "alpha") will be latexised as Greek letter (but other than that, will appear as "alpha" in other places).
1.8.13