Gunnar Andersson
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
3 years ago
2022年1月20日 GMT-5 02:45
I suggest that you add a Filter subnode to the plot and use the following logical expression in the Filter:
(es.Ez >= -1000[V/m]) && (es.Ez <= -990[V/m])
I suggest that you add a Filter subnode to the plot and use the following logical expression in the Filter:
(es.Ez >= -1000[V/m]) && (es.Ez
Please login with a confirmed email address before reporting spam
Posted:
3 years ago
2022年1月20日 GMT-5 04:03
Thanks for the answer, though this doesn't really address my problem. Adjusting the color range does what I want to do, where I'm having problems is automatically calculating the limits (-1000[V/m] and -990[V/m] in the example). If I change a parameter and recalculate the solution so the minimum field value is now -1200[V/m], I want the limits to automatically adjust to -1200[V/m] and -1188[V/m].
Thanks for the answer, though this doesn't really address my problem. Adjusting the color range does what I want to do, where I'm having problems is automatically calculating the limits (-1000[V/m] and -990[V/m] in the example). If I change a parameter and recalculate the solution so the minimum field value is now -1200[V/m], I want the limits to automatically adjust to -1200[V/m] and -1188[V/m].
Gunnar Andersson
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
3 years ago
2022年1月20日 GMT-5 07:37
Try the following:
* Component > Definitions: Add a Nonlocal Couplings > Maximum. Select the domains where you want to compute the maximum.
* Add a Nonlocal Couplings > Minimum in the same way.
* Study > Update Solution: This will add the maximum and minimum couplings defined above.
* You can now use an operator syntax in the Filter to evaluate the maximum and minimum of an expression over the domains selected in the nonlocal couplings. E.g.,
es.Ez >= 0.99maxop1(es.Ez)+0.01minop1(es.Ez)
Here maxop1 and minop1 are the Operator names in the nonlocal couplings.
It is not possible to use these operators in the color range.
Try the following:
* Component > Definitions: Add a Nonlocal Couplings > Maximum. Select the domains where you want to compute the maximum.
* Add a Nonlocal Couplings > Minimum in the same way.
* Study > Update Solution: This will add the maximum and minimum couplings defined above.
* You can now use an operator syntax in the Filter to evaluate the maximum and minimum of an expression over the domains selected in the nonlocal couplings. E.g.,
es.Ez >= 0.99*maxop1(es.Ez)+0.01*minop1(es.Ez)
Here maxop1 and minop1 are the Operator names in the nonlocal couplings.
It is not possible to use these operators in the color range.
Please login with a confirmed email address before reporting spam
Posted:
3 years ago
2022年1月20日 GMT-5 09:17
Hmm, ok, too bad that I can't use these in the color range.
Is it possible to instead use parameters to set these limits? (I have quite a few plots that should use the same limits, so this would be the next best thing.) I managed doing it with model parameters but that is quite cumbersome as I have to first run the simulation, then set the parameters and then update the simulation again to make the new parameter values available for plotting. Adding the parameters to the Results node failed with an "unknown model parameter" error.
Hmm, ok, too bad that I can't use these in the color range.
Is it possible to instead use parameters to set these limits? (I have quite a few plots that should use the same limits, so this would be the next best thing.) I managed doing it with model parameters but that is quite cumbersome as I have to first run the simulation, then set the parameters and then update the simulation again to make the new parameter values available for plotting. Adding the parameters to the Results node failed with an "unknown model parameter" error.
Gunnar Andersson
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
3 years ago
2022年1月20日 GMT-5 09:47
You can use model parameters but not result parameters in the limit in the color range.
To simplify management of limits you can add variables to Component > Definitions > Variables that contain the limits. That way minop and maxop can be confined to one place.
You can use model parameters but not result parameters in the limit in the color range.
To simplify management of limits you can add variables to Component > Definitions > Variables that contain the limits. That way minop and maxop can be confined to one place.
Please login with a confirmed email address before reporting spam
Posted:
3 years ago
2022年1月20日 GMT-5 10:40
Alright, thank you.