Loading [MathJax]/jax/output/CommonHTML/jax.js

Differential equation – Part I First-Order ODE

Euler equation:

{xn+1=xn+hyn+1=yn+Anh

{h=stepsizeAn=f(xn,yn)

Error of solution

error = exact solution – approximate solution

Method 1: smaller step

Euler first-order: ec1h, proportional to step size

Method 2: find a better slop An

Heun’s method = improved Euler method = modified Euler method = RK2

{xn+1=xn+hyn+1=yn+h(An+Bn2)

in which, Bn=f(xn+1,yn+1)

Second-order method: ech2

Method 3: RK4

Standard method – accurate, used in computer programs

Rung-Kutta method

An+2Bn+2Cn+Dn6

Pitfalls

#1 Find in assignments

#2 Singularity

Ex. y=y2

Solus: y=1cx with singularity at x=c, y(2)=

First-order linear ODE

a(x)y+b(x)y=c(x)

when c(x)=0, the equation is homogeneous.

Standard linear form: the coefficient of y equals to 1.

y+p(x)y=q(x)

Models: Temp-conc model (Temperature-concentration model), Decay model, Bank account, Motion

Newton cooling law: dTdt=k(TeT)

t = time, T = temperature, k>0 is the conductivity

Diffusion model: dCdt=k(CeC)

C = salt concentration inside

Derivation of solution method

y+p(x)y=q(x)

uy+puy=qu

(uy)=qu

u=puuu=plnu=pu=epdx

u(x) is defined as integration factor

Method:

  1. standard linear form
  2. calculate integration factor epdx
  3. multiply both sides by epdx
  4. integrate

Example 1:

(1+cosx)y(sinx)y=2x

  1. ysinx1+cosxy=2x1+cosx
  2. I.F. esinx1+cosxdx=eln(1+cosx)=1+cosx
  3. (1+cosx)y(sinx)y=2x
  4. [(1+cosx)y]=2x(1+cosx)y=x2+cy=x2+c1+cosx

Example 2: linear with constant k

Temp: dTdt+kT=kTe

  1. I.F. ekt
  2. (ektT)=kTeekt
  3. ektT=kTe(t)ektdt+c
  4. T=ektkTe(t)ektdt+cekt

ektkTe(t)ektdt is steady state solution, and cekt is transient solution because k>0,t,cekt0.

Changing variables

scaling: x1=xa,y1=yb

Aims:

  1. change units
  2. make variables dimensionless
  3. reduce the number of constants, or simplify constants

Newton cooling law: dTdt=k(M4T4)

T=internal temperature, M=constant external temperature

T1=TMT=T1M

MdTdt=kM4(1T41)dTdt=kM3(1T41)

Direct substitution and indirect substitution

Bernoulli equation: y=p(x)y+q(x)yn(n0)

yyn=p(x)1yn1+q(x)

v=1yn1=y1nv=(1n)yny

v1n=p(x)v+q(x)

we can get linear equation then.

Example 1:

y=yx+y2y=2xx2+c

Homogeneous ODE

Invariant under the operation zoom:

y=F(y/x)

Example: y=x2yx3+y3=y/x1+(y/x)3

Example 1

The light try to track a boat on the sea and the boat travels at a angle of 45° with the light, as figured below, what is the travel path of the boat, assuming the initial point is (x,y).

y=tan(α+45)=tanα+tan451tanαtan45

y=y/x+11y/x=y+xxy

z=y/xy=zx+z

zx+z=z+11z

xdzdx=z+11zz=1+z21z

1+z21zdz=1xdx

(11+z2z1+z2)dz=1xdx

tan1z12ln(1+z2)=lnx+c

tan1(yx)=lnx+ln1+y2x2+c=lnx2+y2+c

θ=lnr+cr=c1eθ

Exponential spiral: r=ceθ

Autonomous First-order ODE

No independent variables on the right

dydt=f(y)

It is not easy to get the solution, but we can get qualitative information about the solution with direction field. For any t, f(y)= constant, which means the slopes are the same. Thus, the curves of solutions can be translated along the x-axis.

The critical point: y=f(y0)=0 or y=y0 is a solution.

Proof: dy0dt=0=f(y0), both sides of the equation equal to zero.

Method to know the qualitative information of the solution:

  1. find the critical points
  2. graph f(y), if f(y)>0, the solution increases, or decreases

Example: y is the money in account, r is the continuous interest, w is the rate of embezzlement with certain amount.

dydt=ryw

critical point: yw=0y=wr

Logistic Equation

Population behavior: y(t), k = growth rate. If k = constant, this is simple growth. If kconstant, this is Logistic growth. Normally k declines as y increases, and we choose the simplest one k=aby, then the population behavior is:

dydt=ayby2

Obviously, we can get the solution of this equation by separating variables and though partial integration. Here we only look at the characteristic of the solution. The critical points can be calculated as

ayby2=0y=0,y=ab

The critical point y=ab is a stable critical point because the solutions goes close, the point y=0 is an unstable critical point because the solutions goes away.

What is there is only one critical point? The critical point is stable on one side and unstable on the other side, which can be called simi-stable critical point, as shown below.

Logistic Equal with Harvesting

Assuming the harvest at constant time rate is h. This model is very useful for animal or plant raising.

dydt=ayby2h

The maximum time rate is hm=a24b, which is the only critical point of the solution.

Complex number

i2=1

z=a+bi,¯z=abi

Polar representation

a+bi=rcosθ+irsinθ=reiθ

Euler definition: eiθ=cosθ+isinθ

Exponential function:

  1. exponential law: eiθ1eiθ2=ei(θ1+θ2)
  2. initial value: ei0=1
  3. infinite series: ddteit=eit

Proof 1:

eiθ1eiθ2=(cosθ1+isinθ1)(cosθ2+isinθ2)=(cosθ1cosθ2sinθ1sinθ2)+i(cosθ1sinθ2+cosθ2sinθ1)=cos(θ1+θ2)+isin(θ1+θ2)=ei(θ1+θ2)

Proof 2:

ei0=cos0+isin0=1

Proof 3:

ddteit=ddt(cost+isint)=sint+icost=i(cost+isint)=eit

Advantage of polar representation: good for multiplication

Example:

excosxdx=Re(e(1+i)x)=12ex(cosx+sinx)

e(1+i)x=e(1+i)x1+i=11+iex(cosx+isinx)=1i2ex(cosx+isinx)

n1 has n answers as complex numbers. For example, 51 can be expressed with a circle with radius equals to 1 and the circle is divided with five lines equally, as shown below.

ξ=ei25πξ5=ei25π5=e2πi=1

First-order differential equation with complex numbers

y+ky=q(t)

Solution:

y=ektq(t)ektdt+cekt

The first part ektq(t)ektdt is steady-state solution, also called long-term solution, the second part cekt is transient solution. We usually choose the simplest answer as steady-state solution, usually c=0. If k>0, the solution is steady solution, the solution goes close to the steady-state value, otherwise, the solution is transient.

y+ky=kqe(t),qe(t)=coswt

w = angular frequency = number of complete oscillation

complexified equation:

˜y+k˜y=keiwt

complex solution: ˜y=y1+iy2

y=realpartof˜y

(˜yekt)=ke(k+wi)t˜yekt=kk+iwe(k+wi)t

˜y=k(kiw)k2+w2eiwt=11+iwkeiwt

Method 1: Go polar

Reminder: α is a complex number, then

1αα=1arg(1α)+arg(α)=arg(1)=0arg(1α)arg(α)

1αα=1|1α|=1|α|

Polar form:

11+i(w/k)=Aeiϕ=11+(w/k)2eiϕ

arg(1+iwk)ϕ=tan1(w/k)

So, the solution of the ODE , which is the real part of the complex solution, is

˜y=Aeiwtiϕ=11+(w/k)2ei(wtϕ)y1=11+(w/k)2cos(wtϕ)

in which, A is the amplitude and ϕ is the phase lag. If the conductivity k increases, the amplitude A also increases, which is consistent with our common sense.

Method 2: Go Cartesian

˜y=11+i(w/k)eiwt=1i(w/k)1+(w/k)2(coswt+isinwt)

y1=11+(w/k)2(coswt+(w/k)sinwt)=11+(w/k)21+(w/k)2cos(wtϕ)=11+(w/k)2cos(wtϕ)

The following equation is used in the derivation, which is very important and we can just remember it with the triangle as figured above.

acosθ+bsinθ=ccos(θϕ),c=a2+b2,ϕ=tan1(b/a)

Proof of this equation:

Method 1: high school method, write all from the right side and compare with the left side.

Method 2: 18.08 proof

<a,b><cosθ,sinθ>=|<a,b>|1cos(θϕ)

Definition: ab=ni=1aibi=a1b1+a2b2++anbn=|a||b|cosθ

Method 3: 18.03 proof

(abi)(cosθ+isinθ)=a2+b2eiϕeiθ=a2+b2ei(θϕ)

Take real parts of both sides:

acosθ+bsinθ=a2+b2cos(θϕ)

Summary: basic linear ODE

y+ky=kqe(t),k>0

y+ky=q(t)

y+p(t)y=q(t)

Mixing example

x(t) = amount of salt in tank at time t, Ce = concentration of incoming salt, V is the volume of the tank, r = rate of salt inflow = rate of salt outflow. Then, the variation of salt in tank equals to the amount of salt inflow minus the amount of salt outflow expressed by equation:

dxdt=rCerxV

Standard form: dCdt+rVC=rVCe

How dose the tank concentration C(t) follows the inflow salt concentration ({C_e}\left( t \right)\)? If the volume of the tank V is very small, then the tank concentration C(t) is very close to Ce(t), so the the amplitude A1 and ϕ0.

For the second kind of linear ODE, if k<0, none of the terminology of transient, steady-state input response applies. However, k<0 is used in economy, biology etc. expressed in the following equation.

dydtay=q(t),a>0

Leave a reply:

Your email address will not be published.

Site Footer

Recording Life, Sharing Knowledge, Be Happy~