public static void solveInequalitiesEquationSymja(){
EvalUtilities util = new EvalUtilities(false, true);
IExpr result = util.evaluate("x^2<x");
IExpr result2 = Solve(result,x);
System.out.println("################## Inequalities equation ##################");
System.out.println(result);
System.out.println(result2);
}
结果是x ^ 2&lt; X
result2是Solve(x ^ 2&lt; x,x)
public static void solveModuleEquationSymja() {
ExprEvaluator util = new ExprEvaluator();
Parser parser = new Parser();
ASTNode exprNode = parser.parse("Sqrt[x^2] == 7");
AST2Expr ast2Expr = new AST2Expr();
IExpr ast = ast2Expr.convert(exprNode);
IAST function = Solve(ast, x);
IExpr result = util.evaluate(function);
System.out.println("################## Module equation ##################");
System.out.println(result);
}
{{X-&GT; -7},{x方向大于7}} 有没有解决方案不使用sqrt(x ^ 2),而是直接使用模数(x)?
提前谢谢
答案 0 :(得分:0)
目前,Solve()不支持不等式。
你的意思是“x ^ 2 == 49”吗?
public static void solveModuleEquationSymja() {
ExprEvaluator util = new ExprEvaluator();
IExpr result = util.evaluate("Solve(x^2 == 49,x)");
System.out.println("################## Module equation ##################");
System.out.println(result);
}