Matlab Assignment 2: Name: Thao Hoang PID: A12495313 Section: A01 TA's Name: Xiaolong (Bruce) Li

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Name: Thao Hoang

PID: A12495313
Section: A01
TAs name: Xiaolong (Bruce) Li

Matlab Assignment 2
Exercise 2.1
a)

Exercise 2.2
a. The lines which DFIELD has drawn are the solutions of the differential equation
at different x and y values based on the initial point that I clicked.
y ' = (exp( - x) - y) (exp( - x) + 2 + y)
4
3
2
1
y

0
-1
-2
-3
-4
-2

4
x

10

b. The utility of plotting direction fields using MATLAB will save us a lot of time
than do it by hand and it is easier to see the solution at the point we need.
Exercise 2.3
If the initial value in the problem were not exactly (0,1) but near (0,1), it would not have
any huge effect on the solution of this differential equation.
y'=x+2y
4
3
2

1
0
-1
-2
-3
-4
-2

4
x

10

Exercise 2.4

If the initial value were not exactly at (1,1), it would have huge effects and alteration on
the solution of this differential equation. The solutions were diverged away from the
horizontal line at (1,1). The solution would concave up if y>1 and concave down if y<1.
y'=y-1
4
3
2

1
0
-1
-2
-3
-4
-2

4
x

Exercise 2.5
At A=1

At A=3

10

At A=10

In real life, A represent the temperature of the environment.


Exercise 2.6

a) The initial value problem which we must solve dy/dt = k(A-y); y(0)=-6
b) A is the environment temperature, it should be A = 41.
c) Since the problem doesnt tell the unit of time. I assume it would be in hour.
According from the graph, it should be around 8 hours

d) It would take 5.5 hours if the delicious chicken breast were thawed on the kitchen
counter instead, given that room-temperature is around 69F. So, it saves us about
2.5 hours.

Exercise 2.7
If we change the values of x' and y' from 2 and -3 to other constant values, it will
change the direction of the solution.

Exercise 2.8

Exercise 2.9

Pplane

Dfiled

From the DFILED and PPLANE, we can see they give us the same solution to the
differential equation. Different initial values for y(0), give us different solution.
Exercise 2.10

a) The only possible solutions is in the first quadrant when x>0 and y>0
b)

c) If rabbit is x, fox is y.
We should have
x ' = x (a - b y)
y ' = c y (x - d)

a=1 b=1
c=1 d=1

3
D

E
2

1
A

-1
-1

2
x

You might also like