mph- / lcapy

Lcapy is a Python package for symbolic linear circuit analysis and signal processing. It uses SymPy for symbolic mathematics.
GNU Lesser General Public License v2.1
246 stars 46 forks source link

Numerical Issue Bode plot: Non-Ideal inverting integrator #111

Closed davidparent closed 1 year ago

davidparent commented 1 year ago

It seems that the smallest magnitude of a bode plot (I tried 1/(s+1) and − 1000000/(s(s+1000001)) is around 140dB ​

Here is my co-lab file: https://colab.research.google.com/drive/1NxAeozFvhL9a9gzLShMODxm5u720umVN?usp=sharing

davidparent commented 1 year ago

It happens in the docs too.: from matplotlib.pyplot import savefig from lcapy import *

H = 1 / (s*2 + 20s + 10000)

H.bode_plot((1, 1000))

No matter how high the frequency, it is limited to a minium of -120dB.

mph- commented 1 year ago

Try

H.bode_plot((1, 1000), dbmin=-140)

davidparent commented 1 year ago

This worked great. Sorry for the delay