[Scilab-users] Having a Problem with fsolve

rsherry8 rsherry8 at comcast.net
Tue Oct 16 02:00:27 CEST 2018


You Wrote:

     If it is provided, g2() must be the jacobian of g1(): it must 
compute and evaluate the partial derivatives of g1(), with respect to x 
and to y.
     That's definitely not the case with your g2(). It should rather 
return something like [2*x 2*y].

I do not understand this because I am trying to solve a system of 
equations and g2 represents the second equation. I suspect I am missing 
something.

I do not know French.

Bob
On 10/15/2018 5:52 PM, Samuel Gougeon wrote:
> Hello,
>
> Le 15/10/2018 à 20:39, rsherry8 a écrit :
>> I am trying to solve a system of two non-linear equations using 
>> fsolve. I define the following two functions:
>>
>> function z=g1(x,y)
>> z = x^2 + y^2
>> endfunction
>>
>> function z=g2(x,y)
>> z = x^4 + y^4 - 20
>> endfunction
>>
>> When I type something like: g2(2,2)
>> I get 12 which is right.
>>
>> I then run the following command:
>>     [xres]=fsolve([0,0],g1,g2);
>
> If it is provided, g2() must be the jacobian of g1(): it must compute 
> and evaluate the partial derivatives of g1(), with respect to x and to y.
> That's definitely not the case with your g2(). It should rather return 
> something like [2*x 2*y].
>
> For what you likely want to do, here are two examples (extracted from 
> a document of mine in french, sorry):
>
>
> Actually, the fsolve() page is rather poor : both given examples are 
> about a single variable.
> https://help.scilab.org/docs/6.0.1/en_US/fsolve.html
>
> fsolve() is a key function. We should improve its help page.
>
> HTH
> Samuel
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20181015/4b5a8097/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 39749 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20181015/4b5a8097/attachment.png>


More information about the users mailing list