SlideShare uma empresa Scribd logo
1 de 40
MATLAB Tutorials




                                            Session V
             Mathematical Applications using MATLAB
                            (Cont….)

                                 Rajeev Madazhy
                              Email: rmadaz1@lsu.edu

                          Dept of Mechanical Engineering
                                      LSU

Department of Mechanical Engineering, LSU               Session V
Last Session….


  Using fplot function
  Minimization
  Zero finding
  Curve fitting
  Interpolation
  Integration




Department of Mechanical Engineering, LSU   Session V
Session V Outline….




    Solving Double Integrals
    Ordinary Differential Equations
    Examples of ODE using MATLAB….
    Mention of DDE’s




Department of Mechanical Engineering, LSU   Session V
Solving Double Integrals….


 Consider the numerical solution of
                   y max xmax

                     ∫ ∫ f ( x, y )dxdy
                    y min x min




 Let             f ( x, y ) = y sin( x ) + x cos( y )

 We write a function to calculate the double integral using the MATLAB
 Inline function dblquad.




Department of Mechanical Engineering, LSU          Session V
MATLAB M-File….

 Function out=integrnd(x,y)
 out= y*sin(x) + x*cos(y);


 To evaluate the double integral, use


 result = dblquad(‘integrnd’,xmin,xmax,ymin,ymax);
 at the command prompt.




Department of Mechanical Engineering, LSU   Session V
In MATLAB….




Department of Mechanical Engineering, LSU   Session V
Books on solving ODE’s using
        MATLAB..

                  Linear Algebra and Differential Equations Using
                  MATLAB
                  Martin Golubitsky, Michael Dellnitz



                  Ordinary Differential Equations Using MATLAB
                  John C. Polking & David Arnold




Department of Mechanical Engineering, LSU   Session V
Solving ODE’s….

  MATLAB has the capability to solve the first order differential
      equations using numerical methods.
  The functions used are ode23 and ode25
  Both ode23 and ode25 work the same way except for the internal
      algorithm that is being used.
  Let us use ode45 in solving the Differential equations.




Department of Mechanical Engineering, LSU   Session V
Format….

 The format is as follows:
  [t,y] = ode45(‘function_name’,tspan,y0)
  function_name is the name of a function type file where the
     differential equation is stored.


  tspan is a vector specifying the initial and final values of
      independent variable
  y0 is a column vector containing the initial conditions
  Results for the command are stored in vector y.
  t is the vector of independent variable
Department of Mechanical Engineering, LSU   Session V
Example….


 Solve a first order homogeneous differential equation with initial
 condition:
                    .
                    y+ = y   0
                    y (t = ) =
                           0   1

 We rewrite it as :


                      .
                      y = y
                          −
                      y (0) =1

Department of Mechanical Engineering, LSU   Session V
Function in MATLAB…
 Write the function in MATLAB and save it as ode1.m




Department of Mechanical Engineering, LSU   Session V
Cont….


 Write the following in another m-file:




Department of Mechanical Engineering, LSU   Session V
Result….




Department of Mechanical Engineering, LSU   Session V
Non-homogenous ODE’s….


 If the differential equation is not homogenous then we do the following:
                    .
                    y + = −t
                         y   e 2
                    y (t = ) =
                           0     1
 It is rewritten again as follows:



                    .
                    y = y + −t
                        −    e 2
                    y (0) =1


Department of Mechanical Engineering, LSU   Session V
Solution….

 All we need to do is change the function in the m-file ode1.m
 Rest remains the same as coded earlier.




Department of Mechanical Engineering, LSU   Session V
Higher order differential Equations….

  The higher order differential equations can be converted to a
      system of first order differential equations.


  Next example shows how to solve second order differential
      equation using ode45 in Matlab




Department of Mechanical Engineering, LSU   Session V
Problem….

The following figure shows a spring-mass-damper system. Plot the response of
the system when the initial displacement of mass m is 0.1 meters.




                                                                c = 1 kg/s
                                       k = 100N/m




                                                    m = 5 kg




   Department of Mechanical Engineering, LSU        Session V
Equation of motion….


 The equation of motion is as follows:
               ..  .
            m x +c x +kx =0
            x (t =0) =0.1

 Now we need to change it to first order equation to solve it.
 Rewriting the equation we get,

                   c      k
              = − x − x
             x        
                   m      m
             x(t = 0) = 0.1
