0% found this document useful (0 votes)
47 views

2017.EngineeringMathematics - Differentialequations 2

The document summarizes techniques for solving ordinary differential equations (ODEs), including separating variables, exact differentials, integrating factors, and linear ODEs. It provides examples of using each technique to solve example ODEs that model mixing problems, decay processes, and other applications. Key steps like setting up models as ODEs, solving, and interpreting solutions are demonstrated.

Uploaded by

Tanvir Hasan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

2017.EngineeringMathematics - Differentialequations 2

The document summarizes techniques for solving ordinary differential equations (ODEs), including separating variables, exact differentials, integrating factors, and linear ODEs. It provides examples of using each technique to solve example ODEs that model mixing problems, decay processes, and other applications. Key steps like setting up models as ODEs, solving, and interpreting solutions are demonstrated.

Uploaded by

Tanvir Hasan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Engineering Mathematics

– Differential Equations –

Eric Yee
1st Trimester
ODE – Separating Variables
• Many practically useful ODEs can be reduced to the
form:
g ( y ) y′ = f (x )

• We can integrate both sides with respect to x:

∫ g ( y )y′dx = ∫ f (x )dx + c
∫ g ( y )dy = ∫ f (x )dx + c
• If f and g are continuous functions, the integrals exist
and by evaluating them, we obtain a general solution.
This method of solving ODEs is called the method of
separating variables (y appears only on the left while
the x appears only are on the right).
ODE – Separating Variables
• Example: The probability per − dn(t ) = λn(t )dt
unit time that a nucleus will
dn(t )
decay is constant. Let us call − = λdt
n(t )
this decay constant λ and at
time t, the number of atoms as dn(t )
−∫ dy = ∫ λdt
n(t). Derive the number of n(t )
undecayed nuclei at time t,
when the number of atoms at − ln n(t ) = λt + c
t = 0 is n0, that is n(0) = n0. n(t ) = e − λt −c

n(t ) = n0 e − λt

Activity α (t ) = α 0 e − λt
Modeling – Mixing Tank
• Problem: Consider a mixing problem involving a
single tank. A tank with 1,000 gal of water in
which initially 100 kg of salt is dissolved. Brine
runs in at a rate of 10 gal/min, and each gallon
contains 5 kg of dissolved salt. The mixture in the
tank is kept uniform by stirring. Brine runs out at
10 gal/min. Find the amount of salt in the tank at
any time t.
Modeling – Mixing Tank
• Step 1: Setting up a model. Let y(t) denote the amount of
salt in the tank at time t. Its time rate of change is
y’ = Salt inflow rate – Salt outflow rate Balance law

5 kg times 10 gal gives an inflow rate of 50 kg of salt. Now


the outflow is 10 gal of brine. This is 10/1,000 = 0.01 (1%)
of the total brine content in the tank, hence 0.01 of the salt
content y(t), that is, 0.01y(t). Therefore the model is the
ODE

= 50 − 0.01 y = −0.01( y − 5000 )


dy
dt
Modeling – Mixing Tank
• Step 2: Solution of the model. The ODE model is separable. Separation,
integration, and taking exponents on both sides gives
dy
= 50 − 0.01 y = −0.01( y − 5000 )
dy
= −0.01dt
dt y − 5000

ln y − 5000 = −0.01t + c1 y − 5000 = ce −0.01t


Initially the tank contains 100 kg of salt. Hence y(0) = 100 kg is the
initial condition that will give the unique solution. Substituting y = 100
at t = 0 gives
100 − 5000 = ce −0.01( 0 )
Making c = –4950. Hence the amount of salt in the tank at time t is

y (t ) = 5000 − 4900e −0.01t


Modeling – Mixing Tank
• Step 3: Interpretation of result (example graph)

y (t ) = 5000 − 4900e −0.01t

The solution shows an exponential approach to


the limit of 5,000 kg.
Exact ODEs – Integrating Factors
• A first-order ODE M(x,y) + N(x,y)y’ = 0, written using dy = y’dx, as
M ( x, y )dx + N (x, y )dy = 0

is called an exact differential equation if the differential form is


exact, that is, this form is the differential:
∂u ∂u
du = dx + dy
∂x ∂y
of some function u(x,y). Then our first-order ODE can be written
du = 0

