[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fsolve not finding correct answer
From: |
Aivo Jürgenson |
Subject: |
fsolve not finding correct answer |
Date: |
Sun, 11 Feb 2007 22:17:47 +0200 (EET) |
Hello,
I'm trying to use fsolve for finding unknown $k$ in a somewhat complex
equation
$ p = \int_{-k}^{k} f_B(y,\sigma) dy $
where f_B is the probability density function of "Bessel's"
distribution and equals to
p=(1/(pi.*sigma)).*besselk(0,(abs(y)./sigma));
where besselk is the standard Octave function.
The problem is that the fsolve function doesn't do a very good job and
sometimes gives "iteration is not making good progress" and
therefore completely wrong answer as well.
The appropriate code is given in the atree_bessel_find_range.m file in the
attachment. I'm using the 2.1.73-13 Debian package of Octave.
Anybody has some hints about how to persuade fsolve giving the correct
answer or perhaps somebody could suggest a different function for solving
the equation in the first place?
Aivo Jürgenson
atree_bessel_find_range.m
Description: Text document
- fsolve not finding correct answer,
Aivo Jürgenson <=