In Math.NET Symbolics, ArcCos function with SymbolicExpression

125 views Asked by At

I'm doing part of my A-Level college project in VB.NET and am using the Math.NET Symbolics package.

I have MathNet.Symbolics.SymbolicExpresssion imported as Expr.

I have variables defined as type Expr (SymbolicExpression) and I want to conduct an equation involving ArcCos.

Math.NET.Symbolics contains a ArcCos function that takes an Expression type arguement (Not SymbolicExpression like my variables) but there does not seem to be an ArcCos function in Expr, so I cannot use the ArcCos function with my variables due to the difference in types.

I would like to avoid attempting to convert them or change my code to use solely the Expression type. Is there a way of doing this?

    Dim a As Expr = CharacteristicPolynomialCoefficients(3)
    Dim b As Expr = CharacteristicPolynomialCoefficients(2)
    Dim c As Expr = CharacteristicPolynomialCoefficients(1)
    Dim d As Expr = CharacteristicPolynomialCoefficients(0)

    Dim p As Expr = -b / (3 * a)
    Dim q As Expr = (p * p * p) + (((b * c) - (3 * a * d)) / (6 * a * a))
    Dim r As Expr = c / (3 * a)
    Dim theta = Expr.Variable("θ")
    theta = MathNet.Symbolics.Expression.ArcCos() 'This is the function

    theta = (1 / 3) * MathNet.Symbolics.Expression.ArcCos(((-1 / 2) * q) * ((3 / -p).Sqrt * (3 / -p).Sqrt * (3 / -p).Sqrt)) 'this will fail due to param being SymbolicExpression
0

There are 0 answers