java - Symja Jar Algebra -
i using symja-0.0.7a.jar algebra expression evaluation. working in standalone java application. when run in server using tomcat , eclipse, following error...
workingexp: (4p * 2) + (8q * 2) java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:601) @ core.markans.doget(markans.java:53) @ core.markans.dopost(markans.java:76) @ javax.servlet.http.httpservlet.service(httpservlet.java:641) @ javax.servlet.http.httpservlet.service(httpservlet.java:722) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:305) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:222) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:123) @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:472) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:168) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:99) @ org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:929) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:118) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:407) @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1002) @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:585) @ org.apache.tomcat.util.net.jioendpoint$socketprocessor.run(jioendpoint.java:310) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1110) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:603) @ java.lang.thread.run(thread.java:722) caused by: java.lang.noclassdeffounderror: org/matheclipse/parser/client/syntaxerror @ core.markworkingslessthansoln.checkalgebraevaluator(markworkingslessthansoln.java:126) @ core.markworkingslessthansoln.checkworkinglessthansoln(markworkingslessthansoln.java:71) @ core.markans.gradepaper(markans.java:153) ... 24 more caused by: java.lang.classnotfoundexception: org.matheclipse.parser.client.syntaxerror @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1714) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1559) ... 27 more
below code used in 1 of class file used evoke method...
import static org.matheclipse.core.expression.f.*; import org.matheclipse.core.basic.config; import org.matheclipse.core.eval.evalutilities; import org.matheclipse.core.interfaces.iast; import org.matheclipse.core.interfaces.iexpr; import org.matheclipse.parser.client.syntaxerror; import org.matheclipse.parser.client.math.mathexception; public class evalexpand { public void evalalgebra() { // static initialization of matheclipse engine instead of null // can set file name overload default initial try { evalutilities util = new evalutilities(false, true); // show expression in java form: string javaform = util.tojavaform("d(sin(x)*cos(x),x)"); // prints: d(times(sin(x),cos(x)),x) system.out.println(javaform.tostring()); // use java form create expression f.* static methods: iast function = d(times(sin(x), cos(x)), x); iexpr result = util.evaluate(function); // print: -sin(x)^2+cos(x)^2 system.out.println(result.tostring()); // evaluate string directly result = util.evaluate("d(sin(x)*cos(x),x)"); // print: -sin(x)^2+cos(x)^2 system.out.println(result.tostring()); // evaluate last result ($ans contains "last answer") result = util.evaluate("$ans+cos(x)^2"); // print: -sin(x)^2+2*cos(x)^2 system.out.println(result.tostring()); // evaluate integrate[] expression result = util.evaluate("integrate(sin(x)^5,x)"); // print: -1/5*cos(x)^5+2/3*cos(x)^3-cos(x) system.out.println(result.tostring()); // use [...] function arguments instead of (...) , upper case names predefined functions (i.e. sin[...] // instead of sin[...]). evalutilities util2 = new evalutilities(false, false); if (config.parser_use_lowercase_symbols) { // if true parser doesn't distinguish between lower- or uppercase predefined symbols result = util2.evaluate("integrate[sin[x]^5,x]"); } else { result = util2.evaluate("integrate[sin[x]^5,x]"); } // print: -1/5*cos(x)^5+2/3*cos(x)^3-cos(x) system.out.println(result.tostring()); } catch (syntaxerror e) { // catch symja parser errors here system.out.println(e.getmessage()); } catch (mathexception me) { // catch symja math errors here system.out.println(me.getmessage()); } catch (exception e) { e.printstacktrace(); } } }
any kind souls able help? have been trying sorts of method no avail.
thank you!
Comments
Post a Comment