[Scilab-users] fsolve including linear interpolation

paul.carrico at free.fr paul.carrico at free.fr
Tue Apr 18 15:03:40 CEST 2017


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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170418/373e4c00/attachment.htm>


More information about the users mailing list