Question: Evaluate function along list

<p>Hi. With the procedure below I want to evaluate the procedure 'OptEff' (which yields a pair of coordinates) for different values of one of the parameters 'delta', 'beta', 'r', 'alpha', 'm', where 'x' specifies which parameter in question, and I want the parameter to take the values given in 'x0'. I hoped that by 'for i in x0 do ...', I would be able to do this. However, all entries in L equals the first one, and corresponds to the first entry in 'x0'. I guess my use of 'subs' is not correct. Any help is appreciated. Sturla OptEffPlot := proc(P10, P20, delta, beta, r, alpha, m, x, x0) local i, L; if not evalb(x in {delta, r, beta, alpha, m}) then RETURN("ERROR"); break end if; L := []; for i in x0 do subs(x = i, {delta, r, beta, alpha, m}); L := [ op(L), OptEff(P10, P20, delta, beta, r, alpha, m) ] end do; L end proc</p>
Please Wait...