You are on page 1of 20

Assignment 3

Abhinav Pradeep
Tutorial group 12
September 22, 2023

1 Question 1.
To prove:
I I
f ∇g · dr = − g∇f · dr
C C
From the provided hint consider:

∇ (f g)
By the chain rule,

∇ (f g) = f ∇g + g∇f
Take line integral over some closed curve C
I I
∇ (f g) · dr = (f ∇g + g∇f ) · dr
C C
By linearity of the integral,
I I I
∇ (f g) · dr = f ∇g · dr + g∇f · dr
C C C
Consider:
I
∇ (f g) · dr
C

If C is parametrized by r(t)
I Z b
∇ (f g) · dr = ∇f g (r(t)) · r′ (t)dt
C a
By the chain rule:
d
f g(r(t)) = ∇f g (r(t)) · r′ (t)
dt
I Z b
d
∇ (f g) · dr = f g(r(t))dt
C a dt

1
By the FTC,
Z b
d
f g(r(t))dt = f g(r(b)) − f g(r(a))
a dt
That is:
I
∇ (f g) · dr = f g(r(b)) − f g(r(a))
C

As r(t) parametrizes closed curve C,

r(b) = r(a)
Hence,

f g(r(b)) − f g(r(a)) = 0
Therefore,
I
∇ (f g) · dr = 0
C
Now consider again
I I I
∇ (f g) · dr = f ∇g · dr + g∇f · dr
C C C
From above derivation,
I I
0= f ∇g · dr + g∇f · dr
C C
Hence,
I I
f ∇g · dr = − g∇f · dr
C C

2 Question 2.
2.1 a
Given:
3
X ∂u
(u · ∇)u ≡ ui
i=1
∂xi
3 3
!
X X ∂uj
(u · ∇)u ≡ ui ej
i=1 j=1
∂xi

To show:
1
(u · ∇)u = ∇||u||2
2
Consider
1
∇||u||2
2
1 1
∇||u||2 = ∇ u21 + u22 + u23

2 2
1 1 1 1
∇||u||2 = ∇u21 + ∇u22 + ∇u23
2 2 2 2

u : R3 → R3

uj : R3 → R , j ∈ {1, 2, 3}
By the chain rule,

∇u2j = 2uj ∇uj , j ∈ {1, 2, 3}

3
!
X ∂uj
∇u2j = 2uj ei , j ∈ {1, 2, 3}
i=1
∂xi
Hence,
3
! 3
! 3
!
1 2 1 X ∂u1 1 X ∂u2 1 X ∂u3
∇||u|| = · 2u1 ei + · 2u2 ei + · 2u3 ei
2 2 i=1
∂xi 2 i=1
∂xi 2 i=1
∂xi
3
! 3
! 3
!
1 X ∂u1 X ∂u2 X ∂u3
∇||u||2 = u1 e i + u2 ei + u3 ei
2 i=1
∂xi i=1
∂xi i=1
∂xi
3 3
!
1 X X ∂u i
∇||u||2 = ui ej
2 i=1 j=1
∂xj

Hence, to prove:
1
(u · ∇)u = ∇||u||2
2
3 3
! 3 3
!
X X ∂uj X X ∂ui
ui ej = ui ej
i=1 j=1
∂xi i=1 j=1
∂xj

u is conservative. Hence,

u = ∇f
Where f : R3 → R
 
∂f ∂f ∂f
u= , ,
∂x1 ∂x2 ∂x3
Consider again
3 3
! 3 3
!
X X ∂uj X X ∂ui
ui ej = ui ej
i=1 j=1
∂xi i=1 j=1
∂xj
As u is conservative,

∂uj ∂ 2f
=
∂xi ∂xi ∂xj
∂ui ∂ 2f
=
∂xj ∂xj ∂xi
By Clairaut’s theorem,

∂ 2f ∂ 2f
=
∂xi ∂xj ∂xj ∂xi
Hence,
∂uj ∂ui
=
∂xi ∂xj
Therefore,
3 3
! 3 3
!
X X ∂uj X X ∂ui
ui ej = ui ej
i=1 j=1
∂xi i=1 j=1
∂xj

1
(u · ∇)u = ∇||u||2
2

