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.
Postprocessing Variable Access
Posted Feb 2, 2011, 7:46 a.m. EST RF & Microwave Engineering, Studies & Solvers 9 Replies
Please login with a confirmed email address before reporting spam
I will be grateful if someone could help.
Please login with a confirmed email address before reporting spam
I did not work with the RF module so far, but I already accessed solutions of models in Matlab.
In Matlab, you should add the path /COMSOL_INSTALLATION_PATH/Comsol41/mli
Then execute: mphstart
You might have to do this as well:
import com.comsol.model.*
import com.comsol.model.util.*
Finally, in Comsol: File -> Export Model to Server
In Matlab: model = ModelUtil.model('NAME'); where NAME is the name you assigned when exporting from Comsol.
Now you can access any variables of the solution of your model with:
model_data = mpheval(model, 'VARIABLE', 'edim',3, 't',1000,'Solnum',1,'refine',1); where VARIABLE is the variable you want to access.
(you should adjust this command to your needs).
Hope this helps,
Juergen
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
If I remember correctly, you don't have to add a path in matlab then.
You can export the fem structure and it should appear in your matlab workspace then.
The command you might use to access the variables could be "postinterp" for example.
I don't remember the syntax, but maybe you find an explanation in the comsol documentation of the matlab interface.
Good luck,
Juergen
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
in v4.1 I find it rather easy and very instructuve to do RF/optics calculations, but I agree you need a very dense mesh, and a powerfull PC
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Any help in resolving this issue is welcomed.
Thanks
Please login with a confirmed email address before reporting spam
And me, that is so pleased with COMSOL as it is so much easier to use, and more powerfull, not to say cheaper than the heavy but excellent, well known FEM programme I used before ! Obviously it all depends from where we come and what we are doing.
Unfortunately I connot really help much for your issue, as I have dropped 3.5 for more than a year now, and with V4 I do not need matlab any more (and the new way to interface Matlab requires time that I do not have had yet, to learn it all over again). I agree that this is annoying, but on the other side, COMSOL can do so many things that no other software can, that I know about, that it is just marlvellous to use (for me ;). each day I'm saying to myself: what if I had had something like that 30 years ago when I was studying physics !
So I believe you should go through the doc again, in V4 you have also the "table export" direct into a txt file or an Excel file
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
I use comsol 3.5 and I don't know the command to extract n_eff from RF module but with fem structure, I think it is quite easy. Just extract sol from fem.sol.lambda for example and calculate n_eff via beta/k0. Anyway, you can access to all variables solution in fem.sol.
Regards
Please login with a confirmed email address before reporting spam
all that is getting very old, I do remember there was something in one of the doc, or the model library examples exactly on n_eff. but I'm also almost sure we discussed this on the FORUM a couple of years ago. have you tried a search with n_eff ?
--
Good luck
Ivar
Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.
Suggested Content
- FORUM How to access the number of elements in each oscillation
- BLOG A Practical Implementation of Multiphysics Topology Optimization
- BLOG Different Ways to Count Particles in COMSOL Multiphysics
- BLOG How to Use the Boundary Element Method in Acoustics Modeling
- KNOWLEDGE BASE My Flux Calculation Seems Wrong