45
This  example  allows  the  user  to  enter  a  function  to  be  integrated.  The  result  is  then  formatted  by  the  typesetting
system  and  saved  as  an  image.  The  source  for  this  page  is  in  webMathematica/Examples/ 
Integrate.jsp. A section that shows the form tag is shown below.
<%@ page language="java"  %>
<%@ taglib uri="/webMathematica taglib" prefix="msp" %>
Integration

Integrate a function

Input:

integrand = Null;
page variable to hold the integrand
If[ MSPValueQ[ $$expr],
integrand = 
interpret input with secure conversion
MSPToExpression[ $$expr]] ;
          value=" MSPValue[ $$expr, 
"Sin[x]^2"]" />


carry out the integration
If[ integrand =!= Null,
MSPFormat[
Integrate[integrand,x],StandardForm]]  

In this example, an msp:evaluate tag integrates an expression and uses 
MSPFormat
 to format the result with
StandardForm. This generates an image and returns a reference to the image. For this to work, it is necessary to
use the Mathematica front end.
The  example  also  demonstrates  the  use  of  page  variables  with    
MSPToExpression
.  This  is  an  alternative  to
using  
MSPBlock
 suitable  in  certain  constructions,  for  example,  when  the  input  will  be  used  in  a  number  of
computations.  The page  variable  integrand  is initialized  to  Null  and  later,  if its  value has  been  modified,  the
integration is carried out. It is assigned to the interpreted value of $$expr only if this input variable actually has a
value.  Note  that if  an error,  such  as  a  security  error,  is  encountered  in interpreting  $$expr,  an exception  will  be
thrown and integrand will remain assigned to Null.
 .
<





New Page 1








Home : About Us : Network : Services : Support : FAQ : Control Panel : Order Online : Sitemap : Contact : Terms Of Service

 

Our web partners:  Jsp Web Hosting  Unlimited Web Hosting  Cheapest Web Hosting  Java Web Hosting  Web Templates  Best Web Templates  Web Design Templates  Interland Web Hosting  Cheap Web Hosting  Filemaker Web Hosting  Tomcat Web Hosting  Quality Web Hosting  Best Web Hosting  Mac Web Hosting

 
 

Virtualwebstudio. Business web hosting division of Vision Web Hosting Inc. All rights reserved

Comcast Web Hosting