# Mapping over function's several parameters regions [closed]

Mapping multiple parameters of a function to specific values

I wonder if the parameters a and b have ranges with steps, as: a-> {1,5,0.5}, which means a =1,1.5,2,...,5.

How the definition of the parameters will be written then instead being with fixed values as in the referred post

parameters = {{1/2, 1/2}, {1, 1/3}, {2, 1/4}, {0.5, 1/5}}; ?

• Yeah, realized that, deleted comment...
– ciao
Commented May 24, 2016 at 6:05
• Please make this question self contained. Prepare minimal example and tell us what exactly do you want to get. Do you want to plot all possible combinations of generated parameters or maybe respective pairs, etc etc.
– Kuba
Commented May 24, 2016 at 9:48
• @Kuba. I just will repeat the previous question in the post I referred to ! put as I said in the question I want the parameters go to ranges not for specific values
– S.S.
Commented May 24, 2016 at 10:44
• @S.S. What haven't you got from my comment? I understand you want ranges.
– Kuba
Commented May 24, 2016 at 10:50
• @ Kuba. Fine !!
– S.S.
Commented May 24, 2016 at 11:02

Use Mapping multiple parameters of a function to specific values and supply it with the following version of parameters.

parameters=Flatten[Table[{a, 1/bInverted}, {a, 1/2, 5, 1/2}, {bInverted, 2, 5}], 1]


## Update

Let's redefine myfunction to be a function of a, b and x.

myfunction[a_, b_, x_] := (b/a)*((a/x)^(b + 1))


Now when you generate parameters

parameters = Flatten[
Table[{a, 1/bInverted}, {a, 1/2, 5, 1/2}, {bInverted, 2, 5}], 1]


and plot it

Plot[myfunction[Sequence @@ #, x] & /@ parameters, {x, 0, 3},
Evaluated -> True]


you get several lines.

But is there a way in this case to plot myfunction in a single line instead versus x for continuous regions for a and b ?

Certainly it can't be done as a single line, but you could plot a band between the lowest and highest values similar to Plot confidence interval around curve.

A test shows that the lowest values are achieved with the minimum for a and b and the largest values for the maximum. So we plot two curves and area shade between them.

Plot[{myfunction[1/2, 1/5, x], myfunction[5, 1/2, x]}, {x, 0, 3},
Filling -> {2 -> {1}}, FillingStyle -> Directive[Opacity[.3], Gray],
PlotStyle -> Black]


• I know that names are arbitrary but x is not a parameter in linked question so it may be confusing here. Also, there is a pair of values and it's not clear if OP wants pair of ranges or multiple pairs.
– Kuba
Commented May 24, 2016 at 11:07
• @Kuba I couldn't figure how to get an interator of the form {b, 1/2, 1/5} so thought it would be better to use x. I will change it to bInverted. Commented May 24, 2016 at 11:24
• @ Jack LaVigne. Ok I used: parameters=Flatten[Table[{a, b}, {a, 1/2, 5, 1/2}, {b, 2, 5,1/2}], 1] , because a and b are the independent parameters and x is the variable i want to plot myfunction versus it as in the previous example. I got a several lines for myfunction according to the {a,b} generated pairs. But is there a way in this case to plot myfunction in a single line instead versus x for continuous regions for a and b ?.
– S.S.
Commented May 24, 2016 at 11:39
• Herply thanks @Jack LaVigne for your effort, I will try it..
– S.S.
Commented May 24, 2016 at 14:58
• Hay @Kuba, thanks for your trail to understand my question ..
– S.S.
Commented May 24, 2016 at 15:03