Please login with a confirmed email address before reporting spam
Posted:
6 years ago
May 29, 2019, 3:41 a.m. EDT
Updated:
5 years ago
May 31, 2019, 5:56 p.m. EDT
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:
6 years ago
May 30, 2019, 1:35 p.m. EDT
Updated:
6 years ago
May 30, 2019, 1:34 p.m. EDT
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
May 31, 2019, 5:58 p.m. EDT
Updated:
5 years ago
May 31, 2019, 5:59 p.m. EDT
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.