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.

Using parameter files, file naming and extraction of results

Please login with a confirmed email address before reporting spam

Hi,

I would like to achiev the following:

- a model has to be solved with ONE varying parameter, e.g. flowrate at the inlet has to take the values "1,2,4,6,7,8"
- after solving for a parameter, several variables, e.g. "'U_mmglf" or "p" have to be integrated over a selected domain using postint (for example "I3=postint(fem,'U_mmglf'....")
- I3 should be written to a textfile with "save filename I3 -ascii"

My problem now is, how to save the integration result for each parameter in a separate file which is named according to the parameter. I thinks this is an easy one, but I am blind to find the right syntax.

Is there any command to write the results for I3=postint(...) into one file, e.g. by appending entries during each step through the parameters " 1,2,4,6,7,8" in the textfile generated?

-------------------------------

Another question is how to read selected parameter pairs from a parameter file?

For example if the entries are {1 5 2 7 3 11} but I would like to select only the pair {2 7} to solve for. The idea is to set up loops according to "for i = 1:nSteps" and somehow use "i" to point to a position in a parameter file and read out the corresponding value pair as input for solving. Is there any solution to this?

Thanks for help!

Matthias


2 Replies Last Post Feb 28, 2011, 7:06 a.m. EST
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 28, 2011, 1:13 a.m. EST
Hi

have you checked the "solve - solver manager - sequence" and/ or "Solve - Parametric Sweep* tab ? With the latter you can generate different files of the solutions

--
Good luck
Ivar
Hi have you checked the "solve - solver manager - sequence" and/ or "Solve - Parametric Sweep* tab ? With the latter you can generate different files of the solutions -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 28, 2011, 7:06 a.m. EST
Hi Ivar,

thanks for your response.

I used the parameteric solving and storing of solutions in separate files in the past. The problem is, that I still had to go into these solution files and do the integration of the subdomains manually to retrieve the values.

Matthias
Hi Ivar, thanks for your response. I used the parameteric solving and storing of solutions in separate files in the past. The problem is, that I still had to go into these solution files and do the integration of the subdomains manually to retrieve the values. Matthias

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.