Invalid output of ICFUN. ICFUN must return a column vector. (pdepe) Can someone help me with this error?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
% ceiso pde's yn matlab
%dp1/dt=d/dt(Ddp1/dr)+gp1(1-p1-p2)-d1p2p1
%dp2/dt=d/dt(Ddp2/dr)+gp2(1-p1-p2)-d2p2p1
clear all; clc; close all;
function [p1,f,s] = tryonepde(r,t,u,dudr)
%constants
g1=0.0695; %per hour
g2=0.0695; %per hour
ns=0.05*10^6 %saturation for n2
D=0.0132; %mm^2/h
t=24;%hours
p1=[1;1];
f=[D*dudr(1)
D*dudr(2)];
s=[g*u(1)*(1-u(1)-u(2))-d1*u(2)*u(1);
g*u(2)*(1-u(1)*u(2))-d2*u(2)*u(1)];
end
function u0=attemptonepdeic(r)
u0=[0.5;0.77];
t(1)=0
end
function [a1,b1,as,bs]=attemptonepdebc(r1,u1,rs,us,t)
a1=[0,0];
b1=[1,1];
as=a1;
bs=b1;
end
% r=linspace(0,0.005,24);
% t=linspace(0,0.005,24);
% m=1;
% sol=pdepe(m,@tryonepde, @attemptonepdeic, @attemptonepdebc ,r,t);
% p1 = sol(:,:,1);
% p2 = sol(:,:,2);
% surf(r,t,p1)
% title('p1(r,t): title')
% xlabel('d')
% ylabel('t')
%
% surf(r,t,p2)
% title('p2(r,t): title')
% xlabel('d')
% ylabel('t')
%
% plot(r,p2(end,:))
% title('title')
%
% plot(r,p1(end,:))
% title('title')
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Geometry and Mesh dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!