Azzera filtri
Azzera filtri

Extend Arithmetic precision

1 visualizzazione (ultimi 30 giorni)
Kim O
Kim O il 18 Mag 2012
*Hello, when I want to solve a algebraic equation with fsolve(), it gives me a solution with low Arithmetic precision.
How can I change the Arithmetic precision of the solution?
Thank you! bye*

Risposta accettata

Walter Roberson
Walter Roberson il 18 Mag 2012
fsolve(YourFunction, YourStartingPoint, optimset('TolFun', 1e-10, 'TolX', 1e-10))
You might also need to use 'MaxIter', 1000
If you need more than 16 digits of precision (taking into account round-off error) then you will need to use a different solution method entirely, such as using the Symbolic Toolkit.
  2 Commenti
Kim O
Kim O il 18 Mag 2012
Oh thank you for your answer. Another question: in fsolve I get sometimes an exitflag=3
help says: exitflag=3: Change in the residual was smaller than the specified tolerance. what does that mean??
btw: Can I solve Algebraic and DAE Equations with the Symbolic Toolkit??
Thank you Walter!
Walter Roberson
Walter Roberson il 18 Mag 2012
I am not clear on when the various flags are used. exitflag = 3 appears to mean that the problem was solved to within the tolerance it was told, or else perhaps that the solver got stuck in a local minimum. (fsolve() is not a global optimizer)
The Symbolic Toolbox can be asked to try to solve algebraic systems analytically using solve(), and numerically via numeric::solve() [a routine there is no direct access to from MATLAB]. The success of finding analytic solutions depends a fair bit on the version you are using; there was a big improvement in R2010b (I think it was.) If transcendental functions are involved, there might not be any analytic solution.
The Symbolic Toolbox can be asked to try to solve DAE by using dsolve(). I do not know what classes of problems it can deal with. In particular I am not certain there is any routine in the Symbolic toolbox to deal with partial differential equations.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by