1
我使用MathNet.Symbolics
库simplyfy像这样的表达式:如何计算平方根在MathNet.Symbolics
string f = Infix.Print(Infix.ParseOrThrow("A+5*2"))
可正常工作(f = A+10
),但试图让根的数量为比我预期的要困难得多。例如:
string f = Infix.Print(Infix.ParseOrThrow("sqrt(9)"))
f = "sqrt(9)
“,而不是f = "3"
你所期望的
string f = Infix.Print(Infix.ParseOrThrow("sqrt(x^2)"))
f = "sqrt(x^2)"
insted的的f = "x"
string f = Infix.Print(Infix.ParseOrThrow("9^(1/2)"))
也不起作用insted的它被简化为f = "sqrt(9)"
。
我该如何强制它计算一个数字/变量的sqrt?
当使用MathNet.Symbolics
的“自动简化”时,是否会遇到其他问题?
参见:https://discuss.mathdotnet.com/t/how-do-i-calculate-the-sqrt-in-数学净符号处理/ 533 –