# [Scilab-users] fsolve including linear interpolation

3 messages
Open this post in threaded view
|

## [Scilab-users] fsolve including linear interpolation

 Hi All I'm wondering what is the way to solve the following study (but at the same time I'm not sure that the problem has been correctly posed) ... I'm a bit "disrupted" by theta scalar that depends itself on x value.   The problem seems to be non linear and I tried (but I failed) in using fsolve.   Any suggestion where I've to see to?   Thanks for your time and help   Paul       ################################################# ```function y=calculus(x) theta = [ 1 100 200 300 1000 1200 1500 2000]'; theta_interp = interp1(theta(:,1),theta(:,2),x,'linear'); y = -theta_interp * 0.268 + 120 -x; //pause // if theta = 1 : y = 0 -> x = 120 - 0.268 = 119.73 // if theta = 100 : y = 0 -> x = 120 - 26.8 = 93.2 // if theta = 200 : x = 66.4 // if theta = 300 : x = 120 - 0.268 = 39.6 // can we say that y belongs to [39.6 , 119.73] ? endfunction [x,v,info] = fsolve(0,calculus) ``` _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users