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

Name: CHONG SOON YEE Matrix: BK15110055 H/P: 0143980188 Subject: KE26503

Assignment 1 (40 marks)

1. State a first order non-linear and non-homogeneous differential equation. Solve using
(a) Exact Equation Approach (page 1)
(10 marks)
The first order differential equation is (x2+6y) y’+2xy= 8x. Assume that y (0) =1.
First, change the equation to the form of M (x, y) dx + N (x, y) dy =0.

(x2+6y) y’+2xy = 8x
(x2+6y+5) dy+2xydx = 8x dx
(2xy-8x) dx +(x2+6y) dy = 0
M= 2xy-8x N = x2+6y
My=2x Nx =2x
My = Nx
Since My = Nx. So, the differential equation is exact.
We can either integrate M with respect to x or integrate N with respect to y. In this case, I do
integration on M with respect to x.
(2xy-8x) dx +(x2+6y) dy = 0

𝜕𝜑 𝜕𝜑
= 𝜑x = M(x, y) = 𝜑y = N(x, y)
𝜕𝑥 𝜕𝑦
= 2xy - 8x = x2 + 6y

𝜑 = ∫( M (x, y) dx
= 𝑥 2 𝑦 − 4𝑥 2 + ℎ(𝑦)
Differentiating 𝜑 with respect to y and compare the answer to N (x, y):
𝜕𝜑
= 𝜑𝑦
𝜕𝑦
𝜕
= ∫(M (x, y)dx
𝜕𝑦
𝜕
= [𝑥 2 𝑦 − 4𝑥 2 + ℎ(𝑦)]
𝜕𝑦
= 𝑥 2 + ℎ′(𝑦)
By comparison with N (x, y):
ℎ′(𝑦) = 6y
Integrate to find ℎ(𝑦): ℎ (𝑦) = 3𝑦 2 +c1

Substitute ℎ(𝑦) to 𝜑: 𝜑 = 𝑥 2 𝑦 − 4𝑥 2 +3𝑦 2 +c1

KE00103 / KS20303 Differential Equations


Name: CHONG SOON YEE Matrix: BK15110055 H/P: 0143980188 Subject: KE26503
So, the implicit solution to the differential equation is
𝑥 2 𝑦 − 4𝑥 2 +3𝑦 2 +c1=c2
𝑥 2 𝑦 − 4𝑥 2 +3𝑦 2 =c2-c1
𝑥 2 𝑦 − 4𝑥 2 +3𝑦 2 =c
Applying the initial condition given,
When y (0) =1,
3=c
So, the equation is
𝑥 2 𝑦 − 4𝑥 2 +3𝑦 2 = 3
3𝑦 2 +𝑥 2 𝑦 = 4𝑥 2 + 3

Arranging the equation in the form of ay2+by+c=0:


3𝑦 2 +𝑥 2 𝑦 − 4𝑥 2 − 3 = 0
a = 3; b =𝑥 2 ; c = −4𝑥 2 − 3
Applying the quadratic formula gives:

−𝑏 ± √𝑏 2 − 4𝑎𝑐
𝑦(𝑥) =
2𝑎

−𝑥 2 ± √(𝑥 2 )2 − 4(3)(−4𝑥 2 − 3)
𝑦=
2(3)

−𝑥 2 ± √𝑥 4 + 48𝑥 2 + 36
𝑦=
6

−𝑥 2 +√𝑥 4 +48𝑥 2 +36 −𝑥 2 −√𝑥 4 +48𝑥 2 +36


The y obtained in term of x is y = and 𝑦 =
6 6

Substitute the initial condition of y (0) = 1 into the both solution,


0+√04 +48(0)2 +36
y= = 1(True)
6

0−√04 +48(0)2 +36


y= = -1 (False)
6

−𝑥 2 +√𝑥 4 +48𝑥 2 +36


Thus, the final solution for this equation is y =
6
√𝑥 4 +48𝑥 2 +36−𝑥 2
y=
6

KE00103 / KS20303 Differential Equations


Name: CHONG SOON YEE Matrix: BK15110055 H/P: 0143980188 Subject: KE26503
(b) MATLAB m-file (with graph for solution) (page 2)
(10 marks)
Figure below shows the coding in the m-file to get the solution of the first order differential
equation as well as the graph of this equation.

Results of MATLAB Simulation:

Graph plotted using MATLAB

KE00103 / KS20303 Differential Equations


Name: CHONG SOON YEE Matrix: BK15110055 H/P: 0143980188 Subject: KE26503
(c) MATLAB-SIMULINK (with graph for solution) (page 3)
(10 marks)
The simulink constructed based on the first order non-linear non-homogenous is as shown
in figure below.

Graph obtained from the Scope:

KE00103 / KS20303 Differential Equations


Name: CHONG SOON YEE Matrix: BK15110055 H/P: 0143980188 Subject: KE26503
(d) Discussion of all the methods and solution (page 4)

(10 marks)
A differential equation is said to be linear when it is of the first degree in the dependent
variable and all of its derivatives. A differential equation is said to be homogenous
when g(x) =0. So, for the differential equation to be non-homogenous, we just make
sure that the term g(x) ≠ 0.

A differential expression M (x, y) dx + N (x, y) dy is an exact differential in a


region R of the xy-plane if it corresponds to the differential of some function f (x, y)
defined in R. A first-order differential equation of the form
M (x, y) dx + N (x, y) dy =0
is said to be an exact equation if the expression on the left-hand side is an exact
differential.

In this question, the first order linear non-homogenous equation that I have
chosen is an exact equation as the L.H.S of the equation is an exact differential.
(x2+6y) y’+2xy= 8x ⇒ (2xy-8x) dx +(x2+6y) dy = 0

Since this is an exact equation, we do not need to find the integrating factor as the
integrating would be equal to 1. In other words, if it is a non-exact differential equation,
then we need to multiply an integrating factor to the equation to make it exact.

Either using exact equation approach or MATLAB simulation, we will get the
same answer. The exact equation approach is a good method to solve a non-linear
differential equation. Moreover, MATLAB would be a powerful tool in solving the
general equation of differential equation as we can observe the graph plotted of the
equation using the coding method or the MATLAB SIMULNK. MATLAB could save a lot
a time compared to solving the differential equation by manual calculation.

KE00103 / KS20303 Differential Equations

You might also like