Now that we have learnt about system of linear equations and how to solve it, let’s move on to non-linear system of equations.

**Non-linear system of equations**

Non-linear equations are equations that cannot be linearly plotted, and hence cannot be plotted on a graph as a straight line. The highest degree of the variables inside a non-linear equation is higher than 1. An example of a non-linear equation is

A system of non-linear equations refers to a system of equations in which a non-linear equation is present, though not all equations inside the system needs to be non-linear. It also differs from a linear system as it can also have more than one solution. The following is an example of a non-linear system of equations with 2 equations with variables and .

The concept of solving a non-linear system of equations is similar to that of a linear system of equation, as we are trying to find the point of intersection for all of the graphs. Using the above system as an example, by plotting it in a graph,

And from the 2 points of intersection, we can deduce the 2 solutions, which are

and

We are also able to use substitution to obtain our results. Using the previous system as an example, we can use the equation

and substitute it into

to obtain

By completing the root, we will get

With the values and , we are able to substitute it back into the original equation and obtain the same solution sets.

### Real World Examples!

Did you know? One of the best known and most used case of non-linear system of equations is calculating alternating current power-flow model in an electric power system, as they use non-linear equations to calculate power for each transmission line.

Solving this system gives the flow of active power in an electrical system. It is the same flow of power that powers your home and keeps the computer charging, and is very important for analysing power grids. The system of equations is expressed as:

This same system in NM dev, represented by f1 being and f2 being , would look like this:

` ````
```%use s2
//f1:y=x+1
val f1:BivariateRealFunction = object : AbstractBivariateRealFunction() {
//Using AbstractBivariateRealFunction as we are only using 2 variables
override fun evaluate(x: Double, y: Double): Double {
//if the values are correct, it returns 0
return x + 1 - y
}}
//f2:y=x^2+1
val f2:BivariateRealFunction = object : AbstractBivariateRealFunction() {
//Using AbstractBivariateRealFunction as we are only using 2 variables
override fun evaluate(x: Double, y: Double): Double {
//if the values are correct, it returns 0
return x*x + 1 - y
}}
println(f1.evaluate(1.0,2.0))
println(f2.evaluate(1.0,2.0))

output:

0.0

0.0

As systems of nonlinear equations becomes more complex, it will be harder to obtain solutions by substitutions or graphing. In the next chapter, we will be looking at the theory behind Newton’s method, as well as how to implement it in NMdev, to be able to find solutions to more complex non-linear systems.