You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a simulation starts the initial values of all components are calculated for t=0. Hence, the first simulation step should calculate the results for the time $t=\Delta t$ because the results for $t=0$ are the initial values. However, this is not the case for the voltage sorces. In the first simulation step, voltage sources are stamping in the right side vector the value of $t=0$ and not for $t=\Delta t$ which introduces a one step delay between the voltage sources and all other components of DPsim. This behavior translates to transients in the first steps of the simulation. For examples, in a simple 3 phase RLC circuit (initialized with consistent values) we can observe transients in phase b and c of the current of the capacitor:
This PR ensures that the calculation of the first simulation step means
the calculation of the values for the time instant `t=mTimeStep`, while
`t=0` is covered by the initialization values. This was not consistently
the case, in particular for `EMT::Ph3::VoltageSource`, which caused
corresponding transients at the beginning of some simulations. Moreover,
a small error in the intialization of the EMT Power Transformer is
fixed. Besides, the scaling of voltages and currents has been
harmonised, which is documented now under `docs/Development/Guidelines`.
Closes#195
@dinkelbachjan @gnakti @m-mirz
When a simulation starts the initial values of all components are calculated for t=0. Hence, the first simulation step should calculate the results for the time$t=\Delta t$ because the results for $t=0$ are the initial values. However, this is not the case for the voltage sorces. In the first simulation step, voltage sources are stamping in the right side vector the value of $t=0$ and not for $t=\Delta t$ which introduces a one step delay between the voltage sources and all other components of DPsim. This behavior translates to transients in the first steps of the simulation. For examples, in a simple 3 phase RLC circuit (initialized with consistent values) we can observe transients in phase b and c of the current of the capacitor:
To fix this error, the parameter "time" of the functions EMT::Ph1::VoltageSource::updateVoltage(Real time) and EMT::Ph3::VoltageSource::updateVoltage(Real time) must be updated to
time = time + timestep
.In addition, the log must be adapted accordingly. Currently, the column time of the log files also has a one-step delay, as shown in the table below:
In my opinion, for time 0 we should log the initial values and the column time should not have a one-step delay:
The text was updated successfully, but these errors were encountered: