Hi,
Based on the question, it can be understand that you are facing issue in plotting the differential equations while using the “pdepe” function.
There are a few corrections and modifications needed in your code to incorporate the boundary condition at (1+delta).
- Since delta is a constant parameter with a range of values, you'll need to update the domain of x to x = linspace(0, 1 + delta); to include the (1+delta) boundary.
- In the pdex4bc function, you need to adjust the boundary conditions to match the problem statement. The updated function should have ql = [0; 0; 0]; instead of ql = [1; 0; 0];
- The t variable in linspace(0, 1) should be modified to match the appropriate time range for your problem.
- “pdepe” only supports parabolic and elliptic equations, and your current PDE does not meet this requirement. By adding a small positive value epsilon in the pdex4pde function, you introduce an artificial diffusion that allows the system to be treated as a parabolic equation and can be solved using pdepe. So function pdex4pde would look like:
function [c, f, s] = pdex4pde(~, ~, u, DuDx)
alpha = 2; beta = 5; gamma = 3; sigma = 0.5; varphi = 2; omega = 2;
epsilon = 1e-5; % Small positive value for artificial diffusion
c = [1; 1; 1];
f = [1; 1; 1] .* DuDx;
F1 = alpha^2 .* u(1) .* u(2) ./ u(1) + u(2);
F2 = beta^2 .* u(1) .* u(2) ./ u(1) + u(2);
F3 = gamma^2 .* u(1) .* u(2) ./ u(1) + u(2);
s = [F1; F2; F3] + epsilon * DuDx;
end
Hope it helps,
Raghav Bansal