# How to plot table with two variables?

in my script,i have defined function current(cur), which is a function of two variables resistance(res) and time(tim). Now what i need that for my function to pick a resistance value(which is a vector) and evaluate the function over a certain range of time and obtain the RMS value of current. then i want to plot these values of current wrt their resistance values?

My program is as shown below:

Rlist = {10^0, 10^1, 10^2, 10^3, 10^4, 10^5, 10^6, 10^7, 10^8, 10^9};
cur[tim_, res_] := sig*(r2^2 - r1^2)*num* omega*(1/2 - Exp[-(tim/(res*capa))]/(1 + Exp[Pi/(num*omega*res*capa)]))

Pr[res_] := Evaluate@Table[cur[tim, res]^2*res, {tim, 0, (2*Pi)/(num*omega)}, {res, Rlist}];
ListLogLinearPlot[Pr[res],Frame -> True,PlotStyle -> Thickness[0.01],Joined -> True,FrameLabel -> {Style["Load Resistance(\[CapitalOmega])", 16],Style["Average Power", 16]},FrameTicks -> {Rlist},PlotStyle -> PointSize[0.5]]


Although the above code is generating a graph, I am not sure whether the obtained graph is wrt resistance, as the axis ticks are integers like 1,2,3,4... and not resistance values as per the list. (all others variables are constants defined earlier).

Kindly let me know whether the obtained graph is wrt resistance values or not?

Regards, Sagar H P

• You did not specify constant values num, omega, capa. Oct 29 '18 at 13:02
• sig*(r2^2 - r1^2)=? Oct 29 '18 at 13:08

Put sig*(r2^2 - r1^2)=1,num = 1; omega = 1; capa = 1; then

Rlist = {10^0, 10^1, 10^2, 10^3, 10^4, 10^5, 10^6, 10^7, 10^8, 10^9};
cur[tim_, res_] :=
num*omega*(1/2 -
Exp[-(tim/(res*capa))]/(1 + Exp[Pi/(num*omega*res*capa)]))

Pr = Table[{res, cur[tim, res]^2*res}, {tim,
0, (2*Pi)/(num*omega)}, {res, Rlist}];
ListLogLinearPlot[Pr, Frame -> True, PlotStyle -> Thickness[0.01],
Joined -> True,

data = Evaluate@ Table[{res, RootMeanSquare[Table[cur[tim, res]^2*res, {tim, 0, (2*Pi)/(num*omega)}]]}, {res,Rlist}]