pdepe help!! incorrect answer

1 Ansicht (letzte 30 Tage)
Hüseyin Cagdas Yatkin
Hüseyin Cagdas Yatkin am 29 Dez. 2019
Hi guys,
Script is working, however I don't get the correct result for the XvsC graph, what is the problam, how can I solve that, is there any other way to solve this?
clc
clear
%% defining the mash points
x = linspace(0,15000,10); %defining distance from 0 to 15000m which is divaded in to 10
t = linspace(0, 30, 30); %defining time from 0 to 30th day which is divided in to 30
m = 0;
sol = pdepe(m, @pde,@pdeic,@pdebc,x,t);
%% ploting for the x(m) vs C(30, x)(mg/L) for t = 30 day
sol(30,:);
plot(x, sol(30,:))
xlabel('Distance (m)')
ylabel('Concentration (mg/L)')
title('x vs C for t = 30 day')
%% ploting for the t(day) vs C(t, 5)(mg/L) for x = 7500 m
sol(:, 5);
plot(t, sol(:, 5))
xlabel('Time (days)')
ylabel('Concentration (mg/L)')
title('t vs C for x = 50 m')
%% main function that represent our governing equation
function [c, f, s] = pde(x, t, C, dCdx)
c = 1;
f = -49680*C;
s = -(0.24+0.45/5)*C;
end
%% defining the initial condition
function u0 = pdeic(x)
u0 = 25;
end
%% defining the boundry condition
function [pl,ql,pr,qr] = pdebc(xl,ul,xr,ur,t)
pl = ul - 13.75;
ql = 0;
pr = ur - 0.05;
qr = 0;
end
  4 Kommentare
Bill Greene
Bill Greene am 29 Dez. 2019
The problem you have modeled makes little sense to me. You have a flow velocity of 49680 m/day and you are looking for a solution after 30 days yet you have modelled a domain of just 15000 m. What were you expecting the solution to look like in this domain after 30 days?
Hüseyin Cagdas Yatkin
Hüseyin Cagdas Yatkin am 30 Dez. 2019
You gat a point yeah, I never thought in that way. Since the boundry conditions are hypothetical, I will rearrange the conditions and try again. Thanks a lot.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by