Re: fsolve problems
- From: "Miroslav Balda" <miroslav.nospam@xxxxxxxx>
- Date: Sun, 23 Mar 2008 23:08:01 +0000 (UTC)
"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
.
- Follow-Ups:
- Re: fsolve problems
- From: John D'Errico
- Re: fsolve problems
- References:
- fsolve problems
- From: Jacob McFarland
- fsolve problems
- Prev by Date: Re: fminsearch mle parameters
- Next by Date: mcc error
- Previous by thread: fsolve problems
- Next by thread: Re: fsolve problems
- Index(es):
Relevant Pages
|