Hi All,(adsbygoogle = window.adsbygoogle || []).push({});

I am trying to solve a set of coupled non-linear algebraic equations. I'm doing this using the LinearSolve fcn of mathematica and an implementation of the Newton-Raphson method. One of the issues I'm having is that I need to tell mathematica that one of these variables,let's say x, is a real number. In my Newton-Raphson scheme I initialize all of my variables, and I set x to initially be a real number. But as the process iterates x gets a complex component. Is there any command that will tell mathematica that x always needs to remain real?

I have seen that if one uses the functions Reduce and Solve, they can pick the output to be real. But unfortunately I do not believe I can use those fcns since I have a matrix equation to solve, and I do need some of the variables to be complex.

Any help is greatly appreciated.

Happy Holidays.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Mathematica setting variable to be real number

**Physics Forums | Science Articles, Homework Help, Discussion**