CURENT / andes

Python toolbox / library for power system transient dynamics simulation with symbolic modeling and numerical analysis 🔥
https://ltb.curent.org
Other
208 stars 108 forks source link

TDS Convergence is not likely. #424

Closed xiaojiangsi closed 5 months ago

xiaojiangsi commented 1 year ago

Based on kundur_full.xlsx, I set the fault start from 1.0s to 1.1s at bus 1, and when I run the tds, it shows the information as follow:

Time step reduced to zero. Convergence is not likely. Simulation terminated at t=1.1000 s.

I wonder why this would happen, how I get the result under the above situation (Based on kundur_full.xlsx, I set the fault start from 1.0s to 1.1s at bus 1).

cuihantao commented 1 year ago

I was able to replicate this isse. It is due to the non-convergence of post-fault equations using the pre-fault values as the initial values.

One temporary solution is to scale the initial values to the post-fault equations by setting ss.Fault.config.scale.

import andes

andes.config_logger(20)

%matplotlib inline

ss = andes.run("kundur_full_fault.xlsx")

xy = ss.TDS.init()

ss.Fault.config.scale = 1.8
ss.TDS.run()

ss.TDS.plt.plot(ss.Bus.v)

kundur_full_fault.xlsx

xiaojiangsi commented 1 year ago

I tried the above and it works under the situation of fault start from 1.0s to 1.1s at bus 1. But in other situations which don't need change the scale can be converged, after set the scale at 1.8, it is not work. Could you tell me how to adjust the scale in different scenarios? What is the usage of scale? for example when I alter the tc to 1.05, the scale change doesn't work: image

image

cuihantao commented 1 year ago

When a fault gets cleared, algebraic variables change drastically. E.g., voltages can go from nearly zero back to 1.0. As we are using Newton's method for solving the DAE, the initial values are crucial for the immediate step after fault clearance.

What's done in ANDES is the restoration of pre-fault algebraic variables. ss.Fault.config.scale is the scaling factor for the pre-fault algebraic variables for adjusting the initial values. There is no theory about adjusting the initial value; some trial and error are expected for severe disturbances, like the one on Bus 1 where there is a generator. See here: https://github.com/CURENT/andes/blob/e4d1c274129d2e1ff0287ade895625f633b9c640/andes/models/timer.py#L208.

xiaojiangsi commented 1 year ago

Thanks for your answer.