2.2 b
∂u ∇P
+ (u · ∇)u = F −
∂t ρ
∂u
As u is time invariant, =0
∂t
∇P
(u · ∇)u = F −
ρ
From section a,
1 ∇P
∇||u||2 = F −
2 ρ
As F is a conservative vector field,
1 ∇P
∇||u||2 = −∇V −
2 ρ
1 ∇P
∇||u||2 + ∇V + =0
2 ρ
By linearity of the derivative  
1 P
∇ ||u||2 + V + =0
2 ρ
As the derivative is 0, the function must be constant
1 P
||u||2 + V + = constant
2 ρ

2.3 c
The equation insofar derived is an an energy conservation statement, Bernoulli’s principle, for a fluid
under some conservative field F . If its potential V is constant then it can be absorbed by the RHS:
1 P
||u||2 + = constant
2 ρ
Call this constant C.
1 P
||u||2 + = C
2 ρ
1 P
||u||2 = C −
2 ρ
 
2 P
||u|| = 2 C −
ρ
s  
P
||u|| = 2 C −
ρ
Where,

ρ ∈ (0, ∞)
As density cannot be negative. Moreover, density cannot be 0 as that would imply there exists none
of the fluid in the volume under consideration or that that fluid has no mass.

Moreover,

P ≤ Cρ
As P > Cρ this would make the value inside the radical negative and speed, the magnitude of a vector
in R3 , cannot be complex valued.

It is also assumed that C can take on any real value, that is:

C ∈ (−∞, ∞)
Based on this the below can be said about the relationship between a fluids speed and the pressure
excreted by it:

1. Fluid speed ∥u∥ has a square root relationship with fluid pressure P .

2. In general, increasing fluid velocity results in decreasing fluid pressure.


3. A fluid that has no speed exerts pressure P = Cρ. From research, this would be hydrostatic
pressure. Fluid pressure cannot be lower than hydrostatic. For example, for a fluid under the effect of
the gravitional field, C = gh that is: Phydrostatic = ρgh. (Hydrostatics, 2023)

Below is the equation graphed for a fluid under the effect of gravity with the density of water at a
height of 10m. SI units used throughout.

3 Question 3.
3.1 a
Fnet (t) = Fon particle (t) − Ffriction (t)

Fnet (t) = ma(t)


As

v̇(t) = a(t)

Fnet (t) = mv̇(t)


Given that:

Ffriction (t) ∝ v 2 (t)

Ffriction (t) = kv 2 (t)


For some real k.

Hence,

Fnet (t) = Fon particle (t) − Ffriction (t)

mv̇(t) = Fon particle (t) − kv 2 (t)


dv
m = Fon particle (t) − kv 2
dt
m
dv = dt
Fon particle (t) − kv 2
Z Z
m
dv = 1dt
Fon particle (t) − kv 2

Without additional information, the only case where this integral can be solved is by assuming
Fon particle (t) = F for some real constant force F .
Z Z
m
dv = 1dt
F − kv 2

3.2 b
Assumption that F = 0 is legal. Hence,
Z Z
m
dv = 1dt
0 − kv 2
−m
Z Z
dv = 1dt
kv 2
m
=t+C
kv
At t = 0, v = v0 .
m
=C
kv0
Hence,
m m
=t+
kv kv0
m m
− =t
kv kv0
 
m 1 1
− =t
k v v0
1 1 kt
− =
v v0 m
1 kt 1
= +
v m v0
1 ktv0 + m
=
v mv0
mv0
v=
ktv0 + m
3.3 c
mv0
v=
ktv0 + m
Z Z
mv0
vdt = dt
ktv0 + m
Z Z
1
vdt = mv0 dt
ktv0 + m
mv0
x= ln |ktv0 + m| + C
kv0
m
x= ln |ktv0 + m| + C
k
At t = 0, x = x0 . Hence,
m
x0 = ln |m| + C
k
m
C = x0 − ln |m|
k
Hence,
m
x= ln |ktv0 + m| + C
k
m m
x= ln |ktv0 + m| + x0 − ln |m|
k k
m m
x= ln |ktv0 + m| − ln |m| + x0
k k
m |ktv0 + m|
x= ln + x0
k |m|
3.4 d
dx mv0
=
dt ktv0 + m
 
mv0
xn+1 = xn + h
ktn v0 + m
Plugging in constants.
 