Department of Mechanical Engineering, LSU   Session V
Cont….
                        .
 Consider the fact that x =vis just velocity. So we can rewrite the
 equation as two first order differential equations

                    c      k
              v =− v− x
              
                    m      m
              x=v
              
              v(t = 0) = 0
              x(t = 0) = 0.1




Department of Mechanical Engineering, LSU   Session V
Cont….


 Or in general form we get:

             c  k
     x1 = − x1 − x2
     
            m   m
     x2 = x1
     
     x1 (t = 0) = 0
     x2 (t = 0) = 0.1


Department of Mechanical Engineering, LSU   Session V
Cont….


 Write the function as follows in Matlab editor and save it as ode2.m




Department of Mechanical Engineering, LSU   Session V
Cont….

 Write the main program naming it as sorDiff.m
 Note that we have two initial conditions here.




Department of Mechanical Engineering, LSU   Session V
Velocity Response….




Department of Mechanical Engineering, LSU   Session V
Displacement
            Response….




Department of Mechanical Engineering, LSU   Session V
Exercise….




 Write a Matlab program to determine the time-temperature history of a
 sphere of radius r=5mm, initially at a uniform temperature of 400 0C.
 The sphere is exposed to 2000C air with a convection coefficient of
 h=10 W/m^2-K. The thermophysical properties of the sphere material
 are:
 ρ=Density=3000kg/m^3
 k=Thermal conductivity=20 W/m-K
 c=specific heat=1000J/kg-K




Department of Mechanical Engineering, LSU   Session V
Exercise cont….


 The relation between the sphere temperature and time is given by an
 energy balance on the sphere, which results in the following
 differential equation

                                            dT
              − hA(T − T∞ ) = ρcV
                                            dt
 where
 H = convective heat transfer coefficient
 T = temperature of the sphere at any time
 A = surface area of the sphere = 4r2
 V = volume of the sphere = 4/3 r3
 T = time
Department of Mechanical Engineering, LSU        Session V
Exercise cont….



 This differential equation has the following exact solution which can be
 used to check the accuracy of the numerical solution provided by
 Matlab


                T − T∞         − hA
                        = exp(      t)
                Ti − T∞        ρcV




Department of Mechanical Engineering, LSU   Session V
Exact Temperature code….




Department of Mechanical Engineering, LSU   Session V
Using as function….




Department of Mechanical Engineering, LSU   Session V
MATLAB main code….




Department of Mechanical Engineering, LSU   Session V
Result and plot….




Department of Mechanical Engineering, LSU   Session V
Delay Differential Equations…


 Ordinary differential equations (ODEs) and delay differential equations
 (DDEs) are used to describe many phenomena of physical interest.
 While ODEs contain derivatives which depend on the solution at the
 present value of the independent variable (“time”), DDEs contain in
 addition, derivatives which depend on the solution at previous times.


 DDEs are a better approximation than ODEs to many physical systems.




Department of Mechanical Engineering, LSU   Session V
Cont….

 Consider a system of delay differential equations of the form:
     y(t) = f(t, y(t), y(t - τ1), y(t - τ2), . . . , y(t - τk))
 that are solved on a ≤ t ≤ b with given history y(t) = S(t) for t ≤ a.




Department of Mechanical Engineering, LSU            Session V
Function code….




Department of Mechanical Engineering, LSU   Session V
Main
                      program….




Department of Mechanical Engineering, LSU   Session V
Output….




Department of Mechanical Engineering, LSU   Session V
Website where you could obtain
            The dde23.m file…..




   http://www.radford.edu/~thompson/webddes/




Department of Mechanical Engineering, LSU   Session V
Recap….


    Solving Double Integrals
    Ordinary Differential Equations
    Examples of ODE using MATLAB….
    Mention of DDE’s




Department of Mechanical Engineering, LSU   Session V
Next Session….


 Engineering Applications using MATLAB….
  Solving non linear differential equations
  Algorithm analysis
  Common mechanical problems
            a) four bar linkage
            b) vibrations
            c) thermal and fluids




Department of Mechanical Engineering, LSU   Session V
Thank You



Department of Mechanical Engineering, LSU   Session V

Mais conteúdo relacionado

Mais procurados

