필터 지우기
필터 지우기

pdepe help!! incorrect answer

조회 수: 5 (최근 30일)
Hüseyin Cagdas Yatkin
Hüseyin Cagdas Yatkin 2019년 12월 29일
댓글: Hüseyin Cagdas Yatkin 2019년 12월 30일
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
Bill Greene
Bill Greene 2019년 12월 29일
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 2019년 12월 30일
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.

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

답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by