1
xn+1 = xn + 0.1
2tn + 1
This formula was evaluated using the below Matlab code and visualized with Desmos.

t=0:0.1:0.5;
h=0.1;
x(1)=0;
for n=1:5
x(n+1)=x(n)+h*(1/(2*t(n)+1));
end
disp(x);

Which yields:

0 0.1000 0.1833 0.2548 0.3173 0.3728

Hence, an error of:

E = |0.3728 − 0.3466|

E = 0.0262
was observed.
4 Question 4.
f (m, ρ, δ, r, g) = 0

m
ρ=
l3
ml m
δ= 2
⇒δ= 2
tl t

r=l

l
g=
t2
(NOTE: Here δ corresponds to surface tension) Where m = mass, l = length, t = time. Observe that
there exist 5 parameters and 3 fundamental units. Hence, for two dimensionless parameters Π1 and
Π2 , the Buckingham Π theorem guarantees the existence of Φ1 , Φ2 and Φ3 such that f (m, ρ, δ, r, g) = 0
can be written as

Φ1 (Π1 , Π2 ) = 0

Π1 = Φ2 (Π2 )

Π2 = Φ3 (Π1 )
Choose repeating variables δ, r and g as these cannot be made to form a dimensionless constant.
Hence, Π1 and Π2 are of the form:

Π 1 = δ α1 r α2 g α3 m

Π2 = δ α4 rα5 g α6 ρ
Solving for Π1 ’s constants:

Π 1 = δ α1 r α2 g α3 m

 m  α1  α3
0 0 0 α2 l
ml t = (l) (m)
t2 t2
By inspection,
   
α1 −1
α2  = −1
α3 1
Hence,

Π1 = δ −1 r−1 g 1 m1
mg
Π1 =
δr
Solving for Π2 ’s constants:

Π2 = δ α4 rα5 g α6 ρ

 m  α4   α6  
0 0 0 α5 l m
ml t = (l)
t2 t 2 l3
By inspection,
   
α4 −1
α5  =  2 
α6 1
Hence,

Π2 = δ −1 r2 g 1 ρ1

gr2 ρ
Π2 =
δ
Consider that by the Buckingham Π theorem, there exists some function Φ such that

Π1 = Φ(Π2 )

gr2 ρ

mg

δr δ
 2 
δr gr ρ
m= Φ
g δ

5 Question 5.
dx
= 2x − xy
dt
dy
= −2y + xy
dt

5.1 a.
The below matlab code achieves this:

X = [2,3,1.5,1.5];
Y = [1.5,1.5,3,1.5];

U = 2.*X - X.*Y;
V = -2.*Y + X.*Y;
disp("Gradient calulations:")
for n=1:4
disp([U(n),V(n)]);
end

disp("Vectors:")
for n=1:4
disp(strcat(’(’,string(X(n)),’,’,string(Y(n)),’)’, " --> ", ...
’(’,string(X(n)+U(n)),’,’,string(Y(n)+V(n)),’)’));
end
quiver(X,Y,U, V,’off’);

Its output is:

Gradient calulations:
1 0

1.5000 1.5000

-1.5000 -1.5000

0.7500 -0.7500

Vectors:
(2,1.5) --> (3,1.5)
(3,1.5) --> (4.5,3)
(1.5,3) --> (0,1.5)
(1.5,1.5) --> (2.25,0.75)
5.2 b.
[X,Y] = meshgrid(0.1:0.2:4,0.1:0.2:4);
U = 2.*X - X.*Y;
V = -2.*Y + X.*Y;

mag = hypot(U, V);

quiver(X,Y,U./mag, V./mag);

5.3 c.
[X,Y] = meshgrid(0.1:0.2:4,0.1:0.2:4);
U = 2.*X - X.*Y;
V = -2.*Y + X.*Y;
[C,I] = meshgrid(0.1:0.01:4,0.1:0.01:4);
O = 2.*C - C.*I;
B = -2.*I + C.*I;
mag = hypot(U, V);
quiver(X,Y,U./mag, V./mag);
startx = [1; 1.25];
starty = [1; 1.25];
streamline(C,I,O,B,startx,starty);
Equilibrium solutions occur when:
dx
=0
dt
dy
=0
dt
Substituting expressions:

2x − xy = 0

−2y + xy = 0
That is,

x(2 − y) = 0

