# Thread: Can IMSL Solve a system of n nonlinear complex equations

1. ## Can IMSL Solve a system of n nonlinear complex equations

Can IMSL Solve a system of n nonlinear complex equations?
Thanks very much!

2. There is an indirect way to approach this problem. Whether it helps you depends on the problem size, unstated constraints and local solutions. It also will require the use of a non-linear equation solver software code. There is one in the C library. Others exist in the Fortran library that are likely to be more effective. The C code is zeros_sys_eqn.

Some notation: You have a complex set of k variables, z=(z_1,...,z_k), and k equations f_i(z), i=1,...,k. (We are heading toward an equivalent system that has n=2k equations in n=2k variables.) You will provide an initial set of values for z, to start the iterative search for a solution to f(z)=0. Here f=(f_1,...,f_k).

Now we consider the system as two equations of size k, one for the real and the next for the imaginary part: f(z) = f_r(z) + f_i(z) * i. f_r and f_i are both real for each z. So the real system is of size n=2k, g(z)=(f_r(z), f_i(z)) = 0. It is not necessary to algebraically compute f_r, f_i.

So far this is obvious enough. But now things get interesting. In order to use the most effective method for the software, it is necessary to provide the Jacobian matrix for g(z), as it depends on the n=2k variables. These are the real and imaginary parts of each z_j, j=1,...,k.

For each value of the complex vector z, compute f(z) and the derivative matrix df/dz. These values are a complex vector and a k by k complex matrix. Now recall the Cauchy-Riemann equations from that long ago course in complex variables, http://en.wikipedia.org/wiki/Cauchy%...mann_equations

In terms of writing the evaluation functions, you will first reconstitute z from the 2n real values of the unknowns. First all the real parts, then the imaginary parts, in natural order.

Then evaluate f(z), as a complex variable, to get g(z).

For the Jacobian of g(z) again reconstitute z. Then compute df/dz with resulting real and imaginary matrices A, B for each z. Thus df/df = A + B*i, for each z. The Jacobian for g(z) is the block matrix [A, -B] (first rows) and [B, A] (second rows). This is where the Cauchy-Riemann equations are used. BTW the usual development of these equations is for a single equation but we have used it here for vectors functions of several complex variables. The mathematical extension is straightforward.

Hope this gets you started.

3. Thanks very much for your help! If the system can not break into the real and the imaginary part: f(z) = f_r(z) + f_i(z) * i, for example, including trigonometric functions. How can I solve this problem?

4. This is a reasonable question. But you are overlooking that you do no need to know the explicit formulas for the real and imaginary parts. You put the z values together from their real and imaginary parts. Then you just evaluate f(z) and df/dz. After that you have what is needed in the function evaluation codes - real and imaginary parts of the point-wise evaluations. You are correct that finding the formulas themselves is a pain. But you do not have to do this. Here is a real trivial example. You want to solve f(z)=z^2 + 2. You have df/dz=2z, obviously. So given the real and imaginary parts x, y, compute z=x+i*y, then f(z) then df/dz. These give you complex values upon evaluation. Then use the real and imaginary parts for g(z) and the parts of the derivatives for your Jacobian, using the Cauchy-Riemann equations.

5. I don't understand your statement about trigonometric functions in #3. For example,

sin z = sin x cosh y + i cos x sinh y

and similarly for other trigonometric functions. Did you have something more complicated in mind?

6. You are missing an important point. There is no need to do the algebraic preliminary such as you have written. Don't go there.

Consider the example problem of computing the inverse sine of w=.49 + i *.22. This is equivalent to solving f(z)=sin(z)-w=0, with f'(z)=cos(z). As outlined above this is 2 equations in 2 real unknowns. But the intermediate algebraic equation you wrote is not used. Only the numerical evaluation of f(z) and f'(z) is required. (Incidentally sin(.5 + i*.25) is close to w.)

You will need to pick approximate starting values for the real and imaginary parts. In the example there are lots of solutions.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•