Newton Raphson method for load flow analysis
Newton Raphson method for load flow analysisNewton Raphson method for load flow analysis
Newton Raphson method for load flow analysis
divyanshuprakashrock
 
8178001772 control
8178001772 control8178001772 control
8178001772 control
MaRwa Hamed
 
linear algebra in control systems
linear algebra in control systemslinear algebra in control systems
linear algebra in control systems
Ganesh Bhat
 

Mais procurados (20)

Pid controller
Pid controllerPid controller
Pid controller
 
Control system mathematical modelling of a system
Control system mathematical modelling of a systemControl system mathematical modelling of a system
Control system mathematical modelling of a system
 
Inverse laplace transforms
Inverse laplace transformsInverse laplace transforms
Inverse laplace transforms
 
Modeling and simulation of pmsm
Modeling and simulation of pmsmModeling and simulation of pmsm
Modeling and simulation of pmsm
 
ME451_L17_Root locus - examples.pdf
ME451_L17_Root locus - examples.pdfME451_L17_Root locus - examples.pdf
ME451_L17_Root locus - examples.pdf
 
SOLID STATE TRANSFORMER - USING FLYBACK CONVERTER
SOLID STATE TRANSFORMER - USING FLYBACK CONVERTERSOLID STATE TRANSFORMER - USING FLYBACK CONVERTER
SOLID STATE TRANSFORMER - USING FLYBACK CONVERTER
 
2.time domain analysis of lti systems
2.time domain analysis of lti systems2.time domain analysis of lti systems
2.time domain analysis of lti systems
 
Stability Analysis of Discrete System
Stability Analysis of Discrete SystemStability Analysis of Discrete System
Stability Analysis of Discrete System
 
Fourier series and transforms
Fourier series and transformsFourier series and transforms
Fourier series and transforms
 
Basics of Digital Filters
Basics of Digital FiltersBasics of Digital Filters
Basics of Digital Filters
 
Transfer function and mathematical modeling
Transfer  function  and  mathematical  modelingTransfer  function  and  mathematical  modeling
Transfer function and mathematical modeling
 
system properties
system propertiessystem properties
system properties
 
Newton Raphson method for load flow analysis
Newton Raphson method for load flow analysisNewton Raphson method for load flow analysis
Newton Raphson method for load flow analysis
 
Application of Fourier Transformation
Application of Fourier TransformationApplication of Fourier Transformation
Application of Fourier Transformation
 
State space models
State space modelsState space models
State space models
 
Lecture 5: The Convolution Sum
Lecture 5: The Convolution SumLecture 5: The Convolution Sum
Lecture 5: The Convolution Sum
 
Reference for z and inverse z transform
Reference for z and inverse z transformReference for z and inverse z transform
Reference for z and inverse z transform
 
8178001772 control
8178001772 control8178001772 control
8178001772 control
 
ME-314- Control Engineering - Week 03-04
ME-314- Control Engineering - Week 03-04ME-314- Control Engineering - Week 03-04
ME-314- Control Engineering - Week 03-04
 
linear algebra in control systems
linear algebra in control systemslinear algebra in control systems
linear algebra in control systems
 

Destaque

Matlab programming project
Matlab programming projectMatlab programming project
Matlab programming project
Assignmentpedia
 
A chemical engineering timeline
A chemical engineering timelineA chemical engineering timeline
A chemical engineering timeline
mils-water
 
Civil engineering timeline
Civil engineering timelineCivil engineering timeline
Civil engineering timeline
bptruett
 
poster(Hydrogen Fuel)
poster(Hydrogen Fuel)poster(Hydrogen Fuel)
poster(Hydrogen Fuel)
student
 
1st and 2nd order systems in s domain
1st and 2nd order systems in s domain1st and 2nd order systems in s domain
1st and 2nd order systems in s domain
Waqar Memon
 
Mechanical Engineering Poster presentation - Copy
Mechanical Engineering Poster presentation - CopyMechanical Engineering Poster presentation - Copy
Mechanical Engineering Poster presentation - Copy
Mallikarjuna H T
 

Destaque (20)

Final
FinalFinal
Final
 
Matlab programming project
Matlab programming projectMatlab programming project
Matlab programming project
 
A chemical engineering timeline
A chemical engineering timelineA chemical engineering timeline
A chemical engineering timeline
 
