-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Hi,
I am working with a pandapipes network that runs successfully in the normal bidirectional mode using [run_timeseries]. Now, I wanted to try a transient calculation and set the parameter [transient=True] in [run_timeseries]. So my function call changes from:
run_time_series.run_timeseries(net, time_steps, mode='bidirectional, iter=100, alpha=0.6)
to
run_time_series.run_timeseries(net, time_steps, mode='bidirectional, iter=100, alpha=0.6, transient=True)
However, I immediately get the following error in the first time step:
...\Python\Python311\Lib\site-packages\pandapipes\pf\derivative_calculation.py", line 129, in calculate_derivatives_thermal derivatives_termal(node_pit, branch_pit, from_nodes, to_nodes, t_init_i, t_init_i1, t_init_n, cp_i, cp_i1, cp_n, TypeError: expected float64, got None 4%|██▊ | 1/24 [00:00<00:02, 10.63it/s]
To debug, I printed the types and values of all arguments passed to derivatives_termal right before the call:
print("DEBUG:") print("node_pit:", type(node_pit), node_pit is None) print("branch_pit:", type(branch_pit), branch_pit is None) print("from_nodes:", type(from_nodes), from_nodes is None) print("to_nodes:", type(to_nodes), to_nodes is None) print("t_init_i:", type(t_init_i), t_init_i is None) print("t_init_i1:", type(t_init_i1), t_init_i1 is None) print("t_init_n:", type(t_init_n), t_init_n is None) print("cp_i:", type(cp_i), cp_i is None) print("cp_i1:", type(cp_i1), cp_i1 is None) print("cp_n:", type(cp_n), cp_n is None) print("cp:", type(cp), cp is None) print("rho:", type(rho), rho is None) print("dt:", type(dt), dt is None) print("transient:", type(transient), transient is None) print("amb:", type(amb), amb is None)
The output was:
DEBUG: node_pit: <class 'numpy.ndarray'> False branch_pit: <class 'numpy.ndarray'> False from_nodes: <class 'numpy.ndarray'> False to_nodes: <class 'numpy.ndarray'> False t_init_i: <class 'numpy.ndarray'> False t_init_i1: <class 'numpy.ndarray'> False t_init_n: <class 'numpy.ndarray'> False cp_i: <class 'numpy.ndarray'> False cp_i1: <class 'numpy.ndarray'> False cp_n: <class 'numpy.ndarray'> False cp: <class 'numpy.ndarray'> False rho: <class 'numpy.ndarray'> False dt: <class 'NoneType'> True transient: <class 'bool'> False amb: <class 'float'> False
So, the error is caused by the variable dt being None. I am not familiar with what this variable does and how it should be set for transient simulations. Could you please explain what dt is, how it is used in pandapipes, and how I should set it up for transient calculations?
As I couldn't find any documentation about this and no examples, I think this should be explained more transparently.
Best regards
Jonas