Graphing a function for several parameter values



On 02/13/2012 04:20 PM, Patrick Blanchenay wrote:
> Do you know if I could apply the substitution of parameters to several
> functions?
>
> E.g. something like:
>
> flist: makelist ( concat(ev(f(x,p1,p2), p),",",ev(g(x,p1,p2), p)), p,
> plist);
> plot2d ( flist, [x, 0, 7]);
>
> I have no idea, but basically i'd like to plot two functions for several
> parameters values, so I need to have them like
> [f(under param_set1), g(under param_set1), f(under param_set2), g(under
> param_set2)]
>
> Is this still feasible with makelist?
Sure, something such as:

flist: makelist ( ev( [f(x,p1,p2), g(x,p1,p2)], p), p, plist)$
plot2d (flatten (flist), [x, 0, 7]);

That makelist command will create a list of the type [[f1,g1], [f2,g2],...]
flatten() will transform it into the list that plot2d needs: [f1, g1, 
f2, g2, ...]

(concat will not work here because it will produce strings with a "," 
inside the
strings, but not a list).

Cheers,
Jaime