| 查看: 1008 | 回复: 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 大概能明白是区域不能这样选中,求问有什么解决办法没 |
» 猜你喜欢
科研人应该花精力去思考如何解决问题,而不是去凝练问题
已经有5人回复
梦想
已经有8人回复
有多少人是今天查系统知道结果的?
已经有19人回复
面上合作单位盖章
已经有9人回复
面上函评意见出来了,像什么等级?
已经有17人回复
为什么国自然不能直接公布
已经有5人回复
学科评审组评审是指会评吗?
已经有4人回复
为什么资助数各大高校都创新高,自己申请怎么就这么难
已经有14人回复
小白求助 投论文要求的highlights应该如何写
已经有4人回复
麻烦专家们看看评委们的意见(F口面上)
已经有12人回复










回复此楼
投票:
20