Please login with a confirmed email address before reporting spam
Posted:
5 years ago
2019年5月29日 GMT-4 03:41
Updated:
5 years ago
2019年5月31日 GMT-4 17:56
Hi Gustavo,
I had the same problem a while ago, I am interested if you find a good solution.
In my case I realized the double sweep was not needed, but the solution I was experimenting with before that was the following:
- Create a default solver in your study, if its Solver configurations branch is empty
- In the 2nd step, set the Initial values of variables solved for to Physics controlled.
- In the equation of the dependent variable
X
, create a second Initial values entry and set the initial value to withsol('sol_tag', X, setval(p, p))
where sol_tag
in the tag of the solution node for step 1, and p
is the parameter varied in your sweep
- In the 1st step go to Physics and Variables Selection, tick the Modify model configuration for study step and disable in the model the new initial values you just created (otherwise they would override the original initial settings).
- Optionally, to be extra safe: In the 2nd step go to Physics and Variables Selection, tick the Modify model configuration for study step and disable the original initial values.
I have not fully tested this. Please let me know how it goes or if you find a better solution !
Hi Gustavo,
I had the same problem a while ago, I am interested if you find a good solution.
In my case I realized the double sweep was not needed, but the solution I was experimenting with before that was the following:
* Create a default solver in your study, if its **Solver configurations** branch is empty
* In the 2nd step, set the *Initial values of variables solved for* to **Physics controlled**.
* In the equation of the dependent variable `X`, create a second **Initial values** entry and set the initial value to `withsol('sol_tag', X, setval(p, p))` where `sol_tag` in the tag of the solution node for step 1, and `p` is the parameter varied in your sweep
* In the 1st step go to **Physics and Variables Selection**, tick the *Modify model configuration for study step* and disable in the model the new initial values you just created (otherwise they would override the original initial settings).
* Optionally, to be extra safe: In the 2nd step go to **Physics and Variables Selection**, tick the *Modify model configuration for study step* and disable the original initial values.
I have not fully tested this. Please let me know how it goes or if you find a better solution !
Please login with a confirmed email address before reporting spam
Posted:
5 years ago
2019年5月30日 GMT-4 13:35
Updated:
5 years ago
2019年5月30日 GMT-4 13:34
Hi Alexis
Thank you for your response! It worked, with some modifications.
Instead of
withsol('sol_tag', X, getVal(p, p))
it is
withsol('sol_tag', X, setval(p, p))
At least in version 5.4.
If one needs to find it, in a result expression, it is in (along with withsol):
Built in > Operators > Evaluation
Hi Alexis
Thank you for your response! It worked, with some modifications.
Instead of
> withsol('sol_tag', X, **getVal**(p, p))
it is
> withsol('sol_tag', X, **setval**(p, p))
At least in version 5.4.
If one needs to find it, in a result expression, it is in (along with **withsol**):
Built in > Operators > Evaluation
Please login with a confirmed email address before reporting spam
Posted:
5 years ago
2019年5月31日 GMT-4 17:58
Updated:
5 years ago
2019年5月31日 GMT-4 17:59
Glad to see it worked!
I have edited my answer to match your correction, to make it easier for future visitors.
Please let me know if you encounter issue with this, because I am probably going to use it as well. It seems that this solves faster than the alternative I ended up using in my case.
Glad to see it worked!
I have edited my answer to match your correction, to make it easier for future visitors.
Please let me know if you encounter issue with this, because I am probably going to use it as well. It seems that this solves faster than the alternative I ended up using in my case.