<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">You Wrote:<br>
      <br>
          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.<br>
          That's definitely not the case with your g2(). It should
      rather return something like [2*x 2*y].<br>
      <br>
      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.<br>
      <br>
      I do not know French.<br>
      <br>
      Bob<br>
      On 10/15/2018 5:52 PM, Samuel Gougeon wrote:<br>
    </div>
    <blockquote cite="mid:2de32110-fb5b-684f-22a1-afefcfdcece3@free.fr"
      type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Hello,<br>
        <br>
        Le 15/10/2018 à 20:39, rsherry8 a écrit :<br>
      </div>
      <blockquote cite="mid:5BC4DEF8.7040508@comcast.net" type="cite">I
        am trying to solve a system of two non-linear equations using
        fsolve. I define the following two functions: <br>
        <br>
        function z=g1(x,y) <br>
        z = x^2 + y^2 <br>
        endfunction <br>
        <br>
        function z=g2(x,y) <br>
        z = x^4 + y^4 - 20 <br>
        endfunction <br>
        <br>
        When I type something like: g2(2,2) <br>
        I get 12 which is right. <br>
        <br>
        I then run the following command: <br>
            [xres]=fsolve([0,0],g1,g2); <br>
      </blockquote>
      <br>
      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.<br>
      That's definitely not the case with your g2(). It should rather
      return something like [2*x 2*y].<br>
      <br>
      For what you likely want to do, here are two examples (extracted
      from a document of mine in french, sorry):<br>
      <img src="cid:part1.09020906.01060500@comcast.net" alt=""
        height="268" width="545"><br>
      <br>
      Actually, the fsolve() page is rather poor : both given examples
      are about a single variable.<br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
        href="https://help.scilab.org/docs/6.0.1/en_US/fsolve.html">https://help.scilab.org/docs/6.0.1/en_US/fsolve.html</a><br>
      <br>
      fsolve() is a key function. We should improve its help page.<br>
      <br>
      HTH<br>
      Samuel<br>
      <br>
      <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>