§1
§1.6 Numerical Computation
For most of initial value problem
[pic], [pic] [pic]
we cannot find a closed form for the solution[pic]. Hence it is important to find the numerical solution of I.V.P.[pic]. In the matlab there are several ODE solver for the I.V.P.[pic] in vector form, i.e., a system of ordinary differentiatial equations,
[pic]
[pic]
[pic] [pic]
[pic]
[pic], [pic]
Let
[pic], [pic]
Then [pic] can be written in vector form
[pic],
[pic].
We recommend two most popular ODE solvers in the Matlab, ode45 and ode23s. ode45 is an explicit one-step Runge-Kutter (4th to 5th order) solver. Suitable for nonstiff problems that require moderate accuracy. This is typically the first solver to try on a new problem. Ode23s is suitable for stiff problem where lower accuracy is acceptable.
Example 6.1: Write the well-known van der pol equation [pic] into a system of ODE.
Let [pic], [pic]. Then
[pic]
[pic].
In the following we show how to use the Matlab ODE solvers and sketch the graph.
Example 6.2: Use ode45 solver to solve
[pic], [pic], [pic]
clear all
format long
global [pic] [pic]
[pic] input(‘Please input [pic]’);
[pic];
[pic]; [pic];
[pic];
[t y]=ode45(‘test1’, [t0 tf],y0);
plot[pic]
[pic]label[pic];
[pic]label[pic];
Xmin=0;
Xmax=85;
Ymin=0;
Ymax=16;
axis([Xmin,Xmax,Ymin,Ymax]);
disp(‘finish’)
function dy=test1(t,y)
global [pic] [pic]
[pic];
[pic]
Example 6.3: Solve the Van der Pol equation
[pic], [pic], [pic], [pic].
| function [pic]=vdpol([pic],[pic]) |
|%VDPOL van der Pol equation. |
|% [pic]=VDPOL([pic],[pic]) |
|% [pic] |
|% [pic] |
|% [pic] |
| |
|[pic]; |
|[pic]; |
Note that the input arguments are [pic] and [pic] but that the function does not use [pic]. Note also that the output [pic] must be a column vector.
Given the above ODE file, this set of ODEs is solved using the following commands.
>> [pic]span =[0 20]; % time span to integrate over
>> [pic]0=[2; 0]; % initial conditions (must be a column)
>> [t,y]= ode45(@vdpol, [pic]span,[pic]0);
>> size([pic]) % number of time points
ans =
333. 1
>>size([pic]) % (i)th column is [pic](i) at [pic](i)
ans =
333. 2
>> plot([pic],[pic](:,1),[pic],[pic](:,2), ‘- -’)
>> [pic]label(‘time’)
>> title(‘Figure 24.1: van der Pol Solution’)
Figure 24.1: van der Pol Solution
[pic]
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- state approved calculators for sol tests
- using matlab s differential equation solver
- system definition
- unit 9 assessment 1
- linear systems laboratory 6
- the quest for linear equation solvers john gustafson
- the power flow equations
- simulation of on chip interconnects with three dimensional
- user s guide to running the trajectory code using aae450
Related searches
- 1 or 2 374 374 1 0 0 0 1 168 1 1 default username and password
- 1 or 3 374 374 1 0 0 0 1 168 1 1 default username and password
- 1 or 2 711 711 1 0 0 0 1 168 1 1 default username and password
- 1 or 3 711 711 1 0 0 0 1 168 1 1 default username and password
- 1 or 2 693 693 1 0 0 0 1 168 1 1 default username and password
- 1 or 3 693 693 1 0 0 0 1 168 1 1 default username and password
- 1 or 2 593 593 1 0 0 0 1 or 2dvchrbu 168 1 1 default username and password
- 1 or 3 593 593 1 0 0 0 1 or 2dvchrbu 168 1 1 default username and password
- 1 or 2 910 910 1 0 0 0 1 168 1 1 default username and password
- 1 or 3 910 910 1 0 0 0 1 168 1 1 default username and password
- 192 1 or 2 33 33 1 0 0 0 1 1 1 default username and password
- 1 or 2 364 364 1 0 0 0 1 168 1 1 admin username and password