Tricks of the Trade
In and Out
Download This Issue
What's New in Mathematica 5
The function NDSolve has been completely rewritten, resulting in better performance and much greater flexibility. While many of the enhancements are transparent and will benefit all users, the new NDSolve gives advanced users many more options for selecting methods, setting evaluation options, and monitoring the progress of the solver—and even ways for implementing their own custom solvers into NDSolve.
Some of the most significant improvements include:
Example: Solving a System of Differential Equations
The following example demonstrates the use of vector variables to specify a system of differential equations of dimension 12.
To assist in the visualization of the results of the following numerical differential equation, it is useful to view the solution as a three-dimensional graphic.
The following example is of a space curve defined by curvature and torsion.
Example: Solving a Matrix Differential Equation
In this example we solve the matrix differential equation with and the initial condition .
We can define a particular matrix norm and look at the differences.
Example: Solving a Differential-Algebraic Equation
In this case we have one differential equation and one explicit algebraic equation . Notice how (in this case only) we give one initial value equation . The initial value equation for is implicitly determined by the algebraic equation.
Example: Modeling an Exothermic Chemical Reactor
The following is an exothermal chemical reactor model. In this simple first-order isomerization process, the heat is removed through an external cooling circuit. In this case we have product concentration, product temperature, and reaction rate. Furthermore, we have reactant concentration, reactant temperature, cooling circuit temperature, and constants.
Example: Solving a Partial Differential Equation
A soliton is a solitary wave that survives collisions with other solitary waves. For example, ocean waves are solitons. The Korteweg-de Vries equation was the first differential equation describing a soliton. Technical applications of solitons include long-haul optical fiber transmission systems.
This is the Korteweg-de Vries equation in one spatial dimension.
This is a solitary wave solution to the KdV equation above.
Because we are going to use periodic boundary conditions, we will add up all the period contributions to get the following initial condition.
Here we can see how these solitary waves interact.
Notice the nonlinear interaction when they pass each other.
The function FindRoot now supports general array variables and includes new and improved algorithms that lead to speed increases and better handling of large-scale problems on computers with limited memory.
Example: Solving a Matrix Riccati Equation
Here is an example of solving a matrix equation—in this case a continuous-time algebraic Riccati equation .
Suppose we have a system (e.g., a double integrator, or some type of mechanical system) and constraints.
This finds a matrix root to the equation .
The new function FindFit supersedes and extends the functionality of the functions Fit and NonlinearFit. FindFit supports array variables, provides more methods, and can use the functions StepMonitor and EvaluationMonitor for keeping track of the process.
Example: Fitting Data
FindFit can even fit data using a piecewise continuous function.
The data can be shown with the following fitting function.
Example: Fitting a Circle
Suppose we are taking measurements along a circle.
This fits a circle with radius and center to the data.
This shows the data and the fitted circle together.
FindMinimum and FindMaximum
The new function FindMaximum has been added for convenience. The functions FindMinimum and FindMaximum now support general array variables, offer new and improved algorithms, and work better in limited-memory situations.
Example: Computing a Matrix Norm
In this case we are using a vector variable.
About Mathematica Download Mathematica Player
Copyright © Wolfram Media, Inc. All rights reserved.