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 data from comsol to matlab through mphinterp
Posted 27.11.2012, 09:00 GMT-5 RF & Microwave Engineering, LiveLink for MATLAB Version 4.2a 2 Replies
Please login with a confirmed email address before reporting spam
Hello,
I have implemented the mphinterp function but when I want to extract results for different parameters something goes wrong.
My typical comsolfiles look something like this:
- In the Study section I have Step1: Boundary Mode Analysis and in Step 2: Frequency Domain Analysis (and in front of these two a Parametric sweep)
- I have 3 data sets in the Result section : Solution 1, Solution 2, Solution 3 and Solution 3 is the one that contains the parametric sweep (e.g. 24 different parameter combinations)
In my MATLAB file I have a for loop that loops over all parameter numbers
for i=1:nr_param
...
mphinterp(model1,'emw.normE','coord',grid3D,'Dataset','Solution 3','Solnum',i);
...
end
I extract emw.normE from model1 for a given grid3D. I select the dataset Solution3 and in 'Solnum' I select each time another parameter i (determined by the for loop). But it already errors with Solution 3. If I only put
mphinterp(model1,'emw.normE','coord',grid3D,'Solnum',i);
then I can extract one parameter, but from the second one it again errors.
Could somebody please tell me what is going wrong in the above scheme. So how can I exactly say matlab that I want to extract emw.normE from Solution 3 and that it only extracts one parameter at a time?
Thanks in advance,
F.Peyskens
I have implemented the mphinterp function but when I want to extract results for different parameters something goes wrong.
My typical comsolfiles look something like this:
- In the Study section I have Step1: Boundary Mode Analysis and in Step 2: Frequency Domain Analysis (and in front of these two a Parametric sweep)
- I have 3 data sets in the Result section : Solution 1, Solution 2, Solution 3 and Solution 3 is the one that contains the parametric sweep (e.g. 24 different parameter combinations)
In my MATLAB file I have a for loop that loops over all parameter numbers
for i=1:nr_param
...
mphinterp(model1,'emw.normE','coord',grid3D,'Dataset','Solution 3','Solnum',i);
...
end
I extract emw.normE from model1 for a given grid3D. I select the dataset Solution3 and in 'Solnum' I select each time another parameter i (determined by the for loop). But it already errors with Solution 3. If I only put
mphinterp(model1,'emw.normE','coord',grid3D,'Solnum',i);
then I can extract one parameter, but from the second one it again errors.
Could somebody please tell me what is going wrong in the above scheme. So how can I exactly say matlab that I want to extract emw.normE from Solution 3 and that it only extracts one parameter at a time?
Thanks in advance,
F.Peyskens
2 Replies Last Post 07.01.2013, 04:35 GMT-5