필터 지우기
필터 지우기

Solving 3 systems of pde using pdepe

조회 수: 7 (최근 30일)
University Glasgow
University Glasgow 2022년 7월 25일
댓글: University Glasgow 2022년 7월 28일
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
Torsten
Torsten 2022년 7월 28일
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.
University Glasgow
University Glasgow 2022년 7월 28일
Sure I will, thank you.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Eigenvalue Problems에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by