Re: fsolve problems



"Jacob McFarland" <jacob.a.mcfarland@xxxxxxxxx> wrote in
message <fs6egh$98h$1@xxxxxxxxxxxxxxxxxx>...
Hello,
Let me start by saying im a pretty basic user for matlab.
Im no beginer but definately not a professional.
I am trying to solve a nonlinear system of equations for a
combustion problem. I need to know if there is a way to
force fsolve to only look for real roots. It is unable to
find an answer so far but it always moves into complex
numbers. The roots will not be complex or negative if they
actually exist. Can someone tell me if i can limit the
roots it looks for to only real positive numbers?
Also how many itterations should i allow it to use? I am in
the realm of 1e6 for itterations and function evaluations.
This does not take too long on my computer but it doesnt
seem to help it find any better of a solution.
Thanks,
- Jacob

Hi Jacob
I see that nobody, who has the Optimization Toolbox answers.
I may not help you with fsolve, which is in that toolbox,
because I don't have it, however, I could use my function
LMFnlsq.m from the File exchange (Id 17534). I thing that
the solution for fsolve could be similar:

x = LMFnlsq('eqns',x0);

Build a function which evaluates f_i(x), 1<=i<=n to be zero:

function f = eqns(x)

f = [expression for the 1st equation
expression for the 2nd equation
:
expression for the nth equation
imag(x).*w1
(x<0).*x.*w2
];
x is a column vextor, w1, w2 are big enough (1e4?) scalar
weights or columns of vector weights.
I hope it helps.

Mira


.



Relevant Pages

  • Re: finding complex root from nonlinear equations
    ... On Jan 3, 5:49 pm, "Roger Stafford" ... I don't know how to find complex roots, ... For polynomial equations the matlab function 'roots' will find all ... advice in their 'fsolve' documentation is "fsolve only handles real ...
    (comp.soft-sys.matlab)
  • Re: finding complex root from nonlinear equations
    ... I know fsolve can find the real roots from polynomial equations, ... I don't know how to find complex roots, ... As to finding all possible roots, 'fsolve' only promises to find one root. ... I can see that polynomial equations can be split ...
    (comp.soft-sys.matlab)
  • Re: Solving non linear equations
    ... I tried to solve these equations using 'fsolve' command, ... This is a problem for 'roots'. ... Then substitute the left hand expression in this equation for z in the third ...
    (comp.soft-sys.matlab)
  • Re: fsolve problems
    ... force fsolve to only look for real roots. ... The roots will not be complex or negative if they ... While fsolve will not accept explicit constraints, ... use a transformation of variables. ...
    (comp.soft-sys.matlab)