A good way to get an overall view of the solution is to use Plot3D :. An alternative that often gives good information about solution details is DensityPlot :. For time evolution equations like this, often the best intuition comes from an animation. Typically you will get the best results using ListAnimate. First make a list of plots at equal time intervals apart, all with the same PlotRange :.
In this case it is a little hard to see the wave motion because of the varying background coming from a zero initial condition. AccuracyGoal effectively specifies the absolute local error allowed at each step in finding a solution, while PrecisionGoal specifies the relative local error. If solutions must be followed accurately when their values are close to zero, AccuracyGoal should be set larger, or to Infinity. The default setting of Automatic for MaxSteps estimates the maximum number of steps to be taken by NDSolve , depending on start and stop time and an estimate of the step size.
Should this not be possible, a fixed number of steps is taken. The setting for MaxStepFraction specifies the maximum step to be taken by NDSolve as a fraction of the range of values for each independent variable. NDSolve typically solves differential equations by going through several different stages, depending on the type of equations. The actual stages used and their order are determined by NDSolve , based on the problem to solve.
Basic Examples 7 Solve a first-order ordinary differential equation:. Scope 25 Ordinary Differential Equations 8 Specify any order equation. Partial Differential Equations 5 Nonlinear advection-diffusion equation in one dimension:.
Boundary Value Problems 5 A nonlinear multipoint boundary value problem:. Delay Differential Equations 2 Solve a delay differential with two constant delays and initial history function :. Hybrid and Discontinuous Equations 4 A differential equation with a discontinuous right-hand side using automatic event generation:. Differential-Algebraic Equations 1 A differential equation with an algebraic constraint:. Options 29 AccuracyGoal and PrecisionGoal 1 Use defaults to solve a celestial mechanics equation with sensitive dependence on initial conditions:.
DependentVariables 1 Set up a very large system of equations:. EvaluationMonitor 2 Total number of evaluations:. InitialSeedings 2 Specify an initial seeding of 0 for a boundary value problem:.
MaxStepFraction 1 Features with small relative size in the integration interval can be missed:. MaxSteps 1 Integration stops short of the requested interval:. MaxStepSize 2 The default step control may miss a suddenly varying feature:. Method 12 TimeIntegration 4. PDEDiscretization 2. BoundaryValues 1. DiscontinuityProcessing 1. EquationSimplification 2. IndexReduction 1. DAEInitialization 1. NormFunction 1 Plot the actual solution error when using different error estimation norms:.
StartingStepSize 1 For a very large interval, a short-lived feature near the start may be missed:. StepMonitor 3 Plot the solution at each point where a step is taken in the solution process:.
WorkingPrecision 1 Error in the solution to a harmonic oscillator over periods:. Applications 34 Ordinary Differential Equations 5 Simulate Duffing's equation for a particle in a double potential well:. Partial Differential Equations 9 Simple model for soil temperature at depth x with periodic heating at the surface:.
Delay Differential Equations 1 View solutions of the Mackey — Glass delay differential equation for respiratory dynamics:. Mechanical Systems 3 Model the motion of a pendulum in Cartesian coordinates.
Electrical Systems 6 Simulate the response of an RLC circuit to a step in the voltage at time : Use component laws together with Kirchhoff's laws for connections:.
Hydraulic Systems 3 Model the change in height of water in two cylindrical tanks as water flows from one tank to another through a pipe: Use pressure relations and mass conservation:. Chemical Systems 2 Model the kinetics of an autocatalytic reaction: The rate equations are given as:. Possible Issues 11 Numerical Error 3 The error tends to grow as you go further from the initial conditions:. Differential Algebraic Equations 3 NDSolve cannot automatically handle systems of index greater than Boundary Value Problems 1 This finds a trivial solution of a boundary value problem:.
Definitions for Unknown Functions 1 Definitions for an unknown function may affect the evaluation:. History Introduced in 2. APA Wolfram Language. Give Feedback Top. I'm not experienced in differential equation solving, unfortunately I'll try in a minute. Thank you very much. Thanks a lot, Claude. Reply to this discussion in reply to. Community posts can be styled and formatted using the Markdown syntax. Tag limit exceeded. Note: Only the first five people you tag will receive an email notification; the other tagged names will appear as links to their profiles.
Publish anyway Cancel. Remove Add a file to this post. This computes a very simple solution to the boundary value problem with :. This gives the equation, boundary conditions, and exact solution as Wolfram Language input:. This solves the system with shooting from the default :. This computes the solution using shooting from :.
This computes the solution for shooting from. This solves a two-point boundary value problem for a second-order equation:. The solver can solve multipoint boundary value problems of linear systems of equations. Note that each boundary equation must be at one specific value of. This checks to see if the boundary conditions are "satisfied":. This checks the residual error at each of the boundary conditions:. Here is a boundary value problem that does not have a unique solution.
Its general solution is shown as computed symbolically with DSolve :. NDSolve issues a warning message because the matrix to solve for the initial conditions is singular, but has a solution:.
You can identify which solution it found by fitting it to the interpolating points. This makes a plot of the error relative to the actual best fit solution:. Here is a boundary value problem with a simple solution computed symbolically using DSolve :.
This shows the error in the solution computed using the chasing method in NDSolve :. Using extra precision to solve for the initial conditions reduces the error substantially:. This uses extra precision to compute the initial conditions along with more stringent settings for the AccuracyGoal and PrecisionGoal options:.
This solves the flow problem with for and , plots the solution and returns the value of :. Give Feedback Top. Boundary Value Problems with Parameters.
0コメント