SlideShare uma empresa Scribd logo
1 de 25
Differential equation &
LAPLACE TRANSFORmation
with MATLAB
RAVI JINDAL
Joint Masters, SEGE (M1) Second semester
B.K. Birla institute of Engineering & Technology, Pilani
Differential Equations with
MATLAB
 MATLAB has some powerful features for
solving differential equations of all types. We
will explore some of these features for the
Constant Coefficient Linear Ordinary
Differential Equation forms.
 The approach here will be that of the Symbolic
Math Toolbox. The result will be the form of
the function and it may be readily plotted with
MATLAB.
Symbolic Differential Equation
Terms
2
2
n
n
y
dy
dt
d y
dt
d y
dt
y
Dy
D2y
Dny
Finding Solutions to Differential
Equations
 Solving a First Order Differential Equation
 Solving a Second Order Differential
Equation
 Solving Simultaneous Differential
Equations
 Solving Nonlinear Differential Equations
 Numerical Solution of a Differential
Equation
Solving a 1st Order DE
 Consider the differential
equation:
122 =+ y
dt
dy
The general solution is given by:
The Matlab command used to solve differential
equations is dsolve .
Verify the solution using dsolve command
Solving a Differential
Equation in Matlab
C1 is a constant which is specified by way of the
initial condition
Dy means dy/dt and D2y means d2y/dt2 etc
» syms y t
» ys=dsolve('Dy+2*y=12')
ys =6+exp(-2*t)*C1
Verify Results
 Verify results given y(0) = 9