Mechanical engineer
Mechanical engineerMechanical engineer
Mechanical engineer
 
Double integration final
Double integration finalDouble integration final
Double integration final
 
multiple intrigral lit
multiple intrigral litmultiple intrigral lit
multiple intrigral lit
 
Civil engineering timeline
Civil engineering timelineCivil engineering timeline
Civil engineering timeline
 
Double integration
Double integrationDouble integration
Double integration
 
poster(Hydrogen Fuel)
poster(Hydrogen Fuel)poster(Hydrogen Fuel)
poster(Hydrogen Fuel)
 
1st and 2nd order systems in s domain
1st and 2nd order systems in s domain1st and 2nd order systems in s domain
1st and 2nd order systems in s domain
 
Mechanical Engineering Poster presentation - Copy
Mechanical Engineering Poster presentation - CopyMechanical Engineering Poster presentation - Copy
Mechanical Engineering Poster presentation - Copy
 
01 SDOF - SPC408 - Fall2016
01 SDOF - SPC408 - Fall201601 SDOF - SPC408 - Fall2016
01 SDOF - SPC408 - Fall2016
 
Series solution to ordinary differential equations
Series solution to ordinary differential equations Series solution to ordinary differential equations
Series solution to ordinary differential equations
 
The History of The Steam Engine
The History of The Steam EngineThe History of The Steam Engine
The History of The Steam Engine
 
Brief history of Aerospace Engineering
Brief history of Aerospace EngineeringBrief history of Aerospace Engineering
Brief history of Aerospace Engineering
 
Sdof
SdofSdof
Sdof
 
Ch 02 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
Ch 02 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片Ch 02 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
Ch 02 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
 
Ch 01 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
Ch 01 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片Ch 01 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
Ch 01 MATLAB Applications in Chemical Engineering_陳奇中教授教學投影片
 
Writing Fast MATLAB Code
Writing Fast MATLAB CodeWriting Fast MATLAB Code
Writing Fast MATLAB Code
 
Solar still project report
Solar still project reportSolar still project report
Solar still project report
 

Semelhante a first order system

SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
anhlodge
 
From the Front LinesOur robotic equipment and its maintenanc.docx
From the Front LinesOur robotic equipment and its maintenanc.docxFrom the Front LinesOur robotic equipment and its maintenanc.docx
From the Front LinesOur robotic equipment and its maintenanc.docx
hanneloremccaffery
 
20070823
2007082320070823
20070823
neostar
 

Semelhante a first order system (20)

A MATLAB project on LCR circuits
A MATLAB project on LCR circuitsA MATLAB project on LCR circuits
A MATLAB project on LCR circuits
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
 
Differential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlabDifferential equation & laplace transformation with matlab
Differential equation & laplace transformation with matlab
 
From the Front LinesOur robotic equipment and its maintenanc.docx
From the Front LinesOur robotic equipment and its maintenanc.docxFrom the Front LinesOur robotic equipment and its maintenanc.docx
From the Front LinesOur robotic equipment and its maintenanc.docx
 
20070823
2007082320070823
20070823
 
Digital Signal Processing[ECEG-3171]-Ch1_L03
Digital Signal Processing[ECEG-3171]-Ch1_L03Digital Signal Processing[ECEG-3171]-Ch1_L03
Digital Signal Processing[ECEG-3171]-Ch1_L03
 
ENGINEERING SYSTEM DYNAMICS-TAKE HOME ASSIGNMENT 2018
ENGINEERING SYSTEM DYNAMICS-TAKE HOME ASSIGNMENT 2018ENGINEERING SYSTEM DYNAMICS-TAKE HOME ASSIGNMENT 2018
ENGINEERING SYSTEM DYNAMICS-TAKE HOME ASSIGNMENT 2018
 
UNIT-III FMM
UNIT-III FMMUNIT-III FMM
UNIT-III FMM
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulinkMATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
MATLAB/SIMULINK for Engineering Applications day 2:Introduction to simulink
 
Es272 ch1
Es272 ch1Es272 ch1
Es272 ch1
 
Signals And Systems Lab Manual, R18 Batch
Signals And Systems Lab Manual, R18 BatchSignals And Systems Lab Manual, R18 Batch
Signals And Systems Lab Manual, R18 Batch
 
Mathematical models for a chemical reactor
Mathematical models for a chemical reactorMathematical models for a chemical reactor
Mathematical models for a chemical reactor
 
