# How to work with snapshots correctly?

Hello all,

for performance reasons, we have been trying to initialize our network once and then save a snapshot. Afterwards, we are going to run lots (up to hundreds) of simulations based on that snapshot. However, what we encountered so far seems a little strange:

If the simulations starts from the snapshot they are not 100% steady, how they would be if we did the initialization in the same process.

We performed some testing on 5 different ways to run the simulation:

1. reference simulation - just initialize and simulate in one run
2. snapshot at t=-0.002 and no second initialization when running
3. snapshot at t=0.0 and no second initialization when running
4. snapshot at t=-0.002 and second initialization when running
5. snapshot at t=0.0 and second initialization when running

We also defined a simulation error that is defined as the maximum change of a bus voltage during the entire simulation (we would expect the voltage to be constant when there is no fault or other event). This means an error of 0 represents the expected and best behavior.

Using the SAVNW sample case we discovered the following:

• Method 1 is always fastest and has an error smaller than 1e-6
• Method 2 turns instable and has an error around 1.0
• Methods 3, 4 and 5 are similar in runtime and error value. They come pretty close to method 1

Our conclusion so far: Snapshots only work without another initialization if they have simulated at least one timestep.

Then we applied a comparable analysis to our actual grid case which contains lots of custom models. There we realized that method 3 only has an error value around 1e-2 instead of 1e-6. This is something that can be seen in the voltage diagrams that it is slightly fluctuating instead of being steady.

This effect can probably be blamed on the custom models to be not conserve its initialized state with a snapshot file. But these custom models are third party and we cannot fix them.

Therefore, our conclusion is that we do not get the expected advantage from using snapshot files. The only improvement is that we do not need the dyr file for the actual run step and can already prepare our channel definitions.

Runtime wise we do not get any benefit since we need to run init again in every simulation to maintain exact results.

Does anybody know whether this is expected or whether we might be doing something wrong?

This is the init code we use:

n_iteration = 100  # Number of max. iterations
acceleration = 0.30  # acceleration sfactor used in the network solution
tolerance = 0.0001  # Convergence Tolerance
integration_step = 0.001  # Simulation time step[s]

_i = psspy.getdefaultint()
_f = psspy.getdefaultreal()

psspy.fnsl([0, 0, 0, 1, 1, 0, 0, 0])
psspy.dyre_new([1, 1, 1, 1], dyr_file, '', '', '')
psspy.dynamics_solution_param_2([n_iteration, _i, _i, _i, _i, _i, _i, _i],
[acceleration, tolerance, integration_step, _f, _f, _f, _f, _f])
psspy.cong(0)
psspy.conl(0 ...
edit retag close merge delete