# Newton-Raphson¶

All the explanations on this section are implemented here.

## Canonical Newton-Raphson¶

The Newton-Raphson method is the standard power flow method tough at schools. GridCal implements slight but important modifications of this method that turns it into a more robust, industry-standard algorithm. The Newton-Raphson method is the first order Taylor approximation of the power flow equation.

The expression to update the voltage solution in the Newton-Raphson algorithm is the following: Where:

• : Voltage vector at the iteration t (current voltage).
• : Voltage vector at the iteration t+1 (new voltage).
• : Jacobian matrix.
• : Specified power vector.
• : Calculated power vector using .

In matrix form we get: ## Jacobian in power equations¶

The Jacobian matrix is the derivative of the power flow equation for a given voltage set of values. Where:

• • • • Where:

• Here we introduced two complex-valued derivatives:

• • Where:

• : Diagonal matrix formed by a voltage solution.
• : Diagonal matrix formed by a voltage solution, where every voltage is divided by its module.
• : Diagonal matrix formed by the current injections.
• : And of course, this is the circuit full admittance matrix.

This Jacobian form can be used for other methods.

## Newton-Raphson-Iwamoto¶

In 1982 S. Iwamoto and Y. Tamura present a method  where the Jacobian matrix J is only computed at the beginning, and the iteration control parameter µ is computed on every iteration. In GridCal, J and µ are computed on every iteration getting a more robust method on the expense of a greater computational effort.

The Iwamoto and Tamura’s modification to the Newton-Raphson algorithm consist in finding an optimal acceleration parameter µ that determines the length of the iteration step such that, the very iteration step does not affect negatively the solution process, which is one of the main drawbacks of the Newton-Raphson method: Here µ is the Iwamoto optimal step size parameter. To compute the parameter µ we must do the following: The matrix is the Jacobian matrix computed using the voltage derivative numerically computed as the voltage increment (voltage difference between the current and the previous iteration).          There will be three solutions to the polynomial . Only the last solution will be real, and therefore it is the only valid value for . The polynomial can be solved numerically using 1 as the seed.

  Iwamoto, S., and Y. Tamura. “A load flow calculation method for ill-conditioned power systems.”IEEE transactions on power apparatus and systems 4 (1981): 1736-1743.

## Newton-Raphson in Current Equations¶

Newton-Raphson in current equations is similar to the regular Newton-Raphson algorithm presented before, but the mismatch is computed with the current instead of power.

The Jacobian is then: Where:  The mismatch is computed as increments of current: Where: The steps of the algorithm are equal to the the algorithm presented in Newton-Raphson.