MATLAB-Introd.ppt
MATLAB-Introd.pptMATLAB-Introd.ppt
MATLAB-Introd.ppt
 
MATLAB ODE
MATLAB ODEMATLAB ODE
MATLAB ODE
 
19 4
19 419 4
19 4
 
36336583 control-systems-lecture-notes
36336583 control-systems-lecture-notes36336583 control-systems-lecture-notes
36336583 control-systems-lecture-notes
 
Online Maths Assignment Help
Online Maths Assignment HelpOnline Maths Assignment Help
Online Maths Assignment Help
 

first order system

  • 1. MATLAB Tutorials Session V Mathematical Applications using MATLAB (Cont….) Rajeev Madazhy Email: rmadaz1@lsu.edu Dept of Mechanical Engineering LSU Department of Mechanical Engineering, LSU Session V
  • 2. Last Session….  Using fplot function  Minimization  Zero finding  Curve fitting  Interpolation  Integration Department of Mechanical Engineering, LSU Session V
  • 3. Session V Outline….  Solving Double Integrals  Ordinary Differential Equations  Examples of ODE using MATLAB….  Mention of DDE’s Department of Mechanical Engineering, LSU Session V
  • 4. Solving Double Integrals…. Consider the numerical solution of y max xmax ∫ ∫ f ( x, y )dxdy y min x min Let f ( x, y ) = y sin( x ) + x cos( y ) We write a function to calculate the double integral using the MATLAB Inline function dblquad. Department of Mechanical Engineering, LSU Session V
  • 5. MATLAB M-File…. Function out=integrnd(x,y) out= y*sin(x) + x*cos(y); To evaluate the double integral, use result = dblquad(‘integrnd’,xmin,xmax,ymin,ymax); at the command prompt. Department of Mechanical Engineering, LSU Session V
  • 6. In MATLAB…. Department of Mechanical Engineering, LSU Session V
  • 7. Books on solving ODE’s using MATLAB.. Linear Algebra and Differential Equations Using MATLAB Martin Golubitsky, Michael Dellnitz Ordinary Differential Equations Using MATLAB John C. Polking & David Arnold Department of Mechanical Engineering, LSU Session V
  • 8. Solving ODE’s….  MATLAB has the capability to solve the first order differential equations using numerical methods.  The functions used are ode23 and ode25  Both ode23 and ode25 work the same way except for the internal algorithm that is being used.  Let us use ode45 in solving the Differential equations. Department of Mechanical Engineering, LSU Session V
  • 9. Format…. The format is as follows:  [t,y] = ode45(‘function_name’,tspan,y0)  function_name is the name of a function type file where the differential equation is stored.  tspan is a vector specifying the initial and final values of independent variable  y0 is a column vector containing the initial conditions  Results for the command are stored in vector y.  t is the vector of independent variable Department of Mechanical Engineering, LSU Session V
  • 10. Example…. Solve a first order homogeneous differential equation with initial condition: . y+ = y 0 y (t = ) = 0 1 We rewrite it as : . y = y − y (0) =1 Department of Mechanical Engineering, LSU Session V
  • 11. Function in MATLAB… Write the function in MATLAB and save it as ode1.m Department of Mechanical Engineering, LSU Session V
  • 12. Cont…. Write the following in another m-file: Department of Mechanical Engineering, LSU Session V
  • 13. Result…. Department of Mechanical Engineering, LSU Session V
  • 14. Non-homogenous ODE’s…. If the differential equation is not homogenous then we do the following: . y + = −t y e 2 y (t = ) = 0 1 It is rewritten again as follows: . y = y + −t − e 2 y (0) =1 Department of Mechanical Engineering, LSU Session V
  • 15. Solution…. All we need to do is change the function in the m-file ode1.m Rest remains the same as coded earlier. Department of Mechanical Engineering, LSU Session V
  • 16. Higher order differential Equations….  The higher order differential equations can be converted to a system of first order differential equations.  Next example shows how to solve second order differential equation using ode45 in Matlab Department of Mechanical Engineering, LSU Session V
  • 17. Problem…. The following figure shows a spring-mass-damper system. Plot the response of the system when the initial displacement of mass m is 0.1 meters. c = 1 kg/s k = 100N/m m = 5 kg Department of Mechanical Engineering, LSU Session V
  • 18. Equation of motion…. The equation of motion is as follows: .. . m x +c x +kx =0 x (t =0) =0.1 Now we need to change it to first order equation to solve it. Rewriting the equation we get, c k  = − x − x x  m m x(t = 0) = 0.1 Department of Mechanical Engineering, LSU Session V
  • 19. Cont…. . Consider the fact that x =vis just velocity. So we can rewrite the equation as two first order differential equations c k v =− v− x  m m x=v  v(t = 0) = 0 x(t = 0) = 0.1 Department of Mechanical Engineering, LSU Session V
  • 20. Cont…. Or in general form we get: c k x1 = − x1 − x2  m m x2 = x1  x1 (t = 0) = 0 x2 (t = 0) = 0.1 Department of Mechanical Engineering, LSU Session V
  • 21. Cont…. Write the function as follows in Matlab editor and save it as ode2.m Department of Mechanical Engineering, LSU Session V
  • 22. Cont…. Write the main program naming it as sorDiff.m Note that we have two initial conditions here. Department of Mechanical Engineering, LSU Session V
  • 23. Velocity Response…. Department of Mechanical Engineering, LSU Session V
  • 24. Displacement Response…. Department of Mechanical Engineering, LSU Session V
  • 25. Exercise…. Write a Matlab program to determine the time-temperature history of a sphere of radius r=5mm, initially at a uniform temperature of 400 0C. The sphere is exposed to 2000C air with a convection coefficient of h=10 W/m^2-K. The thermophysical properties of the sphere material are: ρ=Density=3000kg/m^3 k=Thermal conductivity=20 W/m-K c=specific heat=1000J/kg-K Department of Mechanical Engineering, LSU Session V
  • 26. Exercise cont…. The relation between the sphere temperature and time is given by an energy balance on the sphere, which results in the following differential equation dT − hA(T − T∞ ) = ρcV dt where H = convective heat transfer coefficient T = temperature of the sphere at any time A = surface area of the sphere = 4r2 V = volume of the sphere = 4/3 r3 T = time Department of Mechanical Engineering, LSU Session V
  • 27. Exercise cont…. This differential equation has the following exact solution which can be used to check the accuracy of the numerical solution provided by Matlab T − T∞ − hA = exp( t) Ti − T∞ ρcV Department of Mechanical Engineering, LSU Session V
  • 28. Exact Temperature code…. Department of Mechanical Engineering, LSU Session V
  • 29. Using as function…. Department of Mechanical Engineering, LSU Session V
  • 30. MATLAB main code…. Department of Mechanical Engineering, LSU Session V
  • 31. Result and plot…. Department of Mechanical Engineering, LSU Session V
  • 32. Delay Differential Equations… Ordinary differential equations (ODEs) and delay differential equations (DDEs) are used to describe many phenomena of physical interest. While ODEs contain derivatives which depend on the solution at the present value of the independent variable (“time”), DDEs contain in addition, derivatives which depend on the solution at previous times. DDEs are a better approximation than ODEs to many physical systems. Department of Mechanical Engineering, LSU Session V
  • 33. Cont…. Consider a system of delay differential equations of the form: y(t) = f(t, y(t), y(t - τ1), y(t - τ2), . . . , y(t - τk)) that are solved on a ≤ t ≤ b with given history y(t) = S(t) for t ≤ a. Department of Mechanical Engineering, LSU Session V
  • 34. Function code…. Department of Mechanical Engineering, LSU Session V
  • 35. Main program…. Department of Mechanical Engineering, LSU Session V
  • 36. Output…. Department of Mechanical Engineering, LSU Session V
  • 37. Website where you could obtain The dde23.m file….. http://www.radford.edu/~thompson/webddes/ Department of Mechanical Engineering, LSU Session V
  • 38. Recap….  Solving Double Integrals  Ordinary Differential Equations  Examples of ODE using MATLAB….  Mention of DDE’s Department of Mechanical Engineering, LSU Session V
  • 39. Next Session…. Engineering Applications using MATLAB….  Solving non linear differential equations  Algorithm analysis  Common mechanical problems a) four bar linkage b) vibrations c) thermal and fluids Department of Mechanical Engineering, LSU Session V
  • 40. Thank You Department of Mechanical Engineering, LSU Session V