| 查看: 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 大概能明白是区域不能这样选中,求问有什么解决办法没 |
» 猜你喜欢
拟解决的关键科学问题还要不要写
已经有8人回复
26申博
已经有3人回复
存款400万可以在学校里躺平吗
已经有22人回复
最失望的一年
已经有4人回复
国自然申请面上模板最新2026版出了吗?
已经有19人回复
请教限项目规定
已经有3人回复
基金委咋了?2026年的指南还没有出来?
已经有10人回复
基金申报
已经有6人回复
推荐一本书
已经有13人回复
疑惑?
已经有5人回复













回复此楼