Differential Equations by Laplace transforms ▪ On this activity, you will learn to solve initial value problems using laplace transforms. ■ Example: ▪ Solve the initial value problem: (D2 - 3D + 2)y= sin(5t): y(0) = 1, y (0) = 2 ■ %Step 1: Initialize the variables: syms y(t), t ▪ I I I I I ■ %Step 2: Identify the LHS and RHS of the equation, find the laplace of the given functions 1 = D2y-3*Dy+2*y; ■ r = sin(5*t); ▪ L = laplace (1); Dy=diff(y); D2y=diff(y,2); I cond1=y(0)==1; cond2=Dy(0)==2 R = laplace(r); ▪ %Step 3: Equate the laplace transforms of the LHS and RHS. Plugin the initial conditions: ▪ eqn1 = L==R; ▪eqn1 = subs(eqn1, Ihs(cond1), rhs(cond1)); ■ eqn1 =subs(eqn1, Ihs(cond2), rhs(cond2)); ■ %Step 4: solve for Y(s) in the resulting equation ■ eqn1 = isolate(eqn1,laplace(y)); ▪ %Solve the resulting equation: ▪ysolnilaplace(eqn1) Exercises: Solve the Initial Value problem (D2 + 4D + 3)y=1+2: y(0) = 2, y' (0) = 1, using laplace transforms Script> 1 %Step 1: Initialize the variables: 2 syms y(t), t 3 Dy= 4 D2y= 5 cond1= 9 r = 10 L = 6 cond2= 7 %Step 2: Identify the LHS and RHS of the equation, find the laplace of the given functions 8 = 11 R = 12 %Step 3: Equate the laplace transforms of the LHS and RHS. Plugin the initial conditions: 13 eqn1 = 14 eqn1 = 15 eqn1 = 16 %Step 4: solve for Y(s) in the resulting equation 17 eqn1 = 18 %Solve the resulting equation: 19 ysoln = 20 Save C Reset My Solutions > MATLAB Documentation

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
answer in matlab code please
Differential Equations by Laplace transforms
▪ On this activity, you will learn to solve initial value problems using laplace transforms.
■ Example:
▪ Solve the initial value problem: (D² - 3D + 2)y= sin(5t): y(0) = 1, y (0) = 2
■ %Step 1: Initialize the variables:
syms y(t), t
■
I
Dy=diff(y);
D2y=diff(y, 2);
cond1=y(0)==1;
cond2=Dy(0)==2
■ %Step 2: Identify the LHS and RHS of the equation, find the laplace of the given functions
1 = D2y-3*Dy+2*y;
■
r = sin(5*t);
▪ L = laplace (1);
I
R = laplace(r);
▪ %Step 3: Equate the laplace transforms of the LHS and RHS. Plugin the initial conditions:
▪eqn1 = L==R;
▪eqn1 = subs(eqn1, Ihs(cond1), rhs(cond1));
▪eqn1 =subs(eqn1, Ihs(cond2), rhs(cond2));
■ %Step 4: solve for Y(s) in the resulting equation
▪eqn1 = isolate(eqn1,laplace(y));
▪ %Solve the resulting equation:
▪ysolnilaplace(eqn1)
Exercises:
Solve the Initial Value problem (D2 + 4D + 3)y=t+2: y(0) = 2, y' (0) = 1, using laplace transforms
Script>
1 %Step 1: Initialize the variables:
2 syms y(t), t
3 Dy=
4 D2y=
5 cond1=
6 cond2=
7 %Step 2: Identify the LHS and RHS of the equation, find the laplace of the given functions
8 =
9 r =
10 L =
11 R =
12 %Step 3: Equate the laplace transforms of the LHS and RHS. Plugin the initial conditions:
13 eqn1 =
14 eqn1 =
15 eqn1 =
16 %Step 4: solve for Y(s) in the resulting equation
17 eqn1 =
18 %Solve the resulting equation:
19 ysoln =
20
Save C Reset
My Solutions >
MATLAB Documentation
Transcribed Image Text:Differential Equations by Laplace transforms ▪ On this activity, you will learn to solve initial value problems using laplace transforms. ■ Example: ▪ Solve the initial value problem: (D² - 3D + 2)y= sin(5t): y(0) = 1, y (0) = 2 ■ %Step 1: Initialize the variables: syms y(t), t ■ I Dy=diff(y); D2y=diff(y, 2); cond1=y(0)==1; cond2=Dy(0)==2 ■ %Step 2: Identify the LHS and RHS of the equation, find the laplace of the given functions 1 = D2y-3*Dy+2*y; ■ r = sin(5*t); ▪ L = laplace (1); I R = laplace(r); ▪ %Step 3: Equate the laplace transforms of the LHS and RHS. Plugin the initial conditions: ▪eqn1 = L==R; ▪eqn1 = subs(eqn1, Ihs(cond1), rhs(cond1)); ▪eqn1 =subs(eqn1, Ihs(cond2), rhs(cond2)); ■ %Step 4: solve for Y(s) in the resulting equation ▪eqn1 = isolate(eqn1,laplace(y)); ▪ %Solve the resulting equation: ▪ysolnilaplace(eqn1) Exercises: Solve the Initial Value problem (D2 + 4D + 3)y=t+2: y(0) = 2, y' (0) = 1, using laplace transforms Script> 1 %Step 1: Initialize the variables: 2 syms y(t), t 3 Dy= 4 D2y= 5 cond1= 6 cond2= 7 %Step 2: Identify the LHS and RHS of the equation, find the laplace of the given functions 8 = 9 r = 10 L = 11 R = 12 %Step 3: Equate the laplace transforms of the LHS and RHS. Plugin the initial conditions: 13 eqn1 = 14 eqn1 = 15 eqn1 = 16 %Step 4: solve for Y(s) in the resulting equation 17 eqn1 = 18 %Solve the resulting equation: 19 ysoln = 20 Save C Reset My Solutions > MATLAB Documentation
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY