[Scilab-users] Re : finding roots

Rafael Guerra jrafaelbguerra at hotmail.com
Sun Mar 30 14:01:19 CEST 2014


Hi Paul,

Please try the solution below using fsolve.

Could you let us know why do you want to solve that equation? Is it just for fun or is there an underlying physical problem?

PS:
I was looking for a new version of Scilab and found a donate button, Scilab needs our help.

Regards
Rafael Guerra


// Solution using fsolve (RG, 30-Mar-2014)

function y=fsol1(x)
  y=cos(x).*cosh(x)+1;
endfunction

// plot problem to find where to define initial value guesses:
x=-20:0.1:20;
y1=cos(x);
y2=-sech(x);
clf;
plot(x,y1,'b',x,y2,'r');

// solve for first 10 solutions:
N=10;
x0= linspace(%pi/2,%pi/2+(N-1)*%pi,N);
[Xsol]=fsolve(x0,fsol1);
for i=1:N
  printf("X(%2i)= +/- %8.6f\n",i,Xsol(i));
end


-----Original Message-----
From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of paul.carrico at free.fr
Sent: Sunday, March 30, 2014 10:48 AM
To: International users mailing list for Scilab.
Subject: [Scilab-users] Re : finding roots

Hooops I make a mistake :
cos(x)*cosh(x)+1=0

Paul

----- Mail d'origine -----
De: paul carrico <paul.carrico at free.fr>
À: International users mailing list for Scilab. <users at lists.scilab.org>
Envoyé: Sun, 30 Mar 2014 11:30:23 +0200 (CEST)
Objet: [Scilab-users] finding roots

Dear All

I would like to find the first 10 roots of the following equation :
cos(x)*cosh(x)-1=0

I think the solution is not trivial and need a specific development, isn't it ?

Cheers

Paul
_______________________________________________
users mailing list
users at lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
users at lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




More information about the users mailing list