Hello everyone, we have a problem when we call the FROOT function within a module. If the module is parameterized, we get an error message. We do not understand why. The following is the example code. Once without parameter transfer in the module (parameters a,b,c are initialized within the module). And once with passing the parameters in the module call. What is the problem? Obviously a module in which FROOT is called cannot be parameterized. How can the problem be solved? Thanks in advance! /*Nonlinear solver without error*/
proc iml;
start func(x) global(a,b,c);
measure = (a/x+b/x##2 - c);
return(measure);
finish func;
store module=func;
start getSolution_m;
a = 215;
b = 231.5;
c = 400;
interval = {0.01 2};
roots = froot( "Func", interval);
print roots;
finish;
store module=getSolution_m;
quit;
proc iml;
load;
call getSolution_m;
quit; /*Nonlinear solver with error*/
proc iml;
start func(x) global(a,b,c);
measure = (a/x+b/x##2 - c);
return(measure);
finish func;
store module=func;
start getSolution_m(a,b,c);
interval = {0.01 2};
roots = froot( "Func", interval);
print roots;
finish;
store module=getSolution_m;
quit;
proc iml;
load;
call getSolution_m(215,231.5,400);
quit;
... View more