[Scilab-users] Nested function definition

Rafael Guerra jrafaelbguerra at hotmail.com
Wed Apr 10 14:10:28 CEST 2019


In your example, why not using a simpler URQ function definition into fsolve?
For example:

mg = 0.1; h=0.1; l=0.1; L0=0.1;
function y=URQ(q)
    e = mg./(2*q);
    z= asinh(mg.*h./(2*q.*l.*sinh(e)))+e;
    y= mg.*L0./(q.*l)-sinh(2*e-z)-sinh(z)
endfunction

q=1;
y=URQ(q)

Rgds
Rafael

-----Original Message-----
From: users <users-bounces at lists.scilab.org> On Behalf Of Izabela Wójcik-Grzaba
Sent: Wednesday, April 10, 2019 3:01 PM
To: Users mailing list for Scilab <users at lists.scilab.org>
Subject: Re: [Scilab-users] Nested function definition

Thank you. Is there a way to use this formulation as an input function to fsolve? I don't know how to do it.

In my another example I also had a nested function but I managed to define it in a form like in help page about function. It means that everything was inside one function. This formulation worked fine in fsolve, but with my current example I am not able to use it.

Iza




More information about the users mailing list