CURENT / andes

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

variable wt in 'wtdta1.py' is not set up as the type <y> #297

Closed Wenqi-Cui closed 2 years ago

Wenqi-Cui commented 2 years ago

Describe the bug A clear and concise description of what the bug is. run TDS for the case 'ieee14_wt3n.xlsx' and find the error

TypeError: ExtVar is of type , but source Vars may not.

After checking the source code, it looks like the variable wt in 'wtdta1.py' is not set up as the type . I tried to fix this issue but have not debugged through it in developer mode. Hopefully this issue might be easier to fix on your side. Thank you very much for your efforts in developing the code!

To Reproduce Steps to reproduce the behavior:

  1. Go to '1.2 demo_DGPRCTExt. ipynb'
  2. substitute the case to be 'ieee14/ieee14_wt3n.xlsx
  3. ss.TDS.run()
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

**pip packages (please paste the output from pip list)

Additional context Add any other context about the problem here.

cuihantao commented 2 years ago

Thanks for reporting the issue! I can replicate it. Working on a fix.

cuihantao commented 2 years ago

Just pushed an update to my develop branch. The issue is fixed, but the ieee14_wt3n.xlsx model won't run yet due to an issue with the WTTQA1 model.

It now works without WTTQA1. You can use ieee14_wt3.xlsx (not wt3n) and remove the WTTAQ1 sheet.

I'm hoping to fix WTTQA1 in the week.

Wenqi-Cui commented 2 years ago

Hi Dr. Cui,

Thanks a lot for the prompt fix! Now I realized that setting wt as StateVar in wtpta1.py is more direct and reasonable than changing the type in wtdta1.py. It is also great that WTTQA1 is scheduled to be fixed. Thank you for all the help!

Best wishes,

Wenqi

cuihantao commented 2 years ago

Another fix was pushed to develop for the initialization of WTTQA1.

There is a tricky issue with the Type 3 wind models. When WTTQA1 exists, plant control REPCA1 output should be redirected to WTTQA1 from REECA1 but has not been done yet. The solar model/Type 4 wind model, which only uses REGCA1, REECA1, and REPCA1 should be fully working.

cuihantao commented 2 years ago

I need to walk back from the previous comment. In Powerworld's docs, the output of REPCA1 is Pext, which appears to be intentionally named differently from Pref. The output of Pext at steady-state is zero, meaning the Pext is an external delta signal to Pref.

With this, the Type 3 wind models should be correct with or without WTTQA1 or REPCA1.

Let me know if you find other issues.

Wenqi-Cui commented 2 years ago

Hi Dr. Cui,

Thank you very much for the prompt revisions! My understanding of the modules are based on the WECC Type 3 wind model shown in this link. It looks like the output Pext of REPCA1 is the adjustment of the active power setpoint according to the frequency deviation. So its value should be zero at the steady state and the current setup makes sense. One issue I noticed is that P_plant in REPCA1 is set to be equal to Pline. It might be reasonable to set it as a signal that allows external adjustment, which is similar to the function of pref0 in pvd1.

I tried to run "ieee14_wt3.xlsx" and find it works well. I can also run TDS for "ieee14_wt3n.xlsx", but it cannot converge and the screenshot is as follows. image

It might be resulted from the setup of modules in Type3 Wind model, which is more tricky to be tuned. Thanks a lot for your efforts in fixing the bugs!

Best wishes,

Wenqi

cuihantao commented 2 years ago

The issue in ieee14_wt3n.xlsx is fixed. The system was fully renewable, meaning that all static generators were replaced by solely RE-series models. These renewable models are grid-following models and, as a result, don't have the capability to control voltage angles. If no model controls the angle, the implicit reference angle will drift.

I added a small generator in ieee14_wt3n.xlsx and made it pass. The numerical result looks good, but the applicability of the model remains questionable because these grid-following converters are tied to a weak grid.

Wenqi-Cui commented 2 years ago

Hi Dr. Cui,

Thank you very much for all the help in fixing the bugs and answering questions related to the package!

Best wishes,

Wenqi

On Fri, Mar 25, 2022 at 7:23 AM Hantao Cui @.***> wrote:

Closed #297 https://github.com/cuihantao/andes/issues/297.

— Reply to this email directly, view it on GitHub https://github.com/cuihantao/andes/issues/297#event-6307679058, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ2UNH5AOMK3LL4RTQZZJJTVBXD6XANCNFSM5QXWNHPQ . You are receiving this because you authored the thread.Message ID: @.***>

-- Wenqi Cui Ph.D. Student Department of Electrical and Computer Engineering University of Washington Email: @.***