y(−2 + x) = 0
Hence, equilibrium will occur when:

(x, y) = (0, 0)

(x, y) = (2, 2)

To determine stability, consider again the initial system:

ẋ = f (x, y)

ẏ = g(x, y)
Consider some stable point (xs , ys ). Define variables δ and ϵ to measure variation of some solution
x(t), y(t) from (xs , ys ). That is:

δ(t) := x(t) − xs
ϵ(t) := y(t) − ys
By algebra,

x(t) = xs + δ(t)
y(t) = ys + ϵ(t)
Differentiating w.r.t,

˙ = δ(t)
x(t) ˙
˙ = ϵ(t)
y(t) ˙
˙ and y(t)
Consider x(t) ˙ using above definition of x(t) and y(t).

˙ = f (xs + δ(t), ys + ϵ(t))


x(t)

˙ = g(xs + δ(t), ys + ϵ(t))


y(t)
By established equivalence,

˙ = f (xs + δ(t), ys + ϵ(t))


δ(t)

˙ = g(xs + δ(t), ys + ϵ(t))


ϵ(t)
As f and g in this case are non-linear, take a first order approximation about (xs , ys ):

f (x, y) = f (xs , ys ) + Dx f (xs , ys )(x − xs ) + Dy f (xs , ys )(y − ys )

g(x, y) = g(xs , ys ) + Dx g(xs , ys )(x − xs ) + Dy g(xs , ys )(y − ys )


Hence,

f (xs + δ(t), ys + ϵ(t)) = f (xs , ys ) + Dx f (xs , ys )(xs + δ(t) − xs ) + Dy f (xs , ys )(ys + ϵ(t) − ys )

g(xs + δ(t), ys + ϵ(t)) = g(xs , ys ) + Dx g(xs , ys )(xs + δ(t) − xs ) + Dy g(xs , ys )(ys + ϵ(t) − ys )
As (xs , ys ) is a stable point,

f (xs + δ(t), ys + ϵ(t)) = Dx f (xs , ys )(δ(t)) + Dy f (xs , ys )(ϵ(t))

g(xs + δ(t), ys + ϵ(t)) = Dx g(xs , ys )(δ(t)) + Dy g(xs , ys )(ϵ(t))


From above,

˙ = Dx f (xs , ys )(δ(t)) + Dy f (xs , ys )(ϵ(t))


δ(t)

˙ = Dx g(xs , ys )(δ(t)) + Dy g(xs , ys )(ϵ(t))


ϵ(t)
It must be noted that this is a linear approximation and is hence accurate only when δ(t) and ϵ(t) are
small. Hence, the below is only valid for small deviations from the equilibrium solution, which is what
we want to analyse anyways.

These are linear differential equations. In matrix form,


" # 
˙
δ(t)

Dx f (xs , ys ) Dy f (xs , ys ) δ(t)

˙ =
ϵ(t) Dx g(xs , ys ) Dy g(xs , ys ) ϵ(t)
" #
˙
δ(t)

δ(t)

˙ =J
ϵ(t) ϵ(t)
Consider eigenvalue-eigenvector pair (λ, V ) of J. That is:

JV = λV
Using the above pair a solution of the system can be written as:
 
δ(t)
= eλt V
ϵ(t)
This is because:
" #
˙
δ(t)

δ(t)

˙ =J
ϵ(t) ϵ(t)
" #

δ(t)
 ˙
δ(t)

δ(t)

λt
J = Je V ˙ = Dt
ϵ(t) ϵ(t) ϵ(t)
" #
 
δ(t) ˙
δ(t)
J = eλt JV ˙ = Dt eλt V
ϵ(t) ϵ(t)
" #

δ(t)
 ˙
δ(t)
J = eλt λV ˙ = λeλt V
ϵ(t) ϵ(t)
" #

δ(t)
 ˙
δ(t)
J = λeλt V ˙ = λeλt V
ϵ(t) ϵ(t)

Hence,
 
δ(t)
= eλt V
ϵ(t)
For stable equillibria, δ(t) and ϵ(t) should decay to 0, as any functions with reasonably a small per-
turbation away from (xs , ys ) should decay to (xs , ys ) if that equilibrium point is indeed stable. Hence,
eλt should decay to 0 ∀λ eigenvalues. This ensures that all solutions and superpositions of solutions
decay to zero. Hence, all eigenvalues of J must be negative.

