[Scilab-users] solve a system of equations in scilab
Hermes
herozigle at gmail.com
Sun Sep 17 12:03:03 CEST 2017
Hi, Rafael
In my case,
by setting as initial values [1.5, -0.9]
I get:
1.496447
0.9574371
I always get the second positive value, when it is expected to be negative.
clear;
function Sys=Q(x,z)
Sys(1)=(x(1)-2)^2+(x(2)+2)^2+z^2-9;
Sys(2)=x(1)^6+x(2)^6+z^6-12;
endfunction
z=0;
a=[0,0;1,0;1.2,-1;1.5,-0.9]
for i = 1:3
[j,v,info]=fsolve(a(i,:)',list(Q,z))
disp(j,v,"results",a(i,:),"inc;",i)
end
in this script with several initial values, in the last pair of values, the
solution is negative for the two variables, when in fact it is expected:
and to my pairs the results are changed with respect to the variables
/
--> exec('C:\Users\hermesr\Documents\Scilab Xcos\fsolve_eje19.sce', -1)
1.
inc;
0. 0.
results
0.
1.243D-14
-0.9574371
-1.496447
2.
inc;
1. 0.
results
1.137D-13
1.345D-11
1.496447
0.9574371
3.
inc;
1.2 -1.
results
0.
-1.599D-14/
* -0.9574371
-1.496447*
And I do not know why it evaluates the last one for vaslores as 1.2 and -1,
when in the script for a (3, :) is entered [1.5, -0.9]
--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
More information about the users
mailing list