2
$\begingroup$

I used BodePlot function to plot the magnitude and phase for a transfer function as below.

BodePlot[(1+s/10^6)/((1+s/10^2) (1+s/10^12)),{0.1,10^20}]

Now I want to do the following things:

  1. Find the magnitude of the transfer function from the magnitude plot at 2*10^7 Hz.
  2. Find the phase of the transfer function from the phase plot at 2*10^7 Hz.

Is there a way to get exact these numbers? I tried to use Getcoordinate () function from drawing tool and then move cursor to that point but I only get the approximated result.

enter image description here

$\endgroup$
2
$\begingroup$

Update (answer simplified).

Defining the function you're using as

t[s_] := (1 + s/10^6) / ( (1 + s/10^2) (1 + s/10^12) )

you can get the exact magnitude and phase at 2*10^7 Hertz from AbsArg:

AbsArg[t[I 2 10^7]]
(* {50000 Sqrt[401/100000000042500000001], -ArcTan[10003000001/199999850020]} *)

Comments (based on old answer).

While not necessary for the present question, you can be interested in defining a FunctionTransferModel for the function t:

tfm = TransferFunctionModel[t[s], s]

Different properties for the model can be given at construction time by specifying particular values for the options of TransferFunctionModel. Also, other symbols that act on TransferFunctionModel expressions can be used to access in a simple and direct way properties of the model, such as TransferFunctionZeros and TransferFunctionPoles.

With tfm, the exact magnitude and phase are obtained in a similar way:

AbsArg[tfm[I 2 10^7][[1, 1]]]
(* {50000 Sqrt[401/100000000042500000001], -ArcTan[10003000001/199999850020]} *)

% === AbsArg[t[I 2 10^7]]
(* True *)
$\endgroup$
  • $\begingroup$ Thanks a lot. Could you explain what is the function of "TransferFunctionModel" here? I read this from the help section of Mathematica: TransferFunctionModel represents the model of the transfer-function matrix m with complex variable s. But I don't see any difference between input and output of this function. Also, tfm[I 2. 10^7][[1, 1]]: this is new to me too. Could you tell me where can I read more about this? $\endgroup$ – anhnha Sep 17 '16 at 19:54
  • $\begingroup$ Thanks. What is the purpose of converting the expression into the form with the top-right T? $\endgroup$ – anhnha Sep 17 '16 at 20:33
  • $\begingroup$ Also why I 2. 10^7 not just 2. 10^7? Why should we include the imaginary variable I here? $\endgroup$ – anhnha Sep 17 '16 at 20:39
  • $\begingroup$ Xavier: thanks a lot for the explanation and sorry for my lack of understanding. Could you tell me where can I read more about these things? Actually, I can't understand why we use TransferFunctionModel to convert something like 1/s into 1/s with the T-like letter on the top right. What is the purpose of that? I don't see the difference between that expression (1/s) and the transfer function model (1/s with T on the top right). Also in tfm[I f] how do you know that we should put the imaginary I here? $\endgroup$ – anhnha Sep 19 '16 at 6:52
0
$\begingroup$

If you have the plots, you can simply use Cases to extract the datapoints being plotted, and Interpolation, to create a functional form.

{magnitude, phase} = Interpolation /@ Cases[
   BodePlot[(1 + s/10^6)/((1 + s/10^2) (1 + s/10^12)), {0.1, 10^20}],
   Line[pts_] :> pts, Infinity]

Mathematica graphics

Notice that the domain is from {-1, 20}, which means that the inputs to these functions are actually the base-10 logarithm, so to get the values you just use

magnitude[Log10[2 10^7]]
phase[Log10[2 10^7]]
(* -79.9892 *)
(* -2.86327 *)

These correspond to the values shown in the plot.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.