Azzera filtri
Azzera filtri

pdepe help!! incorrect answer

5 visualizzazioni (ultimi 30 giorni)
Hüseyin Cagdas Yatkin
Hüseyin Cagdas Yatkin il 29 Dic 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 Commenti
Bill Greene
Bill Greene il 29 Dic 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 il 30 Dic 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.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by