Updating initial values in fsolve

Hi,

I’m using fsolve in an external steady_state file with initial values for 10 variables and it is working. However, I want to increase the speed of estimation. Is it possible to update these initial values after each steady state computation with the new steady state values?

Thanks in advance,
Baris

In principle, you could try to set a persistent variable storing the last values or alternatively, use the currently stored steady state values that should be contained in ys.

Thank you very much. Is there an easy way to pass the currently stored ys values to the next steady state computation?

From what I can see, that should automatically happen.

When I write initial values of the variables from ys in fsolve, I cannot find the steady state at the beginning. I think it is because ys is initially set to 0. Is there a way where I set the first initial values manually and then update them with ys automatically?

The output it’s giving you says that the solver stopped because it reached its iteration limit. I.e., it never actually reached a solution. If it never converged, there’s no reason to expect that different starting points would lead you to the same output. It sounds like you need to increase the iteration limit.

Set the initial values via initval.

That works. Thank you very much!

I think it is because ys is initially set to 0. Is there a way where I set the first initial values manually and then update them with ys automatically?.

.

Where exactly do you need to update them?