Question: why the error message?

Here is a snippet of code that returns an error message. The details of the h procedure should be irrelevant.

h:=proc(k,x)
local z,w;
nans(parameters=[k,x]);
z:=nans(0.98);
w:=rhs(z[2]),rhs(z[3])
end proc;
 h := proc (k, x) local z, w; nans(parameters = [k, x]); z := 

    nans(.98); w := rhs(z[2]), rhs(z[3]) end proc;


h(7.7,0.3);
0.310903619302454933005944397083, 0.731944275983583692659532399302

plot([h(7.7,x),x=0..30]);
Error, (in dsolve/numeric/process_parameters) 'parameters' must be specified as a list of numeric values

Note that the line h(7.7,0.3); is just there to show that h functions well. It accepts 2 numerical inputs and spits out a pair of numerical values.

Why is plot not plotting? Why is plot asking about inner workings of h?

If I try

f:=proc(x,y)

cos(x),sin(x*y) 
end proc;
plot([f(x,7.7),x=0..3]);
that woks fine. Plot does not inquire about f.

 

Please Wait...