» ys=dsolve('Dy+2*y=12','y(0)=9')
ys =
6+3*exp(-2*t)
39)0( 1 =→= Cy
Solving a 2nd Order DE
8
 Find the general solution of:
02
2
2
=+ yc
dt
yd
)cos()sin()( 21 ctCctCty +=
» syms c y
» ys=dsolve('D2y = - c^2*y')
ys = C1*sin(c*t)+C2*cos (c*t)
9
 Solve the following set of differential equations:
Solving Simultaneous
Differential Equations Example
yx
dt
dx
43 += yx
dt
dy
34 +−=
Syntax for solving simultaneous differential equations is:
dsolve('equ1', 'equ2',…)
 The general solution is given by:
General Solution
)4sin()4cos()( 3
2
3
1 tectectx tt
+=
)4cos()4sin()( 3
2
3
1 tectecty tt
+−=
yx
dt
dx
43 += yx
dt
dy
34 +−=
Given the equations:
Matlab Verification
» syms x y t
» [x,y]=dsolve('Dx=3*x+4*y','Dy=-4*x+3*y')
x = exp(3*t)*(cos(4*t)*C1+sin(4*t)*C2)
y = -exp(3*t)*(sin(4*t)*C1-cos(4*t)*C2)
yx
dt
dx
43 += yx
dt
dy
34 +−=
Given the
equations:
 General
solution is:
)4sin()4cos()( 3
2
3
1 tectectx tt
+=
)4cos()4sin()( 3
2
3
1 tectecty tt
+−=
 Solve the previous system with the initial conditions:
Initial Conditions
0)0( =x 1)0( =y
» [x,y]=dsolve('Dx=3*x+4*y','Dy=-4*x+3*y',
'y(0)=1','x(0)=0')
x = exp(3*t)*sin(4*t)
y = exp(3*t)*cos(4*t) )4cos(
)4sin(
3
3
tey
tex
t
t
=
=
Non-Linear Differential Equation Example
 Solve the differential equation: 2
4 y
dt
dy
−=
Subject to initial condition:
1)0( =y
» syms y t
» y=dsolve('Dy=4-y^2','y(0)=1')
» y=simplify(y)
y =
2*(3*exp(4*t)-1)/(1+3*exp(4*t))
( )
t
t
e
e
ty 4
4
31
132
)(
+
−
=
 If another independent variable, other than t, is used, it must
be introduced in the dsolve command
Specifying the Independent Parameter of a
Differential Equation
122 =+ y
dx
dy
» y=dsolve('Dy+2*y=12','x')
y = 6+exp(-2*x)*C1
Solve the differential equation:
x
eCxy 2
16)( −
+=
Numerical Solution Example
 Not all non-linear differential equations have a closed
form solution, but a numerical solution can be found
Solve the differential equation:
Subject to initial conditions:
0)sin(92
2
=+ y
dt
yd
1)0( =y
0)0( =
•
y
16
Rewrite Differential Equation
yx =1
••
== 12 xyx
)sin(9
)sin(9
12
2
xx
yyx
−=
−==
•
•••
0)sin(92
2
=+ y
dt
yd
1)0()0(1 == yx
0)0()0(2 ==
•
yx
Rewrite in the
following form
)sin(92
2
yy
dt
yd
−==
••
17
Solve DE with MATLAB.
>> y = dsolve ('D2y + 3*Dy + 2*y = 24',
'y(0)=10', 'Dy(0)=0')
y = 12+2*exp(-2*t)-4*exp(-t)
>> ezplot(y, [0 6])
2
2
3 2 24
d y dy
y
dt dt
+ + =
(0) 10y = '(0) 0y =
Definition of Laplace
Transformation:
Let f(t) be a given function defined for all t ≥ 0 ,
then the Laplace Transformation of f(t)
is defined as
Here,
L = Laplace Transform Operator.
f(t) =determining function, depends on t .
F(s)= Generating function, depends on s .
Differential
equations
Input
excitation e(t)
Output
response r(t)
Time Domain Frequency Domain
Algebraic
equations
Input
excitation E(s)
Output
response R(s)
Laplace Transform
Inverse Laplace Transform
The Laplace Transformation
Laplace Transforms with MATLAB
Calculating the Laplace F(s) transform of a function f(t) is
quite simple in Matlab . First you need to specify that the
variable t and s are symbolic ones. This is done with the
command
>> syms t s
The actual command to calculate the transform is
>> F = Laplace (f , t , s)
example for the function f(t)
>> syms t s
>> f=-1.25+3.5*t*exp(-2*t)+1.25*exp(-2*t);
>> F = laplace ( f , t , s)
F = -5/4/s+7/2/(s+2)^2+5/4/(s+2)
>> simplify(F)
ans = (s-5)/s/(s+2)^2
>> pretty (ans)
Inverse Laplace Transform
The command one uses now is ilaplace .
>> syms t s
>> F=(s-5)/(s*(s+2)^2);
>> ilaplace(F)
ans = -5/4+(7/2*t+5/4)*exp(-2*t)
>> simplify(ans)
ans = -5/4+7/2*t*exp(-2*t)+5/4*exp(-2*t)
>> pretty(ans)
- 5/4 + 7/2 t exp(-2 t) + 5/4 exp(-2 t)
Reference
 http://www.mathworks.in/help/symbolic/simpli
 https://www.google.co.in/#q=laplace+transform+
Thank You 

Mais conteúdo relacionado

Mais procurados

Meeting w4 chapter 2 part 2
Meeting w4   chapter 2 part 2Meeting w4   chapter 2 part 2
Meeting w4 chapter 2 part 2
mkazree
 
Eigen values and eigenvectors
Eigen values and eigenvectorsEigen values and eigenvectors
Eigen values and eigenvectors
Amit Singh
 
First order linear differential equation
First order linear differential equationFirst order linear differential equation
First order linear differential equation
Nofal Umair
 
Second order homogeneous linear differential equations
Second order homogeneous linear differential equations Second order homogeneous linear differential equations
Second order homogeneous linear differential equations
Viraj Patel
 
Differential equations
Differential equationsDifferential equations
Differential equations
Charan Kumar
 

Mais procurados (20)

Fourier transform
Fourier transformFourier transform
Fourier transform
 
Ordinary differential equation
Ordinary differential equationOrdinary differential equation
Ordinary differential equation
 
DIFFERENTIAL EQUATIONS
DIFFERENTIAL EQUATIONSDIFFERENTIAL EQUATIONS
DIFFERENTIAL EQUATIONS
 
Meeting w4 chapter 2 part 2
Meeting w4   chapter 2 part 2Meeting w4   chapter 2 part 2
Meeting w4 chapter 2 part 2
 
Eigen values and eigenvectors
Eigen values and eigenvectorsEigen values and eigenvectors
Eigen values and eigenvectors
 
Higher Order Differential Equation
Higher Order Differential EquationHigher Order Differential Equation
Higher Order Differential Equation
 
Sliding Mode Controller
Sliding Mode Controller Sliding Mode Controller
Sliding Mode Controller
 
Laplace Transforms
Laplace TransformsLaplace Transforms
Laplace Transforms
 
Laplace transforms
Laplace transformsLaplace transforms
Laplace transforms
 
First order linear differential equation
First order linear differential equationFirst order linear differential equation
First order linear differential equation
 
1st order differential equations
1st order differential equations1st order differential equations
1st order differential equations
 
Differential equations of first order
Differential equations of first orderDifferential equations of first order
Differential equations of first order
 
Taylor’s series
Taylor’s   seriesTaylor’s   series
Taylor’s series
 
Laplace Transform And Its Applications
Laplace Transform And Its ApplicationsLaplace Transform And Its Applications
Laplace Transform And Its Applications
 
Green Theorem
Green TheoremGreen Theorem
Green Theorem
 
Laplace transforms
Laplace transformsLaplace transforms
Laplace transforms
 
Eigen value and vectors
Eigen value and vectorsEigen value and vectors
Eigen value and vectors
 
Second order homogeneous linear differential equations
Second order homogeneous linear differential equations Second order homogeneous linear differential equations
Second order homogeneous linear differential equations
 
Differential equations
Differential equationsDifferential equations
Differential equations
 
Laplace transform
Laplace transformLaplace transform
Laplace transform
 

Destaque

Using Laplace Transforms to Solve Differential Equations
Using Laplace Transforms to Solve Differential EquationsUsing Laplace Transforms to Solve Differential Equations
Using Laplace Transforms to Solve Differential Equations
George Stevens
 
Wave behaviour
Wave behaviourWave behaviour
Wave behaviour
reastment
 
Delay-Differential Equations. Tools for Epidemics Modelling
Delay-Differential Equations. Tools for Epidemics ModellingDelay-Differential Equations. Tools for Epidemics Modelling
Delay-Differential Equations. Tools for Epidemics Modelling
Ignasi Gros
 
Linear differential equation
Linear differential equationLinear differential equation
Linear differential equation
Pratik Sudra
 
Giai phuong trinh vi phan bang bien doi laplace
Giai phuong trinh vi phan bang bien doi laplaceGiai phuong trinh vi phan bang bien doi laplace
Giai phuong trinh vi phan bang bien doi laplace
Kiếm Hùng
 

Destaque (20)

Using Laplace Transforms to Solve Differential Equations
Using Laplace Transforms to Solve Differential EquationsUsing Laplace Transforms to Solve Differential Equations
Using Laplace Transforms to Solve Differential Equations
 
APPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJ
APPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJAPPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJ
APPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJ
 
FDM Numerical solution of Laplace Equation using MATLAB
FDM Numerical solution of Laplace Equation using MATLABFDM Numerical solution of Laplace Equation using MATLAB
FDM Numerical solution of Laplace Equation using MATLAB
 
Differential equations
Differential equationsDifferential equations
Differential equations
 
Admission in India 2014
Admission in India 2014Admission in India 2014
Admission in India 2014
 
Laplace
LaplaceLaplace
Laplace
 
Wave behaviour
Wave behaviourWave behaviour
Wave behaviour
 
Ch01 1
Ch01 1Ch01 1
Ch01 1
 
Ordinary Differential Equation
Ordinary Differential EquationOrdinary Differential Equation
Ordinary Differential Equation
 
Wave pitch feedback
Wave pitch feedbackWave pitch feedback
Wave pitch feedback
 
How Waves Behave
How Waves BehaveHow Waves Behave
How Waves Behave
 
Delay-Differential Equations. Tools for Epidemics Modelling
Delay-Differential Equations. Tools for Epidemics ModellingDelay-Differential Equations. Tools for Epidemics Modelling
Delay-Differential Equations. Tools for Epidemics Modelling
 
Linear differential equation
Linear differential equationLinear differential equation
Linear differential equation
 
Conditional Control in MATLAB Scripts
Conditional Control in MATLAB ScriptsConditional Control in MATLAB Scripts
Conditional Control in MATLAB Scripts
 
Applications of differential equations(by Anil.S.Nayak)
Applications of differential equations(by Anil.S.Nayak)Applications of differential equations(by Anil.S.Nayak)
Applications of differential equations(by Anil.S.Nayak)
 
Indeterminate Forms and L' Hospital Rule
Indeterminate Forms and L' Hospital RuleIndeterminate Forms and L' Hospital Rule
Indeterminate Forms and L' Hospital Rule
 
DIFFRENTIAL EQUATIONS
DIFFRENTIAL EQUATIONSDIFFRENTIAL EQUATIONS
DIFFRENTIAL EQUATIONS
 
Orthogonal trajectories
Orthogonal trajectoriesOrthogonal trajectories
Orthogonal trajectories
 
Matlab
MatlabMatlab
Matlab
 
Giai phuong trinh vi phan bang bien doi laplace
Giai phuong trinh vi phan bang bien doi laplaceGiai phuong trinh vi phan bang bien doi laplace
Giai phuong trinh vi phan bang bien doi laplace
 

Semelhante a Differential equation & laplace transformation with matlab

Den5200 ps1
Den5200 ps1Den5200 ps1
Den5200 ps1
jogerpow
 
Week 8 [compatibility mode]
Week 8 [compatibility mode]Week 8 [compatibility mode]
Week 8 [compatibility mode]
Hazrul156
 

Semelhante a Differential equation & laplace transformation with matlab (20)

Differential calculus
Differential calculusDifferential calculus
Differential calculus
 
21 3 ztransform
21 3 ztransform21 3 ztransform
21 3 ztransform
 
19 4
19 419 4
19 4
 
phuong trinh vi phan d geometry part 2
phuong trinh vi phan d geometry part 2phuong trinh vi phan d geometry part 2
phuong trinh vi phan d geometry part 2
 
Top ranking colleges in india
Top ranking colleges in indiaTop ranking colleges in india
Top ranking colleges in india
 
Den5200 ps1
Den5200 ps1Den5200 ps1
Den5200 ps1
 
Assignment6
Assignment6Assignment6
Assignment6
 
Week 8 [compatibility mode]
Week 8 [compatibility mode]Week 8 [compatibility mode]
Week 8 [compatibility mode]
 
On Laplace Transform.ppt
On Laplace Transform.pptOn Laplace Transform.ppt
On Laplace Transform.ppt
 
Chapter 9(laplace transform)
Chapter 9(laplace transform)Chapter 9(laplace transform)
Chapter 9(laplace transform)
 
digital control Chapter 2 slide
digital control Chapter 2 slidedigital control Chapter 2 slide
digital control Chapter 2 slide
 
free Video lecture
free Video lecture free Video lecture
free Video lecture
 
21 1 ztransform
21 1 ztransform21 1 ztransform
21 1 ztransform
 
differentiol equation.pptx
differentiol equation.pptxdifferentiol equation.pptx
differentiol equation.pptx
 
Laplace transforms
Laplace transformsLaplace transforms
Laplace transforms
 
Laplace
LaplaceLaplace
Laplace
 
Laplace problems
Laplace problemsLaplace problems
Laplace problems
 
Advanced Engineering Mathematics Solutions Manual.pdf
Advanced Engineering Mathematics Solutions Manual.pdfAdvanced Engineering Mathematics Solutions Manual.pdf
Advanced Engineering Mathematics Solutions Manual.pdf
 
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
 
Moment Closure Based Parameter Inference of Stochastic Kinetic Models
Moment Closure Based Parameter Inference of Stochastic Kinetic ModelsMoment Closure Based Parameter Inference of Stochastic Kinetic Models
Moment Closure Based Parameter Inference of Stochastic Kinetic Models
 

Último

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 

Último (20)

Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 

Differential equation & laplace transformation with matlab

  • 1. Differential equation & LAPLACE TRANSFORmation with MATLAB RAVI JINDAL Joint Masters, SEGE (M1) Second semester B.K. Birla institute of Engineering & Technology, Pilani
  • 2. Differential Equations with MATLAB  MATLAB has some powerful features for solving differential equations of all types. We will explore some of these features for the Constant Coefficient Linear Ordinary Differential Equation forms.  The approach here will be that of the Symbolic Math Toolbox. The result will be the form of the function and it may be readily plotted with MATLAB.
  • 4. Finding Solutions to Differential Equations  Solving a First Order Differential Equation  Solving a Second Order Differential Equation  Solving Simultaneous Differential Equations  Solving Nonlinear Differential Equations  Numerical Solution of a Differential Equation
  • 5. Solving a 1st Order DE  Consider the differential equation: 122 =+ y dt dy The general solution is given by: The Matlab command used to solve differential equations is dsolve . Verify the solution using dsolve command
  • 6. Solving a Differential Equation in Matlab C1 is a constant which is specified by way of the initial condition Dy means dy/dt and D2y means d2y/dt2 etc » syms y t » ys=dsolve('Dy+2*y=12') ys =6+exp(-2*t)*C1
  • 7. Verify Results  Verify results given y(0) = 9 » ys=dsolve('Dy+2*y=12','y(0)=9') ys = 6+3*exp(-2*t) 39)0( 1 =→= Cy
  • 8. Solving a 2nd Order DE 8  Find the general solution of: 02 2 2 =+ yc dt yd )cos()sin()( 21 ctCctCty += » syms c y » ys=dsolve('D2y = - c^2*y') ys = C1*sin(c*t)+C2*cos (c*t)
  • 9. 9  Solve the following set of differential equations: Solving Simultaneous Differential Equations Example yx dt dx 43 += yx dt dy 34 +−= Syntax for solving simultaneous differential equations is: dsolve('equ1', 'equ2',…)
  • 10.  The general solution is given by: General Solution )4sin()4cos()( 3 2 3 1 tectectx tt += )4cos()4sin()( 3 2 3 1 tectecty tt +−= yx dt dx 43 += yx dt dy 34 +−= Given the equations:
  • 11. Matlab Verification » syms x y t » [x,y]=dsolve('Dx=3*x+4*y','Dy=-4*x+3*y') x = exp(3*t)*(cos(4*t)*C1+sin(4*t)*C2) y = -exp(3*t)*(sin(4*t)*C1-cos(4*t)*C2) yx dt dx 43 += yx dt dy 34 +−= Given the equations:  General solution is: )4sin()4cos()( 3 2 3 1 tectectx tt += )4cos()4sin()( 3 2 3 1 tectecty tt +−=
  • 12.  Solve the previous system with the initial conditions: Initial Conditions 0)0( =x 1)0( =y » [x,y]=dsolve('Dx=3*x+4*y','Dy=-4*x+3*y', 'y(0)=1','x(0)=0') x = exp(3*t)*sin(4*t) y = exp(3*t)*cos(4*t) )4cos( )4sin( 3 3 tey tex t t = =
  • 13. Non-Linear Differential Equation Example  Solve the differential equation: 2 4 y dt dy −= Subject to initial condition: 1)0( =y » syms y t » y=dsolve('Dy=4-y^2','y(0)=1') » y=simplify(y) y = 2*(3*exp(4*t)-1)/(1+3*exp(4*t)) ( ) t t e e ty 4 4 31 132 )( + − =
  • 14.  If another independent variable, other than t, is used, it must be introduced in the dsolve command Specifying the Independent Parameter of a Differential Equation 122 =+ y dx dy » y=dsolve('Dy+2*y=12','x') y = 6+exp(-2*x)*C1 Solve the differential equation: x eCxy 2 16)( − +=
  • 15. Numerical Solution Example  Not all non-linear differential equations have a closed form solution, but a numerical solution can be found Solve the differential equation: Subject to initial conditions: 0)sin(92 2 =+ y dt yd 1)0( =y 0)0( = • y
  • 16. 16 Rewrite Differential Equation yx =1 •• == 12 xyx )sin(9 )sin(9 12 2 xx yyx −= −== • ••• 0)sin(92 2 =+ y dt yd 1)0()0(1 == yx 0)0()0(2 == • yx Rewrite in the following form )sin(92 2 yy dt yd −== ••
  • 17. 17 Solve DE with MATLAB. >> y = dsolve ('D2y + 3*Dy + 2*y = 24', 'y(0)=10', 'Dy(0)=0') y = 12+2*exp(-2*t)-4*exp(-t) >> ezplot(y, [0 6]) 2 2 3 2 24 d y dy y dt dt + + = (0) 10y = '(0) 0y =
  • 18.
  • 19. Definition of Laplace Transformation: Let f(t) be a given function defined for all t ≥ 0 , then the Laplace Transformation of f(t) is defined as Here, L = Laplace Transform Operator. f(t) =determining function, depends on t . F(s)= Generating function, depends on s .
  • 20. Differential equations Input excitation e(t) Output response r(t) Time Domain Frequency Domain Algebraic equations Input excitation E(s) Output response R(s) Laplace Transform Inverse Laplace Transform The Laplace Transformation
  • 21. Laplace Transforms with MATLAB Calculating the Laplace F(s) transform of a function f(t) is quite simple in Matlab . First you need to specify that the variable t and s are symbolic ones. This is done with the command >> syms t s The actual command to calculate the transform is >> F = Laplace (f , t , s)
  • 22. example for the function f(t) >> syms t s >> f=-1.25+3.5*t*exp(-2*t)+1.25*exp(-2*t); >> F = laplace ( f , t , s) F = -5/4/s+7/2/(s+2)^2+5/4/(s+2) >> simplify(F) ans = (s-5)/s/(s+2)^2 >> pretty (ans)
  • 23. Inverse Laplace Transform The command one uses now is ilaplace . >> syms t s >> F=(s-5)/(s*(s+2)^2); >> ilaplace(F) ans = -5/4+(7/2*t+5/4)*exp(-2*t) >> simplify(ans) ans = -5/4+7/2*t*exp(-2*t)+5/4*exp(-2*t) >> pretty(ans) - 5/4 + 7/2 t exp(-2 t) + 5/4 exp(-2 t)

Notas do Editor

  1. <number>