Can't get graph to appear
Show older comments
clf
function main()
global R t CR
R = 1;
CR = 0;
tend = 0.5; %seconds
%symmetry (spherical)
m = 2;
%evaluate at the following
r = linspace(0, R, 200);
t = linspace(0, tend, 10);
%Calling a routine to solve the PDE
C = pdepe(m, @pdex1pde, @pdex1ic, @pdex1bc, r, t);
C_ratio = C(:, :, 1);
%Plotting the results
figure, plot(r,C_ratio(0.001,:,1), r,C_ratio(0.01,:,1), r,C_ratio(0.0574,:,1), r,C_ratio(0.1,:,1), r,C_ratio(0.2,:,1), r,C_ratio(0.4,:,1))
xlabel('r/R (dimensionless)')
ylabel('C/CR (dimensionless)')
end
function[c,f,s] = pdex1pde(r, t, C, DCDr)
c = 1;
f = [(D * DCDr); 1];
s = [(D * 2/r); 1];
end
function C = pdex1ic(r)
C = 0;
end
function [p1, q1, pr, qr] = pdex1bc(r1, Cl, rr, Cr, t)
p1 = 0;
q1 = 1;
pr = Cr;
qr = 0;
end
4 Comments
Adam Danz
on 29 Apr 2019
Probably because when you call main(), this is throwing an error:
C_ratio(0.001,:,1)
When you call main(), does an error message appear?
C. Lane Stanfield
on 29 Apr 2019
C. Lane Stanfield
on 29 Apr 2019
Adam Danz
on 29 Apr 2019
I updated my answer after seeing your screen shot. Start my removing clf in line 1
Accepted Answer
More Answers (0)
Categories
Find more on Graphics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!