| MATLAB Central > MATLAB Newsreader > fsolve |
|
|
|
I am working on a set of equations which are DAE. I use fsolve for the algebraic equations and ode15s for solving the differential equations. But i get complex numbers as output from fval. I tried to change the initial value, slack tolerances, increase number of iterations. But none of them work. The physics of the problem demands a real solution and not complex. How do i avoid getting complex values in fsolve? |
|
On 7/2/2012 6:58 AM, Pratheeba wrote: |
|
Usually complex values occur if the algebraic equations contain |
|
Torsten <Torsten.Hennig@umsicht.fraunhofer.de> wrote in message <1d80e824-00c9-4ff7-91e7-6949372b1eed@w24g2000vby.googlegroups.com>... |
|
> |
|
Thanks for your reply. |
|
Thanks for your reply. |
|
I don't understand what you are trying to do. |
|
As you told, isreal(fval) will return 1 or 0 if real or complex respectively. I wrote wrongly as if(isreal(fval)<0), it should be if(isreal(fval)<1). |
|
On 7/3/2012 8:02 AM, Pratheeba wrote: |
|
Hi Pratheeba: |
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
