



























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
These are the Lecture Slides of Computational Methods which includes Thévenin’s Equivalent Circuit, Circuit Simplification, Analysis of Power Transfer, Voltage Division, Analytical Game Plan, Array Operation, Element Operations, Number of Allowable Values etc.Key important points are: Solutions by Matlab, Runge-Kutta Method, Moderately Stiff Problems, Numerical Damping, Initial Values of Variables, Command Window, Plotting Solution, Component of Solution, Arbitrary Lateral-Acceleration Function
Typology: Slides
1 / 35
This page cannot be seen from the preview
Don't miss anything!




























Solver Problem Type Order of Accuracy When to Use ode45 Nonstiff Medium Most of the time. This should be the first solver you try. ode23 Nonstiff Low For problems with crude error tolerances or for solving moderately stiff problems. ode113 Nonstiff Low to high For problems with stringent error tolerances orfor solving computationally intensive problems.
ode15s Stiff Low to medium If ode45 is slow because the problem is stiff.
ode23s Stiff Low If using crude error tolerances to solve stiffsystems and the mass matrix is constant.
ode23t Moderately Stiff Low For moderately stiff problems if you need asolution without numerical damping.
ode23tb Stiff Low If using crude error tolerances to solve stiff systems.
1 2 0
2 1 2 2 0 2
2
1 1 2 1 0 1
1
m m m m
m
m
m
f t y y y y t b dt
dy
f t y y y y t b dt
dy
f t y y y y t b dt
dy
m-Eqns (1st^ order ODEs) in m-Unknowns
y f y y b
( t , ), ( t 0 )
If we have written ROW vectors for the y & b quantities can Transpose to Column-Vectors
yT y 1 (^) ; y 2 ;; ym
b T b^1 (^) ; b 2 ;; bm
2
1 (^1) dt y x
dy dt
dx x
ReArranging the ODE to isolate Highest order term
x 2 (^) sin t 5 x 1 2 x 2
y sin t 5 y 2 y
Thus the 1 st^ Order Eqn System in 2 Vars
1 2
2 2
2
1 1
sin t 5 x 2 x dt
x dx
x dt
dx x
0 0 73 2
1
y x
y x
And also dx 2 /dt x 1 y x 2 y
Converted the SINGLE 2 nd^ Order ODE to a LINEAR System of TWO 1 st Order ODEs
Sub into ODE
^
2
(^2) y y x dt
d dt
dx
2
(^1) y x dt
dy dt
dx
y 2 y 5 y sin t
x x t dt
dx (^2) 2 2 5 1 sin
Example ode45 (5)
&
0
t
sin 5 2 0 2
0 73
1 2 2
2
2 1
1
t x x x t dt
dx
x x t dt
dx
The final xForm
Example ode45 (6)
sin 5 2 ^0 ^2
1 2 2
2
2 1
1
t x x x t dt
dx
x x t dt
dx
( , , ), ( ) ,
( , , ), ( ) ,
(^2212202)
(^1112101)
f t y y y t b dt
dy
f t y y y t b dt
dy
Example ode45 (8) % Bruce Mayer, PE% ENGR25 * Lec24 on MATLAB ODE solvers* 05Nov % file =% Revised Demo_ODE_Lec24.m to include a set of non-zero ICs %%This script file calls FUNCTION xdot_lec %clear % clear memory % % CASE-I => set the IC's y(0) & dy(0)/dt as COL Vector % y0=[0;% CASE-II 0]; % comment-out => set the IC's y(0) & dy(0)/dt as COL Vectorif Not Used y0=[-0.19; -0.73]; % Comment-Out if Not Used% % Defaulttmax = input('input tmax = Time Interval of 20 Time-Units; user can change this ') trng% = [0, tmax]; % %Call the [t,y]=ode45( ode45'xdot_lec24' routine (^) ,with the above data inputs trng, y0); % %Plot the first column of the solution “matrix” %giving x1 or plot(t,y, 'LineWidth y. ', 2), xlabel('t'), ylabel('ODE Solution y(t) & dy/dt'),... title('ODE Example - Lecture24'), grid, legend('y(t)','dy/dt')
0 2 4 6 8 10 12 14 16 18 20
-0.
-0.
-0.
-0.
-0.
0
Time, t
ODE Solution, y(t)
ODE Example - Lecture