In the case of the given model,


   
Dx f (xs , ys ) Dy f (xs , ys ) 2 − ys −xs
=
Dx g(xs , ys ) Dy g(xs , ys ) ys −2 + xs
Consider point (xs , ys ) = (0, 0)
   
2 − ys −xs 2 0
=
ys −2 + xs 0 −2
This is a diagonal matrix. Eigenvalues lie on the diagonal. That is: λ1 = 2, λ2 = −2. As λ1 > 0,
equilibrium point (0,0) is unstable. In the case with two real eigenvalues of opposite signs, (0,0) is
called a saddle point.
Consider point (xs , ys ) = (2, 2)
   
2 − ys −xs 0 −2
=
ys −2 + xs 2 0
   
0 −2 1 0
det −λ =0
2 0 0 1
 
−λ −2
det =0
2 −λ

λ2 + 4 = 0
Hence, λ1 = 2i, λ2 = −2i
Equilibrium requires that eλi t decays to 0. Complex eigenvalues do not complicate this matter. Con-
sider for some complex λi :

eλi t = eℜ(λi )t+ℑ(λi )t

eλi t = eℜ(λi )t eℑ(λi )t


Hence,

eλi = eℜ(λi )t eℑ(λi )t


The above describes a complex number of magnitude eℜ(λi )t that oscillates due to the t in the eℑ(λi )t
term. Disregarding the oscillation, it is evident that eλi t decays to 0 only if ℜ(λi ) is negative.

As ℜ(λ1 ) = 0 and ℜ(λ2 ) = 0, eλ1 t and eλ2 t do not decay to 0. Instead, eλ1 t and eλ2 t just oscillate with
constant magnitude. As the magnitude remains fixed, it can be said that there is no ’net movement’
of solution curves away from the equilibrium. That is, the solution curves orbit the equillibrium. The
case with a pair of purely imaginary eigenvalues of opposite sign is called a stable center.

This orbital behavior can be shown in both the simplified linear model and the original non-linear
model.

˙ = 0δ(t) − 2ϵ(t)
δ(t)

˙ = 2δ(t) + 0ϵ(t)
ϵ(t)
That is:

= −2ϵ(t)
dt

= 2δ(t)
dt
Take:
dϵ dϵ dt
= ·
dδ dt dδ
dϵ 1
= 2δ(t) ·
dδ −2ϵ(t)
dϵ 2δ(t)
=
dδ −2ϵ(t)
dϵ −δ(t)
=
dδ ϵ(t)

ϵ(t)dϵ = −δ(t)dδ

ϵ2 = −δ 2 + C

ϵ2 + δ 2 = C

The above equation represents circles of radius C centered at the origin in [ϵ × δ] space. The origin
in [ϵ × δ] corresponds to (2,2) as ϵ and δ measure deviation, and ϵ(t) = 0 and δ(t) = 0 implies no
deviation from the (2,2).

Consider the original non-linear model:


dx
= x(2 − y)
dt
dy
= y(−2 + x)
dt
dy dy dt
= ·
dx dt dx
dy y(−2 + x)
=
dx x(2 − y)
(2 − y) (−2 + x)
dy = dx
y x
   
2 −2
− 1 dy = + 1 dx
y x
Z   Z  
2 −2
− 1 dy = + 1 dx
y x
−2
Z Z Z Z
2
dy − 1dy = dx + 1dx
y x

2 ln(y) − y = −2 ln x + x + C

2 ln(y) − y + 2 ln x − x = C
C is a constant and is invariant to the values of x and y. Hence, it is time invariant / a conserved quan-
tity. To see what values of C produced desired curves (lead to non-extinction population trajectories?),
let

f (x, y) = 2 ln(y) − y + 2 ln x − x
The below matlab code was used to visualize f :
syms x,y
f(x,y) = 2*log(y)+2*log(x)-x-y;
ezsurf(f)
Output of the code:

It can be observed that (very roughly) trajectories with C < −1 would work. Using this, the below
was graphed using Desmos.

It is clear that the solution curves orbit the point (2, 2).
5.4 Bibliography
Hydrostatics (2023) Wikipedia. Available at: https://en.wikipedia.org/wiki/Hydrostatics (Accessed:
18 September 2023).

You might also like