# Plotting complex number wrt frequency

I want to plot a complex function wrt frequency. How can i do it? If my function as follows:

w=2*Pi*f;
Zc=(1/i*w*C)
Zl=(i*w*L)
Z1=(R*Zc)/(1+Zc*Zl)


where i==> imaginary number. let Z1 be an imaginary number = a+ib in terms of frequency; I want to plot phase of Z1 wrt frequency.

Normally one uses transfer function in s and then calls BodePlot. Bode replaces s by I w and then plots the magnitude and phase as function of w.

So your question is not clear. You give no context and meaning to the variables you wrote.

But may be this is can get you started. First need some numerical values for the parameters

ClearAll[f]
R0 = 10; C0 = 3; L0 = 4;
w = 2*Pi*f;
Zc = (1/I*w*C0)
Zl = (I*w*L0)
Z1 = (R0*Zc)/(1 + Zc*Zl)
mag = ComplexExpand[Abs@Z1]


Now you plot the magnitudes vs. f in Hz as follows

 LogLogPlot[mag,{f,0,30},PlotRange->All,Frame->True,
FrameLabel->{{"|mag|",None},{"frequency in Hz","my plot"}}]


To plot phase. It is -Pi/2 for all frequencies.

Plot[ComplexExpand@Arg@Z1,{f,0,30},PlotRange->All,Frame->True,
FrameLabel->{{"Phase",None},{"frequency in Hz","my plot"}}]


To plot mag vs. phase (since phase is fixed at -Pi/2 you get straight line), you can use ParametricPlot

ParametricPlot[{mag, ComplexExpand@Arg@Z1},{f,0,30},PlotRange->All,
Frame->True,FrameLabel->{{"Phase",None},{"|mag|","my plot"}}]


• I want exactly same thing which you gave to me .... but i want to plot the graph of phase vs freq............. what syntax i can use for phase instead of mag = ComplexExpand[Abs@Z1] – Jadav Dec 8 '17 at 11:45
• @Jadav to find phase, you use Arg. But it is better to use BodePlot for all these things if you can. – Nasser Dec 8 '17 at 15:04
ClearAll[f]
R0 = 10; C0 = 30; L0 = 4;
w[f_] = 2*Pi*f;
Zc[f_] = (1/I*w[f_]*C0)
Zl[f_] = (I*w[f_]*L0)
Z1[f_] = (R0*Zc[f_])/(1 + Zc[f_]*Zl[f_])

N[A, 3] = Abs[Trans[f]];
N[B, 3] = Arg[Trans[f]]*180/Pi;
Plot[Abs[Trans[f]], {f, 1*10^8, 10*10^9}]
Plot[Arg[Trans[f]]*180/Pi, {f, 7.8*10^9, 8.2*10^9}]


for magnitude

for phase

Any suggestions are welcomed. Thank you @Nasser