
代码如下
close all;
clear;
clc;
h=0.00125;
d=1.5;
muw=1.2;
sgmw=0.2;
mub=8.4823e-9;
sgmb=6.0016e-10;
fai=0;
muy=1e-4;
sgmy=2e-5;
lmd=2.5e-5;
tx=0:1:5000;
syms n
%第一部分
m1=normcdf(d,muw,sgmw);
m4=m1.^n;
%第二部分
mu1=mub.*tx+fai+muy.*n;
sgm1=((sgmb.*tx).^2+lmd.^2.*n).^0.5;
m2=normcdf(h,mu1,sgm1);
%第三部分
m3=(exp(-lmd.*tx).*((lmd.*tx).^n))./factorial(n);
r1=m4.*m2.*m3;
r2=1-symsum(r1,n,0,inf);
plot(tx,r2,'k','LineWidth', 1.5);
set(gca,'FontSize',14,'Fontname','Times New Roman')
xlabel("Time/Day",'fontsize',14,'FontName','Times New Roman','fontweight','bold');
ylabel("R",'fontsize',14,'FontName','Times New Roman','fontweight','bold','Fontangle','italic');
错误信息如下:
错误使用 symengine
Unable to prove '1/800 < n/10000 &
((3022314549036573*n)/4835703278458516698824704)^(1/2) == 0'
literally. Use 'isAlways' to test the statement
mathematically.
出错 sym/subsindex (第 1027 行)
X = find(mupadmex('symobj::logical',A.s,9)) - 1;
出错 sym/privsubsasgn (第 1307 行)
L_tilde2 = builtin('subsasgn',L_tilde,struct('type','()','subs',{varargin}),R_tilde);
出错 索引 (第 1138 行)
C = privsubsasgn(L,R,inds{:});
出错 normcdf>localnormcdf (第 109 行)
p(sigma==0 & x<mu) = 0;
出错 normcdf (第 50 行)
[varargout{1:max(1,nargout)}] = localnormcdf(uflag,x,varargin{:});
出错 CCF3 (第 26 行)
m2=normcdf(h,mu1,sgm1);