Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 5773

COMSOL with matlab always stop looping

$
0
0

DERA All, I use COMSOL with matlab to run my model with a for-loop (change some parameters every time) . But, when the loop time achieved about 15, it will be ended, and says my computer's memory is not enough. What I can do is to close the matlab, and restart COMSOL with matlab, and re-run the matlab code form where it ends, and after about 15 times loop, it comes again. The code I used is bellow:

  import com.comsol.model.*
  import com.comsol.model.util.*
  model = mphload("doubleCly.mph");
  %%use for-loop  
  coefficient_log(60,400) = 0;
  k = 1;
  disp(k);
  for j = 4:1:10
      for i = 10:1:42
          clear model;
          model = mphload("doubleCly.mph");
          model.param.set("begin",num2str(j));
          if(k < 1)
              k = k + 1;
              disp(k);
          else
              model.param.set("factor",num2str(i));
              model.sol("sol1").run;
              coefficient_log(:,k) = mphglobal(model,"Alpha");
              mphsave(model,strcat(strcat("DoubleCly-",num2str(j)),strcat("-",num2str(i))));
              k = k + 1;                                                                                                                           
              disp(k);
          end
      end
  end

And, the problem described by COMSOL is bellow:

  Java exception occurred:
  Exception:
  com.comsol.util.exceptions.FlException: The following feature has encountered a problem
  Messages:
  以下特征遇到问题:
  - 特征: 稳态求解器 1 (sol1/s1)
  找不到解。
  执行稀疏矩阵操作时内存不足。
  返回的解不收敛。
  没有返回所有参数步长。
  Stack trace:
  at com.comsol.solver.SolverOperation.execute(SourceFile:284)
  at com.comsol.solver.SolverOperation.addError(SourceFile:442)
  at com.comsol.solver.SolverOperation.execute(SourceFile:292)
  at com.comsol.model.method.SolverSequenceMethod.doRun(SourceFile:2168)
  at com.comsol.model.method.SolverSequenceMethod.doRun(SourceFile:2710)
  at com.comsol.model.dbmodel.SolverSequenceDb.run(SourceFile:186)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at com.comsol.bridge.command.b.a(SourceFile:145)
  at com.comsol.bridge.command.b.run(SourceFile:90)
  at com.comsol.bridge.command.i.execute(SourceFile:45)
  at com.comsol.bridge.command.j.d(SourceFile:711)
  at com.comsol.bridge.command.j.a(SourceFile:699)
  at com.comsol.bridge.command.j$3.a(SourceFile:600)
  at com.comsol.bridge.command.j$3.call(SourceFile:1)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  at java.lang.Thread.run(Thread.java:748)

Can somebody help me ? Thanks!


Viewing all articles
Browse latest Browse all 5773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>