在一个图上绘制t=0、0.001、0.01、1和10时的MATLAB图
我正在解一个与时间相关的偏微分方程。目前,我正在绘制从0到10的所有时间,这些时间间隔均为10个值。 如果我只想在一个图上绘制t=0、0.001、0.01、1和10,我将如何进行呢在一个图上绘制t=0、0.001、0.01、1和10时的MATLAB图,matlab,plot,matlab-figure,Matlab,Plot,Matlab Figure,我正在解一个与时间相关的偏微分方程。目前,我正在绘制从0到10的所有时间,这些时间间隔均为10个值。 如果我只想在一个图上绘制t=0、0.001、0.01、1和10,我将如何进行呢 function simple_time_dependent_pdepe clear all; close all; clc; % D_ij = 1*10^-6; %Diffusion coefficient D (3.0*10^-7 cm^2/s -> 30 um^2/
function simple_time_dependent_pdepe
clear all; close all; clc;
%
D_ij = 1*10^-6; %Diffusion coefficient D (3.0*10^-7 cm^2/s -> 30 um^2/s)
L0 = 1; %c0 [nM]
x_f =0.02; %Length of domain [um]
maxt = 10; %Max simulation time [s]
%
m = 0; %Parameter corresponding to the symmetry of the problem
x = linspace(0,x_f,100); %xmesh
t = linspace(0,maxt,100); %tspan
%
sol = pdepe(m,@DiffusionPDEfun,@DiffusionICfun,@DiffusionBCfun,x,t,[]);
u = sol;
%
% Plotting
hold all
for n = linspace(1,length(t),10)
plot(x,sol(n,:),'LineWidth',2)
end
title('Time Dependent')
xlabel('Distance (\mum)')
ylabel('Concentration (nM)')
axis([0 x_f 0 L0])
%
function [c,f,s] = DiffusionPDEfun(x,t,u,dudx)
D = D_ij;
%
%Rate constants
k_1 = 0.25;
R_L = -k_1.*u;
%
% PDE
c = 1;
f = D_ij.*dudx;
s = R_L;
end
%
function u0 = DiffusionICfun(x)
u0 = 0;
end
%
function [pl,ql,pr,qr] = DiffusionBCfun(xl,ul,xr,ur,t)
c0 = L0;
pl = ul-c0;
ql = 0;
pr = 0;
qr = 1;
end
结束
非常感谢您的帮助!谢谢大家! m代表什么?如果设置t=[0,0.001,0.01,1,10],会发生什么?