Please help me solve this material balance
Mostrar comentarios más antiguos

8 comentarios
Rachael
el 12 de Sept. de 2023
Rachael
el 12 de Sept. de 2023
You can follow the example of solving a system of PDEs in this link:
Use the template below to define the parameters and code the equations in the 'Local functions' section. If there is an error message, show the code.
x = [0 0.005 0.01 0.05 0.1 0.2 0.5 0.7 0.9 0.95 0.99 0.995 1];
t = [0 0.005 0.01 0.05 0.1 0.5 1 1.5 2];
m = 0;
sol = pdepe(m, @pdefun, @pdeic, @pdebc, x, t);
u1 = sol(:,:,1);
u2 = sol(:,:,2);
surf(x,t,u1)
title('u_1(x,t)')
xlabel('Distance x')
ylabel('Time t')
surf(x,t,u2)
title('u_2(x,t)')
xlabel('Distance x')
ylabel('Time t')
%% -------------- Local functions --------------
% Partial Differential Equation to solve
function [c, f, s] = pdefun(x, t, u, dudx)
c = [1; 1];
f = [0.024; 0.17].*dudx;
y = u(1) - u(2);
F = exp(5.73*y) - exp(- 11.47*y);
s = [-F; F];
end
% Initial Conditions
function u0 = pdeic(x)
u0 = [1; 0];
end
% Boundary Conditions
function [pl, ql, pr, qr] = pdebc(xl, ul, xr, ur, t)
pl = [0; ul(2)];
ql = [1; 0];
pr = [ur(1)-1; 0];
qr = [0; 1];
end
Rachael
el 13 de Sept. de 2023
Rachael
el 13 de Sept. de 2023
Respuesta aceptada
Más respuestas (1)
Sam Chak
el 13 de Sept. de 2023
2 votos
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!








