.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/10_aplications/zv_shaper.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_10_aplications_zv_shaper.py: Spectrum of zero-vibration (ZV) input shaper ============================================ .. GENERATED FROM PYTHON SOURCE LINES 9-41 .. image-sg:: /auto_examples/10_aplications/images/sphx_glr_zv_shaper_001.png :alt: zv shaper :srcset: /auto_examples/10_aplications/images/sphx_glr_zv_shaper_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np import tdcpy import tdcpy.plot s0 = -24 * 0.1 + 24 * np.sqrt(1 - 0.1**2) * 1j beta, omega = -np.real(s0), np.abs(np.imag(s0)) shaper_length = np.pi / np.abs(np.imag(s0)) exponent = np.pi * -np.real(s0) / np.abs(np.imag(s0)) shaper_gain = np.exp( exponent ) / (1 + np.exp( exponent )) ddae = tdcpy.DDAE( E = np.zeros(shape=(0,0), dtype=np.float64), A = np.zeros(shape=(0,0,0), dtype=np.float64), hA = np.zeros(shape=(0,), dtype=np.float64), B = np.zeros(shape=(0,2,0), dtype=np.float64), hb = np.zeros(shape=(0,), dtype=np.float64), C = np.zeros(shape=(1,0,0), dtype=np.float64), hC = np.zeros(shape=(0,), dtype=np.float64), D = [ np.array([[shaper_gain]]), np.array([[1 - shaper_gain]])], hD = [0, shaper_length], ) zeros, _ = tdcpy.zeros(ddae, r=[-100, 10, 0, 1250]) fig, ax = plt.subplots() tdcpy.plot.eigen_plot(zeros, ax=ax, label="zeros") ax.scatter([np.real(s0)], [np.imag(s0)], s=50, facecolors='none', edgecolors='b', marker="o", label=rf"$s_0={s0:.2f}$") ax.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.084 seconds) .. _sphx_glr_download_auto_examples_10_aplications_zv_shaper.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: zv_shaper.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: zv_shaper.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: zv_shaper.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_