.. note::
    :class: sphx-glr-download-link-note

    Click :ref:`here <sphx_glr_download_examples_documentation_model_savemodel.py>` to download the full example code
.. rst-class:: sphx-glr-example-title

.. _sphx_glr_examples_documentation_model_savemodel.py:


doc_model_savemodel.py
======================







.. code-block:: default

    ##
    import warnings
    warnings.filterwarnings("ignore")
    ##
    # <examples/doc_model_savemodel.py>
    import numpy as np

    from lmfit.model import Model, save_model


    def mysine(x, amp, freq, shift):
        return amp * np.sin(x*freq + shift)


    sinemodel = Model(mysine)
    pars = sinemodel.make_params(amp=1, freq=0.25, shift=0)

    save_model(sinemodel, 'sinemodel.sav')
    # <end examples/doc_model_savemodel.py>


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** ( 0 minutes  0.118 seconds)


.. _sphx_glr_download_examples_documentation_model_savemodel.py:


.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-example



  .. container:: sphx-glr-download

     :download:`Download Python source code: model_savemodel.py <model_savemodel.py>`



  .. container:: sphx-glr-download

     :download:`Download Jupyter notebook: model_savemodel.ipynb <model_savemodel.ipynb>`


.. only:: html

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

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