Solving 3 systems of pde using pdepe

6 views (last 30 days)
I have 2 sytems of PDEs as seen in the attached file. I transformed the systems into 3 systems of pde by letting w = \partial \theta/\partial z. Such that
\theta(z,t) = u(1)
w(z,t) = u(2)
v(z,t) = u(3)
and
\partial \theta/\partial z = dudx(1)
\partial w/partial z = dudx(2)
\partial v/\partial z = dudx(3)
Below is my trial code. I have also attached the systems of pde and the trial code. I want to plot v(z,t) and \theta(z,t).
Thank you.
% BC conditions:
function [pl, ql, pr, qr] = bc(xl, ul, xr, ur, t)
pl = [0; 0; 0];
ql = [1;1;1];
pr = pl
qr = ql;
end
%initial conditions
function u0 = init(x)
D = 0.0002
thetab = 0.0001
u0 = [thetab*sin(pi/D)*z ;0; 0];
end
% Next, we will define the function
function [c, f, s] = eq1(x, t, u, dudx)
% parameters.
k1 = 6*10^(-12);
eta1 = 0.0240;
apha3 = -0.001104;
gama1 = 0.1093;
% activity parameter
xi = 0.1;
% c, f and s values
c = [gama1;apha3; 0];
f = [k1*dudx(2)+ apha3*u(3); -eta1*dudx(3); 0];
s = [0;-xi*u(2); dudx(1) - u(2)];
end
% solving systems of PDE
% our problem in cartesian coordinates
m = 0;
% Effect along the river side
% Assume the distance along the river side is x
x= linspace(0, 1,50);
t = linspace(0, 10, 40);
%Solution
sol = pdepe(m, @eq1, @init, @bc, x, t)
% Director angle
u1 = sol(:, :, 1);
% velocity flow
u2 = sol(:, :, 3);
%plot the solution
subplot(2,1,1)
surf(x, t, u1)
title('Director angle')
xlabel('x')
ylabel('t')
zlabel('u(x,t)')
view([150 25])
subplot(2,1,2)
surf(x, t, u3)
xlabel('x')
ylabel('t')
title('velocity flow')
  16 Comments
Torsten
Torsten on 28 Jul 2022
I don't know if it's reasonable to solve the equations the way you try. I only changed the code that it might formally work.
You should search the literature for numerical approaches to solve the equations - standard approaches like yours will fail, I fear.

Sign in to comment.

Answers (0)

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!