0

I am trying to plot multiple curves for a particular parameter in a function S1, where the only variable is t and the rest are parameters.

S1[t_, alpha1_, alpha2_]:=40 + 2.82*t^(alpha1)/Gamma[alpha1 + 1]- 
   137.6*t^(alpha1)/Gamma[alpha1 + 1]-8.82*t^(2*alpha1)/Gamma[2*alpha1 + 1] - 
   52.68*t^(alpha1 + alpha2)/Gamma[alpha1 + alpha2 + 1]+
   129.61*t^(2*alpha1)/Gamma[2*alpha1 + 1]+29.85*t^(3*alpha1)/Gamma[3*alpha1 + 1];

For plotting, I adapted the idea from here.

Plot[Evaluate@Table[S1[t, alpha1, 2], {alpha1, 0.1, 0.15, 0.2}], {t, 
  0, 2}, PlotLegends ->LineLegend[Table[alpha1, {alpha1, 0.1, 0.15, 0.2}], 
   LegendLabel -> alpha1]]

But the output shows only one curve, just for the first entry of alpha1.

zhk
  • 11,939
  • 1
  • 22
  • 38

1 Answers1

4

As requested, posting my comment as an answer. The Table takes {alpha1, {0.1, 0.15, 0.2}} to iterate alpha1 over the list

S1[t_, alpha_, n_] := Sin[100 alpha t];

Plot[Evaluate@Table[S1[t, alpha1, 2], {alpha1, {0.1, 0.15, 0.2}}], {t,
   0, 2}, PlotLegends -> 
  LineLegend[Table[alpha1, {alpha1, {0.1, 0.15, 0.2}}], 
   LegendLabel -> alpha1]]

enter image description here

BlacKow
  • 6,428
  • 18
  • 32