24小时热门版块排行榜    

查看: 931  |  回复: 0

退二进一

新虫 (初入文坛)

[求助] 求助,如何在MATLAB里对区域赋属性

目前在comsol里做关于地下渗流的问题,现在把模型划成50*50的区域,想用下面这个循环在MATLAB里给区域赋上不同渗透率
42 for i=2:2500
43   k(i)=(1e-11)*rand;
44   eval(sprintf(\'model.component(\'\'comp1\'\').physics(\'\'dl\'\').create(\'\'dlm%u\'\', \'\'DarcysLawModel\'\', 2)\',i));
45   eval(sprintf(\'model.component(\'\'comp1\'\').physics(\'\'dl\'\').feature(\'\'dlm%u\'\').selection.set([%u])\',i,i));
46   eval(sprintf(\'model.component(\'\'comp1\'\').physics(\'\'dl\'\').feature(\'\'dlm%u\'\').set(\'\'rho_mat\'\', \'\'userdef\'\')\',i));
47   eval(sprintf(\'model.component(\'\'comp1\'\').physics(\'\'dl\'\').feature(\'\'dlm%u\'\').set(\'\'rho\'\', 1000)\',i));
48   eval(sprintf(\'model.component(\'\'comp1\'\').physics(\'\'dl\'\').feature(\'\'dlm%u\'\').set(\'\'mu_mat\'\', \'\'userdef\'\')\',i));
49   eval(sprintf(\'model.component(\'\'comp1\'\').physics(\'\'dl\'\').feature(\'\'dlm%u\'\').set(\'\'mu\'\', 0.001)\',i));
50   eval(sprintf(\'model.component(\'\'comp1\'\').physics(\'\'dl\'\').feature(\'\'dlm%u\'\').set(\'\'epsilon_mat\'\', \'\'userdef\'\')\',i));
51   eval(sprintf(\'model.component(\'\'comp1\'\').physics(\'\'dl\'\').feature(\'\'dlm%u\'\').set(\'\'epsilon\'\', 0.2)\',i));
52 end
运行到这句  eval(sprintf(\'model.component(\'\'comp1\'\').physics(\'\'dl\'\').feature(\'\'dlm%u\'\').selection.set([%u])\',i,i));就出错,报错显示是
错误使用 Fracture1 (line 45)
Java exception occurred:
Exception:

        com.comsol.util.exceptions.FlException: java.lang.IllegalArgumentException:
    Illegal input vector illegal entity number

Messages:

        java.lang.IllegalArgumentException: Illegal input vector illegal entity number
大概能明白是区域不能这样选中,求问有什么解决办法没
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 退二进一 的主题更新
信息提示
请填处理意见