and by integration we see


u ( x, y ) = c
• This is called an implicit solution, in contrast to the explicit
solution as defined previously.
Exact ODEs – Integrating Factors
• Comparing our two conditions to have an exact differential
equation, we need a function u(x,y) such that:
M ( x, y )dx + N (x, y )dy = 0
∂u ∂u
dx + dy = du ∂M ∂N
∂x ∂y If = ,
∂y ∂x
∂u ∂u
=M OR =N then the differential
∂x ∂y equation is exact!
• If the differential equation is exact, then the function u(x,y) can
be found by inspection or by using
u = ∫ Mdx + k ( y ) u = ∫ Ndy + l ( x )

where we have 2 unknowns in k(y) and l(x) and 2 equations.


Exact ODEs – Integrating Factors
• Example initial value problem. Solve the following:
(cos y sinh x + 1)dx − sin y cosh x dy = 0 y (1) = 2

• Verify that the given ODE is exact (leave to you!). We find u(x,y)
using
u = − ∫ sin y cosh x dy + l ( x ) = cos y cosh x + l ( x )

from this,
∂u dl
= cos y sinh x + = M = cos y sinh x + 1
∂x dx
Hence dl/dx = 1 and from integration, l(x) = x + c1. This gives the
general solution
u ( x, y ) = cos y cosh x + x = c

Remember the condition: du = 0 u ( x, y ) = c


Exact ODEs – Integrating Factors
• From the initial condition
cos 2 cosh 1 + 1 = c = 0.358

• This gives us the solution


u ( x, y ) = cos y cosh x + x = 0.358
cos y cosh x + x = 0
• Graphically, the cos y cosh x + x = 0.358
particular solutions
are shown for
varying c.
cos y cosh x + x = 3
Exact ODEs – Integrating Factors
• What happens when we have an equation that is not
exact? Consider the equation –y dx+x dy = 0. In this
case, M = –y and N = x, however ∂M/∂y ≠ ∂N/∂x. This
shows the differential equation is not exact and thus
the aforementioned approach will not work.

• However, if we multiply the ODE by 1/x2, we get an


exact equation!
− y dx + x dy − y 1 ∂M − 1 ∂N − 1
= 2 dx + dy = 2 = 2
x 2
x x ∂y x ∂x x

• We call this 1/x2 an integrating factor.


Exact ODEs – Integrating Factors
• In general, we take a nonexact equation
P( x, y )dx + Q( x, y )dy = 0
and multiply by a function F(x,y)
FPdx + FQdy = 0
to obtain an exact equation which we can solve.

• The integrating factor can be found by either


1  ∂P ∂Q  ∗ 1  ∂Q ∂P 
R =  −  R =  − 
Q  ∂y ∂x  P  ∂x ∂y 

F ( x ) = exp ∫ R( x )dx F ∗ ( y ) = exp ∫ R ∗ ( y )dy


Linear ODEs
• Linear ODEs, or ODEs that can be transformed to a
linear form, are models for various phenomena. A
first-order ODE is said to be linear if it can be brought
into the form
y′ + p(x ) y = r (x )

• Typically, in applied engineering, r(x) is called the


input while y(x) is called the output or the response to
the input (and given initial conditions).

• Consider cases when there r(x) = 0 and when r(x) ≠ 0.


Linear ODEs
• When the linear ODE has r(x) = 0, it is called
homogeneous.
y′ + p(x ) y = 0

• By separating variables and integrating, we get


= − p( x )dx
dy
y
ln y = − ∫ p( x )dx + c ∗

y ( x ) = ce − ∫ p ( x )dx
• If c = 0, then we obtain the trivial solution y(x) = 0
Linear ODEs
• When the linear ODE has r(x) ≠ 0, it is considered
nonhomogeneous.
y′ + p(x ) y = r (x )
• By applying an appropriate integrating factor (actually
F = eh), we are able to obtain a solution
h = ∫ p( x )dx

(
y (x ) = e − h ∫ e h r dx + c )
• If we re-write the solution, we can see it is a sum of
two terms
y ( x ) = e − h ∫ e h r dx + ce − h

Total Output = Response to Input r + Response to Initial Data

You might also like