<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#330000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 05/11/2012 14:45, Paul Carrico
wrote:<br>
</div>
<blockquote
cite="mid:000901cdbb5b$dcc9e790$965db6b0$@carrico@free.fr"
type="cite">
<pre wrap="">All,
Thanks for the feedback ...
... a basic plot shows the curve is monotonic (see attachment) ; I should plot a 3D curve in order to study the influence of the exponents for example to verify there's one and only one root ...
... I've to code a fast function to solve this kind of equation ... hundred thousand (and maybe million) of similar equation to solve :-~</pre>
</blockquote>
<br>
hi<br>
<br>
beware not to use one single fsolve to solve a set of independent
equations; <br>
<br>
somethign like<br>
<br>
function [a b] = f(x,y)<br>
a=x^3 -1<br>
b= y^(0.6456) +4y^.45 - .566<br>
endfunction<br>
<br>
fsolve([0 0],f)<br>
<br>
<br>
this is a bad idea, because fsolve will systematically calculate
db/dx and da/dy, this would take much longer and much more memory
than just fsolving x^3 -1, and then y^(0.6456) +4y^.45 - .566<br>
of course this is much worse when you have N outputs and N inputs to
your function, in this case fsolve calculates N^2 derivatives at
each step...<br>
<br>
<blockquote
cite="mid:000901cdbb5b$dcc9e790$965db6b0$@carrico@free.fr"
type="cite">
<pre wrap="">
That's one of the reasons why I asked about the possible parallelization
Regards
Paul
-----Message d'origine-----
De : <a class="moz-txt-link-abbreviated" href="mailto:users-bounces@lists.scilab.org">users-bounces@lists.scilab.org</a> [<a class="moz-txt-link-freetext" href="mailto:users-bounces@lists.scilab.org">mailto:users-bounces@lists.scilab.org</a>] De la part de <a class="moz-txt-link-abbreviated" href="mailto:michael.baudin@contrib.scilab.org">michael.baudin@contrib.scilab.org</a>
Envoyé : lundi 5 novembre 2012 13:59
À : International users mailing list for Scilab.
Objet : Re: [Scilab-users] root calculation
Hi,
This is a nonlinear equation, for which we are searching a zero.
The fsolve function is designed for this purpose:
<a class="moz-txt-link-freetext" href="http://help.scilab.org/fsolve">http://help.scilab.org/fsolve</a>
Notice that there might not be a solution. This is why the algorithm is an optimization problem, where the square norm of f(x) is minimized.
This method also works for a system of nonlinear equations, so that this is (much) more general than dichotomy, secant, Brent, etc... which are one-variable solvers.
No 1-variable method is available at the Scilab level, to my knowledge.
But the Brent method is used internally in the computation of the inverse Cumulated Distribution Function (quantile) by the DCDFLIB library (e.g. X=cdfnor("X",Mean,Std,P,Q)). Notice that Matlab has the fzero function :
<a class="moz-txt-link-freetext" href="http://www.mathworks.fr/fr/help/matlab/ref/fzero.html">http://www.mathworks.fr/fr/help/matlab/ref/fzero.html</a>
which uses Brent's method.
But this method is not available directy in Scilab. This is a good design choice in my opinion, since fsolve is much more general. But I guess that fzero may be faster and more robust, in some cases.
Best regards,
Michaël
Le 2012-11-05 13:13, Paul Carrico a écrit :
</pre>
<blockquote type="cite">
<pre wrap="">Dear all,
This a stupid question, but how can I solve directly in, Scilab an
equation such as :
0.403*X^(-0.121) + 60.5*X^(-0.73) - 0.1839 = 0
?
Is-it necessary to code a function ? from memory : dichotomy method,
secant method, Brent one etc. …
Regards
Paul
_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>