Skip to content

Transformers #1269

Closed
Closed

Description

@mikofski

problem
As an energy analyst, I need to know energy at point of interconnect, and that includes detailed transformer efficiency and losses, as well as ac collection losses and curtailment

solution
A transformer load / no-load model

alternatives
Roll your own, but then this risks everyone using slightly different, possibly flawed models, precisely one of the issues pvlib tries to solve

Additional context

Activity

  1. adriesse commented on Aug 27, 2021

    @adriesse
    Member

    I think this would be a nice addition. The modelling is relatively easy and spec sheets often have the needed info.

  2. kurt-rhee commented on May 10, 2024

    @kurt-rhee
    Contributor

    Hey @mikofski,

    @kevinsa5 and @AdamRJensen brought this up during the PVPMC pvlib session. I'd like to take a stab at it if there are no objections. PlantPredict uses this very simple model from McCann, Lawrence , ABB Electrical Transmission and Distribution Reference, P.101.

    https://terabase.atlassian.net/servicedesk/customer/portal/3/article/1292304413

  3. kurt-rhee commented on May 10, 2024

    @kurt-rhee
    Contributor

    I would also like to write a blog post that documents how to create a pull request for a pvlib upgrade using the transformer model as a real world example.

  4. mikofski commented on May 10, 2024

    @mikofski
    MemberAuthor
  5. kurt-rhee commented on May 11, 2024

    @kurt-rhee
    Contributor

    Mark those are awesome references, I will definitely riff off of them.

  6. kandersolar commented on May 13, 2024

    @kandersolar
    Member

    @kurt-rhee that would be great! FYI I skimmed around a bit in the reference but did not find the equation from the PlantPredict docs. For the pvlib function, we should cite a particular equation number or something to make it easier to find.

  7. mikofski commented on May 14, 2024

    @mikofski
    MemberAuthor

    here is the SolarFarmer equation. I don’t know the reference. Is it similar to Plant Predict?

  8. kurt-rhee commented on May 14, 2024

    @kurt-rhee
    Contributor

    @kandersolar That is unfortunate, I looked through it as well and there is no mention of the equations that are in PlantPredict's documentation. I've also asked around internally and none of our EE's are familiar with the equation. Looking at the commit history, the function was last edited back in 2017 so whichever performance engineer wrote the spec for that code is likely long gone.

    As for the path forward, I could upload the PlantPredict documentation to zenodo, or if that isn't sufficient for this type of work, I have reached out to First Solar to see if any of their engineers are familiar with the function.

  9. kurt-rhee commented on May 14, 2024

    @kurt-rhee
    Contributor

    @mikofski Looks like SolarFarmer and PlantPredict have different models for transformer losses.

    image

  10. mikofski commented on May 15, 2024

    @mikofski
    MemberAuthor

    @kurt-rhee I did a test and actually they’re identical!
    Transformers.xlsx

    They’re just algebraic manipulations of each other. Now who knows the reference? Is this just common power electronics? Maybe any textbook?

  11. kandersolar commented on May 15, 2024

    @kandersolar
    Member

    I think it's possible to derive them based on definitions inspired by the load and no-load losses described in that ABB reference. It would still be nice to have a more explicit reference though. Here is the outline (note: all quantities in the following are normalized to the rated power of the transformer):

    Assume load loss is proportional to the square of output power:

    $$\begin{aligned} L_\mathrm{load}(P_{\mathrm{out}}) &= L_\mathrm{load}(P_{\mathrm{rated}}) \cdot P_{\mathrm{out}}^2 \\\ &= L_\mathrm{full\,load} \cdot P_{\mathrm{out}}^2 \end{aligned}$$

    Total loss is the variable load loss, plus a constant no-load loss:

    $$ \begin{aligned} L_\mathrm{total}(P_{\mathrm{out}}) &= L_\mathrm{no,load} + L_\mathrm{load}(P_{\mathrm{out}}) \\ &= L_\mathrm{no,load} + L_\mathrm{full,load} \cdot P_{\mathrm{out}}^2 \end{aligned} $$

    Conservation of energy:

    $$ \begin{aligned} P_{\mathrm{in}} &= P_{\mathrm{out}} + L_\mathrm{total}(P_{\mathrm{out}}) \\ &= L_\mathrm{no,load} + P_{\mathrm{out}} + L_\mathrm{full,load} \cdot P_{\mathrm{out}}^2 \end{aligned} $$

    Now use quadratic formula to solve for $P_{\mathrm{out}}$ as a function of $P_{\mathrm{in}}$:

    $$ P_{\mathrm{out}} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}, $$

    where

    $$ \begin{aligned} a &= L_\mathrm{full,load} \\ b &= 1 \\ c &= L_\mathrm{no,load} - P_{\mathrm{in}} \end{aligned} $$

    So:

    $$ P_{\mathrm{out}} = \frac{-1 \pm \sqrt{1 - 4L_\mathrm{full,load}(L_\mathrm{no,load} - P_{\mathrm{in}})}}{2L_\mathrm{full,load}} $$

    (the positive root must be the correct one, if $P_{\mathrm{out}}$ is to be positive)

  12. 2 remaining items

  13. adriesse commented on May 16, 2024

    @adriesse
    Member

    I think it would be best to reference an introductory electrical engineering text for the simplification of the losses as:

    • constant core losses, plus
    • quadratic winding losses

    I've thrown out my textbooks decades ago, but I assume they still teach it so I hope some young engineer can suggest one.

    The total loss is a vertically shifted parabola. Spec sheets give two points on that parabola, so you use these points to solve for the two coefficients of the parabola/transformer model, which we could call k_core and k_winding.

    I think that all the calculations that go directly from specs to simulation needlessly and unfortunately obfuscate what is actually happening.

  14. kurt-rhee commented on May 16, 2024

    @kurt-rhee
    Contributor

    @adriesse An introductory electrical engineering text would be really nice I agree.

    Would you be okay if I wrote a first version and created a PR with a reference to the worse text cited above along with Kevin's derivation just so that pvlib has some transformer model? My personal feeling is that a model with a not very good reference is better than no model at all, and we can always update the reference in the future.

  15. kurt-rhee commented on May 16, 2024

    @kurt-rhee
    Contributor

    @mikofski and @kandersolar

    Seriously bravo thank you for all of the work you guys did.

  16. echedey-ls commented on May 16, 2024

    @echedey-ls
    Member

    I hope some young engineer can suggest one.

    It's my time to shine! I'll drop my two cents here: the only English book I see recommended in the subject I had regarding them, is Electric machinery fundamentals. Stephen J. Chapman.. Luckily it's easy to find freely on the Internet. Relevant section is 2.7, subsection "Transformer Efficiency", first equation is 2-65, p. 122 of the PDF, 102 of the textbook. Maybe it's a bit old, but I think it does the trick.

  17. kurt-rhee commented on May 17, 2024

    @kurt-rhee
    Contributor
  18. mikofski commented on May 17, 2024

    @mikofski
    MemberAuthor

    @echedey-ls & @kurt-rhee sorry I don’t understand the textbook reference. I can’t see how to manipulate it to the same form as @kandersolar derivation, Plant Predict, or SolarFarmer.

  19. echedey-ls commented on May 17, 2024

    @echedey-ls
    Member

    I see your point @mikofski . I understood from @adriesse comment were looking for a didactic reference, not an explicit reference with the same equations. Textually, the book states some losses are constant and other losses are quadratic with the current. The following changes explain @kandersolar first equation:

    $$ P_{in} = P_{Cu} + P_{core} + V_S I_S cos \theta = P_{Cu} + P_{core} + P_{out} $$

    $P_{Cu}$ relationship with output power is:

    $$ P_{Cu} = I_{out}^2 R = \left( \frac{P_{out}}{V_{out}} \right) ^2 R \stackrel{V_{out}\approx constant}{=} P_{out}^2 \cdot k_{Cu}$$

    Notation is different; how to determine $L_{full,load} \enspace\text{or}\enspace k_{Cu}$ is a matter of solving for it in the first equation.

    Thanks for putting the image @kurt-rhee , sometimes I forget the most obvious features of github 💀

  20. kandersolar commented on May 22, 2024

    @kandersolar
    Member

    I think that all the calculations that go directly from specs to simulation needlessly and unfortunately obfuscate what is actually happening.

    I do not see a way to simplify or meaningfully separate the math shown above. If the copper loss was defined to be proportional to $P_{in}^2$ then the equations would surely be much cleaner. But the only way to arrive at the SolarFarmer and PlantPredict model was to assume that the copper loss was instead proportional to $P_{out}^2$, requiring the nasty quadratic formula to solve for $P_{out}$.

    If you have a cleaner way, I would be quite happy to see it!

  21. adriesse commented on May 23, 2024

    @adriesse
    Member

    I'm afraid I've reached my pro bono limit on this one. Perhaps just give it another name like "plantpredict_solarfarmer" rather than "simple"! :)

  22. kurt-rhee commented on May 23, 2024

    @kurt-rhee
    Contributor

    @adriesse @kandersolar how about something like "abb_efficiency" so that it related to the reference? I don't think that PlantPredict or SolarFarmer should get credit for the model since neither of us came up with it. I'm sure @mikofski would agree.

  23. cwhanse commented on May 23, 2024

    @cwhanse
    Member

    +1 for abb_efficiency if we change the reference to ABB's 1997 publication, which is a derivative work of the 1950s Westinghouse book.

  24. mikofski commented on May 24, 2024

    @mikofski
    MemberAuthor

    Works for me

  25. mikofski commented on Jun 19, 2024

    @mikofski
    MemberAuthor

    Thank you so much @kurt-rhee , @echedey-ls , @kandersolar , @adriesse , & everyone who helped on this. It feels so gods to see this issue/feature-request closed after 3 years! Amazing!

  26. added this to the 0.11.0 milestone on Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions