MAE200B - Homework No. 1: Laura Novoa January 15, 2016

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

U NIVERSITY OF C ALIFORNIA , I RVINE

MAE200B - Homework No. 1

Laura Novoa
January 15, 2016

Problem 1
The function u(x, y) is governed by:
u
= 2xu
x
Subject to the BC: u(0, y) = si n(y). Calculate the Solution.
Solution
Assuming our "common clock" to be the new variable s, from the boundary condition:
u(0, y) = si n(y)
u(s = 0) = si n()
Thus, we know that
(

y(0) =
x(0) = 0

Using the method of characteristics:


A=

1
, B = 0, and F = u
2x

d x(s)
1
=A=

ds
2x(s)

2x(s)d x(s) =

>
d s x 2 = s +C 1 s = x 2 
C
1

BC : x(0) = 0 C 1 = 0

d y(s)
=B =0
ds

d y = 0 y(s) = C 2 y(s) =

BC : y(0) = C 2 =

d u(s)
= F = u
ds

d u(s)
=
u(s)

d s u(s) = C 3 e s u(s) = si n()e s

BC : u(0) = si n() C 3 = si n()

Thus, from 1 and 2 into 3


u(x, y) = si n(y)e x

Problem 2 Use the Method of characteristics to solve the following two equations for u(x, y) :
u
u
+ 2t
=1
t
x
u
u
+x
= si n(t )
t
x

u(x, 0) = f (x)

u(x, 0) = g (x)

In both cases:
(a) Use the rigorous approach to express the characteristics and the solutions in terms of an
independent variable s.
(b) Derive and plot the shapes of the characteristics.
(c) Derive the solutions u(x, t ) for arbitrary f and g .
(d) Specialize the solutions for f (x) = e x and g (x) = cos(x). Make 3D plots of the respective solutions.

Solution
(I)

u
u
+ 2t
= 1, u(x, 0) = f (x)
t
x
A = 1, B = 2t , and F = 1

Assuming s the new variable, from the boundary condition:


u(x, 0) = f (x)
s = 0 u(s = 0) = f ()
Thus, we know that
(

x(s) x(0) =
t (s) t (0) = 0

a)
0
d t (s)
>
1
= A = 1 t (s) = s +C 1 s = t (s) 
C
1
ds
BC : t (0) = 0 C 1 = 0

d x(s)
= B = 2t (s) = 2s x(s) = s 2 +C 2 x(s) = s 2 +
ds
BC : x(0) = C 2 =

d u(s)
= F = 1 u(s) = s +C 3 u(s) = s + f ()
3
ds
BC : u(0) = f () C 3 = f ()

b) Eliminating s from the first two equation gives the characteristic equation:
Substituting 1 into 2 :
x(s) = t (s)2 +

Which is a parabola that crosses the x axis at a positive or negative

c) The solution for an arbitrary f(x) will be:


u(s) = s + f ()
From 1 s = t (s)
From 2 = x(s) s 2 = (x(s) t (s))2
Thus: u(x, t ) = t + f (x t 2 )
d) Specialize the solution for f (x) = e x
u(x, t ) = t + e xt

The surface plot of the function:

(II)

u
u
+x
= si n(t ), u(x, 0) = g (x)
t
x
A = 1, B = x, and F = si n(t )

Assuming s the new variable, from the boundary condition:


u(x, 0) = g (x)
s = 0 u(s = 0) = g ()
Thus, we know that
(

x(s) x(0) =
t (s) t (0) = 0

a)
0
d t (s)
>
= A = 1 t (s) = s +C 1 s = t (s) 
C
1
1
ds
BC : t (0) = 0 C 1 = 0

d x(s)
= B = x(s)
ds

d x(s)
=
x(s)

d s x(s) = C 2 e s x(s) = e s

BC : x(0) = C 2 =

d u(s)
= F = si n(t (s)) from 1 si n(s)
ds

d u(s) =

si n(s)

u(s) = cos(s) +C 3 u(s) = cos(s) + g () + 1

BC : u(0) = g () 1 +C 3 = g () C 3 = g () + 1

b) Eliminating s from the first two equation gives the characteristic equation:
Substituting 1 into 2 :
x(s) = e t (s)

c) From 2 = x(s)e s . Thus:


u(x, t ) = cos(t ) + g (xe t )

d) Specialize the solution for g (x) = cos(x)


u(x, t ) = cos(t ) + cos(xe t )

Problem 3
The potential, incompressible solution for 2D stagnation-point flow is:

