
Wolfram Mathematica ® Tutorial Collection ADVANCED NUMERICAL DIFFERENTIAL EQUATION SOLVING IN MATHEMATICA For use with Wolfram Mathematica® 7.0 and later. For the latest updates and corrections to this manual: visit reference.wolfram.com For information on additional copies of this documentation: visit the Customer Service website at www.wolfram.com/services/customerservice or email Customer Service at [email protected] Comments on this manual are welcomed at: [email protected] Content authored by: Mark Sofroniou and Rob Knapp Printed in the United States of America. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 ©2008 Wolfram Research, Inc. All rights reserved. No part of this document may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of the copyright holder. Wolfram Research is the holder of the copyright to the Wolfram Mathematica software system ("Software") described in this document, including without limitation such aspects of the system as its code, structure, sequence, organization, “look and feel,” programming language, and compilation of command names. Use of the Software unless pursuant to the terms of a license granted by Wolfram Research or as otherwise authorized by law is an infringement of the copyright. Wolfram Research, Inc. and Wolfram Media, Inc. ("Wolfram") make no representations, express, statutory, or implied, with respect to the Software (or any aspect thereof), including, without limitation, any implied warranties of merchantability, interoperability, or fitness for a particular purpose, all of which are expressly disclaimed. Wolfram does not warrant that the functions of the Software will meet your requirements or that the operation of the Software will be uninterrupted or error free. As such, Wolfram does not recommend the use of the software described in this document for applications in which errors or omissions could threaten life, injury or significant loss. Mathematica, MathLink, and MathSource are registered trademarks of Wolfram Research, Inc. J/Link, MathLM, .NET/Link, and webMathematica are trademarks of Wolfram Research, Inc. Windows is a registered trademark of Microsoft Corporation in the United States and other countries. Macintosh is a registered trademark of Apple Computer, Inc. All other trademarks used herein are the property of their respective owners. Mathematica is not associated with Mathematica Policy Research, Inc. Contents Introduction . 1 Overview . 1 The Design of the NDSolve Framework . 11 ODE Integration Methods . 17 Methods . 17 Controller Methods . 66 Extensions . 162 Partial Differential Equations . 174 The Numerical Method of Lines . 174 Boundary Value Problems . 243 Shooting Method . 243 Chasing Method . 248 Boundary Value Problems with Parameters . 255 Differential-Algebraic Equations . 256 Introduction . 256 IDA Method . 264 Delay Differential Equations . 274 Comparison and Contrast with ODEs . 275 Propagation and Smoothing of Discontinuities . 280 Storing History Data . 284 The Method of Steps . 285 Examples . 290 Norms in NDSolve . 294 ScaledVectorNorm . 296 Stiffness Detection . 298 Overview . 298 Introduction . 299 Linear Stability . 301 "StiffnessTest" Method Option . 304 "NonstiffTest" Method Option . 305 Examples . 315 Option Summary . 323 Structured Systems . 324 Structured Systems . 324 Numerical Methods for Solving the Lotka|Volterra Equations . 324 Rigid Body Solvers . 329 Components and Data Structures . 339 Introduction . 339 Example . 340 Creating NDSolve`StateData Objects . 341 Iterating Solutions . 343 Getting Solution Functions . 344 NDSolve`StateData methods . 348 DifferentialEquations Utility Packages . 351 InterpolatingFunctionAnatomy . 351 NDSolveUtilities . 356 References . 358 Introduction to Advanced Numerical Differential Equation Solving in Mathematica Overview The Mathematica function NDSolve is a general numerical differential equation solver. It can handle a wide range of ordinary differential equations (ODEs) as well as some partial differential equations (PDEs). In a system of ordinary differential equations there can be any number of unknown functions xi, but all of these functions must depend on a single “independent variable” t, which is the same for each function. Partial differential equations involve two or more indepen- dent variables. NDSolve can also solve some differential-algebraic equations (DAEs), which are typically a mix of differential and algebraic equations. NDSolve@8eqn1,eqn2,…<, find a numerical solution for the function u with t in the u,8t,tmin,tmax<D range tmin to tmax NDSolve@8eqn1,eqn2,…<, find numerical solutions for several functions ui 8u1,u2,…<,8t,tmin,tmax<D Finding numerical solutions to ordinary differential equations. NDSolve represents solutions for the functions xi as InterpolatingFunction objects. The InterpolatingFunction objects provide approximations to the xi over the range of values tmin to tmax for the independent variable t. In general, NDSolve finds solutions iteratively. It starts at a particular value of t, then takes a sequence of steps, trying eventually to cover the whole range tmin to tmax. In order to get started, NDSolve has to be given appropriate initial or boundary conditions for the xi and their derivatives. These conditions specify values for xi@tD, and perhaps derivatives xi ‘@tD, at particular points t. When there is only one t at which conditions are given, the equa- tions and initial conditions are collectively referred to as an initial value problem. A boundary value occurs when there are multiple points t. NDSolve can solve nearly all initial value prob- lems that can symbolically be put in normal form (i.e. are solvable for the highest derivative order), but only linear boundary value problems. 2 Advanced Numerical Differential Equation Solving in Mathematica can solve nearly all initial value prob- lems that can.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages184 Page
-
File Size-