100 likes | 399 Views
Solving ODEs with Mathematica. Anchors: Scandium δ Jocelyn Anleitner Diane Feldkamp. Mathematica Basics. Purpose: Mathematica solves difficult mathematical formulas Focus: solving ordinary differential equations (ODEs) of 1 st and higher order using Mathematica. Mathematica Syntax.
E N D
Solving ODEs with Mathematica Anchors: Scandiumδ Jocelyn Anleitner Diane Feldkamp
Mathematica Basics • Purpose: Mathematica solves difficult mathematical formulas • Focus: solving ordinary differential equations (ODEs) of 1st and higher order using Mathematica
Mathematica Syntax • Details about important syntax for Mathematica can be reviewed on the wiki page titled “Solving ODEs with Mathematica” • For entering ODEs, use double equal signs (==) to define the functions • When finished with a line, use “Shift”+ “Enter” for Mathematica to compute the answer
Dsolve and NDSolve • For ODEs without initial conditions, use Dsolve • For ODEs with initial conditions, use NDSolve
Example: Semi-batch Reactor(Worked Out Example 2) Reaction: AB Given Variables: First-order ODE with Initial Conditions Use NDSolve in Mathematica
Entering in Mathematica • Open Mathematica (Version shown here is Mathematica 6) • Use the following steps to solve the ODE in Mathematica: • Input ODE • Define given variables
Entering in Mathematica (cont.) • Define a variable to NDSolve and enter inputs • Plot the solution X is conversion, and X[0] is entered as 0.0001 instead of 0 so that the ODE will not be undefined
Sources Solving ODEs with Mathematica (wiki): http://controls.engin.umich.edu/wiki/index.php/Solving_ODEs_with_Mathematica