Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Extracting sweep and solution properties with matlab livelink
Posted 20 gen 2011, 18:14 GMT-5 RF & Microwave Engineering, Interfacing, Results & Visualization Version 4.0a 1 Reply
Please login with a confirmed email address before reporting spam
I have created a parametric sweep in Comsol, sweeping e.g. frequency or a geometry parameter or many of those and for each setting solving the emw 2D mode.
Now I am postprocessing with Matlab livelink in matlab.
I know how to extract the solution lambda e.g. with mphgetp(name, 'solname', 'sol1') and how to calculate the effective refractive index neff etc.
But my problem is:
I have written a matlab program.
This should extract the settings, sweeped parameter's names and the value ranges from matlab out of the .mph file which I have loaded into a variable in matlab with mphload(filename.mph)
In the manual for livelink on page 41 I can find how to create a parametric sweep with
model.batch.create(...)
But there is no explanation how to get a list of values and name of those sweeped values out of the model again with Matlab?
Also: Is there no way to get the names and number of solutions sol1 to soln from matlab? I unfortunately also cannot find anything about that in the manual...
Does this really mean I always have to look up all this stuff manually in an extra GUI version of comsol, which I do not want to open, and then type in value by value into matlab?
I thought there might be some kind of a "get" command for all these settings. But Matlab always tells me, such a command does not exist, e.g. for model.param.set(...) when trying model.param.get(...)
I do not believe that and I think it is my fault, that I just do not know how to do it.
Maybe someone of you has an advice?
Best regards
Arian
PS: I do not want / I cannot run all my simulations again from Matlab. I just want to evaluate simulations which have taken a lot of time to calculate. Also in the future, I want to run my simulations from Comsol and not from Matlab.
Hello Arian Kirsch
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.