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
Posted 27 feb 2011, 09:12 GMT-5 Results & Visualization Version 3.5a 2 Replies
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
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 28 feb 2011, 07:06 GMT-5