如何解决此错误?

3 views (last 30 days)
Bajdar Nouredine
Bajdar Nouredine 2021年8月20日
回答: 达洛娃 2021年8月23日
此代码在R和T方面没有任何问题,但是当我为T和R添加间隔时,它给出了此错误
thanks for helping
b =(2/pi)^(1/2);
R1 = 0.00001;
k=0.42;
CP = 3600;
g = 1000;
rho = 1048;
TB = 37;
QM = 300;
w = 0.0005;
RA = 0.01;
%%
c = w*rho*cp;
r_distance = ra*2;
time_total = 1;
dr=r_distance/10;
DT = 0.1;
rmesh = 0:dr:r_distance;
tmesh = 0:dt:time_total;
rskip = 2;
tskip = 2;
number_iterations = 2;
nr =长度(rmesh);
nt =长度(tmesh);
v =零(nt,nr);
为了i = 1:nt
为了j = 1:nt
为了m=1:number_iterations
q = int((((b*(rp*sqrt(c)))0.5)*sin(sqrt(c)))) - 1)*rp*sin(m*pi*rp),rp,0,1);%的积分r素数从0到1
first_term = symsum(((exp((m*pi)^2+c)*(-tmesh(j)))*sin(m*pi*rmesh(i))*q,m,1,10);%求和
结尾
结尾
结尾
Error使用Sym/Symsum(第52行)
不能compute the sum with respect to '1'. The summation index must be a symbolic variable.
Error在测试中(第36行)
first_term = symsum(((exp((m*pi)^2+c)*(-tmesh(j)))*sin(m*pi*rmesh(i))*q,m,1,10);%求和
7条评论

登录发表评论。

接受的答案

达洛娃
达洛娃 2021年8月23日
您使用的变量与 为了 环形。那就是为什么你有错误

更多答案(0)

社区寻宝

在Matlab Central中找到宝藏,发现社区如何为您提供帮助!

Start Hunting!