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 values from a text file
Posted 24 ago 2009, 11:57 GMT-4 8 Replies
Please login with a confirmed email address before reporting spam
im trying to use a parametric solver with a text file containing the values. However, the solver immediately gives an error saying "Error 7096: parameter list must be strictly monotone". Can anyone shed light on this?
Best regards,
Adam
Please login with a confirmed email address before reporting spam
you can generate the same error message inside the GUI if you enter a non-monotonus series such as 1,2,3,6,4,5 : COMSOL will not accept to jump"back" from 6 to 4, neither not 1,2,3,3,4,5 the ...3,3... is one repetition too much.
So by some way either the values or the fomatting get's COMSOL to interprete your text data as a series not respecitng a striclty positive growth
I do not know of any other case, but comsol support might have more to say
Good luck
Ivar
Please login with a confirmed email address before reporting spam
i didnt know what monotone meant in regard to a list of numbers but I see now. I have a model with 3 physical parameters that I have assigned a number of possible values, and I want to solve the model for every possible combination of those values.
I want to use parameters something like this:
1 1 1
2 1 1
3 1 1
1 2 1
...etc
but it seems its not possible as the list becomes non-monotonous. Should I look into using matlab with the comsol script?
Thanks,
Adam
Please login with a confirmed email address before reporting spam
I'm not sure that the parameter works with lists and several values, even if in COMSOL functions shall be written "array" compatible, for postprocessing one cannot enter an array, even if it could be usefull (and logical) to ask for u,v,w in one go.
I have aleady submitted this request of array postprocessing values to COMSOL and they accepted that it was a good idea, hope they manage to get it implemented in next version, we will see.
In the mean time you might get around by manually using the "Solve - Parametric Sweep", in addition to "Solve - Solve Parameter - Parametric", and define two separate variables, and then manually scan through the combinations you need. Clearly you will end up with quite many files.
A script is probably the easiest, as you can directly add your postreatment and probably reduce your data out
Have fun
Ivar
Please login with a confirmed email address before reporting spam
I've begun trying to use Matlab to achieve my aim, although my knowledge is very rudimentary. Its going fairly well, but Im stuck on a particular part. I want to use a for loop on the m-file, each time returning a z-coordinate where the variable (concentration 'c' in this case) falls to a particular level on a specific boundary. I can use postinterp to return the c values on that boundary (in a roundabout way), but from there Im having difficulty obtaining the z-coordinate where c equals the particular value. I have tried using postmin(fem, c-value) but its not working. Any suggestions would be greatly appreciated!
Thanks again,
Adam
Please login with a confirmed email address before reporting spam
The way I understand postinterp and posteval (the other access point to the results via matlab) is that the first one gives you the resultig values at your own "interpolated" mesh points, while the latter returns the results at the actual mesh points, on a particular domain or edge.
If you are looking for the Z coordinate, I beleive you are better getthing there with the posteval. The return structure (see the command.pdf) is giving you access to the different elements by indexes, try the function first on a simple case with few items until you feel comfortable with the approach, otherwise you might get the feeling I often had, being lost in the complexity of index and index to index ...
I believe I have seen somewhere an description of your need, but I cannot just now remember if it is in one of the books/.pdf or in one of the courses I have followed.
Good luck
Ivar
Please login with a confirmed email address before reporting spam
"When solving for several parameters, the list must be monotonic in the first parameter. Enter the list as a vector where the parameter sets are stored consecutively. For example, if there are two solver parameters, the entry 0 5 2 3 4 8 in the Parameter values edit field means that the parametric solver is called with the parameter-value pairs (0, 5), (2, 3), and finally (4, 8). For three solver parameters, the same list would correspond to the parameter sets (0, 5, 2) and (3, 4, 8). To avoid the constraint that the list must be monotonic in the first parameter, you can use a dummy variable as the first parameter. If you want to use the parameter-value pairs (7, 8), (4, 12), and (1, 6), for example, add an unused dummy parameter, say p0, first in the Parameter names edit field. Then use the entry 1 7 8 2 4 12 3 1 6 in the Parameter values edit field. The parametric solver then uses the parameter sets (1, 7, 8), (2, 4, 12), and (3, 1, 6), where the first value in each set applies to the first parameter, p0, which is a dummy parameter that does not appear in the model settings.
You can also use the Load Parameter Values From File option. This option loads the values from a text file into the Parameter values edit field. In this text file, the parameter sets must be listed row-wise with the values in each set separated by a space or tab."
So you cannot input them as a matrix, but you have to from the combinations yourself and list them all after each other on one line.
Best regards,
Maarten.
Please login with a confirmed email address before reporting spam
Thanks for the precision, it's true that several parameters/GUI fields can be entered as lists (but by far not all), I had not noticed, nor remebered, that this applies for the parameter field too. Nice work around too.
I hope COMSOL could either make all list accept paramters (i.e. for the postprocessing too), or to "flag" them with an optional [ ] or something like that, it would help us to remember where we must use scalars and where vectors/arrays might be accepted
Thanks again
Ivar
Please login with a confirmed email address before reporting spam
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
- BLOG New Functionality for Buckling Analysis in {:comsolmph}
- FORUM Auxiliary sweep - parameter list values
- KNOWLEDGE BASE Running parametric sweeps, batch sweeps, and cluster sweeps from the command line
- KNOWLEDGE BASE Improving Convergence of Nonlinear Stationary Models
- BLOG How to Build Geometries from Elevation Data to Model Irregular Shapes