u = Ax , v = Ay
Where u and v are the horizontal and vertical velocity components, respectively, and A is a constant. At time t = 0 a blob of contaminants is introduced in this flow. The initial shape of the
blob is a circle centered at (x = 0, y = b) with radius R < b. You are asked to find the shape of the
blob at later times using the following steps.
(a) Neglecting diffusion, and assuming that the contaminant is a passive scalar, write the transport equation for the contaminant concentration C(x, y, t).
Considering steady-state flow:

C
t

= 0 we have:
0
7
C
C
C
 +u
+v
=0
t
x
y


(b) and (c): Write differential evolution equations for the characteristics and the concentration
field, using as independent variable the time t measured by an observed moving with a fluid
particle.Integrate the above equations to obtain algebraic relations for the characteristics (x(t),
y(t)) and the concentration field c(t).

d x(t )
= Ax(t )
dt

d x(t )
=A
x(t )

d t x(t ) = C 1 e At

d y(s)
= Ay(t ) y(t ) = C 2 e At
dt

1 ln

x(t )
= At
C1

dC (t )
= 0 C (t ) = C 3 = constant
dt



x(t )
x(t ) 1
C1
C3
1 into 2 y(t ) = C 2 exp ln
= C 2 exp ln
= C2
y(t ) =
C1
C1
x(t )
x(t )

(d) Plot the shapes of the characteristics on the x y plane.

(e) Derive an analytic expression for the shape of the blob for t > 0. Characterize this shape,and
plot for A = 1, b = 1, R = 0.5, t = 1.
At t = 0, from the equation of the circumference with a b displacement in the y axis:
x 02 + (y 0 b)2

=R

x 2
0

y0 b
+
R

=1

From part c), we had:


x(t ) = C 1 e At

y(t ) = C 2 e At
Applying initial conditions:
x(0) = x 0 C 1 = x o x(t ) = x 0 e At

y(0) = y 0 C 2 = y o y(t ) = y 0 e At

Substituting 2 and 3 into 1 will give us an analytic expression for the shape of the blob for
t > 0.

x(t )
e At R

y(t )
e At

!2

=1

x(t )
e At R

y(t ) b
Re At

=1

Which describes an Ellipsoid.


Since we know that e At R is increasing over time, we can expect that the ellipse radius in the x
direction will progressively increase over time.
Similarly, since e At R is decreasing, the ellipse radius in the y direction will progressively decrease over time
Also, e At b is decreasing over time, meaning the blob will flow downward in the y axis.
Eventually, when t = , the blob will become a flat "line" in the y = 0 position.
The plot below describes the evolution of the blob with time. The blue circle represents the
blob at t = 0 , the red circle is the blob at t = 1 and the yellow at t = 2.:

10

11

MATLAB SOURCE CODE


PDE # 1
figure
[X,T] = meshgrid(-4:.2:4);
U = T + exp(X - T.^2);
surf(X,T,U)
xlabel('x')
ylabel('t')
zlabel('u')
%Plot characteristics
C = [-10:1:10];
t = [-5:0.1:5];
figure
for i=1:length(C)
x = t.^2 + C(i);
plot(t,x)
ylim = ([0 100]);
hold on
end
xlabel('t(s)')
ylabel('x(s)')

PDE #2
[X,T] = meshgrid(-10:.5:25);
U = -1*cos(T) + cos(X.*exp(-T));

figure
surf(X,T,U)
xlabel('x')
ylabel('t')
zlabel('u')
%Plot characteristics
C = [-10:1:10];
t = [-5:0.1:5];

figure
for i=1:length(C)
x = C(i).*exp(t);
plot(t,x)
ylim = ([0 100]);
hold on
end
xlabel('t(s)')
ylabel('x(s)')

Problem 3
clc
clear all
close all
%Plot characteristic lines
C = [-10:1:10];
x = [-5:0.1:5];
for i=1:length(C)
y = C(i)./x;
plot(x,y)
axis([ -inf inf 0 100]);
hold on
end
xlabel('x(t)')
ylabel('y(t)')

Plotting blob
%t = 0
r = 0.5; %radius
xc = 0; %0
yc = 1; % b
theta = 0 : .1 : 2*pi;
x = r * cos(theta) + xc;
y = r * sin(theta) + yc;
%figure
plot(x, y)
t = 1;
A = 1;
xt = x.*exp(A.*t);
yt = y.*exp(-1*A.*t);
hold on
plot(xt, yt)

t = 2;
A = 1;
xt = x.*exp(A.*t);
yt = y.*exp(-1*A.*t);
hold on
plot(xt, yt)
xlabel('x(t)')
ylabel('y(t)')
axis([ -5 5 0 5]);

Published with MATLAB R2015a

You might also like