70 likes | 140 Views
Basics of webMathematica. What is webMathematica ?. This is normal Mathematica code:. WebMathematica is an interactive environment , where Mathematica Kernel does the calculations but the user submits input values using a web page. Give an equation:. x^2+x-2 ==0. x. Give the variable:.
E N D
What is webMathematica ? This is normal Mathematica code: WebMathematica is an interactive environment, where Mathematica Kernel does the calculations but the user submits input values using a web page. Give an equation: x^2+x-2 ==0 x Give the variable: {{ x->2} ,{x -> 1}}
Ramk’s webMathematica server LAN - address: http://webmath/vm Address from outside https://193.167.81.43/wm/ When we want to put own files to the server, the place has the following address. It can bee reached from mycomputer \\webmath\webapps$ You need an extra password to reach this server.
How to create own applications • Use editor (f.e.notepad) to write the code • Save it to server under webmath/vm using extention .jsp (f.e. myapp1.jsp) • To use application load it with your web-browser from http://webmath/vm/myapp1.jsp
How does webMathematica code look like? • Code is mostly html – code • The webmathematica tags have A prefix msp, for example: <msp:allocateKernel>, </msp:allocateKernel> <msp:evaluate>, </msp:evaluate> MSPBlock , MSPValue , MSPShow MSPToExpression, MSPFormat Read from documentation how to use these tags. (You will find the documentation using google and search phrase: “webmathematica documantation”
Example : Myfactor.jsp <html> <head> <title>Factoring Polynomials</title> </head> <body> <h1>Factoring Polynomials</h1> <form action="Myfactor.jsp" method="post"> Enter a polynomial : <input type="text" name="expr" size="15"/> <br> <br> <msp:allocateKernel> <msp:evaluate> MSPBlock[{$$expr}, Factor[$$expr]] </msp:evaluate> </msp:allocateKernel> <br> <input type="submit" name="submitButton" value="Evaluate"> </form> <br>Simple example by Jouko Teeriaho 23.5<br> </body> </html> These names must be the same html - form input box Mathematica command “Factor” Button for evaluating the command
Summary • 1. Best way for a beginner is to take some example jsp and • modify the code for your own purposes. • Use some specific folder under webmath/vm/ to save your • work • Create a web site from where any user can access the applications.