:orphan:

Native simulation
=================

These examples simulate systems built in *motulator* natively, i.e., in C, with
:class:`motulator_export.native.Simulation`. The systems are built as in the examples
of *motulator*, and only the simulation object is replaced; the results are those of
*motulator* and can be plotted with its plotting functions. The control system runs
the C port of the control algorithms of *motulator*, which is also used by the PLECS
and Simulink models of this package.


.. raw:: html

  <div id='sg-tag-list' class='sphx-glr-tag-list'></div>


.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example simulates sensorless flux-vector control (FVC) of a 2.2-kW interior permanent-magnet synchronous machine (IPMSM) drive natively. The system is that of the motulator example motulator:drive_examples/flux_vector/plot_2kw_ipmsm_fvc. The same system is also simulated in motulator, and the run times and the differences are printed.">

.. only:: html

  .. image:: /examples/images/thumb/sphx_glr_plot_2kw_ipmsm_fvc_thumb.png
    :alt:

  :doc:`/examples/plot_2kw_ipmsm_fvc`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">2.2-kW IPMSM, FVC</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example studies the sensitivity of sensorless flux-vector control (FVC) of a 2.2-kW interior permanent-magnet synchronous machine (IPMSM) drive to an error in the stator resistance estimate at low speeds. The drive of plot_2kw_ipmsm_fvc is simulated natively for several estimates, each simulation taking a fraction of a second.">

.. only:: html

  .. image:: /examples/images/thumb/sphx_glr_plot_2kw_ipmsm_fvc_sweep_thumb.png
    :alt:

  :doc:`/examples/plot_2kw_ipmsm_fvc_sweep`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">2.2-kW IPMSM, FVC, parameter sweep</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example simulates flux-vector control (FVC) of a 5.6-kW PM synchronous reluctance machine drive natively. The system is that of the motulator example motulator:drive_examples/flux_vector/plot_6kw_pmsyrm_gn_fvc_fem_harm: the machine model uses a GradNet current map with spatial harmonics, and the control system uses a GradNet flux map, both trained on FEM data. The GradNets are evaluated in C, which makes the native simulation about 30 times faster than motulator.">

.. only:: html

  .. image:: /examples/images/thumb/sphx_glr_plot_6kw_pmsyrm_gn_fvc_thumb.png
    :alt:

  :doc:`/examples/plot_6kw_pmsyrm_gn_fvc`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">5.6-kW PM-SyRM, GradNet models, FVC</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example simulates pure open-loop V/Hz control of a 2.2-kW induction machine (IM) drive natively. The system is that of the motulator example motulator:drive_examples/vhz/plot_2kw_im_diode_vhz: a diode bridge, a stiff three-phase grid, and a DC link are modeled, the load torque is quadratic, and the converter uses carrier comparison.">

.. only:: html

  .. image:: /examples/images/thumb/sphx_glr_plot_2kw_im_diode_vhz_thumb.png
    :alt:

  :doc:`/examples/plot_2kw_im_diode_vhz`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">2.2-kW IM, diode bridge, V/Hz control</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example simulates grid-following (GFL) current-vector control of a 10-kVA grid converter, connected to the grid through an LCL filter, natively. The system is that of the motulator example motulator:grid_examples/grid_following/plot_10kva_lcl_gfl.">

.. only:: html

  .. image:: /examples/images/thumb/sphx_glr_plot_10kva_lcl_gfl_thumb.png
    :alt:

  :doc:`/examples/plot_10kva_lcl_gfl`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">10-kVA, LCL filter, GFL</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example simulates a 12.5-kVA converter with disturbance-observer-based grid-forming (DO-GFM) control in a weak grid during a grid-voltage sag natively. The system is that of the motulator example motulator:grid_examples/grid_forming/plot_13kva_do_gfm_sag: the grid voltage drops to 0.5 p.u. while the active-power reference is kept at 1 p.u., and the active-power reference is limited to a realizable level. The magnitude of the grid voltage is a function of time, which the native simulation calls from C.">

.. only:: html

  .. image:: /examples/images/thumb/sphx_glr_plot_13kva_do_gfm_sag_thumb.png
    :alt:

  :doc:`/examples/plot_13kva_do_gfm_sag`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">12.5-kVA, DO-GFM, grid-voltage sag</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/plot_2kw_ipmsm_fvc
   /examples/plot_2kw_ipmsm_fvc_sweep
   /examples/plot_6kw_pmsyrm_gn_fvc
   /examples/plot_2kw_im_diode_vhz
   /examples/plot_10kva_lcl_gfl
   /examples/plot_13kva_do_gfm_sag


.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-gallery

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download all examples in Python source code: examples_python.zip </examples/examples_python.zip>`

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download all examples in Jupyter notebooks: examples_jupyter.zip </examples/examples_jupyter.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
