3
$\begingroup$

I'm trying to plot the Bode diagrams of the Warburg impedance (A=1, s=jw):

$$Z=\frac{A}{\sqrt{\omega}}+\frac{A}{j\sqrt{\omega}}$$

$$Z=A \sqrt{\frac{j}{s}}+\frac{A}{j}\sqrt{\frac{j}{s}}$$

BodePlot[TransferFunctionModel[Sqrt[I/s] + 1/Sqrt[I s], s]]

idem with:

BodePlot[TransferFunctionModel[Sqrt[I/s] (1 - I), s]]

but Mathematica gives me a series of error. Is it possible to plot it in Mathematica? Is there another way to do it?

PolynomialGCD::lrgexp: Exponent is out of bounds for function PolynomialGCD.

TransferFunctionModel::npnd: Unable to automatically separate polynomial numerators and denominators in TransferFunctionModel[{{{(1+Sqrt[Times[<<2>>]] Sqrt[Times[<<2>>]]) Sqrt[s]}},Sqrt[I s] Sqrt[s]},s]. Try simplifying the object.

TransferFunctionModel::invsys: TransferFunctionModel[{{{(1+Sqrt[Times[<<2>>]] Sqrt[Times[<<2>>]]) Sqrt[s]}},Sqrt[I s] Sqrt[s]},s] is not a valid TransferFunctionModel, StateSpaceModel, AffineStateSpaceModel, or NonlinearStateSpaceModel.

PolynomialGCD::lrgexp: Exponent is out of bounds for function PolynomialGCD.

TransferFunctionModel::npnd: Unable to automatically separate polynomial numerators and denominators in TransferFunctionModel[{{{(1+Sqrt[Times[<<2>>]] Sqrt[Times[<<2>>]]) Sqrt[s]}},Sqrt[I s] Sqrt[s]},s]. Try simplifying the object.

TransferFunctionModel::invsys: TransferFunctionModel[{{{(1+Sqrt[Times[<<2>>]] Sqrt[Times[<<2>>]]) Sqrt[s]}},Sqrt[I s] Sqrt[s]},s] is not a valid TransferFunctionModel, StateSpaceModel, AffineStateSpaceModel, or NonlinearStateSpaceModel.

SystemsModelDimensions::invsys: TransferFunctionModel[Sqrt[I/s]+1/Sqrt[I s],s] is not a valid TransferFunctionModel, StateSpaceModel, AffineStateSpaceModel, or NonlinearStateSpaceModel.

SystemsModelDimensions::invsys: TransferFunctionModel[Sqrt[I/s]+1/Sqrt[I s],s] is not a valid TransferFunctionModel, StateSpaceModel, AffineStateSpaceModel, or NonlinearStateSpaceModel.

Array::ilsmn: Single or list of non-negative machine-sized integers expected at position 2 of Array[SystemsModelExtract[TransferFunctionModel[Sqrt[I Power[<<2>>]]+1/Sqrt[I s],s],#2,#1]&,SystemsModelDimensions[TransferFunctionModel[Sqrt[I/s]+1/Sqrt[I s],s]]].

Thank you in advance.

$\endgroup$
  • $\begingroup$ I'd guess that BodePlot cannot handle transfer functions that aren't ratios of polynomials. Perhaps you should seek a rational approximation for the domain of interest. $\endgroup$ – John Doty Aug 9 '18 at 18:03
  • $\begingroup$ @JohnDoty It's above all TranferFunctionModel that only accepts ratios of polynomials (with the addition of delays) $\endgroup$ – andre314 Aug 9 '18 at 18:07
5
$\begingroup$

If all you want is a plot of the impedance, and given @JohnDoty observation that TransferFunctionModel is expecting rational polynomials, you can roll your own

z[s_] := Sqrt[I/s] + 1/Sqrt[I*s]; 
Column[{
  LogLinearPlot[20*Log10[Abs[z[I*w]]], {w, 1, 1000}, PlotTheme -> "Detailed"], 
  LogLinearPlot[Arg[z[I*w]]/Degree, {w, 1, 1000}, PlotTheme -> "Detailed"]
}]

Also, here is a relevant Wolfram demonstration.

$\endgroup$
  • $\begingroup$ Hello @DanielW, thank you so much for your excellent solution. $\endgroup$ – Gennaro Arguzzi Aug 9 '18 at 18:29

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.