Professional Documents
Culture Documents
Homework 1
Homework 1
Drexel University
Office of the Dean of the College of Engineering
ENGR 232 – Dynamic Engineering Systems
Homework 1
The following problems are similar to those from the main course textbook: Differential Equations and Linear Algebra
(Farlow and Hall). The material on this homework will appear on Quiz #1.
1. 𝑥 2 𝑦′′ + 3𝑥𝑦′ + 2𝑦 = 𝑒 −𝑥
2. 𝑦 ′ = 𝑦 − 𝑥
𝑑2 𝜃
3. 𝑑𝑡 2
+ sin 𝜃 = 0 (Pendulum)
3
𝑑 𝑥 𝑑𝑥
4. 𝑥 3 ∙ 3 − 𝑥 ∙ 𝑑𝑡 = 𝑥2
𝑑𝑡
𝑑2 𝑖 𝑑𝑖 𝑖
5. 𝐿 𝑑𝑡 2 + 𝑅 𝑑𝑡 + 𝑘 = 𝐸 sin(𝑘𝑡)
𝑑4 𝑦 𝑑2 𝑦
6. 𝑑𝑡 4
+ 4 ∙ 𝑑𝑡 2 = 5𝑦
7. 𝜃 ′′ + sin 𝜃 = sin 𝜔𝑡
8. 𝑡 ′′ − 2𝑥𝑡 ′ + 𝑥 2 = 0
Here, t is a function of x!
𝑑𝑦 2 𝑑𝑦
9. ( 𝑑𝑡 ) + 2 𝑑𝑡 + 1 = cos2 (𝑡)
𝑑𝑦 2
10. (𝑑𝑥 ) = +1
1
Drexel University, College of Engineering 2017-2018 Academic Year
𝑑𝑦 2
11. (𝑑𝑥 ) = −1
Does this DE have any solutions?
𝑑𝑦
12. 𝑑𝑡
= 4𝑦 − 𝑦 2
Logistic!
𝑑𝑧
13. 𝑑𝑡
= 1 − 4𝑧
Here, z = 1/y from the previous problem.
𝑑3 𝑥
14. 𝑑𝑡 3
=0
Jerk-free motion
𝑑𝑦
15. 𝑥 𝑑𝑥 + 𝑦 = 0
Family of involutions
Reminder: A differential equation is linear if and only if it can be rearranged into the form:
𝑑𝑛 𝑦 𝑑𝑛−1 𝑦 𝑑𝑦
𝑎𝑛 (𝑡) 𝑛
+ 𝑎𝑛−1 (𝑡) 𝑛
+ ⋯ + 𝑎1 (𝑡) + 𝑎0 (𝑡)𝑦(𝑡) = 𝑓(𝑡)
𝑑𝑡 𝑑𝑡 𝑑𝑡
Here's a graph to help you see how well the approximation has worked. I've taken it out to t = 5 instead.
dy/dt = t - y
5
Exact
4.5 Euler with h=0.5
3.5
2.5
y
1.5
0.5
0
0 1 2 3 4 5
t
Now explore the Excel file named Euler_Problem2 to see how easily Euler's method can be implemented in a
spreadsheet. Try different step sizes. Try adding more rows.
𝑑𝑦
Now let's solve the same DE 𝑑𝑡
= 𝑓(𝑡, 𝑦) = 𝑡 – 𝑦 using a different initial condition.
3
Drexel University, College of Engineering 2017-2018 Academic Year
Here's a graph (for both parts a and b) to help you see how well the approximation has worked. I've taken it out
to t = 5 instead. In case b, the numerical solution perfectly follows the exact solution which is the line 𝑦 = 𝑡 − 1.
dy/dt = t - y
4
2
y
4
Drexel University, College of Engineering 2017-2018 Academic Year
Solve the given IVP numerically using Euler's Method using a step-size of ℎ = 0.1
𝑑𝑦
= 𝑓(𝑡, 𝑦) = 1 − 2𝑡 − 2𝑦
𝑑𝑡
Hint: The exact solutions for this DE are: 𝑦(𝑡) = (1 − 𝑡) + 𝑘 ∙ 𝑒 −2𝑡 where 𝑘 = 𝑦(0) − 1
a. Here's a graph to help you see how well the approximation has worked. I've taken it all the way to 2.
dy/dt = 1 - 2t - 2y
1
Exact
Euler with h=0.1
0.5
0
y
-0.5
-1
0 0.5 1 1.5 2 5
t
Drexel University, College of Engineering 2017-2018 Academic Year
Now explore the Excel file named Euler_Problem3 to see how easily Euler's method can be implemented in a
spreadsheet. Try different step sizes. Try different initial conditions. Try adding more rows.
dy/dt = 1 - 2t - 2y
1
Exact for y(0)=+1
0.8 Euler with h=0.1
Exact for y(0)=-1
Euler with h=0.1
0.6 Initial Points
0.4
0.2
0
y
-0.2
-0.4
-0.6
-0.8
-1
0 0.5 1 1.5 2
t
6
Drexel University, College of Engineering 2017-2018 Academic Year
7
Drexel University, College of Engineering 2017-2018 Academic Year
The following graphs show we have not done too well at all! Both solutions are cosines, but we just found
straight lines! Exact for y(0)=+1
Euler with h=1
Exact for y(0)=-1
Euler with h=1
Initial Points
dy/dt = -pi * sin(pi*t)
1
-1
y
-2
-3
0 2 4 6 8 10
t
-1
y
-2
-3
0 2 4 6 8 10
t
8
Drexel University, College of Engineering 2017-2018 Academic Year
Problem 5: Euler slips on an infinite slope See the Excel file Euler_Problem5
Euler's method can also give weird answers if the slope field assumes large values, that is the solution curve is
changing fast! Consider the DE:
𝑦 ′ = − 𝑥⁄𝑦
The exact solutions are semicircles with infinite slope where they approach the x-axis. 𝑦 = ±√𝑅 2 − 𝑥 2
These infinite slopes are definitely going to cause problems! Let's see what that looks like.
Initial condition: 𝑦(0) = 1
Increment time in steps of ℎ = 0.1 until you reach 𝑥 = 2. The Excel file will help.
Note the exact solutions stops just before 𝑥 = 1, the last half of your points will be numerical noise.
Show your result in tabular form using the format below. Do a few by hand then finish off using the Excel file.
You'll have to adjust the equation in that file, which instead is for the DE: 𝑦 ′ = 𝑥 − 𝑦
If you click on cell D5, you will see a different equation: Change that to – 𝑥/𝑦
Then be sure to copy your new D5 and paste it to all cells beneath it.
Also adjust the step size down to 0.1
n 𝑥𝑛+1 = 𝑥𝑛 + ℎ Euler's Method 𝑑𝑦
= −𝑥/𝑦
∆𝑥 = ℎ 𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓𝑛 𝑑𝑥
𝑓𝑛 = 𝑓(𝑥𝑛 , 𝑦𝑛 )
Initial condition
0 0 1 0.000
1 0.1 1.000 -0.100
2 0.2 0.990 -0.202
3 0.3 0.970 -0.309
4 0.4 0.939 -0.426
5 0.5 0.896 -0.558
6 0.6 0.840 -0.714
7 0.7 0.769 -0.910
8 0.8 0.678 -1.180
Singularity at x=1 9 0.9 0.560 -1.607
condition 10 1.0 0.399 -2.504
Infinite Slope
11 1.1 0.149 -7.382
condition
12 1.2 -0.589 2.037
13 1.3 -0.386 3.372
14 1.4 -0.048 28.988
15 1.5 2.850 -0.526
Noise
16 1.6 2.798 -0.572
17 1.7 2.741 -0.620
18 1.8 2.679 -0.672
19 1.9 2.611 -0.728
20 2.0 2.539 -0.788
Fill in the table!
All the points after you crash through the singularity at 𝑥 = 1 are noise, and have nothing to do with the
solution curve which started at the point at (0,1).
9
Drexel University, College of Engineering 2017-2018 Academic Year
dy/dx = -x/y
3
Here's a graph to help understand where and why Euler has slipped Exact
2.5 Euler with h=0.1
up. The blue quarter circle is the exact solution in the forward
2
direction from the starting point (0,1). That solution is 𝑦 = √1 − 𝑥 2
1.5
which has an infinite slope as y approached the x-axis. The solution
1
stops just before 𝑦 = 0 at 𝑥 = 1.
0.5
y
The yellow dots (with red outlines) are the approximate solutions 0
from Euler's method. All that chaos on the RHS is due to numerical -0.5
error which becomes very large for jumps near the x-axis where -1
the slope is infinite. All the points in the red zone 𝑥 > 1 are just -1.5 Noise!
noise and do not correspond to the solution curve through the -2
0 1 2 3 4
starting point (0,1). They should be rejected. x
10
Drexel University, College of Engineering 2017-2018 Academic Year
𝟏
Given the direction field for 𝒙′ = − 𝒙(𝒙 + 𝟒)(𝒙 − 𝟐) showing x vs. t.
𝟒
𝑡=0
a) How many equilibrium solutions are there for this differential equation? Draw them, then list in the box:
2, 0, -4
b) Estimate the time for the initial condition 𝑥(0) = – 1 to reach –3.
Draw the curve on the direction field and show the time, fill in the values below
t = 0.5
d) Draw at least 10 solution curves and select starting values to cover all solution curve shapes.
11