Ask Your Question

pschmurr's profile - activity

2019-08-21 01:03:22 -0500 received badge  Famous Question (source)
2019-08-13 10:29:14 -0500 received badge  Notable Question (source)
2019-08-12 01:54:25 -0500 commented question How to work with snapshots correctly?

I would say that depends on the use case. If you do not have issues with custom DLLs then the snapshot approach can reduce the time for each simulation. Another use case example: You could also take a snapshot within a fault to see how different strategies to handle it are working out.

2019-08-09 12:34:47 -0500 received badge  Student (source)
2019-08-09 07:57:24 -0500 received badge  Popular Question (source)
2019-08-08 06:36:01 -0500 received badge  Organizer (source)
2019-08-08 06:35:38 -0500 asked a question 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.read(0, raw_file)
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 ...
(more)
2019-08-08 02:12:34 -0500 received badge  Editor (source)
2019-08-08 02:10:48 -0500 answered a question Create DLL using Python

You can use the python module of the environment manager.

import psse_env_manager
import os

psse_version = 34
src1 = 'model.f90'
modsources = ['module.f90']
dllname = 'dsusr.dll'
workdir = os.getcwd()
ivf_version = '19'

psse_env_manager.create_dll(psse_version, src1, modsources=modsources, dllname=dllname,
   workdir=workdir, showprg=True, useivfvrsn=ivf_version, shortname='DSUSR',
   description='description', majorversion=1, minorversion=0, buildversion=0, companyname='',
   mypathlib=False)

However, you will also need visual studio build tools to actually build the dll. This is the problematic part for me since psse_env_manager will not recognize my visual studio 2017 Installation when I import the module like above.

The error in my case is something like <"\vswhere.exe" file not found> I don't know why this happens in my case and why there is that strange backslash in front of the file path.

I still hope it works for you.