VOOZH about

URL: https://www.geeksforgeeks.org/matlab/solving-initial-value-2nd-order-differential-equation-problem-using-laplace-transform-in-matlab/

⇱ Solving Initial Value 2nd Order Differential Equation Problem using Laplace Transform in MATLAB - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Solving Initial Value 2nd Order Differential Equation Problem using Laplace Transform in MATLAB

Last Updated : 29 Mar, 2022

In the domain of Multivariable calculus, the Initial value problem (IVP) is a general differential equation given together with some initial condition(s), which usually specifies the value of the unknown function at some given point(s) in its Domain. Here, Initial conditions are values of the solution and/or its derivative(s) at a specific point(s) in its domain.

Steps to Solve Initial Value Second Order Differential Equation Problem using Laplace Transform:

Step 1: Apply the Laplace Transform to the Given Equation on its Both Sides.

Step 2: Separate the 'L(y)' Terms after applying Laplace Transform. 

Step 3: Substitute the Initial Value Conditions given along with the 2nd Order Differential Equation in the 'L(y)' found in the above step.

Step 4: Simplify the 'L(y)'.

Step 5: Now, Apply the Inverse Laplace Transform on Both Sides of the above Equation. Hence. we obtained the required solution 'y(t)' ( Since, InvL(L(y))=>y ).

Approach:

  • disp(txt): This method displays the 'txt'.
  • input(txt): This method displays the 'txt' and waits for the user to input a value and press the Return key.
  • diff(y) (or) diff(y,x) : This method differentiates y with respect to x.
  • laplace (y,t s): This method returns the Laplace Transform of, where the independent variable is 't', and the transformation variable is 's'.
  • subs(y, old, new): This method returns a copy of y, replacing all occurrences of old with new.
  • ilaplace(Y,s,t): This method returns the Inverse Laplace Transform of Y, where the independent variable is s and the transformation variable is t
  • ezplot(y,xinterval): This Method plots the curve y=f(x) over the specified interval 'xinterval'.

Example 1:

Output:

d^2y/dt^2 + 2dy/dt + 5y = exp(-t)(sin(t)), y(0)=0 ,y'(0)=1
👁 Image
 

Example 2:

Output:

d^2y/dt^2 - 2dy/dt + y = e^t, y(0)=2 ,y'(0)=-1
👁 Image
 
Comment