├── docs ├── .nojekyll ├── objects.inv ├── _images │ ├── fig_2.png │ ├── sphx_glr_g_app_001.png │ ├── sphx_glr_g_BMCF_001.png │ ├── sphx_glr_g_FMAS_001.png │ ├── sphx_glr_g_app_thumb.png │ ├── sphx_glr_g_test_001.png │ ├── sphx_glr_g_BMCF_thumb.png │ ├── sphx_glr_g_FMAS_S_001.png │ ├── sphx_glr_g_FMAS_S_R_001.png │ ├── sphx_glr_g_FMAS_S_thumb.png │ ├── sphx_glr_g_FMAS_thumb.png │ ├── sphx_glr_g_optfrog_001.png │ ├── sphx_glr_g_test_thumb.png │ ├── sphx_glr_g_FMAS_S_R_thumb.png │ ├── sphx_glr_g_model_KdV_001.png │ ├── sphx_glr_g_model_LLE_001.png │ ├── sphx_glr_g_model_NSE_001.png │ ├── sphx_glr_g_optfrog_thumb.png │ ├── sphx_glr_g_error_scaling_001.png │ ├── sphx_glr_g_model_KdV_thumb.png │ ├── sphx_glr_g_model_LLE_thumb.png │ ├── sphx_glr_g_model_NSE_thumb.png │ ├── sphx_glr_g_molecules_01_001.png │ ├── sphx_glr_g_molecules_02_001.png │ ├── sphx_glr_g_spectrogram_001.png │ ├── sphx_glr_g_spectrogram_002.png │ ├── sphx_glr_g_spectrogram_003.png │ ├── sphx_glr_g_spectrogram_004.png │ ├── sphx_glr_g_spectrogram_005.png │ ├── sphx_glr_g_spectrogram_thumb.png │ ├── sphx_glr_g_NSE_absorption_001.png │ ├── sphx_glr_g_code_listing_01_001.png │ ├── sphx_glr_g_error_scaling_thumb.png │ ├── sphx_glr_g_list_prop_const_001.png │ ├── sphx_glr_g_list_prop_const_002.png │ ├── sphx_glr_g_list_prop_const_003.png │ ├── sphx_glr_g_list_prop_const_004.png │ ├── sphx_glr_g_molecules_01_thumb.png │ ├── sphx_glr_g_molecules_02_thumb.png │ ├── sphx_glr_g_performance_CQE_001.png │ ├── sphx_glr_g_performance_CQE_002.png │ ├── sphx_glr_g_performance_LEM_001.png │ ├── sphx_glr_g_performance_LEM_002.png │ ├── sphx_glr_g_raman_response_001.png │ ├── sphx_glr_g_NSE_absorption_thumb.png │ ├── sphx_glr_g_absorption_profile_001.png │ ├── sphx_glr_g_code_listing_01_thumb.png │ ├── sphx_glr_g_error_dealiasing_001.png │ ├── sphx_glr_g_error_dealiasing_thumb.png │ ├── sphx_glr_g_instabilities_dz_001.png │ ├── sphx_glr_g_instabilities_dz_thumb.png │ ├── sphx_glr_g_list_prop_const_thumb.png │ ├── sphx_glr_g_list_raman_models_001.png │ ├── sphx_glr_g_performance_CQE_thumb.png │ ├── sphx_glr_g_performance_LEM_thumb.png │ ├── sphx_glr_g_raman_response_thumb.png │ ├── sphx_glr_g_soliton_implosion_001.png │ ├── sphx_glr_ng_generate_infile_thumb.png │ ├── sphx_glr_g_absorption_profile_thumb.png │ ├── sphx_glr_g_list_raman_models_thumb.png │ ├── sphx_glr_g_soliton_implosion_thumb.png │ ├── sphx_glr_g_user_guide_PropConst_001.png │ ├── sphx_glr_g_NSE_absorption_constant_001.png │ ├── sphx_glr_g_error_3rdOrderSoliton_001.png │ ├── sphx_glr_g_error_3rdOrderSoliton_002.png │ ├── sphx_glr_g_error_3rdOrderSoliton_thumb.png │ ├── sphx_glr_g_specialized_model_NLPM_001.png │ ├── sphx_glr_g_specialized_model_PCF_001.png │ ├── sphx_glr_g_specialized_model_PCF_thumb.png │ ├── sphx_glr_g_user_guide_PropConst_thumb.png │ ├── sphx_glr_g_NSE_absorption_constant_thumb.png │ ├── sphx_glr_g_custom_propagation_model_001.png │ ├── sphx_glr_g_custom_propagation_model_002.png │ ├── sphx_glr_g_specialized_model_NLPM_thumb.png │ ├── sphx_glr_ng_fiber_details_nlpm750_thumb.png │ ├── sphx_glr_g_custom_propagation_model_thumb.png │ ├── sphx_glr_g_four_pulse_interaction_ESM_001.png │ └── sphx_glr_g_four_pulse_interaction_ESM_thumb.png ├── _static │ ├── file.png │ ├── minus.png │ ├── plus.png │ ├── no_image.png │ ├── broken_example.png │ ├── fonts │ │ ├── Lato-Bold.ttf │ │ ├── Inconsolata.ttf │ │ ├── Lato-Regular.ttf │ │ ├── Lato │ │ │ ├── lato-bold.eot │ │ │ ├── lato-bold.ttf │ │ │ ├── lato-bold.woff │ │ │ ├── lato-bold.woff2 │ │ │ ├── lato-italic.eot │ │ │ ├── lato-italic.ttf │ │ │ ├── lato-italic.woff │ │ │ ├── lato-regular.eot │ │ │ ├── lato-regular.ttf │ │ │ ├── lato-italic.woff2 │ │ │ ├── lato-regular.woff │ │ │ ├── lato-regular.woff2 │ │ │ ├── lato-bolditalic.eot │ │ │ ├── lato-bolditalic.ttf │ │ │ ├── lato-bolditalic.woff │ │ │ └── lato-bolditalic.woff2 │ │ ├── Inconsolata-Bold.ttf │ │ ├── RobotoSlab-Bold.ttf │ │ ├── Inconsolata-Regular.ttf │ │ ├── RobotoSlab-Regular.ttf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ ├── fontawesome-webfont.woff2 │ │ └── RobotoSlab │ │ │ ├── roboto-slab-v7-bold.eot │ │ │ ├── roboto-slab-v7-bold.ttf │ │ │ ├── roboto-slab-v7-bold.woff │ │ │ ├── roboto-slab-v7-bold.woff2 │ │ │ ├── roboto-slab-v7-regular.eot │ │ │ ├── roboto-slab-v7-regular.ttf │ │ │ ├── roboto-slab-v7-regular.woff │ │ │ └── roboto-slab-v7-regular.woff2 │ ├── css │ │ ├── fonts │ │ │ ├── lato-bold.woff │ │ │ ├── lato-bold.woff2 │ │ │ ├── lato-normal.woff │ │ │ ├── lato-normal.woff2 │ │ │ ├── Roboto-Slab-Bold.woff │ │ │ ├── Roboto-Slab-Bold.woff2 │ │ │ ├── lato-bold-italic.woff │ │ │ ├── lato-bold-italic.woff2 │ │ │ ├── Roboto-Slab-Regular.woff │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ ├── lato-normal-italic.woff │ │ │ ├── lato-normal-italic.woff2 │ │ │ ├── Roboto-Slab-Regular.woff2 │ │ │ └── fontawesome-webfont.woff2 │ │ └── badge_only.css │ ├── gallery-binder.css │ ├── documentation_options.js │ ├── js │ │ ├── badge_only.js │ │ └── html5shiv.min.js │ └── gallery-dataframe.css ├── _sources │ ├── reference_manual │ │ ├── tools.rst.txt │ │ ├── config.rst.txt │ │ ├── stepper.rst.txt │ │ ├── raman_response.rst.txt │ │ ├── analytic_signal.rst.txt │ │ ├── propagation_constant.rst.txt │ │ ├── data_io.rst.txt │ │ ├── solver.rst.txt │ │ ├── models.rst.txt │ │ └── index.rst.txt │ ├── auto_examples │ │ ├── gallery_02 │ │ │ └── sg_execution_times.rst.txt │ │ ├── gallery_03 │ │ │ └── sg_execution_times.rst.txt │ │ └── gallery_01 │ │ │ └── sg_execution_times.rst.txt │ ├── auto_tutorials │ │ ├── tests │ │ │ └── sg_execution_times.rst.txt │ │ ├── basics │ │ │ └── sg_execution_times.rst.txt │ │ ├── errors │ │ │ └── sg_execution_times.rst.txt │ │ ├── photon_number_conservation │ │ │ └── sg_execution_times.rst.txt │ │ ├── attenuation │ │ │ ├── sg_execution_times.rst.txt │ │ │ └── g_test.rst.txt │ │ └── specific │ │ │ └── sg_execution_times.rst.txt │ └── citations.rst.txt ├── _downloads │ ├── 07fcc19ba03226cd3d83d4e40ec44385 │ │ └── auto_examples_python.zip │ ├── 6f1e7a639e0699d6164445b55e6c116d │ │ └── auto_examples_jupyter.zip │ ├── 97a1de59bce682890841bb846e3dd09c │ │ └── auto_tutorials_jupyter.zip │ ├── cab7a090c4183ca69dc0cd84d3b04413 │ │ └── auto_tutorials_python.zip │ ├── 3bd7975d46103e6166fd99423ccfe727 │ │ └── g_test.py │ ├── 15a0767e6a3ccba7db6df4310681a0b4 │ │ └── g_app.py │ ├── 7858650ed8421f570ff3925a3a1f7b03 │ │ └── g_absorption_profile.py │ ├── 1cd25e73d461dcdc2c32e012083c0924 │ │ └── g_BMCF.py │ ├── 8cf930e74a92bb490b58b139759bb68a │ │ └── g_model_NSE.py │ ├── 3745328a0547fe4f5769ecd6761cbbf6 │ │ └── g_list_raman_models.py │ ├── 4c173db4132e8b9f26de6e89a8813638 │ │ └── g_test.ipynb │ ├── 7b7f0d3bb8c4459d28fcafc074035e70 │ │ └── g_soliton_implosion.py │ ├── a7b0fcfb9e68029b3cdca5c8c0f21f9e │ │ └── g_absorption_profile.ipynb │ ├── 014f33e28498cb8fe7d8bd5c37686ad6 │ │ └── g_list_prop_const.py │ ├── 1ef6897f04eddfcb385c6f79cb344688 │ │ └── g_code_listing_01.py │ ├── 6c6cb4966c0aa6f6405c4dc79e9b5d83 │ │ └── g_molecules_01.py │ ├── 90005f5a4ab65407bb9900a0664dbc85 │ │ └── g_BMCF.ipynb │ ├── 7f4c353a79a1296439f832bc865411d1 │ │ └── g_model_NSE.ipynb │ ├── 6f8ed726dcbea9374ace56909c4edbc7 │ │ └── g_specialized_model_NLPM.py │ ├── 0bab1337cc4d21ee4f1782f5643299eb │ │ └── g_soliton_implosion.ipynb │ └── ccccfbf2a29a392f75915612a6959a6a │ │ └── g_model_KdV.py └── .buildinfo ├── tutorials ├── basics │ ├── input_file.h5 │ ├── README.rst │ ├── g_app.py │ └── g_code_listing_01.py ├── attenuation │ ├── README.rst │ └── g_absorption_profile.py ├── specific │ ├── README.rst │ ├── g_list_raman_models.py │ └── g_list_prop_const.py ├── tests │ └── README.rst ├── README.rst └── photon_number_conservation │ └── README.rst ├── dist └── py_fmas-1.0-py3-none-any.whl ├── examples_article ├── code_listing_01 │ ├── in_file.h5 │ └── main_code_listing_01.py ├── usage_example_01 │ ├── pp_fig_01_v2 │ │ └── fig01.png │ ├── README.rst │ ├── res_SiSSM_RK2.dat │ ├── res_CQE.dat │ ├── res_IFM_RK4.dat │ ├── res_LEM_RK2.dat │ ├── res_LEM_RK4.dat │ └── res_SySSM_RK2.dat ├── usage_example_02 │ └── pp_figure │ │ ├── fig_02_v2.png │ │ └── NOTES.txt ├── usage_example_04 │ ├── pp_figure │ │ └── fig_LEM_SolSolCollision.png │ └── main_usage_example_04.py └── code_listing_02 │ └── main_code_listing_02.py ├── fmas ├── __init__.py ├── version.py ├── solver │ ├── __init__.py │ └── integrating_factor_method.py ├── config.py ├── models │ ├── __init__.py │ ├── model_base.py │ ├── custom_model_pcf.py │ ├── bmcf.py │ ├── fmas_s.py │ ├── fmas_thg.py │ └── fmas.py ├── app.py ├── stepper.py ├── grid.py └── analytic_signal.py ├── galleries ├── gallery_02 │ ├── README.rst │ └── g_molecules_01.py ├── gallery_03 │ ├── README.rst │ ├── g_BMCF.py │ ├── g_model_NSE.py │ └── g_model_KdV.py ├── gallery_01 │ ├── README.rst │ ├── g_soliton_implosion.py │ ├── g_specialized_model_NLPM.py │ └── g_four_pulse_interaction_ESM.py └── README.rst ├── setup.py ├── LICENSE.md └── README.md /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/objects.inv -------------------------------------------------------------------------------- /docs/_images/fig_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/fig_2.png -------------------------------------------------------------------------------- /docs/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/file.png -------------------------------------------------------------------------------- /docs/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/minus.png -------------------------------------------------------------------------------- /docs/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/plus.png -------------------------------------------------------------------------------- /docs/_static/no_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/no_image.png -------------------------------------------------------------------------------- /tutorials/basics/input_file.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/tutorials/basics/input_file.h5 -------------------------------------------------------------------------------- /docs/_static/broken_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/broken_example.png -------------------------------------------------------------------------------- /docs/_static/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /dist/py_fmas-1.0-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/dist/py_fmas-1.0-py3-none-any.whl -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_app_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_app_001.png -------------------------------------------------------------------------------- /docs/_static/fonts/Inconsolata.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Inconsolata.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_BMCF_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_BMCF_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_FMAS_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_FMAS_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_app_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_app_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_test_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_test_001.png -------------------------------------------------------------------------------- /docs/_sources/reference_manual/tools.rst.txt: -------------------------------------------------------------------------------- 1 | fmas.tools 2 | ========== 3 | 4 | .. automodule:: fmas.tools 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/lato-bold.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-bold.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-bold.ttf -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_BMCF_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_BMCF_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_FMAS_S_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_FMAS_S_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_FMAS_S_R_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_FMAS_S_R_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_FMAS_S_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_FMAS_S_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_FMAS_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_FMAS_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_optfrog_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_optfrog_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_test_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_test_thumb.png -------------------------------------------------------------------------------- /docs/_sources/reference_manual/config.rst.txt: -------------------------------------------------------------------------------- 1 | fmas.config 2 | =========== 3 | 4 | .. automodule:: fmas.config 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/lato-normal.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/lato-normal.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Inconsolata-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Inconsolata-Bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-bold.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-italic.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-italic.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-italic.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-regular.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/RobotoSlab-Bold.ttf -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_FMAS_S_R_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_FMAS_S_R_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_model_KdV_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_model_KdV_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_model_LLE_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_model_LLE_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_model_NSE_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_model_NSE_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_optfrog_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_optfrog_thumb.png -------------------------------------------------------------------------------- /docs/_static/fonts/Inconsolata-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Inconsolata-Regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-italic.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-regular.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-regular.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/RobotoSlab-Regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_error_scaling_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_error_scaling_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_model_KdV_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_model_KdV_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_model_LLE_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_model_LLE_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_model_NSE_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_model_NSE_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_molecules_01_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_molecules_01_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_molecules_02_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_molecules_02_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_spectrogram_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_spectrogram_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_spectrogram_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_spectrogram_002.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_spectrogram_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_spectrogram_003.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_spectrogram_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_spectrogram_004.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_spectrogram_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_spectrogram_005.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_spectrogram_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_spectrogram_thumb.png -------------------------------------------------------------------------------- /docs/_sources/reference_manual/stepper.rst.txt: -------------------------------------------------------------------------------- 1 | fmas.stepper 2 | ============ 3 | 4 | .. automodule:: fmas.stepper 5 | :members: 6 | 7 | -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/Roboto-Slab-Bold.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/lato-bold-italic.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/lato-bold-italic.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-bolditalic.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-bolditalic.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-bolditalic.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/Lato/lato-bolditalic.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /examples_article/code_listing_01/in_file.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/examples_article/code_listing_01/in_file.h5 -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_NSE_absorption_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_NSE_absorption_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_code_listing_01_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_code_listing_01_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_error_scaling_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_error_scaling_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_list_prop_const_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_list_prop_const_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_list_prop_const_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_list_prop_const_002.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_list_prop_const_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_list_prop_const_003.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_list_prop_const_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_list_prop_const_004.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_molecules_01_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_molecules_01_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_molecules_02_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_molecules_02_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_performance_CQE_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_performance_CQE_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_performance_CQE_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_performance_CQE_002.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_performance_LEM_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_performance_LEM_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_performance_LEM_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_performance_LEM_002.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_raman_response_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_raman_response_001.png -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/Roboto-Slab-Regular.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/lato-normal-italic.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/lato-normal-italic.woff2 -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_NSE_absorption_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_NSE_absorption_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_absorption_profile_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_absorption_profile_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_code_listing_01_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_code_listing_01_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_error_dealiasing_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_error_dealiasing_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_error_dealiasing_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_error_dealiasing_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_instabilities_dz_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_instabilities_dz_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_instabilities_dz_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_instabilities_dz_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_list_prop_const_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_list_prop_const_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_list_raman_models_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_list_raman_models_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_performance_CQE_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_performance_CQE_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_performance_LEM_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_performance_LEM_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_raman_response_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_raman_response_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_soliton_implosion_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_soliton_implosion_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_ng_generate_infile_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_ng_generate_infile_thumb.png -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/css/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_absorption_profile_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_absorption_profile_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_list_raman_models_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_list_raman_models_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_soliton_implosion_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_soliton_implosion_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_user_guide_PropConst_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_user_guide_PropConst_001.png -------------------------------------------------------------------------------- /docs/_static/gallery-binder.css: -------------------------------------------------------------------------------- 1 | /* CSS for binder integration */ 2 | 3 | div.binder-badge { 4 | margin: 1em auto; 5 | vertical-align: middle; 6 | } 7 | -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_NSE_absorption_constant_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_NSE_absorption_constant_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_error_3rdOrderSoliton_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_error_3rdOrderSoliton_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_error_3rdOrderSoliton_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_error_3rdOrderSoliton_002.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_error_3rdOrderSoliton_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_error_3rdOrderSoliton_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_specialized_model_NLPM_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_specialized_model_NLPM_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_specialized_model_PCF_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_specialized_model_PCF_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_specialized_model_PCF_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_specialized_model_PCF_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_user_guide_PropConst_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_user_guide_PropConst_thumb.png -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_NSE_absorption_constant_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_NSE_absorption_constant_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_custom_propagation_model_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_custom_propagation_model_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_custom_propagation_model_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_custom_propagation_model_002.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_specialized_model_NLPM_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_specialized_model_NLPM_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_ng_fiber_details_nlpm750_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_ng_fiber_details_nlpm750_thumb.png -------------------------------------------------------------------------------- /docs/_sources/reference_manual/raman_response.rst.txt: -------------------------------------------------------------------------------- 1 | fmas.raman_response 2 | =================== 3 | 4 | .. automodule:: fmas.raman_response 5 | :members: 6 | 7 | -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff -------------------------------------------------------------------------------- /examples_article/usage_example_01/pp_fig_01_v2/fig01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/examples_article/usage_example_01/pp_fig_01_v2/fig01.png -------------------------------------------------------------------------------- /examples_article/usage_example_02/pp_figure/fig_02_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/examples_article/usage_example_02/pp_figure/fig_02_v2.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_custom_propagation_model_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_custom_propagation_model_thumb.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_four_pulse_interaction_ESM_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_four_pulse_interaction_ESM_001.png -------------------------------------------------------------------------------- /docs/_images/sphx_glr_g_four_pulse_interaction_ESM_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_images/sphx_glr_g_four_pulse_interaction_ESM_thumb.png -------------------------------------------------------------------------------- /docs/_sources/reference_manual/analytic_signal.rst.txt: -------------------------------------------------------------------------------- 1 | fmas.analytic_signal 2 | ==================== 3 | 4 | .. automodule:: fmas.analytic_signal 5 | :members: 6 | 7 | -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 -------------------------------------------------------------------------------- /docs/_sources/reference_manual/propagation_constant.rst.txt: -------------------------------------------------------------------------------- 1 | fmas.propagation\_constant 2 | ========================== 3 | 4 | .. automodule:: fmas.propagation_constant 5 | :members: 6 | -------------------------------------------------------------------------------- /examples_article/usage_example_02/pp_figure/NOTES.txt: -------------------------------------------------------------------------------- 1 | 2 | Mi 14 Apr 2021 09:18:22 CEST 3 | ---------------------------- 4 | * added main_figure_use_case_02_v2.py with amended figure (f) 5 | -------------------------------------------------------------------------------- /fmas/__init__.py: -------------------------------------------------------------------------------- 1 | """py-fmas initialization 2 | 3 | .. moduleauthor: Oliver Melchert 4 | """ 5 | from .app import run 6 | from .version import __version__ 7 | -------------------------------------------------------------------------------- /tutorials/basics/README.rst: -------------------------------------------------------------------------------- 1 | Basic examples 2 | -------------- 3 | 4 | The step-by-step demonstrations in this gallery show how to perfom basic 5 | simulations using the provided software. 6 | -------------------------------------------------------------------------------- /docs/_sources/reference_manual/data_io.rst.txt: -------------------------------------------------------------------------------- 1 | fmas.data_io 2 | ============ 3 | 4 | .. automodule:: fmas.data_io 5 | :members: SimPars, save_h5, read_h5, set_par_from_dict, fetch_par_dict_h5 6 | -------------------------------------------------------------------------------- /examples_article/usage_example_04/pp_figure/fig_LEM_SolSolCollision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/examples_article/usage_example_04/pp_figure/fig_LEM_SolSolCollision.png -------------------------------------------------------------------------------- /docs/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip -------------------------------------------------------------------------------- /docs/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip -------------------------------------------------------------------------------- /docs/_downloads/97a1de59bce682890841bb846e3dd09c/auto_tutorials_jupyter.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_downloads/97a1de59bce682890841bb846e3dd09c/auto_tutorials_jupyter.zip -------------------------------------------------------------------------------- /docs/_downloads/cab7a090c4183ca69dc0cd84d3b04413/auto_tutorials_python.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omelchert/py-fmas/HEAD/docs/_downloads/cab7a090c4183ca69dc0cd84d3b04413/auto_tutorials_python.zip -------------------------------------------------------------------------------- /docs/_sources/reference_manual/solver.rst.txt: -------------------------------------------------------------------------------- 1 | fmas.solver 2 | =========== 3 | 4 | .. automodule:: fmas.solver 5 | :members: LEM, LEM_SySSM, CQE, CQE_RK4IP, SolverBaseClass, SySSM, SiSSM, IFM 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /galleries/gallery_02/README.rst: -------------------------------------------------------------------------------- 1 | Two-frequency pulse compounds 2 | ----------------------------- 3 | 4 | This gallery shows specific examples demonstrating the generation and dynamical 5 | evolution of two-frequency pulse compounds. 6 | 7 | -------------------------------------------------------------------------------- /galleries/gallery_03/README.rst: -------------------------------------------------------------------------------- 1 | Simulation of other models 2 | -------------------------- 3 | 4 | This gallery shows how the functionality of the provided software can be 5 | extended by implementing additional propagation models. 6 | 7 | -------------------------------------------------------------------------------- /docs/_sources/reference_manual/models.rst.txt: -------------------------------------------------------------------------------- 1 | fmas.models 2 | =========== 3 | 4 | .. automodule:: fmas.models 5 | :members: ModelBaseClass, FMAS_THG, FMAS_S_Raman, FMAS_S_R, FMAS_S, FMAS, BMCF, CustomModelPCF 6 | :show-inheritance: 7 | 8 | -------------------------------------------------------------------------------- /tutorials/attenuation/README.rst: -------------------------------------------------------------------------------- 1 | Attenuation 2 | ----------- 3 | 4 | The examples provided in this gallery demonstrate how to use models that 5 | incorporate loss in terms of an absorption constant or a frequency dependent 6 | absorption profile. 7 | -------------------------------------------------------------------------------- /examples_article/usage_example_01/README.rst: -------------------------------------------------------------------------------- 1 | Exact single soltion solution of the NSE 2 | ======================================== 3 | 4 | Mo 12 Apr 2021 10:35:57 CEST 5 | ---------------------------- 6 | * added perfomance test for CQE method - OM 7 | 8 | -------------------------------------------------------------------------------- /docs/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 7e5f3dabdde2bf78218614c733946fcd 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /galleries/gallery_01/README.rst: -------------------------------------------------------------------------------- 1 | Exemplary propagation scenarios 2 | ------------------------------- 3 | 4 | This gallery shows examples demonstrating the dynamical evolution of ultrashort 5 | optical pulses in terms of :math:`z`-propagation models for the analytic 6 | signal. 7 | -------------------------------------------------------------------------------- /tutorials/specific/README.rst: -------------------------------------------------------------------------------- 1 | More specific examples 2 | ---------------------- 3 | 4 | The step-by-step demonstrations in this gallery show how the 5 | functionality of the provided software can be used to customize 6 | the implemented models and to compute spectrograms. 7 | -------------------------------------------------------------------------------- /tutorials/tests/README.rst: -------------------------------------------------------------------------------- 1 | Performance tests 2 | ----------------- 3 | 4 | The step-by-step demonstrations in this gallery illustrate performance tests 5 | for the various implemented solver types. 6 | All test cases are implemented on basis of the standard nonlinear Schrödinger 7 | equation. 8 | 9 | -------------------------------------------------------------------------------- /galleries/README.rst: -------------------------------------------------------------------------------- 1 | .. _usage-examples: 2 | 3 | Usage examples 4 | ============== 5 | 6 | Exemplary propagation scenarios obtained using `py-fmas`. Click on any image 7 | to see more details and source code. 8 | 9 | For more detailed tutorials, see our :ref:`extended-user-guide` page. 10 | -------------------------------------------------------------------------------- /tutorials/README.rst: -------------------------------------------------------------------------------- 1 | .. _extended-user-guide: 2 | 3 | Extended user guide 4 | =================== 5 | 6 | Step-by-step demonstration of basic and more specific `py-fmas` functionality. 7 | Click on any image to see the full demo including source code. 8 | 9 | For further examples that illustrate how to work with the `fmas` package, see 10 | our :ref:`usage-examples` page. 11 | -------------------------------------------------------------------------------- /tutorials/photon_number_conservation/README.rst: -------------------------------------------------------------------------------- 1 | Photon number conservation 2 | -------------------------- 3 | 4 | The examples provided in this gallery demonstrate the conservation of the 5 | photon number for the different models. Having available a proper conservation 6 | law is particularly important when the conservation quantity error method (CQE) 7 | is used for guiding step size adaption. 8 | -------------------------------------------------------------------------------- /docs/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '0.0.1', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | BUILDER: 'html', 7 | FILE_SUFFIX: '.html', 8 | LINK_SUFFIX: '.html', 9 | HAS_SOURCE: true, 10 | SOURCELINK_SUFFIX: '.txt', 11 | NAVIGATION_WITH_KEYS: false 12 | }; -------------------------------------------------------------------------------- /docs/_sources/reference_manual/index.rst.txt: -------------------------------------------------------------------------------- 1 | Reference manual 2 | **************** 3 | 4 | `py-fmas` is a pure Python package, organized as a collection of modules. The 5 | scope and capabilities of the individual modules are detailed below. 6 | 7 | .. toctree:: 8 | :maxdepth: 3 9 | :caption: Submodules 10 | 11 | models 12 | propagation_constant 13 | raman_response 14 | solver 15 | analytic_signal 16 | stepper 17 | tools 18 | data_io 19 | config 20 | 21 | 22 | -------------------------------------------------------------------------------- /fmas/version.py: -------------------------------------------------------------------------------- 1 | """ 2 | py-fmas version information. 3 | 4 | .. moduleauthor: Oliver Melchert 5 | """ 6 | __version__ = "1.0" 7 | 8 | """ 9 | CHANGELOG: 10 | 11 | 1.0 (Fr 23 Apr 2021 10:57:15 CEST) 12 | ---------------------------------- 13 | * increased major version number prior to submission -- OM 14 | 15 | 0.3.2 (So 18 Apr 2021 11:42:51 CEST) 16 | ------------------------------------ 17 | * added root-power loss to ModelBaseClass and derived fmas models -- OM 18 | 19 | 0.3.1 (Mo 12 Apr 2021 09:31:30 CEST) 20 | ------------------------------------ 21 | * added CQE_RK$IP to py-fmas solver module - OM 22 | 23 | """ 24 | -------------------------------------------------------------------------------- /examples_article/usage_example_01/res_SiSSM_RK2.dat: -------------------------------------------------------------------------------- 1 | 9.586794792767144e-05 3.4719164860898046e-06 4.53216264e-07 2 | 0.00019172419465335 6.944227982153156e-06 9.06451720480153e-07 3 | 0.00038340159306685296 1.389003720822393e-05 1.8129803915963635e-06 4 | 0.0007666160696900423 2.778640853848251e-05 3.626269844690934e-06 5 | 0.0015324842212633136 5.559822714984232e-05 7.253786113279886e-06 6 | 0.003061981143849701 0.0001112986838008118 1.4512642271615008e-05 7 | 0.006112047964182477 0.00022301101099901313 2.904621648263045e-05 8 | 0.012176715711588345 0.00044771458108405006 5.818134419934964e-05 9 | 0.0241660973353061 0.0009025060586413992 0.0001167595785003989 10 | 0.04759988869075444 0.001835812680044111 0.00023543665073862705 11 | 0.09239978392911156 0.003815242275475405 0.0004810849654287103 12 | -------------------------------------------------------------------------------- /examples_article/usage_example_01/res_CQE.dat: -------------------------------------------------------------------------------- 1 | 9.586794792767144e-05 7.48676650514303e-14 4.110034483450012e-15 2 | 0.00019172419465335 3.1870222871143924e-14 8.96483839172598e-16 3 | 0.00038340159306685296 2.2669645224661398e-14 1.9105298939436422e-15 4 | 0.0007666160696900423 1.3591232469791011e-14 1.372687022672779e-15 5 | 0.0015324842212633136 1.5378934354545975e-13 1.9457669468069652e-14 6 | 0.003061981143849701 2.4647169289853544e-12 3.1220206762941443e-13 7 | 0.006112047964182477 3.9411436409093156e-11 4.989397368540515e-12 8 | 0.012176715711588345 6.291706374333581e-10 7.957548702636745e-11 9 | 0.0241660973353061 1.0013031925294456e-08 1.2636483014690576e-09 10 | 0.04759988869075444 1.5796696385064025e-07 1.9825815039413775e-08 11 | 0.09239978392911156 2.4263563017582634e-06 2.997788797841814e-07 12 | -------------------------------------------------------------------------------- /examples_article/usage_example_01/res_IFM_RK4.dat: -------------------------------------------------------------------------------- 1 | 9.586794792767144e-05 1.2589261940861104e-13 1.1872352922377207e-14 2 | 0.00019172419465335 7.479417900335343e-14 4.239636030299554e-15 3 | 0.00038340159306685296 3.227824632377156e-14 9.39841257617868e-16 4 | 0.0007666160696900423 2.177929245180232e-14 1.921025532248044e-15 5 | 0.0015324842212633136 1.551368663654921e-13 1.968180431466452e-14 6 | 0.003061981143849701 2.4651900271718882e-12 3.1220840883054363e-13 7 | 0.006112047964182477 3.941067768948944e-11 4.989317565098659e-12 8 | 0.012176715711588345 6.291704778137722e-10 7.957548447408681e-11 9 | 0.0241660973353061 1.0013031866668531e-08 1.2636482935945164e-09 10 | 0.04759988869075444 1.579669638174262e-07 1.9825815039744598e-08 11 | 0.09239978392911156 2.4263563018268875e-06 2.997788797909199e-07 12 | -------------------------------------------------------------------------------- /examples_article/usage_example_01/res_LEM_RK2.dat: -------------------------------------------------------------------------------- 1 | 9.586794792767144e-05 4.641097545840023e-13 4.330844906819343e-14 2 | 0.00019172419465335 1.845302882032674e-13 1.958854200243349e-14 3 | 0.00038340159306685296 4.1873186279497697e-13 6.929335229574822e-14 4 | 0.0007666160696900423 3.151287206177318e-12 5.380628324391693e-13 5 | 0.0015324842212633136 2.4947327034748193e-11 4.26301984750017e-12 6 | 0.003061981143849701 1.9893474197985654e-10 3.4066165674327543e-11 7 | 0.006112047964182477 1.5807125630405112e-09 2.7184768862991955e-10 8 | 0.012176715711588345 1.2474784847170827e-08 2.1641223778882303e-09 9 | 0.0241660973353061 9.708416744727124e-08 1.7148560883816824e-08 10 | 0.04759988869075444 3.007466271271768e-07 5.4133765460433076e-08 11 | 0.09239978392911156 3.31727113059123e-07 5.831574476278593e-08 12 | -------------------------------------------------------------------------------- /examples_article/usage_example_01/res_LEM_RK4.dat: -------------------------------------------------------------------------------- 1 | 9.586794792767144e-05 4.625621976361518e-13 4.226648459914456e-14 2 | 0.00019172419465335 1.6549143138715446e-13 1.1858506342272797e-14 3 | 0.00038340159306685296 9.867167396826178e-14 2.92535944554799e-15 4 | 0.0007666160696900423 5.194245382313443e-14 5.011516095348287e-15 5 | 0.0015324842212633136 3.108447321876892e-14 1.2593470702104732e-15 6 | 0.003061981143849701 1.5516618044924636e-13 1.8011007108067405e-14 7 | 0.006112047964182477 2.5530663975877185e-12 2.9859623806324326e-13 8 | 0.012176715711588345 4.087264253444994e-11 4.780813040334859e-12 9 | 0.0241660973353061 6.535761156187608e-10 7.646677604059578e-11 10 | 0.04759988869075444 1.042524598801281e-08 1.2187196042608383e-09 11 | 0.09239978392911156 1.042524598801281e-08 1.2187196042608383e-09 12 | -------------------------------------------------------------------------------- /examples_article/usage_example_01/res_SySSM_RK2.dat: -------------------------------------------------------------------------------- 1 | 9.586794792767144e-05 4.1140488672521223e-10 4.066877950814735e-11 2 | 0.00019172419465335 1.645637144719851e-09 1.6269712678237836e-10 3 | 0.00038340159306685296 6.583430326898185e-09 6.509049688112462e-10 4 | 0.0007666160696900423 2.6341268958842223e-08 2.6045946974244307e-09 5 | 0.0015324842212633136 1.0542521727228251e-07 1.0426137895689141e-08 6 | 0.003061981143849701 4.2218057744877326e-07 4.176643553381147e-08 7 | 0.006112047964182477 1.692533233699418e-06 1.675574725910505e-07 8 | 0.012176715711588345 6.800196074475302e-06 6.741108578206302e-07 9 | 0.0241660973353061 2.743460433078652e-05 2.72666101965204e-06 10 | 0.04759988869075444 0.00011150515449312764 1.1137734586652009e-05 11 | 0.09239978392911156 0.0004585809623513615 4.629785177753676e-05 12 | -------------------------------------------------------------------------------- /docs/_sources/auto_examples/gallery_02/sg_execution_times.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | .. _sphx_glr_auto_examples_gallery_02_sg_execution_times: 5 | 6 | Computation times 7 | ================= 8 | **08:40.240** total execution time for **auto_examples_gallery_02** files: 9 | 10 | +------------------------------------------------------------------------------------+-----------+--------+ 11 | | :ref:`sphx_glr_auto_examples_gallery_02_g_molecules_02.py` (``g_molecules_02.py``) | 06:08.820 | 0.0 MB | 12 | +------------------------------------------------------------------------------------+-----------+--------+ 13 | | :ref:`sphx_glr_auto_examples_gallery_02_g_molecules_01.py` (``g_molecules_01.py``) | 02:31.420 | 0.0 MB | 14 | +------------------------------------------------------------------------------------+-----------+--------+ 15 | -------------------------------------------------------------------------------- /docs/_static/js/badge_only.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}}); -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name = "py-fmas", 5 | version = "1.0", 6 | author = "Oliver Melchert", 7 | author_email = "melchert@iqo.uni-hannover.de", 8 | description = "Ultrashort optical pulse propagation in terms of the analytic signal", 9 | keywords = "Ultrashort pulse propagation, analytic signal, Raman effect, Spectrograms", 10 | license = "MIT", 11 | packages=['fmas','fmas/solver','fmas/models'], 12 | classifiers=[ 13 | "Development Status :: Beta", 14 | "Intended Audience :: Science/Research", 15 | "Topic :: Scientific/Engineering :: Physics", 16 | "License :: OSI Approved :: MIT License", 17 | "Programming Language :: Python :: 3.9", 18 | ], 19 | install_requires=[ 20 | "numpy>=1.19.4", 21 | "scipy>=1.5.4", 22 | "matplotlib>=3.3.3", 23 | "h5py>=3.1.0" 24 | ], 25 | python_requires='>=3.9', 26 | ) 27 | -------------------------------------------------------------------------------- /docs/_static/gallery-dataframe.css: -------------------------------------------------------------------------------- 1 | /* Pandas dataframe css */ 2 | /* Taken from: https://github.com/spatialaudio/nbsphinx/blob/fb3ba670fc1ba5f54d4c487573dbc1b4ecf7e9ff/src/nbsphinx.py#L587-L619 */ 3 | 4 | table.dataframe { 5 | border: none !important; 6 | border-collapse: collapse; 7 | border-spacing: 0; 8 | border-color: transparent; 9 | color: black; 10 | font-size: 12px; 11 | table-layout: fixed; 12 | } 13 | table.dataframe thead { 14 | border-bottom: 1px solid black; 15 | vertical-align: bottom; 16 | } 17 | table.dataframe tr, 18 | table.dataframe th, 19 | table.dataframe td { 20 | text-align: right; 21 | vertical-align: middle; 22 | padding: 0.5em 0.5em; 23 | line-height: normal; 24 | white-space: normal; 25 | max-width: none; 26 | border: none; 27 | } 28 | table.dataframe th { 29 | font-weight: bold; 30 | } 31 | table.dataframe tbody tr:nth-child(odd) { 32 | background: #f5f5f5; 33 | } 34 | table.dataframe tbody tr:hover { 35 | background: rgba(66, 165, 245, 0.2); 36 | } 37 | -------------------------------------------------------------------------------- /docs/_sources/auto_tutorials/tests/sg_execution_times.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | .. _sphx_glr_auto_tutorials_tests_sg_execution_times: 5 | 6 | Computation times 7 | ================= 8 | **00:30.750** total execution time for **auto_tutorials_tests** files: 9 | 10 | +--------------------------------------------------------------------------------------+-----------+--------+ 11 | | :ref:`sphx_glr_auto_tutorials_tests_g_error_scaling.py` (``g_error_scaling.py``) | 00:30.750 | 0.0 MB | 12 | +--------------------------------------------------------------------------------------+-----------+--------+ 13 | | :ref:`sphx_glr_auto_tutorials_tests_g_performance_CQE.py` (``g_performance_CQE.py``) | 00:00.000 | 0.0 MB | 14 | +--------------------------------------------------------------------------------------+-----------+--------+ 15 | | :ref:`sphx_glr_auto_tutorials_tests_g_performance_LEM.py` (``g_performance_LEM.py``) | 00:00.000 | 0.0 MB | 16 | +--------------------------------------------------------------------------------------+-----------+--------+ 17 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2021 Oliver Melchert 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /docs/_sources/auto_tutorials/basics/sg_execution_times.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | .. _sphx_glr_auto_tutorials_basics_sg_execution_times: 5 | 6 | Computation times 7 | ================= 8 | **01:08.293** total execution time for **auto_tutorials_basics** files: 9 | 10 | +-----------------------------------------------------------------------------------------+-----------+--------+ 11 | | :ref:`sphx_glr_auto_tutorials_basics_g_app.py` (``g_app.py``) | 00:34.211 | 0.0 MB | 12 | +-----------------------------------------------------------------------------------------+-----------+--------+ 13 | | :ref:`sphx_glr_auto_tutorials_basics_g_code_listing_01.py` (``g_code_listing_01.py``) | 00:34.082 | 0.0 MB | 14 | +-----------------------------------------------------------------------------------------+-----------+--------+ 15 | | :ref:`sphx_glr_auto_tutorials_basics_ng_generate_infile.py` (``ng_generate_infile.py``) | 00:00.000 | 0.0 MB | 16 | +-----------------------------------------------------------------------------------------+-----------+--------+ 17 | -------------------------------------------------------------------------------- /docs/_sources/auto_tutorials/errors/sg_execution_times.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | .. _sphx_glr_auto_tutorials_errors_sg_execution_times: 5 | 6 | Computation times 7 | ================= 8 | **00:09.406** total execution time for **auto_tutorials_errors** files: 9 | 10 | +---------------------------------------------------------------------------------------------------+-----------+--------+ 11 | | :ref:`sphx_glr_auto_tutorials_errors_g_error_dealiasing.py` (``g_error_dealiasing.py``) | 00:09.406 | 0.0 MB | 12 | +---------------------------------------------------------------------------------------------------+-----------+--------+ 13 | | :ref:`sphx_glr_auto_tutorials_errors_g_error_3rdOrderSoliton.py` (``g_error_3rdOrderSoliton.py``) | 00:00.000 | 0.0 MB | 14 | +---------------------------------------------------------------------------------------------------+-----------+--------+ 15 | | :ref:`sphx_glr_auto_tutorials_errors_g_instabilities_dz.py` (``g_instabilities_dz.py``) | 00:00.000 | 0.0 MB | 16 | +---------------------------------------------------------------------------------------------------+-----------+--------+ 17 | -------------------------------------------------------------------------------- /docs/_sources/auto_tutorials/photon_number_conservation/sg_execution_times.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | .. _sphx_glr_auto_tutorials_photon_number_conservation_sg_execution_times: 5 | 6 | Computation times 7 | ================= 8 | **01:23.698** total execution time for **auto_tutorials_photon_number_conservation** files: 9 | 10 | +---------------------------------------------------------------------------------------------+-----------+--------+ 11 | | :ref:`sphx_glr_auto_tutorials_photon_number_conservation_g_FMAS_S_R.py` (``g_FMAS_S_R.py``) | 00:33.755 | 0.0 MB | 12 | +---------------------------------------------------------------------------------------------+-----------+--------+ 13 | | :ref:`sphx_glr_auto_tutorials_photon_number_conservation_g_FMAS.py` (``g_FMAS.py``) | 00:25.543 | 0.0 MB | 14 | +---------------------------------------------------------------------------------------------+-----------+--------+ 15 | | :ref:`sphx_glr_auto_tutorials_photon_number_conservation_g_FMAS_S.py` (``g_FMAS_S.py``) | 00:24.400 | 0.0 MB | 16 | +---------------------------------------------------------------------------------------------+-----------+--------+ 17 | -------------------------------------------------------------------------------- /examples_article/code_listing_01/main_code_listing_01.py: -------------------------------------------------------------------------------- 1 | """ 2 | Exemplary workflow using the py-fmas library code. 3 | 4 | .. codeauthor:: Oliver Melchert 5 | """ 6 | import fmas 7 | import numpy as np 8 | 9 | glob = fmas.data_io.read_h5("in_file.h5") 10 | 11 | grid = fmas.grid.Grid( 12 | t_max=glob.t_max, t_num=glob.t_num, z_max=glob.z_max, z_num=glob.z_num 13 | ) 14 | 15 | model = fmas.models.FMAS_S_Raman( 16 | w=grid.w, beta_w=glob.beta_w, n2=glob.n2, fR=glob.fR, tau1=glob.tau1, tau2=glob.tau2 17 | ) 18 | 19 | ic = fmas.analytic_signal.AS(glob.E_0t) 20 | 21 | 22 | def Cp(i, zi, w, uw): 23 | Iw = np.abs(uw) ** 2 24 | return np.sum(Iw[w > 0] / w[w > 0]) 25 | 26 | 27 | solver = fmas.solver.IFM_RK4IP(model.Lw, model.Nw, user_action=Cp) 28 | solver.set_initial_condition(grid.w, ic.w_rep) 29 | solver.propagate(z_range=glob.z_max, n_steps=glob.z_num, n_skip=glob.z_skip) 30 | 31 | res = {"t": grid.t, "z": solver.z, "w": solver.w, "u": solver.utz, "Cp": solver.ua_vals} 32 | fmas.data_io.save_h5("out_file.h5", **res) 33 | 34 | fmas.tools.plot_evolution( 35 | solver.z, grid.t, solver.utz, t_lim=(-500, 2200), w_lim=(1.0, 4.0) 36 | ) 37 | -------------------------------------------------------------------------------- /docs/_sources/auto_examples/gallery_03/sg_execution_times.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | .. _sphx_glr_auto_examples_gallery_03_sg_execution_times: 5 | 6 | Computation times 7 | ================= 8 | **10:22.905** total execution time for **auto_examples_gallery_03** files: 9 | 10 | +------------------------------------------------------------------------------+-----------+--------+ 11 | | :ref:`sphx_glr_auto_examples_gallery_03_g_BMCF.py` (``g_BMCF.py``) | 10:09.831 | 0.0 MB | 12 | +------------------------------------------------------------------------------+-----------+--------+ 13 | | :ref:`sphx_glr_auto_examples_gallery_03_g_model_KdV.py` (``g_model_KdV.py``) | 00:06.980 | 0.0 MB | 14 | +------------------------------------------------------------------------------+-----------+--------+ 15 | | :ref:`sphx_glr_auto_examples_gallery_03_g_model_LLE.py` (``g_model_LLE.py``) | 00:04.720 | 0.0 MB | 16 | +------------------------------------------------------------------------------+-----------+--------+ 17 | | :ref:`sphx_glr_auto_examples_gallery_03_g_model_NSE.py` (``g_model_NSE.py``) | 00:01.374 | 0.0 MB | 18 | +------------------------------------------------------------------------------+-----------+--------+ 19 | -------------------------------------------------------------------------------- /docs/_sources/auto_tutorials/attenuation/sg_execution_times.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | .. _sphx_glr_auto_tutorials_attenuation_sg_execution_times: 5 | 6 | Computation times 7 | ================= 8 | **00:01.820** total execution time for **auto_tutorials_attenuation** files: 9 | 10 | +------------------------------------------------------------------------------------------------------------+-----------+--------+ 11 | | :ref:`sphx_glr_auto_tutorials_attenuation_g_absorption_profile.py` (``g_absorption_profile.py``) | 00:01.820 | 0.0 MB | 12 | +------------------------------------------------------------------------------------------------------------+-----------+--------+ 13 | | :ref:`sphx_glr_auto_tutorials_attenuation_g_NSE_absorption_constant.py` (``g_NSE_absorption_constant.py``) | 00:00.000 | 0.0 MB | 14 | +------------------------------------------------------------------------------------------------------------+-----------+--------+ 15 | | :ref:`sphx_glr_auto_tutorials_attenuation_ng_fiber_details_nlpm750.py` (``ng_fiber_details_nlpm750.py``) | 00:00.000 | 0.0 MB | 16 | +------------------------------------------------------------------------------------------------------------+-----------+--------+ 17 | -------------------------------------------------------------------------------- /fmas/solver/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implements a solver base class that serves as a driver for a selection of 3 | implemented :math:`z`-propagation algorithms. Currently, the following 4 | algorithms are supported: 5 | 6 | .. autosummary:: 7 | :nosignatures: 8 | 9 | SolverBaseClass 10 | SiSSM 11 | SySSM 12 | IFM 13 | LEM_SySSM 14 | CQE_RK4IP 15 | 16 | A full :math:`z`-propagation scheme, i.e. a solver, is obtained by choosing one 17 | of the implemented :math:`z`-propagation algorithms and specifying a 18 | :math:`z`-stepping formula for the field update, see the calling structure of 19 | the solvers below. If a user does not specify a :math:`z`-stepping formula, 20 | each solver falls back to a reasonable default. 21 | 22 | Further :math:`z`-propagation schemes can be implemented by using the 23 | class :class:`SolverBaseClass`. 24 | 25 | .. codeauthor:: Oliver Melchert 26 | """ 27 | from .solver_base import SolverBaseClass 28 | from .split_step_solver import SiSSM, SySSM 29 | from .integrating_factor_method import IFM 30 | from .local_error_method import LEM_SySSM 31 | from .conservation_quantity_error_method import CQE_RK4IP 32 | 33 | # ALIAS FOR RUNGE-KUTTA IN THE INTERACTION PICTURE METHOD 34 | IFM_RK4IP = IFM 35 | 36 | # ALIAS FOR LOCAL ERROR METHOD 37 | LEM = LEM_SySSM 38 | 39 | # ALIAS FOR CONSERVATION QUANTITY ERROR METHOD 40 | CQE = CQE_RK4IP 41 | -------------------------------------------------------------------------------- /examples_article/code_listing_02/main_code_listing_02.py: -------------------------------------------------------------------------------- 1 | """ 2 | Script demonstrating how the convenience class PropConst can be used to analyze 3 | a propagation constant. 4 | 5 | .. codeauthor:: Oliver Melchert 6 | """ 7 | import numpy as np 8 | from fmas.propagation_constant import PropConst 9 | 10 | 11 | def get_beta_fun_ESM(): 12 | p = np.poly1d( 13 | (16.89475, 0.0, -319.13216, 0.0, 34.82210, 0.0, -0.992495, 0.0, 0.0010671)[::-1] 14 | ) 15 | q = np.poly1d( 16 | (1.00000, 0.0, -702.70157, 0.0, 78.28249, 0.0, -2.337086, 0.0, 0.0062267)[::-1] 17 | ) 18 | c = 0.29979 # (micron/fs) 19 | return lambda w: (1 + p(w) / q(w)) * w / c 20 | 21 | 22 | # -- WRAP PROPAATION CONSTANT 23 | beta_fun = get_beta_fun_ESM() 24 | pc = PropConst(beta_fun) 25 | 26 | # -- FIND ZERO DISPERSION POINT 27 | w_Z = pc.find_root_beta2(1.3, 2.2) 28 | print("w_Z = %lf rad/fs" % (w_Z)) 29 | 30 | # -- FIND GV MATCHED PARTNER FREQUENCY 31 | w_S = 1.5 # (rad/fs) 32 | w_GVM = pc.find_match_beta1(w_S, w_Z, 2.5) 33 | print("w_GVM = %lf rad/fs " % (w_GVM)) 34 | 35 | # -- GV MISMATCH FOR S AND DW1 36 | w_DW1 = 2.06 # (rad/fs) 37 | dvg = pc.vg(w_DW1) - pc.vg(w_S) 38 | print("dvg = %lf micron/fs" % (dvg)) 39 | 40 | # -- LOCAL EXPANSION COEFFICIENTS 41 | betas = pc.local_coeffs(w_S, n_max=4) 42 | for n, bn in enumerate(betas): 43 | print("b_%d = %lf fs^%d/micron" % (n, bn, n)) 44 | -------------------------------------------------------------------------------- /docs/_sources/citations.rst.txt: -------------------------------------------------------------------------------- 1 | Citations 2 | ********* 3 | 4 | If you use `py-fmas` in your work, please cite the `py-fmas` methods manuscript: 5 | 6 | - O. Melchert, A. Demircan, A python package for ultrashort optical pulse 7 | propagation in terms of forward models for the analytic signal, 8 | arXiv:2104.11649, https://arxiv.org/abs/2104.11649. 9 | 10 | Below you find a list of articles that used some of the :math:`z`-proapgation 11 | models and algorithms implemented by the `py-fmas` package: 12 | 13 | 4. O. Melchert, C. Bree, A. Tajalli, A. Pape, R. Arkhipov, S. Willms, I. 14 | Babushkin, D. Skryabin, G. Steinmeyer, U. Morgner, A. Demircan, All-optical 15 | supercontinuum switching, Communications Physics 3 (2020) 146, 16 | https://doi.org/10.1038/s42005-020-00414-1. 17 | 18 | 3. O. Melchert, S. Willms, S. Bose, A. Yulin, B. Roth, F. Mitschke, U. 19 | Morgner, I. Babushkin, A. Demircan, Soliton Molecules with Two Frequencies, 20 | Phys. Rev. Lett. 123 (2019) 243905, 21 | https://doi.org/10.1103/PhysRevLett.123.243905. 22 | 23 | 2. O. Melchert, B. Roth, U. Morgner, A. Demircan, OptFROG — Analytic signal 24 | spectrograms with optimized time–frequency resolution, SoftwareX 10 (2019) 25 | 100275, https://doi.org/10.1016/j.softx.2019.100275, code repository: 26 | https://github.com/ElsevierSoftwareX/SOFTX_2019_130. 27 | 28 | 1. O. Melchert, U. Morgner, B. Roth, I. Babushkin, A. Demircan, Accurate 29 | propagation of ultrashort pulses in nonlinear waveguides using propagation 30 | models for the analytic signal, Proc. SPIE 10694, Computational Optics II, 31 | 106940M (2018), https://doi.org/10.1117/12.2313255. 32 | -------------------------------------------------------------------------------- /fmas/config.py: -------------------------------------------------------------------------------- 1 | """ 2 | Module containing helper routines, convenient abbreviations, and constants. 3 | 4 | .. module:: config 5 | 6 | .. codeauthor:: Oliver Melchert 7 | """ 8 | import numpy as np 9 | import numpy.fft as nfft 10 | 11 | # -- FAST FOURIER-TRANSFORM 12 | FT = nfft.ifft 13 | r"""Compute one-dimensional discrete Fourier Transform (DFT). 14 | 15 | Note: 16 | * Alias for `numpy.fft.ifft`. 17 | * See numpy.ifft for definition of DFT, its arguments and conventions. 18 | * See ifft for inverse of `fft`. 19 | """ 20 | 21 | IFT = nfft.fft 22 | r"""Compute one-dimensional inverse discrete Fourier Transform (DFT). 23 | 24 | Note: 25 | * Alias for `numpy.fft.fft`. 26 | * See numpy.fft for definition of DFT, its arguments and conventions. 27 | * See FT for inverse of IFT. 28 | """ 29 | 30 | FTFREQ = nfft.fftfreq 31 | r"""Discrete Fourier Transform sample frequencies. 32 | 33 | Note: 34 | * Alias for `numpy.fft.fftfreq`. 35 | * See numpy.fft.fftfreq for definition, arguments and conventions. 36 | """ 37 | 38 | FTSHIFT = nfft.fftshift 39 | r"""Shift order of frequencies. 40 | 41 | Note: 42 | * Alias for `numpy.fft.fftshift`. 43 | * See numpy.fft.fftshift for definition, arguments and conventions. 44 | """ 45 | 46 | # -- ANGULAR FREQUENCY BOUND FOR DEALIASING 47 | W_MAX_FAC = 0.75 48 | r"""float: Angular frequency bound for dealiasing. 49 | 50 | All angular frequency components satisfying abs(w) >= W_MAX_FAC*max(w) are 51 | discarded. 52 | """ 53 | 54 | # -- C0 - UNIT(C0) = micron/fs = mm/ps 55 | C0 = 0.29979 56 | r"""float: Speed of light. 57 | 58 | Units are [C0] = micron/fs. 59 | """ 60 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # py-fmas 2 | 3 | [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) 4 | 5 | `py-fmas` is a Python package for the accurate numerical simulation of the 6 | z-propagation dynamics of ultrashort optical pulses in single mode nonlinear 7 | waveguides. The simulation approach is based on propagation models for the 8 | analytic signal of the optical field. 9 | 10 | The software implements various models of the Raman response and allows to 11 | calculate spectrograms, detailing the time-frequency composition of the 12 | analytic signal. Additionally, a convenience class for analyzing propagation 13 | constants is provided. 14 | 15 | Further details can be found on the [py-fmas project page](https://omelchert.github.io/py-fmas/). 16 | 17 | ## Installation 18 | 19 | The software can be installed by cloning the repository and installing the 20 | provided Python3 wheel in the following way 21 | 22 | ``` 23 | $ git clone https://github.com/omelchert/py-fmas.git 24 | $ cd ./py-fmas/dist 25 | $ python3 -m pip install py_fmas-1.0-py3-none-any.whl 26 | ``` 27 | 28 | ## Further information 29 | 30 | - **Project page:** 31 | 32 | - **Source:** 33 | 34 | - **Extended user guide:** 35 | 36 | - **Examples gallery:** 37 | 38 | - **Reference manual:** 39 | 40 | - **Citations:** 41 | 42 | ## License 43 | 44 | This project is licensed under the MIT License - see the 45 | [LICENSE.md](LICENSE.md) file for details. 46 | 47 | -------------------------------------------------------------------------------- /docs/_sources/auto_examples/gallery_01/sg_execution_times.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | .. _sphx_glr_auto_examples_gallery_01_sg_execution_times: 5 | 6 | Computation times 7 | ================= 8 | **09:18.268** total execution time for **auto_examples_gallery_01** files: 9 | 10 | +----------------------------------------------------------------------------------------------------------------+-----------+--------+ 11 | | :ref:`sphx_glr_auto_examples_gallery_01_g_four_pulse_interaction_ESM.py` (``g_four_pulse_interaction_ESM.py``) | 04:42.481 | 0.0 MB | 12 | +----------------------------------------------------------------------------------------------------------------+-----------+--------+ 13 | | :ref:`sphx_glr_auto_examples_gallery_01_g_soliton_implosion.py` (``g_soliton_implosion.py``) | 01:24.165 | 0.0 MB | 14 | +----------------------------------------------------------------------------------------------------------------+-----------+--------+ 15 | | :ref:`sphx_glr_auto_examples_gallery_01_g_optfrog.py` (``g_optfrog.py``) | 01:21.680 | 0.0 MB | 16 | +----------------------------------------------------------------------------------------------------------------+-----------+--------+ 17 | | :ref:`sphx_glr_auto_examples_gallery_01_g_specialized_model_PCF.py` (``g_specialized_model_PCF.py``) | 01:05.424 | 0.0 MB | 18 | +----------------------------------------------------------------------------------------------------------------+-----------+--------+ 19 | | :ref:`sphx_glr_auto_examples_gallery_01_g_specialized_model_NLPM.py` (``g_specialized_model_NLPM.py``) | 00:44.519 | 0.0 MB | 20 | +----------------------------------------------------------------------------------------------------------------+-----------+--------+ 21 | -------------------------------------------------------------------------------- /fmas/models/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implements several :math:`z`-propagation models based on the forward model for 3 | the analytic signal [1,2,3,4]. 4 | 5 | .. autosummary:: 6 | :nosignatures: 7 | 8 | ModelBaseClass 9 | FMAS_THG 10 | FMAS 11 | FMAS_S 12 | FMAS_S_Raman 13 | BMCF 14 | CustomModelPCF 15 | 16 | Further :math:`z`-propagation models can be implemented by using the 17 | class :class:`ModelBaseClass`. 18 | 19 | References: 20 | [1] Sh. Amiranashvili, A. Demircan, Hamiltonian structure of 21 | propagation equations for ultrashort optical pulses, Phys. Rev. E 10 22 | (2010) 013812, http://dx.doi.org/10.1103/PhysRevA.82.013812. 23 | 24 | [2] Sh. Amiranashvili, A. Demircan, Ultrashort Optical Pulse Propagation in 25 | terms of Analytic Signal, Adv. Opt. Tech. 2011 (2011) 989515, 26 | http://dx.doi.org/10.1155/2011/989515. 27 | 28 | [3] A. Demircan, Sh. Amiranashvili, C. Bree, C. Mahnke, F. Mitschke, G. 29 | Steinmeyer, Rogue wave formation by accelerated solitons at an optical 30 | event horizon, Appl. Phys. B 115 (2014) 343, 31 | http://dx.doi.org/10.1007/s00340-013-5609-9 32 | 33 | [4] A. Demircan, Sh. Amiranashvili, C. Bree, U. Morgner, G. Steinmeyer, 34 | Supercontinuum generation by multiple scatterings at a group velocity 35 | horizon, Opt. Exp. 22 (2014) 3866, 36 | https://doi.org/10.1364/OE.22.003866. 37 | 38 | .. module:: models 39 | 40 | .. codeauthor:: Oliver Melchert 41 | """ 42 | # from .my_models import * 43 | from .model_base import ModelBaseClass 44 | from .fmas_thg import FMAS_THG 45 | from .fmas import FMAS 46 | from .fmas_s import FMAS_S 47 | from .fmas_s_raman import FMAS_S_Raman 48 | from .bmcf import BMCF 49 | from .custom_model_pcf import CustomModelPCF 50 | 51 | 52 | # ALIAS FOR FMAS_S_Raman 53 | FMAS_S_R = FMAS_S_Raman 54 | -------------------------------------------------------------------------------- /docs/_sources/auto_tutorials/specific/sg_execution_times.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | :orphan: 3 | 4 | .. _sphx_glr_auto_tutorials_specific_sg_execution_times: 5 | 6 | Computation times 7 | ================= 8 | **04:07.185** total execution time for **auto_tutorials_specific** files: 9 | 10 | +-----------------------------------------------------------------------------------------------------------+-----------+--------+ 11 | | :ref:`sphx_glr_auto_tutorials_specific_g_raman_response.py` (``g_raman_response.py``) | 03:12.144 | 0.0 MB | 12 | +-----------------------------------------------------------------------------------------------------------+-----------+--------+ 13 | | :ref:`sphx_glr_auto_tutorials_specific_g_custom_propagation_model.py` (``g_custom_propagation_model.py``) | 00:34.113 | 0.0 MB | 14 | +-----------------------------------------------------------------------------------------------------------+-----------+--------+ 15 | | :ref:`sphx_glr_auto_tutorials_specific_g_spectrogram.py` (``g_spectrogram.py``) | 00:19.830 | 0.0 MB | 16 | +-----------------------------------------------------------------------------------------------------------+-----------+--------+ 17 | | :ref:`sphx_glr_auto_tutorials_specific_g_list_prop_const.py` (``g_list_prop_const.py``) | 00:00.581 | 0.0 MB | 18 | +-----------------------------------------------------------------------------------------------------------+-----------+--------+ 19 | | :ref:`sphx_glr_auto_tutorials_specific_g_user_guide_PropConst.py` (``g_user_guide_PropConst.py``) | 00:00.297 | 0.0 MB | 20 | +-----------------------------------------------------------------------------------------------------------+-----------+--------+ 21 | | :ref:`sphx_glr_auto_tutorials_specific_g_list_raman_models.py` (``g_list_raman_models.py``) | 00:00.220 | 0.0 MB | 22 | +-----------------------------------------------------------------------------------------------------------+-----------+--------+ 23 | -------------------------------------------------------------------------------- /fmas/models/model_base.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implements model bas class. 3 | 4 | .. codeauthor:: Oliver Melchert 5 | """ 6 | import numpy as np 7 | from ..config import FTFREQ, FT, IFT, C0 8 | 9 | 10 | class ModelBaseClass: 11 | r"""Base class for propagation models. 12 | 13 | Attributes: 14 | w (:obj:`numpy.ndarray`): 15 | Angular frequency grid. 16 | beta_w (:obj:`numpy.ndarray`): 17 | Frequency-domain representation of propagation constant. 18 | alpha_w (:obj:`numpy.ndarray`): 19 | Frequency-domain representation of root-power loss. 20 | c0 (:obj:`float`): speed of light 21 | 22 | Args: 23 | w (:obj:`numpy.ndarray`): 24 | Angular frequency grid. 25 | beta_w (:obj:`numpy.ndarray`): 26 | Frequency-domain representation of propagation constant. 27 | alpha_w (:obj:`numpy.ndarray`): 28 | Frequency-domain representation of root-power loss (default: None). 29 | """ 30 | 31 | def __init__(self, w, beta_w, alpha_w=None): 32 | self.beta_w = beta_w 33 | self.alpha_w = alpha_w 34 | self.w = w 35 | self.c0 = C0 36 | 37 | @property 38 | def Lw(self): 39 | r"""Frequency-domain representation of nonlinear operator. 40 | 41 | Returns: 42 | exception `NotImplementedError` 43 | """ 44 | raise NotImplementedError 45 | 46 | def Nw(self, uw): 47 | r"""Frequency-domain representation of nonlinear operator. 48 | 49 | Args: 50 | uw (:obj:`numpy.ndarray`): 51 | Frequency-domain representation of field at current 52 | :math:`z`-position. 53 | 54 | Returns: 55 | exception `NotImplementedError` 56 | """ 57 | raise NotImplementedError 58 | 59 | def claw(self, *args): 60 | r"""Conservation law. 61 | 62 | Callback function that can be used to implementing a measurement 63 | using a user-supplied function. 64 | 65 | Returns: 66 | None 67 | """ 68 | return None 69 | -------------------------------------------------------------------------------- /fmas/app.py: -------------------------------------------------------------------------------- 1 | import sys, os 2 | import time 3 | import numpy as np 4 | import logging as log 5 | from .config import FTFREQ, FT, IFT 6 | from .solver import IFM_RK4IP, SiSSM, SySSM, LEM, CQE 7 | from .models import FMAS_S, FMAS_S_Raman 8 | from .data_io import read_h5, save_h5 9 | from .grid import Grid 10 | from .analytic_signal import AnalyticSignal 11 | 12 | 13 | def run(file_name, model_type = 'FMAS_S_R', solver_type = 'IFM_RK4IP'): 14 | 15 | glob = read_h5(file_name) 16 | 17 | grid = Grid(t_max=glob.t_max, t_num=glob.t_num, z_max=glob.z_max, z_num=glob.z_num) 18 | 19 | # -- SET MODEL TYPE 20 | model_switch = { 21 | "FMAS_S": FMAS_S(w=grid.w, beta_w=glob.beta_w, n2=glob.n2), 22 | "FMAS_S_R": FMAS_S_Raman( 23 | w=grid.w, 24 | beta_w=glob.beta_w, 25 | n2=glob.n2, 26 | fR=glob.fR, 27 | tau1=glob.tau1, 28 | tau2=glob.tau2, 29 | ), 30 | } 31 | try: 32 | model = model_switch[model_type] 33 | except KeyError: 34 | print("MODEL_TYPE MUST BE ONE OF", list(model_switch.keys())) 35 | raise 36 | exit() 37 | 38 | ic = AnalyticSignal(glob.E_0t) 39 | 40 | # -- SET SOLVER TYPE 41 | solver_switch = { 42 | "SiSSM": SiSSM, 43 | "SySSM": SySSM, 44 | "IFM_RK4IP": IFM_RK4IP, 45 | "LEM": LEM, 46 | "CQE": CQE 47 | } 48 | try: 49 | Solver = solver_switch[solver_type] 50 | except KeyError: 51 | print("SOLVER_TYPE MUST BE ONE OF", list(solver_switch.keys())) 52 | raise 53 | exit() 54 | 55 | solver = Solver(model.Lw, model.Nw, user_action=model.claw) 56 | 57 | solver.set_initial_condition(grid.w, ic.w_rep) 58 | 59 | solver.propagate(z_range=glob.z_max, n_steps=glob.z_num, n_skip=glob.z_skip) 60 | 61 | res = { 62 | "t": grid.t, 63 | "z": solver.z, 64 | "w": solver.w, 65 | "u": solver.utz, 66 | "Cp": solver.ua_vals, 67 | } 68 | 69 | return res 70 | 71 | 72 | if __name__ == "__main__": 73 | file_name = sys.argv[1] 74 | res = run(file_name) 75 | save_h5("out_file.h5", **res) 76 | -------------------------------------------------------------------------------- /tutorials/basics/g_app.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Using `fmas` as a black-box application 3 | ======================================= 4 | 5 | This examples shows how to use `py-fmas` as a black-box application, that 6 | only requires a minimal amount of scripting. 7 | 8 | .. codeauthor:: Oliver Melchert 9 | """ 10 | 11 | 12 | ############################################################################### 13 | # We start by simply importing the required `fmas` into the current namespace. 14 | # 15 | 16 | import fmas 17 | 18 | ############################################################################### 19 | # If an adequate input file is located within the current working directory, 20 | # `fmas` can be used as shown below. It features a particular function called 21 | # `run`, which reads-in the propagation setting stored in the input file 22 | # `input_file.h5` and runs the simulaton 23 | 24 | res = fmas.run('input_file.h5', model_type='FMAS_S_R', solver_type='IFM_RK4IP') 25 | 26 | ############################################################################### 27 | # An example that shows how an adequate input file can be generated via python 28 | # is shown under the link below: 29 | # 30 | # :ref:`sphx_glr_auto_tutorials_basics_ng_generate_infile.py` 31 | # 32 | # After the proapgation algorithm (specified in `input_file.h5`) terminates, 33 | # a simple dictionary data structure with the following keys is available 34 | 35 | print(res.keys()) 36 | 37 | ############################################################################### 38 | # A simple plot that shows the result of the simulation run can be produced 39 | # using function `plot_evolution` implemented in module `tools` 40 | 41 | from fmas.tools import plot_evolution 42 | plot_evolution( res['z'], res['t'], res['u'], t_lim=(-500,2200), w_lim=(1.,4.)) 43 | 44 | ############################################################################### 45 | # The results can be stored for later postprocessing using the function 46 | # `save_h5` implemented in module `data_io`. It will generate a file 47 | # `out_file.h5` with HDF5 format in the current working directory 48 | 49 | from fmas.data_io import save_h5 50 | save_h5('out_file.h5', **res) 51 | -------------------------------------------------------------------------------- /docs/_downloads/3bd7975d46103e6166fd99423ccfe727/g_test.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Attenuation of a NLPM750 fiber 3 | ============================== 4 | 5 | This example demonstrates how to use models along with a realistic attenuation 6 | profile. 7 | 8 | .. codeauthor:: Oliver Melchert 9 | """ 10 | import fmas 11 | import numpy as np 12 | from fmas.grid import Grid 13 | from fmas.models import FMAS_S 14 | from fmas.solver import IFM_RK4IP, SySSM 15 | from ng_fiber_details_nlpm750 import define_alpha_fun_NLPM750 16 | 17 | 18 | # -- INITIALIZATION STAGE 19 | # ... DEFINE SIMULATION PARAMETERS 20 | t_max = 1000. # (fs) 21 | t_num = 2**13 # (-) 22 | z_max = 1.0e5 # (micron) 23 | z_num = 1000 # (-) 24 | z_skip = 10 # (-) 25 | # ... PROPAGGATION CONSTANT 26 | alpha_fun = define_alpha_fun_NLPM750() 27 | # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER 28 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 29 | model = FMAS_S( w = grid.w, beta_w = 0., alpha_w = alpha_fun(grid.w), n2 = 0.0) 30 | solver = SySSM( model.Lw, model.Nw) 31 | 32 | # -- SET UP INITIAL CONDITION 33 | u_0w = np.where(np.logical_and( grid.w>1, grid.w<6. ), 1, 0) 34 | solver.set_initial_condition( grid.w, u_0w) 35 | 36 | # -- PERFORM Z-PROPAGATION 37 | solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip) 38 | 39 | 40 | import matplotlib as mpl 41 | import matplotlib.pyplot as plt 42 | import matplotlib.colors as col 43 | 44 | f, ax = plt.subplots(1, 1, figsize=(5, 3)) 45 | plt.subplots_adjust(left=0.15, right=0.96, bottom=0.15, top=0.96, hspace=0.2) 46 | 47 | _dB = lambda x: np.where(x>1e-20,10.*np.log10(x),10*np.log10(1e-20)) 48 | w_mask = np.logical_and(grid.w>1,grid.w<5.) 49 | I0 = np.abs(solver.uwz[0,w_mask])**2 50 | Iz = np.abs(solver.uwz[-1,w_mask])**2 51 | lam =2*np.pi*0.3/grid.w[w_mask] 52 | loss = -_dB(Iz/I0)*1e9/z_max # (dB/km) attenuation 53 | ax.plot(lam, loss) 54 | 55 | ax.xaxis.set_ticks_position("bottom") 56 | ax.yaxis.set_ticks_position("left") 57 | ax.set_xlim([0.4, 1.6]) 58 | ax.set_ylim([0,200]) 59 | ax.ticklabel_format(useOffset=False, style="sci") 60 | ax.set_xlabel(r"Wavelength $\mathrm{(\mu m)}$") 61 | ax.set_ylabel(r"Loss $\mathrm{(dB/km)}$") 62 | 63 | plt.show() 64 | -------------------------------------------------------------------------------- /docs/_downloads/15a0767e6a3ccba7db6df4310681a0b4/g_app.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Using `fmas` as a black-box application 3 | ======================================= 4 | 5 | This examples shows how to use `py-fmas` as a black-box application, that 6 | only requires a minimal amount of scripting. 7 | 8 | .. codeauthor:: Oliver Melchert 9 | """ 10 | 11 | 12 | ############################################################################### 13 | # We start by simply importing the required `fmas` into the current namespace. 14 | # 15 | 16 | import fmas 17 | 18 | ############################################################################### 19 | # If an adequate input file is located within the current working directory, 20 | # `fmas` can be used as shown below. It features a particular function called 21 | # `run`, which reads-in the propagation setting stored in the input file 22 | # `input_file.h5` and runs the simulaton 23 | 24 | res = fmas.run('input_file.h5', model_type='FMAS_S_R', solver_type='IFM_RK4IP') 25 | 26 | ############################################################################### 27 | # An example that shows how an adequate input file can be generated via python 28 | # is shown under the link below: 29 | # 30 | # :ref:`sphx_glr_auto_tutorials_basics_ng_generate_infile.py` 31 | # 32 | # After the proapgation algorithm (specified in `input_file.h5`) terminates, 33 | # a simple dictionary data structure with the following keys is available 34 | 35 | print(res.keys()) 36 | 37 | ############################################################################### 38 | # A simple plot that shows the result of the simulation run can be produced 39 | # using function `plot_evolution` implemented in module `tools` 40 | 41 | from fmas.tools import plot_evolution 42 | plot_evolution( res['z'], res['t'], res['u'], t_lim=(-500,2200), w_lim=(1.,4.)) 43 | 44 | ############################################################################### 45 | # The results can be stored for later postprocessing using the function 46 | # `save_h5` implemented in module `data_io`. It will generate a file 47 | # `out_file.h5` with HDF5 format in the current working directory 48 | 49 | from fmas.data_io import save_h5 50 | save_h5('out_file.h5', **res) 51 | -------------------------------------------------------------------------------- /tutorials/attenuation/g_absorption_profile.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Attenuation of a NLPM750 fiber 3 | ============================== 4 | 5 | This example demonstrates how to use models along with a realistic attenuation 6 | profile. 7 | 8 | .. codeauthor:: Oliver Melchert 9 | """ 10 | import fmas 11 | import numpy as np 12 | from fmas.grid import Grid 13 | from fmas.models import FMAS_S 14 | from fmas.solver import IFM_RK4IP, SySSM 15 | from ng_fiber_details_nlpm750 import define_alpha_fun_NLPM750 16 | 17 | 18 | # -- INITIALIZATION STAGE 19 | # ... DEFINE SIMULATION PARAMETERS 20 | t_max = 1000.0 # (fs) 21 | t_num = 2 ** 13 # (-) 22 | z_max = 1.0e5 # (micron) 23 | z_num = 1000 # (-) 24 | z_skip = 10 # (-) 25 | # ... PROPAGGATION CONSTANT 26 | alpha_fun = define_alpha_fun_NLPM750() 27 | # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER 28 | grid = Grid(t_max=t_max, t_num=t_num, z_max=z_max, z_num=z_num) 29 | model = FMAS_S(w=grid.w, beta_w=0.0, alpha_w=alpha_fun(grid.w), n2=0.0) 30 | solver = SySSM(model.Lw, model.Nw) 31 | 32 | # -- SET UP INITIAL CONDITION 33 | u_0w = np.where(np.logical_and(grid.w > 1, grid.w < 6.0), 1, 0) 34 | solver.set_initial_condition(grid.w, u_0w) 35 | 36 | # -- PERFORM Z-PROPAGATION 37 | solver.propagate(z_range=z_max, n_steps=z_num, n_skip=z_skip) 38 | 39 | import matplotlib as mpl 40 | import matplotlib.pyplot as plt 41 | import matplotlib.colors as col 42 | 43 | f, ax = plt.subplots(1, 1, figsize=(5, 3)) 44 | plt.subplots_adjust(left=0.15, right=0.96, bottom=0.15, top=0.96, hspace=0.2) 45 | 46 | I0 = np.abs(solver.uwz[0]) ** 2 47 | Iz = np.abs(solver.uwz[-1]) ** 2 48 | _dB = lambda x: 10.0 * np.log10(x) 49 | loss_w = ( 50 | -_dB( 51 | np.divide( 52 | Iz, 53 | I0, 54 | out=np.ones(grid.w.size, dtype="float"), 55 | where=I0 > 1e-10, 56 | ) 57 | ) 58 | * 1e9 59 | / z_max 60 | ) 61 | 62 | w = grid.w 63 | w_mask = np.logical_and(w > 1, w < 5.0) 64 | _lam = lambda w: 2 * np.pi * 0.3 / w 65 | 66 | ax.plot(_lam(w[w_mask]), loss_w[w_mask]) 67 | 68 | ax.xaxis.set_ticks_position("bottom") 69 | ax.yaxis.set_ticks_position("left") 70 | ax.set_xlim([0.4, 1.6]) 71 | ax.set_ylim([0, 200]) 72 | ax.ticklabel_format(useOffset=False, style="sci") 73 | ax.set_xlabel(r"Wavelength $\mathrm{(\mu m)}$") 74 | ax.set_ylabel(r"Loss $\mathrm{(dB/km)}$") 75 | 76 | plt.show() 77 | -------------------------------------------------------------------------------- /docs/_downloads/7858650ed8421f570ff3925a3a1f7b03/g_absorption_profile.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Attenuation of a NLPM750 fiber 3 | ============================== 4 | 5 | This example demonstrates how to use models along with a realistic attenuation 6 | profile. 7 | 8 | .. codeauthor:: Oliver Melchert 9 | """ 10 | import fmas 11 | import numpy as np 12 | from fmas.grid import Grid 13 | from fmas.models import FMAS_S 14 | from fmas.solver import IFM_RK4IP, SySSM 15 | from ng_fiber_details_nlpm750 import define_alpha_fun_NLPM750 16 | 17 | 18 | # -- INITIALIZATION STAGE 19 | # ... DEFINE SIMULATION PARAMETERS 20 | t_max = 1000.0 # (fs) 21 | t_num = 2 ** 13 # (-) 22 | z_max = 1.0e5 # (micron) 23 | z_num = 1000 # (-) 24 | z_skip = 10 # (-) 25 | # ... PROPAGGATION CONSTANT 26 | alpha_fun = define_alpha_fun_NLPM750() 27 | # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER 28 | grid = Grid(t_max=t_max, t_num=t_num, z_max=z_max, z_num=z_num) 29 | model = FMAS_S(w=grid.w, beta_w=0.0, alpha_w=alpha_fun(grid.w), n2=0.0) 30 | solver = SySSM(model.Lw, model.Nw) 31 | 32 | # -- SET UP INITIAL CONDITION 33 | u_0w = np.where(np.logical_and(grid.w > 1, grid.w < 6.0), 1, 0) 34 | solver.set_initial_condition(grid.w, u_0w) 35 | 36 | # -- PERFORM Z-PROPAGATION 37 | solver.propagate(z_range=z_max, n_steps=z_num, n_skip=z_skip) 38 | 39 | import matplotlib as mpl 40 | import matplotlib.pyplot as plt 41 | import matplotlib.colors as col 42 | 43 | f, ax = plt.subplots(1, 1, figsize=(5, 3)) 44 | plt.subplots_adjust(left=0.15, right=0.96, bottom=0.15, top=0.96, hspace=0.2) 45 | 46 | I0 = np.abs(solver.uwz[0]) ** 2 47 | Iz = np.abs(solver.uwz[-1]) ** 2 48 | _dB = lambda x: 10.0 * np.log10(x) 49 | loss_w = ( 50 | -_dB( 51 | np.divide( 52 | Iz, 53 | I0, 54 | out=np.ones(grid.w.size, dtype="float"), 55 | where=I0 > 1e-10, 56 | ) 57 | ) 58 | * 1e9 59 | / z_max 60 | ) 61 | 62 | w = grid.w 63 | w_mask = np.logical_and(w > 1, w < 5.0) 64 | _lam = lambda w: 2 * np.pi * 0.3 / w 65 | 66 | ax.plot(_lam(w[w_mask]), loss_w[w_mask]) 67 | 68 | ax.xaxis.set_ticks_position("bottom") 69 | ax.yaxis.set_ticks_position("left") 70 | ax.set_xlim([0.4, 1.6]) 71 | ax.set_ylim([0, 200]) 72 | ax.ticklabel_format(useOffset=False, style="sci") 73 | ax.set_xlabel(r"Wavelength $\mathrm{(\mu m)}$") 74 | ax.set_ylabel(r"Loss $\mathrm{(dB/km)}$") 75 | 76 | plt.show() 77 | -------------------------------------------------------------------------------- /fmas/stepper.py: -------------------------------------------------------------------------------- 1 | """ 2 | The :math:`z`-propagation schemes implemented with the pyFMAS package are 3 | specified by a :math:`z`-propagation algorithm along with a :math:`z`-stepping 4 | formula that performs the field update for a single step. 5 | Implements are the subsequent :math:`z`-stepping formulas. 6 | 7 | .. autosummary:: 8 | :nosignatures: 9 | 10 | RungeKutta2 11 | RungeKutta4 12 | 13 | .. [NR1992] W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery, 14 | Numerical Recipes in C: The art of scientific computing (Chapter 16.1), 15 | Cambridge University Press (1992). 16 | 17 | .. module:: stepper 18 | 19 | .. codeauthor:: Oliver Melchert 20 | """ 21 | 22 | 23 | def RungeKutta2(fun, z, uw, dz): 24 | r"""Second-order Runge-Kutta formula 25 | 26 | Implements second-order Runge-Kutta formula for :math:`z`-stepping 27 | [NR1992]_. Achieves local error :math:`\mathcal O(\Delta z^3)`, with step 28 | size :math:`\Delta z`. 29 | 30 | Args: 31 | fun (:obj:`function`): 32 | Function evaluating the evolution rate of the ODE. 33 | z (:obj:`float`): 34 | Current :math:`z`-value. 35 | uw (:obj:`numpy.ndarray`, 1-dim): 36 | Frequency-domain representation of the current field. 37 | dz (:obj:`float`): 38 | Step size. 39 | """ 40 | k1 = fun(z, uw) 41 | k2 = fun(z + 0.5 * dz, uw + 0.5 * dz * k1) 42 | return uw + dz * k2 43 | 44 | 45 | def RungeKutta4(fun, z, uw, dz): 46 | r"""Fourth-order Runge-Kutta formula 47 | 48 | Implements fourth-order Runge-Kutta formula for :math:`z`-stepping 49 | [NR1992]_. Achieves local error :math:`\mathcal O(\Delta z^5)`, with step 50 | size :math:`\Delta z`. 51 | 52 | Args: 53 | fun (:obj:`function`): 54 | Function evaluating the evolution rate of the ODE. 55 | z (:obj:`float`): 56 | Current :math:`z`-value. 57 | uw (:obj:`numpy.ndarray`, 1-dim): 58 | Frequency-domain representation of the current field. 59 | dz (:obj:`float`): 60 | Step size. 61 | """ 62 | k1 = fun(z, uw) 63 | k2 = fun(z + 0.5 * dz, uw + 0.5 * dz * k1) 64 | k3 = fun(z + 0.5 * dz, uw + 0.5 * dz * k2) 65 | k4 = fun(z + dz, uw + dz * k3) 66 | return uw + dz * (k1 + 2.0 * k2 + 2.0 * k3 + k4) / 6.0 67 | 68 | 69 | # EOF: z_stepper.py 70 | -------------------------------------------------------------------------------- /fmas/grid.py: -------------------------------------------------------------------------------- 1 | """ 2 | Module containing grid data structure specifying the computational domain. 3 | 4 | .. module:: grid 5 | 6 | .. codeauthor:: Oliver Melchert 7 | """ 8 | import numpy as np 9 | from .config import FTFREQ, FT, IFT, W_MAX_FAC 10 | 11 | 12 | class Grid: 13 | r"""Data structure specifying the discretized computational domain. 14 | 15 | The computational domain is discretized by using a time mesh and 16 | z-coordinate mesh with uniform mesh-widths. 17 | 18 | Args: 19 | t_max (float): temporal mesh extends from -t_max to t_max. 20 | t_num (int): number of meshpoints for temporal mesh. 21 | z_max (float): propagation range. 22 | z_int (int): number of z-steps. 23 | 24 | Attributes: 25 | t_max (float): time mesh extending from -t_max to t_max. 26 | t_num (int): number of time mesh mesh-points. 27 | z_max (float): propagation range. 28 | z_int (int): number of z-steps. 29 | t (np.ndarray): array representing time mesh. 30 | dt (float): time mesh-width. 31 | z (np.ndarray): z-coordinate mesh. 32 | dz (float): z-coordinate mesh width. 33 | """ 34 | 35 | def __init__(self, t_max, t_num, z_max=None, z_num=None): 36 | self.t_max = t_max 37 | self.t_num = t_num 38 | self.z_max = z_max 39 | self.z_num = z_num 40 | self.t, self.dt = self._set_t_axis() 41 | self.w, self.dw = self._set_w_axis() 42 | if z_max is not None: 43 | self.z, self.dz = self._set_z_axis() 44 | 45 | def _set_t_axis(self): 46 | r"""Set temporal mesh. 47 | 48 | Returns: 49 | t (np.ndarray): temporal mesh. 50 | """ 51 | return np.linspace( 52 | -self.t_max, self.t_max, self.t_num, endpoint=False, retstep=True 53 | ) 54 | 55 | def _set_w_axis(self): 56 | r"""Set angular frequency mesh. 57 | 58 | Returns: 59 | w (np.ndarray): angular frequency mesh. 60 | """ 61 | w = FTFREQ(self.t.size, d=self.dt) * 2 * np.pi 62 | dw = w[1] - w[0] 63 | return w, dw 64 | 65 | def _set_z_axis(self): 66 | r"""Set z-mesh. 67 | 68 | Returns: 69 | z (np.ndarray): z-mesh. 70 | """ 71 | return np.linspace(0, self.z_max, self.z_num + 1, retstep=True) 72 | 73 | 74 | if __name__ == "__main__": 75 | grid = Grid(3500, 1000, 30, 300) 76 | print(grid.dt) 77 | -------------------------------------------------------------------------------- /examples_article/usage_example_04/main_usage_example_04.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import numpy as np 3 | from fmas.models import ModelBaseClass 4 | from fmas.config import FTFREQ, FT, IFT, C0 5 | from fmas.grid import Grid 6 | from fmas.solver import LEM 7 | from fmas.data_io import save_h5 8 | 9 | 10 | class NSE(ModelBaseClass): 11 | def __init__(self, w, beta, gamma): 12 | super().__init__(w, beta_w=beta) 13 | self.gamma = gamma 14 | 15 | @property 16 | def Lw(self): 17 | return 1j * self.beta_w 18 | 19 | def N(self, uw): 20 | ut = IFT(uw) 21 | return 1j * self.gamma * FT(np.abs(ut) ** 2 * ut) 22 | 23 | 24 | def main(): 25 | 26 | # -- SET MODEL PARAMETERS 27 | t_max = -50.0 28 | Nt = 2 ** 12 29 | # ... PROPAGATION CONSTANT (POLYNOMIAL MODEL) 30 | beta = np.poly1d([-0.5, 0.0, 0.0]) 31 | beta1 = np.polyder(beta, m=1) 32 | beta2 = np.polyder(beta, m=2) 33 | # ... NONLINEAR PARAMETER 34 | gamma = 1.0 35 | # ... SOLITON PARAMTERS 36 | t0 = 1.0 # duration 37 | t_off = 20.0 # temporal offset 38 | w0 = 25.0 # detuning 39 | P0 = np.abs(beta2(0)) / t0 / t0 / gamma # peak-intensity 40 | LD = t0 * t0 / np.abs(beta2(0)) # dispersion length 41 | # ... EXACT SOLUTION 42 | u_exact = lambda z, t: np.sqrt(P0) * np.exp(0.5j * gamma * P0 * z) / np.cosh(t / t0) 43 | 44 | # -- INITIALIZATION STAGE 45 | # ... COMPUTATIONAL DOMAIN 46 | grid = Grid(t_max=t_max, t_num=Nt) 47 | t, w = grid.t, grid.w 48 | # ... NONLINEAR SCHROEDINGER EQUATION 49 | model = NSE(w, beta(w), gamma) 50 | # ... PROPAGATION ALGORITHM 51 | solver = LEM(model.Lw, model.N, del_G=1e-7) 52 | # ... INITIAL CONDITION 53 | u0_t = u_exact(0.0, t + t_off) * np.exp(1j * w0 * t) 54 | u0_t += u_exact(0.0, t - t_off) * np.exp(-1j * w0 * t) 55 | solver.set_initial_condition(w, FT(u0_t)) 56 | 57 | # -- RUN SOLVER 58 | solver.propagate( 59 | z_range=0.5 * np.pi * LD, n_steps=2 ** 9, n_skip=2 # propagation range 60 | ) 61 | 62 | # -- STORE RESULTS 63 | # ... PREPARE DATA DICTIONARY FOR OUTPUT FILE 64 | results = { 65 | "t": t, 66 | "z": solver.z, 67 | "w": solver.w, 68 | "u": solver.utz, 69 | "dz_integration": solver.dz_, 70 | "dz_a": np.asarray(solver._dz_a), 71 | "del_rle": np.asarray(solver._del_rle), 72 | } 73 | # ... STORE DATA 74 | save_h5("./res_LEM_SolSolCollision.h5", **results) 75 | 76 | 77 | if __name__ == "__main__": 78 | main() 79 | -------------------------------------------------------------------------------- /docs/_static/js/html5shiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /fmas/models/custom_model_pcf.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implements a custom model for a specific photonic crystal fiber. 3 | 4 | .. codeauthor:: Oliver Melchert 5 | """ 6 | import numpy as np 7 | from .fmas_s_raman import FMAS_S_Raman 8 | from ..config import FTFREQ, FT, IFT, C0 9 | 10 | 11 | class CustomModelPCF(FMAS_S_Raman): 12 | r"""Custom model for specific Photonic Crystal Fiber""" 13 | 14 | def __init__(self, w): 15 | 16 | c0 = 0.29979 # (micron/fs) 17 | w0 = 2.2559 # (rad/fs) 18 | gam0 = 0.11e-6 # (1/W/micron) 19 | fR = 0.18 # (-) 20 | tau1 = 12.2 # (fs) 21 | tau2 = 32.0 # (fs) 22 | n2 = gam0 * c0 / w0 23 | 24 | def _beta_fun_detuning(w): 25 | r"""Helper function for propagation constant 26 | 27 | Implements group-velocity dispersion with expansion coefficients 28 | listed in Tab. I of Ref. [1]. Expansion coefficients are valid for 29 | :math:`lambda = 835\,\mathrm{nm}`, i.e. for :math:`\omega_0 \approx 30 | 2.56\,\mathrm{rad/fs}`. 31 | 32 | References: 33 | [1] J. M. Dudley, G. Genty, S. Coen, 34 | Supercontinuum generation in photonic crystal fiber, 35 | Rev. Mod. Phys. 78 (2006) 1135, 36 | http://dx.doi.org/10.1103/RevModPhys.78.1135 37 | 38 | Args: 39 | w (:obj:`numpy.ndarray`): Angular frequency grid. 40 | 41 | Returns: 42 | :obj:`numpy.ndarray` Propagation constant as function of 43 | frequency detuning. 44 | """ 45 | # ... EXPANSION COEFFICIENTS DISPERSION 46 | b2 = -1.1830e-2 # (fs^2/micron) 47 | b3 = 8.1038e-2 # (fs^3/micron) 48 | b4 = -0.95205e-1 # (fs^4/micron) 49 | b5 = 2.0737e-1 # (fs^5/micron) 50 | b6 = -5.3943e-1 # (fs^6/micron) 51 | b7 = 1.3486 # (fs^7/micron) 52 | b8 = -2.5495 # (fs^8/micron) 53 | b9 = 3.0524 # (fs^9/micron) 54 | b10 = -1.7140 # (fs^10/micron) 55 | # ... PROPAGATION CONSTANT (DEPENDING ON DETUNING) 56 | beta_fun_detuning = np.poly1d( 57 | [ 58 | b10 / 3628800, 59 | b9 / 362880, 60 | b8 / 40320, 61 | b7 / 5040, 62 | b6 / 720, 63 | b5 / 120, 64 | b4 / 24, 65 | b3 / 6, 66 | b2 / 2, 67 | 0.0, 68 | 0.0, 69 | ] 70 | ) 71 | return beta_fun_detuning(w) 72 | 73 | beta_w = _beta_fun_detuning(w - w0) 74 | # -- EQUIP THE SUPERCLASS 75 | super().__init__(w, beta_w, n2, fR, tau1, tau2) 76 | -------------------------------------------------------------------------------- /galleries/gallery_03/g_BMCF.py: -------------------------------------------------------------------------------- 1 | r""" 2 | BMCF -- Backscattered optical field components 3 | ============================================== 4 | 5 | This examples demonstrates backscattered optical field components using the 6 | bidirectional model for the complex field (BMCF), described in Ref. [1]. 7 | 8 | In particular, this example reproduces the propagation scenario shown in Fig. 9 | 1(a) of Ref. [1]. The figure shows the evolution of a soliton of duration 10 | :math:`t_{\rm{S}}=50\,\mathrm{fs}`, center frequency 11 | :math:`\omega_{\rm{S}}=2.23548\,\mathrm{rad/fs}`, and soliton order 12 | :math:`N_{\rm{S}}=3.54`. For a detailed discussion, see Ref. [1]. 13 | 14 | References: 15 | [1] Sh. Amiranashvili, A. Demircan, Hamiltonian structure of 16 | propagation equations for ultrashort optical pulses, Phys. Rev. E 10 17 | (2010) 013812, http://dx.doi.org/10.1103/PhysRevA.82.013812. 18 | 19 | .. codeauthor:: Oliver Melchert 20 | """ 21 | import fmas 22 | import numpy as np 23 | from fmas.grid import Grid 24 | from fmas.models import BMCF 25 | from fmas.solver import IFM_RK4IP 26 | from fmas.analytic_signal import AS 27 | from fmas.propagation_constant import PropConst, define_beta_fun_fluoride_glass_AD2010 28 | from fmas.tools import change_reference_frame, plot_evolution 29 | 30 | 31 | def main(): 32 | 33 | # -- INITIALIZATION STAGE 34 | # ... DEFINE SIMULATION PARAMETERS 35 | t_max = 3500./2 # (fs) 36 | t_num = 2**14 # (-) 37 | z_max = 50.0e3 # (micron) 38 | z_num = 100000 # (-) 39 | z_skip = 100 # (-) 40 | c0 = 0.29979 # (micron/fs) 41 | n2 = 1. # (micron^2/W) FICTITIOUS VALUE ONLY 42 | wS = 2.32548 # (rad/fs) 43 | tS = 50.0 # (fs) 44 | NS = 3.54 # (-) 45 | # ... PROPAGGATION CONSTANT 46 | beta_fun = define_beta_fun_fluoride_glass_AD2010() 47 | pc = PropConst(beta_fun) 48 | chi = (8./3)*pc.beta(wS)*c0/wS*n2 49 | 50 | # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER 51 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 52 | model = BMCF(w=grid.w, beta_w=pc.beta(grid.w), chi = chi) 53 | solver = IFM_RK4IP( model.Lw, model.Nw) 54 | 55 | # -- SET UP INITIAL CONDITION 56 | LD = tS*tS/np.abs( pc.beta2(wS) ) 57 | A0 = NS*np.sqrt(8*c0/wS/n2/LD) 58 | Eps_0w = AS(np.real(A0/np.cosh(grid.t/tS)*np.exp(1j*wS*grid.t))).w_rep 59 | solver.set_initial_condition( grid.w, Eps_0w) 60 | 61 | # -- PERFORM Z-PROPAGATION 62 | solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip) 63 | 64 | # -- SHOW RESULTS 65 | utz = change_reference_frame(solver.w, solver.z, solver.uwz, pc.vg(wS)) 66 | plot_evolution( solver.z, grid.t, utz, 67 | t_lim = (-500,500), w_lim = (-10.,10.), DO_T_LOG = True, ratio_Iw=1e-15) 68 | 69 | 70 | if __name__=='__main__': 71 | main() 72 | -------------------------------------------------------------------------------- /docs/_downloads/1cd25e73d461dcdc2c32e012083c0924/g_BMCF.py: -------------------------------------------------------------------------------- 1 | r""" 2 | BMCF -- Backscattered optical field components 3 | ============================================== 4 | 5 | This examples demonstrates backscattered optical field components using the 6 | bidirectional model for the complex field (BMCF), described in Ref. [1]. 7 | 8 | In particular, this example reproduces the propagation scenario shown in Fig. 9 | 1(a) of Ref. [1]. The figure shows the evolution of a soliton of duration 10 | :math:`t_{\rm{S}}=50\,\mathrm{fs}`, center frequency 11 | :math:`\omega_{\rm{S}}=2.23548\,\mathrm{rad/fs}`, and soliton order 12 | :math:`N_{\rm{S}}=3.54`. For a detailed discussion, see Ref. [1]. 13 | 14 | References: 15 | [1] Sh. Amiranashvili, A. Demircan, Hamiltonian structure of 16 | propagation equations for ultrashort optical pulses, Phys. Rev. E 10 17 | (2010) 013812, http://dx.doi.org/10.1103/PhysRevA.82.013812. 18 | 19 | .. codeauthor:: Oliver Melchert 20 | """ 21 | import fmas 22 | import numpy as np 23 | from fmas.grid import Grid 24 | from fmas.models import BMCF 25 | from fmas.solver import IFM_RK4IP 26 | from fmas.analytic_signal import AS 27 | from fmas.propagation_constant import PropConst, define_beta_fun_fluoride_glass_AD2010 28 | from fmas.tools import change_reference_frame, plot_evolution 29 | 30 | 31 | def main(): 32 | 33 | # -- INITIALIZATION STAGE 34 | # ... DEFINE SIMULATION PARAMETERS 35 | t_max = 3500./2 # (fs) 36 | t_num = 2**14 # (-) 37 | z_max = 50.0e3 # (micron) 38 | z_num = 100000 # (-) 39 | z_skip = 100 # (-) 40 | c0 = 0.29979 # (micron/fs) 41 | n2 = 1. # (micron^2/W) FICTITIOUS VALUE ONLY 42 | wS = 2.32548 # (rad/fs) 43 | tS = 50.0 # (fs) 44 | NS = 3.54 # (-) 45 | # ... PROPAGGATION CONSTANT 46 | beta_fun = define_beta_fun_fluoride_glass_AD2010() 47 | pc = PropConst(beta_fun) 48 | chi = (8./3)*pc.beta(wS)*c0/wS*n2 49 | 50 | # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER 51 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 52 | model = BMCF(w=grid.w, beta_w=pc.beta(grid.w), chi = chi) 53 | solver = IFM_RK4IP( model.Lw, model.Nw) 54 | 55 | # -- SET UP INITIAL CONDITION 56 | LD = tS*tS/np.abs( pc.beta2(wS) ) 57 | A0 = NS*np.sqrt(8*c0/wS/n2/LD) 58 | Eps_0w = AS(np.real(A0/np.cosh(grid.t/tS)*np.exp(1j*wS*grid.t))).w_rep 59 | solver.set_initial_condition( grid.w, Eps_0w) 60 | 61 | # -- PERFORM Z-PROPAGATION 62 | solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip) 63 | 64 | # -- SHOW RESULTS 65 | utz = change_reference_frame(solver.w, solver.z, solver.uwz, pc.vg(wS)) 66 | plot_evolution( solver.z, grid.t, utz, 67 | t_lim = (-500,500), w_lim = (-10.,10.), DO_T_LOG = True, ratio_Iw=1e-15) 68 | 69 | 70 | if __name__=='__main__': 71 | main() 72 | -------------------------------------------------------------------------------- /galleries/gallery_03/g_model_NSE.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Nonlinear Schrödinger equation -- Third-order soliton 3 | ===================================================== 4 | 5 | This example solves the standard nonlinear Schrödinger equation, given by 6 | 7 | .. math:: 8 | \partial_z u = -i \frac{\beta_2}{2}\partial_t^2 u + i\gamma |u|^2 u, 9 | 10 | wherein :math:`u = u(z, t)` represents the slowly varying pulse envelope, 11 | :math:`\beta_2=-1` is the second order dispersion parameter, and 12 | :math:`\gamma=1` is the nonlinear parameter. As initial condition, a 13 | higher-order soliton 14 | 15 | .. math:: 16 | u_0(t) = N_{\rm{sol}} \sqrt{\frac{|\beta_2|}{\gamma \, t_0^2}} {\rm{sech}}(t/t_0), 17 | 18 | of duration :math:`t_0=1`, and soliton order :math:`N_{\rm{sol}}=3` is 19 | considered. The propagation is performed up to :math:`z_{\rm{max}}=\pi/2`, i.e. 20 | for one soliton period. 21 | 22 | .. codeauthor:: Oliver Melchert 23 | """ 24 | import fmas 25 | import numpy as np 26 | from fmas.models import ModelBaseClass 27 | from fmas.config import FTFREQ, FT, IFT, C0 28 | from fmas.solver import SySSM 29 | from fmas.grid import Grid 30 | from fmas.tools import plot_evolution 31 | 32 | 33 | class NSE(ModelBaseClass): 34 | def __init__(self, w, b2 = -1.0, gamma = 1.0): 35 | super().__init__(w, 0.5*b2*w*w) 36 | self.gamma = gamma 37 | 38 | @property 39 | def Lw(self): 40 | return 1j*self.beta_w 41 | 42 | def Nw(self, uw): 43 | ut = IFT(uw) 44 | return 1j*self.gamma*FT(np.abs(ut)**2*ut) 45 | 46 | def claw(self, i, zi, w, uw): 47 | return np.sum(np.abs(uw)**2) 48 | 49 | 50 | def main(): 51 | # -- DEFINE SIMULATION PARAMETERS 52 | # ... WAVEGUIDE PROPERTIES 53 | b2 = -1.0 54 | gamma = 1. 55 | # ... TEST PULSE PROPERTIES 56 | t0 = 1. # soliton duration 57 | P0 = np.abs(b2)/t0/t0/gamma # peak-intensity 58 | LD = t0*t0/np.abs(b2) # dispersion length 59 | N_sol = 3 # soliton order 60 | # ... COMPUTATIONAL DOMAIN 61 | t_max = 30. 62 | t_num = 2**12 63 | z_max = 0.5*np.pi*LD 64 | z_num = 1000 65 | z_skip = 2 66 | 67 | # -- INITIALIZATION STAGE 68 | # ... COMPUTATIONAL DOMAIN 69 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 70 | # ... NSE MODEL 71 | model = NSE(grid.w, b2, gamma) 72 | # ... Z-PROPAGATION USING SYMMETRIC SPLIT-STEP FOURIER METHOD 73 | solver = SySSM(model.Lw, model.Nw) 74 | # ... INITIAL CONDITION 75 | u_0t = N_sol*np.sqrt(P0)/np.cosh(grid.t/t0) 76 | solver.set_initial_condition(grid.w, FT(u_0t)) 77 | 78 | # -- RUN SIMULATION 79 | solver.propagate(z_range = z_max, n_steps = z_num, n_skip = z_skip) 80 | 81 | plot_evolution( solver.z, grid.t, solver.utz, 82 | t_lim = (-4,4), w_lim = (-50,50), DO_T_LOG=False) 83 | 84 | 85 | if __name__=='__main__': 86 | main() 87 | -------------------------------------------------------------------------------- /docs/_downloads/8cf930e74a92bb490b58b139759bb68a/g_model_NSE.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Nonlinear Schrödinger equation -- Third-order soliton 3 | ===================================================== 4 | 5 | This example solves the standard nonlinear Schrödinger equation, given by 6 | 7 | .. math:: 8 | \partial_z u = -i \frac{\beta_2}{2}\partial_t^2 u + i\gamma |u|^2 u, 9 | 10 | wherein :math:`u = u(z, t)` represents the slowly varying pulse envelope, 11 | :math:`\beta_2=-1` is the second order dispersion parameter, and 12 | :math:`\gamma=1` is the nonlinear parameter. As initial condition, a 13 | higher-order soliton 14 | 15 | .. math:: 16 | u_0(t) = N_{\rm{sol}} \sqrt{\frac{|\beta_2|}{\gamma \, t_0^2}} {\rm{sech}}(t/t_0), 17 | 18 | of duration :math:`t_0=1`, and soliton order :math:`N_{\rm{sol}}=3` is 19 | considered. The propagation is performed up to :math:`z_{\rm{max}}=\pi/2`, i.e. 20 | for one soliton period. 21 | 22 | .. codeauthor:: Oliver Melchert 23 | """ 24 | import fmas 25 | import numpy as np 26 | from fmas.models import ModelBaseClass 27 | from fmas.config import FTFREQ, FT, IFT, C0 28 | from fmas.solver import SySSM 29 | from fmas.grid import Grid 30 | from fmas.tools import plot_evolution 31 | 32 | 33 | class NSE(ModelBaseClass): 34 | def __init__(self, w, b2 = -1.0, gamma = 1.0): 35 | super().__init__(w, 0.5*b2*w*w) 36 | self.gamma = gamma 37 | 38 | @property 39 | def Lw(self): 40 | return 1j*self.beta_w 41 | 42 | def Nw(self, uw): 43 | ut = IFT(uw) 44 | return 1j*self.gamma*FT(np.abs(ut)**2*ut) 45 | 46 | def claw(self, i, zi, w, uw): 47 | return np.sum(np.abs(uw)**2) 48 | 49 | 50 | def main(): 51 | # -- DEFINE SIMULATION PARAMETERS 52 | # ... WAVEGUIDE PROPERTIES 53 | b2 = -1.0 54 | gamma = 1. 55 | # ... TEST PULSE PROPERTIES 56 | t0 = 1. # soliton duration 57 | P0 = np.abs(b2)/t0/t0/gamma # peak-intensity 58 | LD = t0*t0/np.abs(b2) # dispersion length 59 | N_sol = 3 # soliton order 60 | # ... COMPUTATIONAL DOMAIN 61 | t_max = 30. 62 | t_num = 2**12 63 | z_max = 0.5*np.pi*LD 64 | z_num = 1000 65 | z_skip = 2 66 | 67 | # -- INITIALIZATION STAGE 68 | # ... COMPUTATIONAL DOMAIN 69 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 70 | # ... NSE MODEL 71 | model = NSE(grid.w, b2, gamma) 72 | # ... Z-PROPAGATION USING SYMMETRIC SPLIT-STEP FOURIER METHOD 73 | solver = SySSM(model.Lw, model.Nw) 74 | # ... INITIAL CONDITION 75 | u_0t = N_sol*np.sqrt(P0)/np.cosh(grid.t/t0) 76 | solver.set_initial_condition(grid.w, FT(u_0t)) 77 | 78 | # -- RUN SIMULATION 79 | solver.propagate(z_range = z_max, n_steps = z_num, n_skip = z_skip) 80 | 81 | plot_evolution( solver.z, grid.t, solver.utz, 82 | t_lim = (-4,4), w_lim = (-50,50), DO_T_LOG=False) 83 | 84 | 85 | if __name__=='__main__': 86 | main() 87 | -------------------------------------------------------------------------------- /tutorials/specific/g_list_raman_models.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Implemented Raman response functions 3 | ==================================== 4 | 5 | This examples shows the frequency-domain representation of the different Raman 6 | response models, implemented in modeule `raman_response`. 7 | 8 | An example demonstrating how the implemented Raman response models affect the 9 | dynamical evolution of a specific propagation scenario is shown under 10 | 11 | :ref:`sphx_glr_auto_tutorials_specific_g_raman_response.py` 12 | 13 | .. codeauthor:: Oliver Melchert 14 | """ 15 | 16 | ############################################################################### 17 | # We first import the functionality needed to produce a plot containing all the 18 | # implemented Raman response models 19 | 20 | import numpy as np 21 | from fmas.grid import Grid 22 | from fmas.raman_response import h_BW, h_LA, h_HC 23 | 24 | ############################################################################### 25 | # We then set up a data structure providing a discrete time and frequency axes 26 | 27 | grid = Grid( 28 | t_max = 3500., # (fs) 29 | t_num = 2**14 # (-) 30 | ) 31 | 32 | ############################################################################### 33 | # Next we initialize the frequency-domain representation of the different Raman 34 | # response models 35 | 36 | hw_BW = h_BW(grid.t) 37 | hw_LA = h_LA(grid.t) 38 | hw_HC = h_HC(grid.t) 39 | 40 | ############################################################################### 41 | # The subsequent plot compares the three Raman response models side-by-side. 42 | # The subplot on top shows the real part of the frequency-domain representation 43 | # of the Raman response, the subplot at the bottom shows the respective 44 | # imaginary parts (i.e. the Raman gain spectrum): 45 | 46 | import matplotlib as mpl 47 | import matplotlib.pyplot as plt 48 | import matplotlib.colors as col 49 | 50 | w_min, w_max = 0., 0.3 51 | w_mask = np.logical_and(grid.w>w_min, grid.w 14 | """ 15 | 16 | ############################################################################### 17 | # We first import the functionality needed to produce a plot containing all the 18 | # implemented Raman response models 19 | 20 | import numpy as np 21 | from fmas.grid import Grid 22 | from fmas.raman_response import h_BW, h_LA, h_HC 23 | 24 | ############################################################################### 25 | # We then set up a data structure providing a discrete time and frequency axes 26 | 27 | grid = Grid( 28 | t_max = 3500., # (fs) 29 | t_num = 2**14 # (-) 30 | ) 31 | 32 | ############################################################################### 33 | # Next we initialize the frequency-domain representation of the different Raman 34 | # response models 35 | 36 | hw_BW = h_BW(grid.t) 37 | hw_LA = h_LA(grid.t) 38 | hw_HC = h_HC(grid.t) 39 | 40 | ############################################################################### 41 | # The subsequent plot compares the three Raman response models side-by-side. 42 | # The subplot on top shows the real part of the frequency-domain representation 43 | # of the Raman response, the subplot at the bottom shows the respective 44 | # imaginary parts (i.e. the Raman gain spectrum): 45 | 46 | import matplotlib as mpl 47 | import matplotlib.pyplot as plt 48 | import matplotlib.colors as col 49 | 50 | w_min, w_max = 0., 0.3 51 | w_mask = np.logical_and(grid.w>w_min, grid.w\n" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": null, 24 | "metadata": { 25 | "collapsed": false 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "import fmas\nimport numpy as np\nfrom fmas.grid import Grid\nfrom fmas.models import FMAS_S\nfrom fmas.solver import IFM_RK4IP, SySSM\nfrom ng_fiber_details_nlpm750 import define_alpha_fun_NLPM750\n\n\n# -- INITIALIZATION STAGE\n# ... DEFINE SIMULATION PARAMETERS\nt_max = 1000. # (fs)\nt_num = 2**13 # (-)\nz_max = 1.0e5 # (micron)\nz_num = 1000 # (-)\nz_skip = 10 # (-)\n# ... PROPAGGATION CONSTANT\nalpha_fun = define_alpha_fun_NLPM750()\n# ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER \ngrid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num)\nmodel = FMAS_S( w = grid.w, beta_w = 0., alpha_w = alpha_fun(grid.w), n2 = 0.0)\nsolver = SySSM( model.Lw, model.Nw)\n\n# -- SET UP INITIAL CONDITION\nu_0w = np.where(np.logical_and( grid.w>1, grid.w<6. ), 1, 0)\nsolver.set_initial_condition( grid.w, u_0w)\n\n# -- PERFORM Z-PROPAGATION\nsolver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip)\n\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.colors as col\n\nf, ax = plt.subplots(1, 1, figsize=(5, 3))\nplt.subplots_adjust(left=0.15, right=0.96, bottom=0.15, top=0.96, hspace=0.2)\n\n_dB = lambda x: np.where(x>1e-20,10.*np.log10(x),10*np.log10(1e-20))\nw_mask = np.logical_and(grid.w>1,grid.w<5.)\nI0 = np.abs(solver.uwz[0,w_mask])**2\nIz = np.abs(solver.uwz[-1,w_mask])**2\nlam =2*np.pi*0.3/grid.w[w_mask]\nloss = -_dB(Iz/I0)*1e9/z_max # (dB/km) attenuation \nax.plot(lam, loss)\n\nax.xaxis.set_ticks_position(\"bottom\")\nax.yaxis.set_ticks_position(\"left\")\nax.set_xlim([0.4, 1.6])\nax.set_ylim([0,200])\nax.ticklabel_format(useOffset=False, style=\"sci\")\nax.set_xlabel(r\"Wavelength $\\mathrm{(\\mu m)}$\")\nax.set_ylabel(r\"Loss $\\mathrm{(dB/km)}$\")\n\nplt.show()" 30 | ] 31 | } 32 | ], 33 | "metadata": { 34 | "kernelspec": { 35 | "display_name": "Python 3", 36 | "language": "python", 37 | "name": "python3" 38 | }, 39 | "language_info": { 40 | "codemirror_mode": { 41 | "name": "ipython", 42 | "version": 3 43 | }, 44 | "file_extension": ".py", 45 | "mimetype": "text/x-python", 46 | "name": "python", 47 | "nbconvert_exporter": "python", 48 | "pygments_lexer": "ipython3", 49 | "version": "3.9.4" 50 | } 51 | }, 52 | "nbformat": 4, 53 | "nbformat_minor": 0 54 | } -------------------------------------------------------------------------------- /docs/_static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} -------------------------------------------------------------------------------- /galleries/gallery_01/g_soliton_implosion.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Soliton implosion in a NLPM750 PCF 3 | ================================== 4 | 5 | This examples demonstrates breakdown of a high-order soliton in a NL-PM-750 6 | photonic crystal fiber, described in Ref. [1]. For the numerical simualtion 7 | the forward model for the analytic signal including the Raman effect is used 8 | [1,2]. 9 | 10 | In particular, this example reproduces the propagation scenario shown in 11 | Fig.~2 of Ref. [1]. The resulting figure shows the breakdown of a high-order 12 | soliton of duration :math:`t_{\rm{S}}=10\,\mathrm{fs}`, center frequency 13 | :math:`\omega_{\rm{S}}=1.884\,\mathrm{rad/fs}`, and soliton order 14 | :math:`N_{\rm{S}}=10`. This process is also referred to as soliton implosion. 15 | For more details see Ref. [1]. 16 | 17 | References: 18 | [1] I. Babushkin, A. Tajalli, H. Sayinc et al., Simple route toward 19 | efficient frequency conversion for generation of fully coherent 20 | supercontinua in the mid-IR and UV range, Light: Science & Applications 6 21 | (2017) e16218, https://doi.org/10.1038/lsa.2016.218 22 | 23 | [2] A. Demircan, Sh. Amiranashvili, C. Bree, C. Mahnke, F. Mitschke, G. 24 | Steinmeyer, Rogue wave formation by accelerated solitons at an optical 25 | event horizon, Appl. Phys. B 115 (2014) 343, 26 | http://dx.doi.org/10.1007/s00340-013-5609-9 27 | 28 | .. codeauthor:: Oliver Melchert 29 | """ 30 | import fmas 31 | import numpy as np 32 | from fmas.grid import Grid 33 | from fmas.models import FMAS_S_R 34 | from fmas.solver import IFM_RK4IP 35 | from fmas.analytic_signal import AS 36 | from fmas.propagation_constant import PropConst, define_beta_fun_NLPM750 37 | from fmas.tools import change_reference_frame, plot_evolution 38 | 39 | 40 | def main(): 41 | 42 | # -- INITIALIZATION STAGE 43 | # ... DEFINE SIMULATION PARAMETERS 44 | t_max = 3000. # (fs) 45 | t_num = 2**14 # (-) 46 | z_max = 8.0e3 # (micron) 47 | z_num = 10000 # (-) 48 | z_skip = 10 # (-) 49 | n2 = 3.0e-8 # (micron^2/W) 50 | wS = 1.884 # (rad/fs) 51 | tS = 10.0 # (fs) 52 | NS = 10. # (-) 53 | # ... PROPAGGATION CONSTANT 54 | beta_fun = define_beta_fun_NLPM750() 55 | pc = PropConst(beta_fun) 56 | # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER 57 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 58 | model = FMAS_S_R(w=grid.w, beta_w=pc.beta(grid.w), n2 = n2) 59 | solver = IFM_RK4IP( model.Lw, model.Nw) 60 | 61 | # -- SET UP INITIAL CONDITION 62 | A0 = NS*np.sqrt(np.abs(pc.beta2(wS))*model.c0/wS/n2)/tS 63 | Eps_0w = AS(np.real(A0/np.cosh(grid.t/tS)*np.exp(1j*wS*grid.t))).w_rep 64 | solver.set_initial_condition( grid.w, Eps_0w) 65 | 66 | # -- PERFORM Z-PROPAGATION 67 | solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip) 68 | 69 | # -- SHOW RESULTS 70 | utz = change_reference_frame(solver.w, solver.z, solver.uwz, pc.vg(wS)) 71 | plot_evolution( solver.z, grid.t, utz, 72 | t_lim = (-100,100), w_lim = (0.5,8.), DO_T_LOG = True) 73 | 74 | 75 | if __name__=='__main__': 76 | main() 77 | -------------------------------------------------------------------------------- /docs/_downloads/7b7f0d3bb8c4459d28fcafc074035e70/g_soliton_implosion.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Soliton implosion in a NLPM750 PCF 3 | ================================== 4 | 5 | This examples demonstrates breakdown of a high-order soliton in a NL-PM-750 6 | photonic crystal fiber, described in Ref. [1]. For the numerical simualtion 7 | the forward model for the analytic signal including the Raman effect is used 8 | [1,2]. 9 | 10 | In particular, this example reproduces the propagation scenario shown in 11 | Fig.~2 of Ref. [1]. The resulting figure shows the breakdown of a high-order 12 | soliton of duration :math:`t_{\rm{S}}=10\,\mathrm{fs}`, center frequency 13 | :math:`\omega_{\rm{S}}=1.884\,\mathrm{rad/fs}`, and soliton order 14 | :math:`N_{\rm{S}}=10`. This process is also referred to as soliton implosion. 15 | For more details see Ref. [1]. 16 | 17 | References: 18 | [1] I. Babushkin, A. Tajalli, H. Sayinc et al., Simple route toward 19 | efficient frequency conversion for generation of fully coherent 20 | supercontinua in the mid-IR and UV range, Light: Science & Applications 6 21 | (2017) e16218, https://doi.org/10.1038/lsa.2016.218 22 | 23 | [2] A. Demircan, Sh. Amiranashvili, C. Bree, C. Mahnke, F. Mitschke, G. 24 | Steinmeyer, Rogue wave formation by accelerated solitons at an optical 25 | event horizon, Appl. Phys. B 115 (2014) 343, 26 | http://dx.doi.org/10.1007/s00340-013-5609-9 27 | 28 | .. codeauthor:: Oliver Melchert 29 | """ 30 | import fmas 31 | import numpy as np 32 | from fmas.grid import Grid 33 | from fmas.models import FMAS_S_R 34 | from fmas.solver import IFM_RK4IP 35 | from fmas.analytic_signal import AS 36 | from fmas.propagation_constant import PropConst, define_beta_fun_NLPM750 37 | from fmas.tools import change_reference_frame, plot_evolution 38 | 39 | 40 | def main(): 41 | 42 | # -- INITIALIZATION STAGE 43 | # ... DEFINE SIMULATION PARAMETERS 44 | t_max = 3000. # (fs) 45 | t_num = 2**14 # (-) 46 | z_max = 8.0e3 # (micron) 47 | z_num = 10000 # (-) 48 | z_skip = 10 # (-) 49 | n2 = 3.0e-8 # (micron^2/W) 50 | wS = 1.884 # (rad/fs) 51 | tS = 10.0 # (fs) 52 | NS = 10. # (-) 53 | # ... PROPAGGATION CONSTANT 54 | beta_fun = define_beta_fun_NLPM750() 55 | pc = PropConst(beta_fun) 56 | # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER 57 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 58 | model = FMAS_S_R(w=grid.w, beta_w=pc.beta(grid.w), n2 = n2) 59 | solver = IFM_RK4IP( model.Lw, model.Nw) 60 | 61 | # -- SET UP INITIAL CONDITION 62 | A0 = NS*np.sqrt(np.abs(pc.beta2(wS))*model.c0/wS/n2)/tS 63 | Eps_0w = AS(np.real(A0/np.cosh(grid.t/tS)*np.exp(1j*wS*grid.t))).w_rep 64 | solver.set_initial_condition( grid.w, Eps_0w) 65 | 66 | # -- PERFORM Z-PROPAGATION 67 | solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip) 68 | 69 | # -- SHOW RESULTS 70 | utz = change_reference_frame(solver.w, solver.z, solver.uwz, pc.vg(wS)) 71 | plot_evolution( solver.z, grid.t, utz, 72 | t_lim = (-100,100), w_lim = (0.5,8.), DO_T_LOG = True) 73 | 74 | 75 | if __name__=='__main__': 76 | main() 77 | -------------------------------------------------------------------------------- /docs/_downloads/a7b0fcfb9e68029b3cdca5c8c0f21f9e/g_absorption_profile.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": { 7 | "collapsed": false 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "%matplotlib inline" 12 | ] 13 | }, 14 | { 15 | "cell_type": "markdown", 16 | "metadata": {}, 17 | "source": [ 18 | "\n# Attenuation of a NLPM750 fiber\n\nThis example demonstrates how to use models along with a realistic attenuation\nprofile.\n\n.. codeauthor:: Oliver Melchert \n" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": null, 24 | "metadata": { 25 | "collapsed": false 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "import fmas\nimport numpy as np\nfrom fmas.grid import Grid\nfrom fmas.models import FMAS_S\nfrom fmas.solver import IFM_RK4IP, SySSM\nfrom ng_fiber_details_nlpm750 import define_alpha_fun_NLPM750\n\n\n# -- INITIALIZATION STAGE\n# ... DEFINE SIMULATION PARAMETERS\nt_max = 1000.0 # (fs)\nt_num = 2 ** 13 # (-)\nz_max = 1.0e5 # (micron)\nz_num = 1000 # (-)\nz_skip = 10 # (-)\n# ... PROPAGGATION CONSTANT\nalpha_fun = define_alpha_fun_NLPM750()\n# ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER\ngrid = Grid(t_max=t_max, t_num=t_num, z_max=z_max, z_num=z_num)\nmodel = FMAS_S(w=grid.w, beta_w=0.0, alpha_w=alpha_fun(grid.w), n2=0.0)\nsolver = SySSM(model.Lw, model.Nw)\n\n# -- SET UP INITIAL CONDITION\nu_0w = np.where(np.logical_and(grid.w > 1, grid.w < 6.0), 1, 0)\nsolver.set_initial_condition(grid.w, u_0w)\n\n# -- PERFORM Z-PROPAGATION\nsolver.propagate(z_range=z_max, n_steps=z_num, n_skip=z_skip)\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.colors as col\n\nf, ax = plt.subplots(1, 1, figsize=(5, 3))\nplt.subplots_adjust(left=0.15, right=0.96, bottom=0.15, top=0.96, hspace=0.2)\n\nI0 = np.abs(solver.uwz[0]) ** 2\nIz = np.abs(solver.uwz[-1]) ** 2\n_dB = lambda x: 10.0 * np.log10(x)\nloss_w = (\n -_dB(\n np.divide(\n Iz,\n I0,\n out=np.ones(grid.w.size, dtype=\"float\"),\n where=I0 > 1e-10,\n )\n )\n * 1e9\n / z_max\n)\n\nw = grid.w\nw_mask = np.logical_and(w > 1, w < 5.0)\n_lam = lambda w: 2 * np.pi * 0.3 / w\n\nax.plot(_lam(w[w_mask]), loss_w[w_mask])\n\nax.xaxis.set_ticks_position(\"bottom\")\nax.yaxis.set_ticks_position(\"left\")\nax.set_xlim([0.4, 1.6])\nax.set_ylim([0, 200])\nax.ticklabel_format(useOffset=False, style=\"sci\")\nax.set_xlabel(r\"Wavelength $\\mathrm{(\\mu m)}$\")\nax.set_ylabel(r\"Loss $\\mathrm{(dB/km)}$\")\n\nplt.show()" 30 | ] 31 | } 32 | ], 33 | "metadata": { 34 | "kernelspec": { 35 | "display_name": "Python 3", 36 | "language": "python", 37 | "name": "python3" 38 | }, 39 | "language_info": { 40 | "codemirror_mode": { 41 | "name": "ipython", 42 | "version": 3 43 | }, 44 | "file_extension": ".py", 45 | "mimetype": "text/x-python", 46 | "name": "python", 47 | "nbconvert_exporter": "python", 48 | "pygments_lexer": "ipython3", 49 | "version": "3.9.4" 50 | } 51 | }, 52 | "nbformat": 4, 53 | "nbformat_minor": 0 54 | } -------------------------------------------------------------------------------- /tutorials/specific/g_list_prop_const.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Implemented propagation constants 3 | ================================= 4 | 5 | This example shows the group-velocity and group-velocity dispersion profiles of 6 | several propagation constants implemnted in module `propagation_constant`. 7 | 8 | .. codeauthor:: Oliver Melchert 9 | """ 10 | ############################################################################### 11 | # We first start by importing the functionality of numpy and fmas into the 12 | # current namespace. Specifically, we import the module `propagation_constant` 13 | # that contains the convenience class `PropConst` as well as the implemented 14 | # propagation constant. A function that allows to plot the group-velocity and 15 | # group-velocity dispersion profiles is imported from module `tools`. 16 | 17 | import numpy as np 18 | import fmas 19 | import fmas.propagation_constant as prop_const 20 | from fmas.tools import plot_details_prop_const 21 | 22 | ############################################################################### 23 | # Below we show a list of the basic properties of several propatgation 24 | # constants implemented in `fmas`. 25 | # 26 | # NLPM750 27 | # ------- 28 | 29 | pc = prop_const.PropConst(prop_const.define_beta_fun_NLPM750()) 30 | w = np.linspace(1.3, 3.2, 200) 31 | plot_details_prop_const(w, pc.vg(w), pc.beta2(w)) 32 | 33 | ############################################################################### 34 | # with zero-dispersion points 35 | 36 | w_Z1 = pc.find_root_beta2(1.4, 1.7) 37 | w_Z2 = pc.find_root_beta2(2.2, 2.5) 38 | 39 | print('w_Z1 = ', w_Z1) 40 | print('w_Z2 = ', w_Z2) 41 | 42 | ############################################################################### 43 | # ESM 44 | # --- 45 | 46 | pc = prop_const.PropConst(prop_const.define_beta_fun_ESM()) 47 | w = np.linspace(1., 3.5, 200) 48 | plot_details_prop_const(w, pc.vg(w), pc.beta2(w)) 49 | 50 | # sphinx_gallery_thumbnail_number = 2 51 | 52 | ############################################################################### 53 | # with zero-dispersion point 54 | 55 | w_Z1 = pc.find_root_beta2(1.5, 2.0) 56 | 57 | print('w_Z1 = ', w_Z1) 58 | 59 | 60 | ############################################################################### 61 | # ZBLAN 62 | # ----- 63 | 64 | pc = prop_const.PropConst(prop_const.define_beta_fun_ZBLAN()) 65 | w = np.linspace(0.5, 5., 200) 66 | plot_details_prop_const(w, pc.vg(w), pc.beta2(w)) 67 | 68 | ############################################################################### 69 | # with zero-dispersion point 70 | 71 | 72 | w_Z1 = pc.find_root_beta2(1., 1.3) 73 | 74 | print('w_Z1 = ', w_Z1) 75 | 76 | 77 | ############################################################################### 78 | # Silicon slot waveguide 79 | # ---------------------- 80 | 81 | pc = prop_const.PropConst(prop_const.define_beta_fun_slot_waveguide_Zhang2012()) 82 | w = np.linspace(0.86, 1.37, 200) 83 | plot_details_prop_const(w, pc.vg(w), pc.beta2(w)) 84 | 85 | ############################################################################### 86 | # with four zero-dispersion points 87 | 88 | w_Z1 = pc.find_root_beta2(0.9, 0.95) 89 | w_Z2 = pc.find_root_beta2(0.95, 1.05) 90 | w_Z3 = pc.find_root_beta2(1.1, 1.2) 91 | w_Z4 = pc.find_root_beta2(1.25, 1.3) 92 | 93 | print('w_Z1 = ', w_Z1) 94 | print('w_Z2 = ', w_Z2) 95 | print('w_Z3 = ', w_Z3) 96 | print('w_Z4 = ', w_Z4) 97 | -------------------------------------------------------------------------------- /docs/_downloads/014f33e28498cb8fe7d8bd5c37686ad6/g_list_prop_const.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Implemented propagation constants 3 | ================================= 4 | 5 | This example shows the group-velocity and group-velocity dispersion profiles of 6 | several propagation constants implemnted in module `propagation_constant`. 7 | 8 | .. codeauthor:: Oliver Melchert 9 | """ 10 | ############################################################################### 11 | # We first start by importing the functionality of numpy and fmas into the 12 | # current namespace. Specifically, we import the module `propagation_constant` 13 | # that contains the convenience class `PropConst` as well as the implemented 14 | # propagation constant. A function that allows to plot the group-velocity and 15 | # group-velocity dispersion profiles is imported from module `tools`. 16 | 17 | import numpy as np 18 | import fmas 19 | import fmas.propagation_constant as prop_const 20 | from fmas.tools import plot_details_prop_const 21 | 22 | ############################################################################### 23 | # Below we show a list of the basic properties of several propatgation 24 | # constants implemented in `fmas`. 25 | # 26 | # NLPM750 27 | # ------- 28 | 29 | pc = prop_const.PropConst(prop_const.define_beta_fun_NLPM750()) 30 | w = np.linspace(1.3, 3.2, 200) 31 | plot_details_prop_const(w, pc.vg(w), pc.beta2(w)) 32 | 33 | ############################################################################### 34 | # with zero-dispersion points 35 | 36 | w_Z1 = pc.find_root_beta2(1.4, 1.7) 37 | w_Z2 = pc.find_root_beta2(2.2, 2.5) 38 | 39 | print('w_Z1 = ', w_Z1) 40 | print('w_Z2 = ', w_Z2) 41 | 42 | ############################################################################### 43 | # ESM 44 | # --- 45 | 46 | pc = prop_const.PropConst(prop_const.define_beta_fun_ESM()) 47 | w = np.linspace(1., 3.5, 200) 48 | plot_details_prop_const(w, pc.vg(w), pc.beta2(w)) 49 | 50 | # sphinx_gallery_thumbnail_number = 2 51 | 52 | ############################################################################### 53 | # with zero-dispersion point 54 | 55 | w_Z1 = pc.find_root_beta2(1.5, 2.0) 56 | 57 | print('w_Z1 = ', w_Z1) 58 | 59 | 60 | ############################################################################### 61 | # ZBLAN 62 | # ----- 63 | 64 | pc = prop_const.PropConst(prop_const.define_beta_fun_ZBLAN()) 65 | w = np.linspace(0.5, 5., 200) 66 | plot_details_prop_const(w, pc.vg(w), pc.beta2(w)) 67 | 68 | ############################################################################### 69 | # with zero-dispersion point 70 | 71 | 72 | w_Z1 = pc.find_root_beta2(1., 1.3) 73 | 74 | print('w_Z1 = ', w_Z1) 75 | 76 | 77 | ############################################################################### 78 | # Silicon slot waveguide 79 | # ---------------------- 80 | 81 | pc = prop_const.PropConst(prop_const.define_beta_fun_slot_waveguide_Zhang2012()) 82 | w = np.linspace(0.86, 1.37, 200) 83 | plot_details_prop_const(w, pc.vg(w), pc.beta2(w)) 84 | 85 | ############################################################################### 86 | # with four zero-dispersion points 87 | 88 | w_Z1 = pc.find_root_beta2(0.9, 0.95) 89 | w_Z2 = pc.find_root_beta2(0.95, 1.05) 90 | w_Z3 = pc.find_root_beta2(1.1, 1.2) 91 | w_Z4 = pc.find_root_beta2(1.25, 1.3) 92 | 93 | print('w_Z1 = ', w_Z1) 94 | print('w_Z2 = ', w_Z2) 95 | print('w_Z3 = ', w_Z3) 96 | print('w_Z4 = ', w_Z4) 97 | -------------------------------------------------------------------------------- /fmas/models/bmcf.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implements bidirectional model for the complex field. 3 | 4 | .. codeauthor:: Oliver Melchert 5 | """ 6 | import numpy as np 7 | from .model_base import ModelBaseClass 8 | from ..config import FTFREQ, FT, IFT, C0 9 | 10 | 11 | class BMCF(ModelBaseClass): 12 | r"""Bidirectional model for the complex field. 13 | 14 | Implements the bidirectional model for the complex field (BMCF), i.e. Eq. 15 | (31) of Ref.[1]. It includes third-harmonic generation and self-steepening 16 | for interacting forward and backward components of the optical field. 17 | 18 | References: 19 | [1] Sh. Amiranashvili, A. Demircan, Hamiltonian structure of 20 | propagation equations for ultrashort optical pulses, Phys. Rev. E 10 21 | (2010) 013812, http://dx.doi.org/10.1103/PhysRevA.82.013812. 22 | 23 | Args: 24 | w (:obj:`numpy.ndarray`): 25 | Angular frequency grid. 26 | beta_w (:obj:`numpy.ndarray`): 27 | Propagation constant. 28 | chi (:obj:`float`): 29 | Nonlinear susceptibility (default=1.0). 30 | """ 31 | 32 | def __init__(self, w, beta_w, chi=1.0): 33 | super().__init__(w, beta_w) 34 | self.chi = chi 35 | 36 | @property 37 | def Lw(self): 38 | r"""Frequency-domain representation of nonlinear operator. 39 | 40 | Returns: 41 | :obj:`numpy.ndarray`: Frequency-domain representation of linear 42 | operator of the partial differential equation. 43 | """ 44 | return 1j * np.abs(self.beta_w) 45 | 46 | def Nw(self, uw): 47 | r"""Frequency-domain representation of nonlinear operator. 48 | 49 | Args: 50 | uw (:obj:`numpy.ndarray`): 51 | Frequency-domain representation of field at current 52 | :math:`z`-position. 53 | 54 | Returns: 55 | :obj:`numpy.ndarray`: Frequency-domain representation of field at 56 | current :math:`z`-position. 57 | """ 58 | w, c0, chi, beta_w = self.w, self.c0, self.chi, self.beta_w 59 | ut = IFT(uw) 60 | 61 | _gam_w = np.divide( 62 | chi * w * w, 63 | c0 * c0 * 8.0 * np.abs(beta_w), 64 | out=np.zeros(w.size, dtype="float"), 65 | where=np.abs(beta_w) > 1e-20, 66 | ) 67 | 68 | return 1j * _gam_w * FT((ut + np.conj(ut)) ** 3) 69 | 70 | def claw(self, i, zi, w, uw): 71 | r"""Conservation law of the propagation model. 72 | 73 | Implements conserved quantity related to the field energy, given by 74 | 75 | .. math:: 76 | C_{\mathcal{E}}(z) = \sum_\omega |\mathcal{E}_\omega(z)|^2. 77 | 78 | Args: 79 | i (:obj:`int`): 80 | Index specifying the current :math:`z`-step. 81 | zi (:obj:`float`): 82 | Current :math:`z`-value. 83 | w (:obj:`numpy.ndarray`): 84 | Angular frequency mesh. 85 | uw (:obj:`numpy.ndarray`): 86 | Freuqency domain representation of the current field. 87 | 88 | Returns: 89 | :obj:`numpy.ndarray`: value of the conserved quantitiy. 90 | """ 91 | _fac_w = np.divide( 92 | np.abs(self.beta_w) * np.abs(uw) ** 2, 93 | w * w, 94 | out=np.zeros(w.size, dtype="float"), 95 | where=w > 1e-6, 96 | ) 97 | return np.sum(_fac_w) 98 | -------------------------------------------------------------------------------- /fmas/models/fmas_s.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implements simplified forward model for the analytic signal. 3 | 4 | .. codeauthor:: Oliver Melchert 5 | """ 6 | import numpy as np 7 | from .model_base import ModelBaseClass 8 | from ..config import FTFREQ, FT, IFT, C0 9 | 10 | 11 | class FMAS_S(ModelBaseClass): 12 | r"""Simplified variant of the forward-model for the analytic signal. 13 | 14 | Implements a simplified variant of the forward-model for the analytic 15 | signal [1,2]. In particular, this model implements Eq. (9) of Ref.[2]. 16 | 17 | References: 18 | [1] Sh. Amiranashvili, A. Demircan, Hamiltonian structure of 19 | propagation equations for ultrashort optical pulses, Phys. Rev. E 10 20 | (2010) 013812, http://dx.doi.org/10.1103/PhysRevA.82.013812. 21 | 22 | [2] A. Demircan, Sh. Amiranashvili, C. Bree, C. Mahnke, F. Mitschke, G. 23 | Steinmeyer, Rogue wave formation by accelerated solitons at an optical 24 | event horizon, Appl. Phys. B 115 (2014) 343, 25 | http://dx.doi.org/10.1007/s00340-013-5609-9 26 | 27 | Args: 28 | w (:obj:`numpy.ndarray`): 29 | Angular frequency grid. 30 | beta_w (:obj:`numpy.ndarray`): 31 | Propagation constant. 32 | alpha_w (:obj:`numpy.ndarray`): 33 | Frequency-domain representation of root-power loss. 34 | n2 (:obj:`float`): 35 | Nonlinear refractive index (default=1.0). 36 | """ 37 | 38 | def __init__(self, w, beta_w, n2=1.0, alpha_w=0.0): 39 | super().__init__(w, beta_w, alpha_w) 40 | self.n2 = n2 41 | 42 | @property 43 | def Lw(self): 44 | r"""Frequency-domain representation of nonlinear operator. 45 | 46 | Returns: 47 | :obj:`numpy.ndarray`: Frequency-domain representation of linear 48 | operator of the partial differential equation. 49 | """ 50 | return 1j * self.beta_w - self.alpha_w 51 | 52 | def Nw(self, uw): 53 | r"""Frequency-domain representation of nonlinear operator. 54 | 55 | Args: 56 | uw (:obj:`numpy.ndarray`): 57 | Frequency-domain representation of field at current 58 | :math:`z`-position. 59 | 60 | Returns: 61 | :obj:`numpy.ndarray`: Frequency-domain representation of field at 62 | current :math:`z`-position. 63 | """ 64 | w, c0, n2, beta_w = self.w, self.c0, self.n2, self.beta_w 65 | ut = IFT(uw) 66 | _gamma = n2 * w / c0 67 | FT_pfp = lambda x: np.where(w > 0, FT(x), 0j) 68 | return 1j * _gamma * FT_pfp(np.abs(ut) ** 2 * ut) 69 | 70 | def claw(self, i, zi, w, uw): 71 | r"""Conservation law of the propagation model. 72 | 73 | Implements conserved quantity related to the field energy, given by 74 | 75 | .. math:: 76 | C_{\mathcal{E}}(z) = \sum_\omega |\mathcal{E}_\omega(z)|^2. 77 | 78 | Args: 79 | i (:obj:`int`): 80 | Index specifying the current :math:`z`-step. 81 | zi (:obj:`float`): 82 | Current :math:`z`-value. 83 | w (:obj:`numpy.ndarray`): 84 | Angular frequency mesh. 85 | uw (:obj:`numpy.ndarray`): 86 | Freuqency domain representation of the current field. 87 | 88 | Returns: 89 | :obj:`numpy.ndarray`: value of the conserved quantitiy. 90 | """ 91 | return np.sum(np.abs(uw[w > 0]) ** 2 / w[w > 0]) 92 | -------------------------------------------------------------------------------- /tutorials/basics/g_code_listing_01.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Basic workflow 3 | ============== 4 | 5 | This examples demonstrates a basic workflow using the `py-fmas` library code. 6 | 7 | .. codeauthor:: Oliver Melchert 8 | """ 9 | 10 | ############################################################################### 11 | # We start by simply importing the required `fmas` into the current namespace. 12 | # 13 | 14 | import fmas 15 | 16 | ############################################################################### 17 | # If an adequate input file is located within the current working directory, 18 | # the function `read_h5`, located in module `data_io`, can be used to read-in 19 | # the propagation setting stored in the input file `input_file.h5`: 20 | 21 | glob = fmas.data_io.read_h5('input_file.h5') 22 | 23 | ############################################################################### 24 | # Next, the problem specific data structures, given by the computational grid 25 | # and the propagation model, can be initialized: 26 | 27 | grid = fmas.grid.Grid( 28 | t_max = glob.t_max, 29 | t_num = glob.t_num, 30 | z_max = glob.z_max, 31 | z_num = glob.z_num) 32 | 33 | model = fmas.models.FMAS_S_R( 34 | w = grid.w, 35 | beta_w = glob.beta_w, 36 | n2 = glob.n2, 37 | fR = glob.fR, 38 | tau1 = glob.tau1, 39 | tau2 = glob.tau2) 40 | 41 | ############################################################################### 42 | # The provided initial condition, which represents the real-valued optical 43 | # field can be converted to the complex-valued analytic signal as shown below: 44 | 45 | ic = fmas.analytic_signal.AS(glob.E_0t) 46 | 47 | ############################################################################### 48 | # Below we implement a user-action function that can be passed to the 49 | # propagation algorithm. Upon propagation it will evaluated at every 50 | # :math:`z`-step 51 | 52 | import numpy as np 53 | 54 | def Cp(i, zi, w, uw): 55 | Iw = np.abs(uw)**2 56 | return np.sum(Iw[w>0]/w[w>0]) 57 | 58 | ############################################################################### 59 | # Next, we initialzize the :math:`z`-propagation algorithm, given by the 60 | # `Runge-Kutta in the interaction picture` (RK4IP) method, set the initial 61 | # condition, and perform :math:`z`-propagation: 62 | 63 | solver = fmas.solver.IFM_RK4IP( 64 | model.Lw, model.Nw, 65 | user_action = Cp) 66 | 67 | solver.set_initial_condition( 68 | grid.w, ic.w_rep) 69 | 70 | solver.propagate( 71 | z_range = glob.z_max, 72 | n_steps = glob.z_num, 73 | n_skip = glob.z_skip) 74 | 75 | ############################################################################### 76 | # After the propagation algorithm has terminated, the generated simulation data 77 | # can be stored within an output file in HDF5-format. Therefore, the data is 78 | # organized as dictionary with custom keys for the stored data objects, which 79 | # is then passed to the function `save_h5` implemented in module `data_io`: 80 | 81 | res = { 82 | "t": grid.t, 83 | "z": solver.z, 84 | "w": solver.w, 85 | "u": solver.utz, 86 | "Cp": solver.ua_vals} 87 | 88 | fmas.data_io.save_h5('out_file.h5', **res) 89 | 90 | ############################################################################### 91 | # A simple plot of the generated data can be obtained using convenience functions 92 | # implemented in module `tools`: 93 | 94 | fmas.tools.plot_evolution( 95 | solver.z, grid.t, solver.utz, 96 | t_lim = (-500,2200), w_lim = (1.,4.)) 97 | -------------------------------------------------------------------------------- /docs/_downloads/1ef6897f04eddfcb385c6f79cb344688/g_code_listing_01.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Basic workflow 3 | ============== 4 | 5 | This examples demonstrates a basic workflow using the `py-fmas` library code. 6 | 7 | .. codeauthor:: Oliver Melchert 8 | """ 9 | 10 | ############################################################################### 11 | # We start by simply importing the required `fmas` into the current namespace. 12 | # 13 | 14 | import fmas 15 | 16 | ############################################################################### 17 | # If an adequate input file is located within the current working directory, 18 | # the function `read_h5`, located in module `data_io`, can be used to read-in 19 | # the propagation setting stored in the input file `input_file.h5`: 20 | 21 | glob = fmas.data_io.read_h5('input_file.h5') 22 | 23 | ############################################################################### 24 | # Next, the problem specific data structures, given by the computational grid 25 | # and the propagation model, can be initialized: 26 | 27 | grid = fmas.grid.Grid( 28 | t_max = glob.t_max, 29 | t_num = glob.t_num, 30 | z_max = glob.z_max, 31 | z_num = glob.z_num) 32 | 33 | model = fmas.models.FMAS_S_R( 34 | w = grid.w, 35 | beta_w = glob.beta_w, 36 | n2 = glob.n2, 37 | fR = glob.fR, 38 | tau1 = glob.tau1, 39 | tau2 = glob.tau2) 40 | 41 | ############################################################################### 42 | # The provided initial condition, which represents the real-valued optical 43 | # field can be converted to the complex-valued analytic signal as shown below: 44 | 45 | ic = fmas.analytic_signal.AS(glob.E_0t) 46 | 47 | ############################################################################### 48 | # Below we implement a user-action function that can be passed to the 49 | # propagation algorithm. Upon propagation it will evaluated at every 50 | # :math:`z`-step 51 | 52 | import numpy as np 53 | 54 | def Cp(i, zi, w, uw): 55 | Iw = np.abs(uw)**2 56 | return np.sum(Iw[w>0]/w[w>0]) 57 | 58 | ############################################################################### 59 | # Next, we initialzize the :math:`z`-propagation algorithm, given by the 60 | # `Runge-Kutta in the interaction picture` (RK4IP) method, set the initial 61 | # condition, and perform :math:`z`-propagation: 62 | 63 | solver = fmas.solver.IFM_RK4IP( 64 | model.Lw, model.Nw, 65 | user_action = Cp) 66 | 67 | solver.set_initial_condition( 68 | grid.w, ic.w_rep) 69 | 70 | solver.propagate( 71 | z_range = glob.z_max, 72 | n_steps = glob.z_num, 73 | n_skip = glob.z_skip) 74 | 75 | ############################################################################### 76 | # After the propagation algorithm has terminated, the generated simulation data 77 | # can be stored within an output file in HDF5-format. Therefore, the data is 78 | # organized as dictionary with custom keys for the stored data objects, which 79 | # is then passed to the function `save_h5` implemented in module `data_io`: 80 | 81 | res = { 82 | "t": grid.t, 83 | "z": solver.z, 84 | "w": solver.w, 85 | "u": solver.utz, 86 | "Cp": solver.ua_vals} 87 | 88 | fmas.data_io.save_h5('out_file.h5', **res) 89 | 90 | ############################################################################### 91 | # A simple plot of the generated data can be obtained using convenience functions 92 | # implemented in module `tools`: 93 | 94 | fmas.tools.plot_evolution( 95 | solver.z, grid.t, solver.utz, 96 | t_lim = (-500,2200), w_lim = (1.,4.)) 97 | -------------------------------------------------------------------------------- /galleries/gallery_02/g_molecules_01.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Superimposed fundamental solitons 3 | ================================= 4 | 5 | This examples demonstrates the generation of two-frequency soliton molecules, 6 | using the forward model for the analytic signal [1,2], in `py-fmas` implemented 7 | as :class:`FMAS`. 8 | 9 | In particular, this example shows how soliton molecules are generated from two 10 | initially superimposed fundamental solitons at distinctly different frequencies 11 | [3]. The exmample reproduces the propagation scenario shown in Fig. S10 of the 12 | supplementary material to [3]. 13 | 14 | References: 15 | 16 | [1] Sh. Amiranashvili, A. Demircan, Hamiltonian structure of 17 | propagation equations for ultrashort optical pulses, Phys. Rev. E 10 18 | (2010) 013812, http://dx.doi.org/10.1103/PhysRevA.82.013812. 19 | 20 | [2] Sh. Amiranashvili, A. Demircan, Ultrashort Optical Pulse Propagation in 21 | terms of Analytic Signal, Adv. Opt. Tech. 2011 (2011) 989515, 22 | http://dx.doi.org/10.1155/2011/989515. 23 | 24 | [3] O. Melchert, S. Willms, S. Bose, A. Yulin, B. Roth, F. Mitschke, U. 25 | Morgner, I. Babushkin, A. Demircan, Soliton Molecules with Two Frequencies, 26 | Phys. Rev. Lett. 123 (2019) 243905, 27 | https://doi.org/10.1103/PhysRevLett.123.243905. 28 | 29 | .. codeauthor:: Oliver Melchert 30 | """ 31 | import fmas 32 | import numpy as np 33 | from fmas.grid import Grid 34 | from fmas.models import FMAS 35 | from fmas.solver import IFM_RK4IP 36 | from fmas.analytic_signal import AS 37 | from fmas.tools import change_reference_frame, plot_evolution 38 | from fmas.propagation_constant import PropConst 39 | 40 | 41 | def define_beta_fun(): 42 | r"""Custom refractive index. 43 | """ 44 | p = np.poly1d((9.653881, -39.738626, 16.8848987, -2.745456)[::-1]) 45 | q = np.poly1d((1.000000, -9.496406, 4.2206250, -0.703437)[::-1]) 46 | n_idx = lambda w: p(w)/q(w) # (-) 47 | c0 = 0.29979 # (micron/fs) 48 | return lambda w: n_idx(w)*w/c0 # (1/micron) 49 | 50 | def main(): 51 | 52 | t_max = 2000. # (fs) 53 | t_num = 2**14 # (-) 54 | z_max = 0.06e6 # (micron) 55 | z_num = 25000 # (-) 56 | z_skip = 50 # (-) 57 | chi = 1.0 # (micron^2/W) 58 | c0 = 0.29979 # (micron/fs) 59 | 60 | # -- PROPAGATION CONSTANT 61 | beta_fun = define_beta_fun() 62 | pc = PropConst(beta_fun) 63 | 64 | # -- INITIALIZE DATA-STRUCTURES AND ALGORITHMS 65 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 66 | model = FMAS(w=grid.w, beta_w = beta_fun(grid.w), chi = chi ) 67 | solver = IFM_RK4IP( model.Lw, model.Nw, user_action = model.claw) 68 | 69 | # -- PREPARE INITIAL CONDITION AND RUN SIMULATION 70 | w01, t01, A01 = 1.178, 30.0, 0.0248892 # (rad/fs), (fs), (sqrt(W)) 71 | w02, t02, A02 = 2.909, 30.0, 0.0136676 # (rad/fs), (fs), (sqrt(W)) 72 | A_0t_fun = lambda t, A0, t0, w0: np.real(A0/np.cosh(t/t0)*np.exp(1j*w0*t)) 73 | E_0t = A_0t_fun(grid.t, A01, t01, w01) + A_0t_fun(grid.t, A02, t02, w02) 74 | solver.set_initial_condition( grid.w, AS(E_0t).w_rep) 75 | solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip) 76 | 77 | # -- SHOW RESULTS IN MOVING FRAME OF REFERENCE 78 | v0 = 0.0749641870819 # (micron/fs) 79 | utz = change_reference_frame(solver.w, solver.z, solver.uwz, v0) 80 | plot_evolution( solver.z, grid.t, utz, t_lim=(-100,150), w_lim=(0.3,3.8)) 81 | 82 | 83 | if __name__=='__main__': 84 | main() 85 | -------------------------------------------------------------------------------- /docs/_downloads/6c6cb4966c0aa6f6405c4dc79e9b5d83/g_molecules_01.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Superimposed fundamental solitons 3 | ================================= 4 | 5 | This examples demonstrates the generation of two-frequency soliton molecules, 6 | using the forward model for the analytic signal [1,2], in `py-fmas` implemented 7 | as :class:`FMAS`. 8 | 9 | In particular, this example shows how soliton molecules are generated from two 10 | initially superimposed fundamental solitons at distinctly different frequencies 11 | [3]. The exmample reproduces the propagation scenario shown in Fig. S10 of the 12 | supplementary material to [3]. 13 | 14 | References: 15 | 16 | [1] Sh. Amiranashvili, A. Demircan, Hamiltonian structure of 17 | propagation equations for ultrashort optical pulses, Phys. Rev. E 10 18 | (2010) 013812, http://dx.doi.org/10.1103/PhysRevA.82.013812. 19 | 20 | [2] Sh. Amiranashvili, A. Demircan, Ultrashort Optical Pulse Propagation in 21 | terms of Analytic Signal, Adv. Opt. Tech. 2011 (2011) 989515, 22 | http://dx.doi.org/10.1155/2011/989515. 23 | 24 | [3] O. Melchert, S. Willms, S. Bose, A. Yulin, B. Roth, F. Mitschke, U. 25 | Morgner, I. Babushkin, A. Demircan, Soliton Molecules with Two Frequencies, 26 | Phys. Rev. Lett. 123 (2019) 243905, 27 | https://doi.org/10.1103/PhysRevLett.123.243905. 28 | 29 | .. codeauthor:: Oliver Melchert 30 | """ 31 | import fmas 32 | import numpy as np 33 | from fmas.grid import Grid 34 | from fmas.models import FMAS 35 | from fmas.solver import IFM_RK4IP 36 | from fmas.analytic_signal import AS 37 | from fmas.tools import change_reference_frame, plot_evolution 38 | from fmas.propagation_constant import PropConst 39 | 40 | 41 | def define_beta_fun(): 42 | r"""Custom refractive index. 43 | """ 44 | p = np.poly1d((9.653881, -39.738626, 16.8848987, -2.745456)[::-1]) 45 | q = np.poly1d((1.000000, -9.496406, 4.2206250, -0.703437)[::-1]) 46 | n_idx = lambda w: p(w)/q(w) # (-) 47 | c0 = 0.29979 # (micron/fs) 48 | return lambda w: n_idx(w)*w/c0 # (1/micron) 49 | 50 | def main(): 51 | 52 | t_max = 2000. # (fs) 53 | t_num = 2**14 # (-) 54 | z_max = 0.06e6 # (micron) 55 | z_num = 25000 # (-) 56 | z_skip = 50 # (-) 57 | chi = 1.0 # (micron^2/W) 58 | c0 = 0.29979 # (micron/fs) 59 | 60 | # -- PROPAGATION CONSTANT 61 | beta_fun = define_beta_fun() 62 | pc = PropConst(beta_fun) 63 | 64 | # -- INITIALIZE DATA-STRUCTURES AND ALGORITHMS 65 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 66 | model = FMAS(w=grid.w, beta_w = beta_fun(grid.w), chi = chi ) 67 | solver = IFM_RK4IP( model.Lw, model.Nw, user_action = model.claw) 68 | 69 | # -- PREPARE INITIAL CONDITION AND RUN SIMULATION 70 | w01, t01, A01 = 1.178, 30.0, 0.0248892 # (rad/fs), (fs), (sqrt(W)) 71 | w02, t02, A02 = 2.909, 30.0, 0.0136676 # (rad/fs), (fs), (sqrt(W)) 72 | A_0t_fun = lambda t, A0, t0, w0: np.real(A0/np.cosh(t/t0)*np.exp(1j*w0*t)) 73 | E_0t = A_0t_fun(grid.t, A01, t01, w01) + A_0t_fun(grid.t, A02, t02, w02) 74 | solver.set_initial_condition( grid.w, AS(E_0t).w_rep) 75 | solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip) 76 | 77 | # -- SHOW RESULTS IN MOVING FRAME OF REFERENCE 78 | v0 = 0.0749641870819 # (micron/fs) 79 | utz = change_reference_frame(solver.w, solver.z, solver.uwz, v0) 80 | plot_evolution( solver.z, grid.t, utz, t_lim=(-100,150), w_lim=(0.3,3.8)) 81 | 82 | 83 | if __name__=='__main__': 84 | main() 85 | -------------------------------------------------------------------------------- /fmas/models/fmas_thg.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implements forward model for the analytic signal including third harmonic 3 | generation. 4 | 5 | .. codeauthor:: Oliver Melchert 6 | """ 7 | import numpy as np 8 | from .model_base import ModelBaseClass 9 | from ..config import FTFREQ, FT, IFT, C0 10 | 11 | 12 | class FMAS_THG(ModelBaseClass): 13 | r"""Forward model for analytic signal including third-harmonic generation. 14 | 15 | Implements the forward model for the analytic signal including 16 | third-harmonic generation, see Eq. (17) of Ref.[1]. 17 | 18 | References: 19 | [1] A. Demircan, Sh. Amiranashvili, C. Bree, U. Morgner, G. Steinmeyer, 20 | Supercontinuum generation by multiple scatterings at a group velocity 21 | horizon, Opt. Exp. 22 (2014) 3866, 22 | https://doi.org/10.1364/OE.22.003866. 23 | 24 | Args: 25 | w (:obj:`numpy.ndarray`): 26 | Angular frequency grid. 27 | beta_w (:obj:`numpy.ndarray`): 28 | Propagation constant. 29 | chi (:obj:`float`): 30 | Nonlinear susceptibility (default=1.0). 31 | """ 32 | 33 | def __init__(self, w, beta_w, chi=1.0): 34 | super().__init__(w, beta_w) 35 | self.chi = chi 36 | 37 | @property 38 | def Lw(self): 39 | r"""Frequency-domain representation of nonlinear operator. 40 | 41 | Returns: 42 | :obj:`numpy.ndarray`: Frequency-domain representation of linear 43 | operator of the partial differential equation. 44 | """ 45 | return 1j * self.beta_w 46 | 47 | def Nw(self, uw): 48 | r"""Frequency-domain representation of nonlinear operator. 49 | 50 | Args: 51 | uw (:obj:`numpy.ndarray`): 52 | Frequency-domain representation of field at current 53 | :math:`z`-position. 54 | 55 | Returns: 56 | :obj:`numpy.ndarray`: Frequency-domain representation of field at 57 | current :math:`z`-position. 58 | """ 59 | w, c0, chi, beta_w = self.w, self.c0, self.chi, self.beta_w 60 | ut = IFT(uw) 61 | 62 | _gam_w = np.divide( 63 | chi * w * w, 64 | c0 * c0 * 8.0 * beta_w, 65 | out=np.zeros(w.size, dtype="float"), 66 | where=np.abs(beta_w) > 1e-20, 67 | ) 68 | 69 | FT_pfp = lambda x: np.where(w > 0, FT(x), 0j) 70 | return 1j * _gam_w * FT_pfp((ut + np.conj(ut)) ** 3) 71 | 72 | def claw(self, i, zi, w, uw): 73 | r"""Conservation law of the propagation model. 74 | 75 | Implements conserved quantity related to the field energy, given by 76 | 77 | .. math:: 78 | C_{\mathcal{E}}(z) = \sum_\omega |\mathcal{E}_\omega(z)|^2. 79 | 80 | Args: 81 | i (:obj:`int`): 82 | Index specifying the current :math:`z`-step. 83 | zi (:obj:`float`): 84 | Current :math:`z`-value. 85 | w (:obj:`numpy.ndarray`): 86 | Angular frequency mesh. 87 | uw (:obj:`numpy.ndarray`): 88 | Freuqency domain representation of the current field. 89 | 90 | Returns: 91 | :obj:`numpy.ndarray`: value of the conserved quantitiy. 92 | """ 93 | _fac_w = np.divide( 94 | self.beta_w * np.abs(uw) ** 2, 95 | w * w, 96 | out=np.zeros(w.size, dtype="float"), 97 | where=w > 1e-6, 98 | ) 99 | return np.sum(_fac_w[w > 0]) 100 | -------------------------------------------------------------------------------- /fmas/solver/integrating_factor_method.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implements integrating factor method (IFM). 3 | 4 | .. codeauthor:: Oliver Melchert 5 | """ 6 | import numpy as np 7 | from ..config import W_MAX_FAC 8 | from ..stepper import RungeKutta4 9 | from .solver_base import SolverBaseClass 10 | 11 | 12 | class IFM(SolverBaseClass): 13 | r"""Fixed stepsize algorithm implementing the integrating factor 14 | method (IFM). 15 | 16 | Implements a fixed stepsize algorithm referred to as the integrating factor 17 | method as discussed in [1,2]. As reference position, when updating the 18 | field from :math:`z` to :math:`z + \Delta z`, the provided implementation 19 | considers the current step midpoint :math:`z_0=z+\Delta z /2`. The 20 | :math:`z`-stepper initialized with the IFM is a fourth-order Runge-Kutta 21 | method. This variant of the IFM achieves global error 22 | :math:`\mathcal{O}(\Delta z^4)`. 23 | 24 | Note: 25 | This variant of the IFM is also referred to as the Runge-Kutta in the 26 | interaction picture (RK4IP) method [3]. 27 | 28 | Args: 29 | L (:obj:`numpy.ndarray`): 30 | Linear operator of the partial differential equation. 31 | N (:obj:`numpy.ndarray`): 32 | Nonlinear operator of the partial differential equation. 33 | user_action (:obj:`function`): callback function implementing a 34 | measurement using a user-supplied function with function call 35 | signature `user_action(i, zi, w, uw)`, where the arguments are: 36 | 37 | * i (:obj:`int`): Index specifying the current :math:`z`-step. 38 | 39 | * zi (:obj:`float`): Current :math:`z`-value. 40 | 41 | * w (:obj:`numpy.ndarray`): Angular frequency mesh. 42 | 43 | * uw (:obj:`numpy.ndarray`): Freuqency domain representation of the 44 | current fiels. 45 | 46 | Aliased as :class:`IFM_RK4IP`. 47 | 48 | References: 49 | [1] A.-K. Kassam, L. N. Trefethen, 50 | Fourth-order time- stepping for stiff PDEs, 51 | SIAM J. Sci. Comp. 26 (2005) 1214, 52 | https://doi.org/10.1137/S1064827502410633. 53 | 54 | [2] L. N. Trefethen, 55 | Spectral Methods in Matlab, 56 | SIAM, Philadelphia, 2000, 57 | https://people.maths.ox.ac.uk/trefethen/spectral.html 58 | (accessed 2021-03-18). 59 | 60 | [3] J. Hult, A Fourth-Order Runge–Kutta in the Inter- action Picture 61 | Method for Simulating Supercontin- uum Generation in Optical Fibers, 62 | IEEE J. Light- wave Tech. 25 (2007) 3770, 63 | https://doi.org/10.1109/JLT.2007.909373. 64 | """ 65 | 66 | def __init__(self, L, N, user_action=None): 67 | super().__init__(L, N, stepper=RungeKutta4, user_action=user_action) 68 | 69 | def single_step(self, z_curr, Ew): 70 | r"""Advance field by a single :math:`z`-slice 71 | 72 | Args: 73 | z_curr (:obj:`float`): Current propagation distance. 74 | Ew (:obj:`numpy.ndarray`): Frequency domain representation of the 75 | field at `z_curr`. 76 | 77 | Returns: 78 | :obj:`numpy.ndarray`: Frequency domain representation of the field 79 | at `z_curr` + `dz`. 80 | """ 81 | dz, w, L, N, P = self.dz_, self.w, self.L, self.N, self.stepper 82 | z0 = z_curr + dz / 2 83 | _cleanup = lambda Ew: np.where(np.abs(w) < W_MAX_FAC * w.max(), Ew, 0j) 84 | _P_lin = lambda z: np.exp(L * z) 85 | _dEIwdz = lambda z, EIw: _P_lin(z0 - z) * N(_P_lin(z - z0) * EIw) 86 | return _P_lin(dz / 2) * P(_dEIwdz, z_curr, _P_lin(dz / 2) * Ew, dz) 87 | -------------------------------------------------------------------------------- /docs/_downloads/90005f5a4ab65407bb9900a0664dbc85/g_BMCF.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": { 7 | "collapsed": false 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "%matplotlib inline" 12 | ] 13 | }, 14 | { 15 | "cell_type": "markdown", 16 | "metadata": {}, 17 | "source": [ 18 | "\n# BMCF -- Backscattered optical field components\n\nThis examples demonstrates backscattered optical field components using the\nbidirectional model for the complex field (BMCF), described in Ref. [1].\n\nIn particular, this example reproduces the propagation scenario shown in Fig.\n1(a) of Ref. [1]. The figure shows the evolution of a soliton of duration\n$t_{\\rm{S}}=50\\,\\mathrm{fs}$, center frequency\n$\\omega_{\\rm{S}}=2.23548\\,\\mathrm{rad/fs}$, and soliton order\n$N_{\\rm{S}}=3.54$. For a detailed discussion, see Ref. [1].\n\nReferences:\n [1] Sh. Amiranashvili, A. Demircan, Hamiltonian structure of\n propagation equations for ultrashort optical pulses, Phys. Rev. E 10\n (2010) 013812, http://dx.doi.org/10.1103/PhysRevA.82.013812.\n\n.. codeauthor:: Oliver Melchert \n" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": null, 24 | "metadata": { 25 | "collapsed": false 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "import fmas\nimport numpy as np\nfrom fmas.grid import Grid\nfrom fmas.models import BMCF\nfrom fmas.solver import IFM_RK4IP\nfrom fmas.analytic_signal import AS\nfrom fmas.propagation_constant import PropConst, define_beta_fun_fluoride_glass_AD2010\nfrom fmas.tools import change_reference_frame, plot_evolution\n\n\ndef main():\n\n # -- INITIALIZATION STAGE\n # ... DEFINE SIMULATION PARAMETERS\n t_max = 3500./2 # (fs)\n t_num = 2**14 # (-)\n z_max = 50.0e3 # (micron)\n z_num = 100000 # (-)\n z_skip = 100 # (-)\n c0 = 0.29979 # (micron/fs)\n n2 = 1. # (micron^2/W) FICTITIOUS VALUE ONLY\n wS = 2.32548 # (rad/fs)\n tS = 50.0 # (fs)\n NS = 3.54 # (-)\n # ... PROPAGGATION CONSTANT\n beta_fun = define_beta_fun_fluoride_glass_AD2010()\n pc = PropConst(beta_fun)\n chi = (8./3)*pc.beta(wS)*c0/wS*n2\n\n # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER \n grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num)\n model = BMCF(w=grid.w, beta_w=pc.beta(grid.w), chi = chi)\n solver = IFM_RK4IP( model.Lw, model.Nw)\n\n # -- SET UP INITIAL CONDITION\n LD = tS*tS/np.abs( pc.beta2(wS) )\n A0 = NS*np.sqrt(8*c0/wS/n2/LD)\n Eps_0w = AS(np.real(A0/np.cosh(grid.t/tS)*np.exp(1j*wS*grid.t))).w_rep\n solver.set_initial_condition( grid.w, Eps_0w)\n\n # -- PERFORM Z-PROPAGATION\n solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip)\n\n # -- SHOW RESULTS\n utz = change_reference_frame(solver.w, solver.z, solver.uwz, pc.vg(wS))\n plot_evolution( solver.z, grid.t, utz,\n t_lim = (-500,500), w_lim = (-10.,10.), DO_T_LOG = True, ratio_Iw=1e-15)\n\n\nif __name__=='__main__':\n main()" 30 | ] 31 | } 32 | ], 33 | "metadata": { 34 | "kernelspec": { 35 | "display_name": "Python 3", 36 | "language": "python", 37 | "name": "python3" 38 | }, 39 | "language_info": { 40 | "codemirror_mode": { 41 | "name": "ipython", 42 | "version": 3 43 | }, 44 | "file_extension": ".py", 45 | "mimetype": "text/x-python", 46 | "name": "python", 47 | "nbconvert_exporter": "python", 48 | "pygments_lexer": "ipython3", 49 | "version": "3.9.4" 50 | } 51 | }, 52 | "nbformat": 4, 53 | "nbformat_minor": 0 54 | } -------------------------------------------------------------------------------- /docs/_downloads/7f4c353a79a1296439f832bc865411d1/g_model_NSE.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": { 7 | "collapsed": false 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "%matplotlib inline" 12 | ] 13 | }, 14 | { 15 | "cell_type": "markdown", 16 | "metadata": {}, 17 | "source": [ 18 | "\n# Nonlinear Schr\u00f6dinger equation -- Third-order soliton\n\nThis example solves the standard nonlinear Schr\u00f6dinger equation, given by\n\n\\begin{align}\\partial_z u = -i \\frac{\\beta_2}{2}\\partial_t^2 u + i\\gamma |u|^2 u,\\end{align}\n\nwherein $u = u(z, t)$ represents the slowly varying pulse envelope,\n$\\beta_2=-1$ is the second order dispersion parameter, and\n$\\gamma=1$ is the nonlinear parameter. As initial condition, a\nhigher-order soliton\n\n\\begin{align}u_0(t) = N_{\\rm{sol}} \\sqrt{\\frac{|\\beta_2|}{\\gamma \\, t_0^2}} {\\rm{sech}}(t/t_0),\\end{align}\n\nof duration $t_0=1$, and soliton order $N_{\\rm{sol}}=3$ is\nconsidered. The propagation is performed up to $z_{\\rm{max}}=\\pi/2$, i.e.\nfor one soliton period.\n\n.. codeauthor:: Oliver Melchert \n" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": null, 24 | "metadata": { 25 | "collapsed": false 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "import fmas\nimport numpy as np\nfrom fmas.models import ModelBaseClass\nfrom fmas.config import FTFREQ, FT, IFT, C0\nfrom fmas.solver import SySSM\nfrom fmas.grid import Grid\nfrom fmas.tools import plot_evolution\n\n\nclass NSE(ModelBaseClass):\n def __init__(self, w, b2 = -1.0, gamma = 1.0):\n super().__init__(w, 0.5*b2*w*w)\n self.gamma = gamma\n\n @property\n def Lw(self):\n return 1j*self.beta_w\n\n def Nw(self, uw):\n ut = IFT(uw)\n return 1j*self.gamma*FT(np.abs(ut)**2*ut)\n\n def claw(self, i, zi, w, uw):\n return np.sum(np.abs(uw)**2)\n\n\ndef main():\n # -- DEFINE SIMULATION PARAMETERS\n # ... WAVEGUIDE PROPERTIES\n b2 = -1.0\n gamma = 1.\n # ... TEST PULSE PROPERTIES\n t0 = 1. # soliton duration\n P0 = np.abs(b2)/t0/t0/gamma # peak-intensity\n LD = t0*t0/np.abs(b2) # dispersion length\n N_sol = 3 # soliton order\n # ... COMPUTATIONAL DOMAIN \n t_max = 30.\n t_num = 2**12\n z_max = 0.5*np.pi*LD\n z_num = 1000\n z_skip = 2\n\n # -- INITIALIZATION STAGE\n # ... COMPUTATIONAL DOMAIN\n grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num)\n # ... NSE MODEL \n model = NSE(grid.w, b2, gamma)\n # ... Z-PROPAGATION USING SYMMETRIC SPLIT-STEP FOURIER METHOD \n solver = SySSM(model.Lw, model.Nw)\n # ... INITIAL CONDITION\n u_0t = N_sol*np.sqrt(P0)/np.cosh(grid.t/t0)\n solver.set_initial_condition(grid.w, FT(u_0t))\n\n # -- RUN SIMULATION\n solver.propagate(z_range = z_max, n_steps = z_num, n_skip = z_skip)\n\n plot_evolution( solver.z, grid.t, solver.utz,\n t_lim = (-4,4), w_lim = (-50,50), DO_T_LOG=False)\n\n\nif __name__=='__main__':\n main()" 30 | ] 31 | } 32 | ], 33 | "metadata": { 34 | "kernelspec": { 35 | "display_name": "Python 3", 36 | "language": "python", 37 | "name": "python3" 38 | }, 39 | "language_info": { 40 | "codemirror_mode": { 41 | "name": "ipython", 42 | "version": 3 43 | }, 44 | "file_extension": ".py", 45 | "mimetype": "text/x-python", 46 | "name": "python", 47 | "nbconvert_exporter": "python", 48 | "pygments_lexer": "ipython3", 49 | "version": "3.9.4" 50 | } 51 | }, 52 | "nbformat": 4, 53 | "nbformat_minor": 0 54 | } -------------------------------------------------------------------------------- /fmas/models/fmas.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implements forward model for the analytic signal. 3 | 4 | .. codeauthor:: Oliver Melchert 5 | """ 6 | import numpy as np 7 | from .model_base import ModelBaseClass 8 | from ..config import FTFREQ, FT, IFT, C0 9 | 10 | 11 | class FMAS(ModelBaseClass): 12 | r"""Forward-model for the analytic signal. 13 | 14 | Implements the forward-model for the analytic signal (FMAS) [1,2]. In 15 | particular, this model implements Eq. (33) of Ref.[1]. 16 | 17 | References: 18 | [1] Sh. Amiranashvili, A. Demircan, Hamiltonian structure of 19 | propagation equations for ultrashort optical pulses, Phys. Rev. E 10 20 | (2010) 013812, http://dx.doi.org/10.1103/PhysRevA.82.013812. 21 | 22 | [2] Sh. Amiranashvili, A. Demircan, Ultrashort Optical Pulse 23 | Propagation in terms of Analytic Signal, Adv. Opt. Tech. 2011 (2011) 24 | 989515, http://dx.doi.org/10.1155/2011/989515. 25 | 26 | Args: 27 | w (:obj:`numpy.ndarray`): 28 | Angular frequency grid. 29 | beta_w (:obj:`numpy.ndarray`): 30 | Propagation constant. 31 | alpha_w (:obj:`numpy.ndarray`): 32 | Frequency-domain representation of root-power loss. 33 | chi (:obj:`float`): 34 | Nonlinear susceptibility (default=1.0). 35 | """ 36 | 37 | def __init__(self, w, beta_w, alpha_w=0.0, chi=1.0): 38 | super().__init__(w, beta_w, alpha_w) 39 | self.chi = chi 40 | 41 | @property 42 | def Lw(self): 43 | r"""Frequency-domain representation of nonlinear operator. 44 | 45 | Returns: 46 | :obj:`numpy.ndarray`: Frequency-domain representation of linear 47 | operator of the partial differential equation. 48 | """ 49 | return 1j * self.beta_w - self.alpha_w 50 | 51 | def Nw(self, uw): 52 | r"""Frequency-domain representation of nonlinear operator. 53 | 54 | Args: 55 | uw (:obj:`numpy.ndarray`): 56 | Frequency-domain representation of field at current 57 | :math:`z`-position. 58 | 59 | Returns: 60 | :obj:`numpy.ndarray`: Frequency-domain representation of field at 61 | current :math:`z`-position. 62 | """ 63 | w, c0, chi, beta_w = self.w, self.c0, self.chi, self.beta_w 64 | ut = IFT(uw) 65 | 66 | _gamma_w = np.divide( 67 | 3.0 * chi * w * w, 68 | c0 * c0 * 8.0 * beta_w, 69 | out=np.zeros(w.size, dtype="float"), 70 | where=np.abs(beta_w) > 1e-20, 71 | ) 72 | 73 | FT_pfp = lambda x: np.where(w > 0, FT(x), 0j) 74 | return 1j * _gamma_w * FT_pfp(np.abs(ut) ** 2 * ut) 75 | 76 | def claw(self, i, zi, w, uw): 77 | r"""Conservation law of the propagation model. 78 | 79 | Implements conserved quantity related to the field energy, given by 80 | 81 | .. math:: 82 | C_{\mathcal{E}}(z) = \sum_\omega |\mathcal{E}_\omega(z)|^2. 83 | 84 | Args: 85 | i (:obj:`int`): 86 | Index specifying the current :math:`z`-step. 87 | zi (:obj:`float`): 88 | Current :math:`z`-value. 89 | w (:obj:`numpy.ndarray`): 90 | Angular frequency mesh. 91 | uw (:obj:`numpy.ndarray`): 92 | Freuqency domain representation of the current field. 93 | 94 | Returns: 95 | :obj:`numpy.ndarray`: value of the conserved quantitiy. 96 | """ 97 | _fac_w = np.divide( 98 | self.beta_w * np.abs(uw) ** 2, 99 | w * w, 100 | out=np.zeros(w.size, dtype="float"), 101 | where=w > 1e-6, 102 | ) 103 | return np.sum(_fac_w[w > 0]) 104 | -------------------------------------------------------------------------------- /galleries/gallery_01/g_specialized_model_NLPM.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Two pulse interaction in a NLPM750 PCF 3 | ====================================== 4 | 5 | This examples demonstrates the interaction between a fundamental soliton and a 6 | dispersive wave in a NL-PM-750 photonic crystal fiber. For the numerical 7 | simualtion the forward model for the analytic signal including the Raman effect 8 | is used [3]. 9 | 10 | In particular, this example reproduces the propagation scenario for 11 | :math:`t_0=250\,\mathrm{fs}`, shown in Fig.~2(b) of Ref. [2]. Note that here 12 | we use a polynomial expansion of the propagation constant, obtained for the 13 | reference frequency :math:`\omega_{\rm{ref}}=1.85\,\mathrm{rad/fs}`. 14 | For a more detailed discussion, see Ref. [2]. 15 | 16 | References: 17 | [1] A. Demircan, Sh. Amiranashvili, C. Bree, C. Mahnke, F. Mitschke, G. 18 | Steinmeyer, Rogue wave formation by accelerated solitons at an optical 19 | event horizon, Appl. Phys. B 115 (2014) 343, 20 | http://dx.doi.org/10.1007/s00340-013-5609-9 21 | 22 | [2] O. Melchert, C. Bree, A. Tajalli, A. Pape, R. Arkhipov, S. Willms, I. 23 | Babushkin, D. Skryabin, G. Steinmeyer, U. Morgner, A. Demircan, All-optical 24 | supercontinuum switching, Communications Physics 3 (2020) 146, 25 | https://doi.org/10.1038/s42005-020-00414-1. 26 | 27 | .. codeauthor:: Oliver Melchert 28 | """ 29 | import fmas 30 | import numpy as np 31 | from fmas.grid import Grid 32 | from fmas.models import FMAS_S_R 33 | from fmas.solver import IFM_RK4IP 34 | from fmas.analytic_signal import AS 35 | from fmas.propagation_constant import PropConst 36 | from fmas.tools import change_reference_frame, plot_evolution 37 | 38 | 39 | def define_beta_fun_poly_NLPM750(): 40 | # -- EXPANSION COEFFIENTS 41 | coeffs =[-7.47658629e-08, 2.07925891e-06, -2.50978046e-05, 1.70783580e-04, 42 | -7.06498505e-04 , 1.74251689e-03 , -2.05510570e-03, -1.02991785e-03, 43 | 7.44467252e-03, -1.15714412e-02, 1.06894885e-02, -1.03866947e-02, 44 | 1.11828958e-02, 8.28155802e-04 , -1.51886109e-02 , 4.97000000e+00, 45 | 8.90000000e+00] 46 | # -- FREQUENCY FOR WHICH EXPANSION COEFFICIENTS ARE VALID 47 | w_ref = 1.85 # (rad/fs) 48 | # -- PROPAGATION CONSTANT FOR DETUNING (1/micron) 49 | _beta = np.poly1d(coeffs); 50 | return lambda w: _beta(w-w_ref) 51 | 52 | 53 | def main(): 54 | 55 | # -- DEFINE SIMULATION PARAMETERS 56 | # ... COMPUTATIONAL DOMAIN 57 | t_max = 2000. # (fs) 58 | t_num = 2**13 # (-) 59 | z_max = 1.0e6 # (micron) 60 | z_num = 10000 # (-) 61 | z_skip = 10 # (-) 62 | n2 = 3.0e-8 # (micron^2/W) 63 | c0 = 0.29979 # (fs/micron) 64 | lam0 = 0.860 # (micron) 65 | w0_S = 2*np.pi*c0/lam0 # (rad/fs) 66 | t0_S = 20.0 # (fs) 67 | w0_DW = 2.95 # (rad/fs) 68 | t0_DW = 70.0 # (fs) 69 | t_off = -250.0 # (fs) 70 | sFac = 0.75 # (-) 71 | 72 | beta_fun = define_beta_fun_poly_NLPM750() 73 | pc = PropConst(beta_fun) 74 | 75 | # -- INITIALIZATION STAGE 76 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 77 | model = FMAS_S_R(w=grid.w, beta_w=pc.beta(grid.w), n2 = n2) 78 | solver = IFM_RK4IP( model.Lw, model.Nw, user_action = model.claw) 79 | 80 | # -- SET UP INITIAL CONDITION 81 | t = grid.t 82 | A0 = np.sqrt(abs(pc.beta2(w0_S))*c0/w0_S/n2)/t0_S 83 | A0_S = A0/np.cosh(t/t0_S)*np.exp(1j*w0_S*t) 84 | A0_DW = sFac*A0/np.cosh((t-t_off)/t0_DW)*np.exp(1j*w0_DW*t) 85 | Eps_0w = AS(np.real(A0_S + A0_DW)).w_rep 86 | solver.set_initial_condition( grid.w, Eps_0w) 87 | solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip) 88 | 89 | # -- SHOW RESULTS 90 | utz = change_reference_frame(solver.w, solver.z, solver.uwz, pc.vg(w0_S)) 91 | plot_evolution( solver.z, grid.t, utz, t_lim=(-1200,1200), w_lim=(1.8,3.2)) 92 | 93 | 94 | if __name__=='__main__': 95 | main() 96 | -------------------------------------------------------------------------------- /docs/_downloads/6f8ed726dcbea9374ace56909c4edbc7/g_specialized_model_NLPM.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Two pulse interaction in a NLPM750 PCF 3 | ====================================== 4 | 5 | This examples demonstrates the interaction between a fundamental soliton and a 6 | dispersive wave in a NL-PM-750 photonic crystal fiber. For the numerical 7 | simualtion the forward model for the analytic signal including the Raman effect 8 | is used [3]. 9 | 10 | In particular, this example reproduces the propagation scenario for 11 | :math:`t_0=250\,\mathrm{fs}`, shown in Fig.~2(b) of Ref. [2]. Note that here 12 | we use a polynomial expansion of the propagation constant, obtained for the 13 | reference frequency :math:`\omega_{\rm{ref}}=1.85\,\mathrm{rad/fs}`. 14 | For a more detailed discussion, see Ref. [2]. 15 | 16 | References: 17 | [1] A. Demircan, Sh. Amiranashvili, C. Bree, C. Mahnke, F. Mitschke, G. 18 | Steinmeyer, Rogue wave formation by accelerated solitons at an optical 19 | event horizon, Appl. Phys. B 115 (2014) 343, 20 | http://dx.doi.org/10.1007/s00340-013-5609-9 21 | 22 | [2] O. Melchert, C. Bree, A. Tajalli, A. Pape, R. Arkhipov, S. Willms, I. 23 | Babushkin, D. Skryabin, G. Steinmeyer, U. Morgner, A. Demircan, All-optical 24 | supercontinuum switching, Communications Physics 3 (2020) 146, 25 | https://doi.org/10.1038/s42005-020-00414-1. 26 | 27 | .. codeauthor:: Oliver Melchert 28 | """ 29 | import fmas 30 | import numpy as np 31 | from fmas.grid import Grid 32 | from fmas.models import FMAS_S_R 33 | from fmas.solver import IFM_RK4IP 34 | from fmas.analytic_signal import AS 35 | from fmas.propagation_constant import PropConst 36 | from fmas.tools import change_reference_frame, plot_evolution 37 | 38 | 39 | def define_beta_fun_poly_NLPM750(): 40 | # -- EXPANSION COEFFIENTS 41 | coeffs =[-7.47658629e-08, 2.07925891e-06, -2.50978046e-05, 1.70783580e-04, 42 | -7.06498505e-04 , 1.74251689e-03 , -2.05510570e-03, -1.02991785e-03, 43 | 7.44467252e-03, -1.15714412e-02, 1.06894885e-02, -1.03866947e-02, 44 | 1.11828958e-02, 8.28155802e-04 , -1.51886109e-02 , 4.97000000e+00, 45 | 8.90000000e+00] 46 | # -- FREQUENCY FOR WHICH EXPANSION COEFFICIENTS ARE VALID 47 | w_ref = 1.85 # (rad/fs) 48 | # -- PROPAGATION CONSTANT FOR DETUNING (1/micron) 49 | _beta = np.poly1d(coeffs); 50 | return lambda w: _beta(w-w_ref) 51 | 52 | 53 | def main(): 54 | 55 | # -- DEFINE SIMULATION PARAMETERS 56 | # ... COMPUTATIONAL DOMAIN 57 | t_max = 2000. # (fs) 58 | t_num = 2**13 # (-) 59 | z_max = 1.0e6 # (micron) 60 | z_num = 10000 # (-) 61 | z_skip = 10 # (-) 62 | n2 = 3.0e-8 # (micron^2/W) 63 | c0 = 0.29979 # (fs/micron) 64 | lam0 = 0.860 # (micron) 65 | w0_S = 2*np.pi*c0/lam0 # (rad/fs) 66 | t0_S = 20.0 # (fs) 67 | w0_DW = 2.95 # (rad/fs) 68 | t0_DW = 70.0 # (fs) 69 | t_off = -250.0 # (fs) 70 | sFac = 0.75 # (-) 71 | 72 | beta_fun = define_beta_fun_poly_NLPM750() 73 | pc = PropConst(beta_fun) 74 | 75 | # -- INITIALIZATION STAGE 76 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 77 | model = FMAS_S_R(w=grid.w, beta_w=pc.beta(grid.w), n2 = n2) 78 | solver = IFM_RK4IP( model.Lw, model.Nw, user_action = model.claw) 79 | 80 | # -- SET UP INITIAL CONDITION 81 | t = grid.t 82 | A0 = np.sqrt(abs(pc.beta2(w0_S))*c0/w0_S/n2)/t0_S 83 | A0_S = A0/np.cosh(t/t0_S)*np.exp(1j*w0_S*t) 84 | A0_DW = sFac*A0/np.cosh((t-t_off)/t0_DW)*np.exp(1j*w0_DW*t) 85 | Eps_0w = AS(np.real(A0_S + A0_DW)).w_rep 86 | solver.set_initial_condition( grid.w, Eps_0w) 87 | solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip) 88 | 89 | # -- SHOW RESULTS 90 | utz = change_reference_frame(solver.w, solver.z, solver.uwz, pc.vg(w0_S)) 91 | plot_evolution( solver.z, grid.t, utz, t_lim=(-1200,1200), w_lim=(1.8,3.2)) 92 | 93 | 94 | if __name__=='__main__': 95 | main() 96 | -------------------------------------------------------------------------------- /docs/_downloads/0bab1337cc4d21ee4f1782f5643299eb/g_soliton_implosion.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": { 7 | "collapsed": false 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "%matplotlib inline" 12 | ] 13 | }, 14 | { 15 | "cell_type": "markdown", 16 | "metadata": {}, 17 | "source": [ 18 | "\n# Soliton implosion in a NLPM750 PCF\n\nThis examples demonstrates breakdown of a high-order soliton in a NL-PM-750\nphotonic crystal fiber, described in Ref. [1]. For the numerical simualtion\nthe forward model for the analytic signal including the Raman effect is used\n[1,2].\n\nIn particular, this example reproduces the propagation scenario shown in\nFig.~2 of Ref. [1]. The resulting figure shows the breakdown of a high-order\nsoliton of duration $t_{\\rm{S}}=10\\,\\mathrm{fs}$, center frequency\n$\\omega_{\\rm{S}}=1.884\\,\\mathrm{rad/fs}$, and soliton order\n$N_{\\rm{S}}=10$. This process is also referred to as soliton implosion.\nFor more details see Ref. [1].\n\nReferences:\n [1] I. Babushkin, A. Tajalli, H. Sayinc et al., Simple route toward\n efficient frequency conversion for generation of fully coherent\n supercontinua in the mid-IR and UV range, Light: Science & Applications 6\n (2017) e16218, https://doi.org/10.1038/lsa.2016.218\n\n [2] A. Demircan, Sh. Amiranashvili, C. Bree, C. Mahnke, F. Mitschke, G.\n Steinmeyer, Rogue wave formation by accelerated solitons at an optical\n event horizon, Appl. Phys. B 115 (2014) 343,\n http://dx.doi.org/10.1007/s00340-013-5609-9\n\n.. codeauthor:: Oliver Melchert \n" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": null, 24 | "metadata": { 25 | "collapsed": false 26 | }, 27 | "outputs": [], 28 | "source": [ 29 | "import fmas\nimport numpy as np\nfrom fmas.grid import Grid\nfrom fmas.models import FMAS_S_R\nfrom fmas.solver import IFM_RK4IP\nfrom fmas.analytic_signal import AS\nfrom fmas.propagation_constant import PropConst, define_beta_fun_NLPM750\nfrom fmas.tools import change_reference_frame, plot_evolution\n\n\ndef main():\n\n # -- INITIALIZATION STAGE\n # ... DEFINE SIMULATION PARAMETERS\n t_max = 3000. # (fs)\n t_num = 2**14 # (-)\n z_max = 8.0e3 # (micron)\n z_num = 10000 # (-)\n z_skip = 10 # (-)\n n2 = 3.0e-8 # (micron^2/W)\n wS = 1.884 # (rad/fs)\n tS = 10.0 # (fs)\n NS = 10. # (-)\n # ... PROPAGGATION CONSTANT\n beta_fun = define_beta_fun_NLPM750()\n pc = PropConst(beta_fun)\n # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER \n grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num)\n model = FMAS_S_R(w=grid.w, beta_w=pc.beta(grid.w), n2 = n2)\n solver = IFM_RK4IP( model.Lw, model.Nw)\n\n # -- SET UP INITIAL CONDITION\n A0 = NS*np.sqrt(np.abs(pc.beta2(wS))*model.c0/wS/n2)/tS\n Eps_0w = AS(np.real(A0/np.cosh(grid.t/tS)*np.exp(1j*wS*grid.t))).w_rep\n solver.set_initial_condition( grid.w, Eps_0w)\n\n # -- PERFORM Z-PROPAGATION\n solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip)\n\n # -- SHOW RESULTS\n utz = change_reference_frame(solver.w, solver.z, solver.uwz, pc.vg(wS))\n plot_evolution( solver.z, grid.t, utz,\n t_lim = (-100,100), w_lim = (0.5,8.), DO_T_LOG = True)\n\n\nif __name__=='__main__':\n main()" 30 | ] 31 | } 32 | ], 33 | "metadata": { 34 | "kernelspec": { 35 | "display_name": "Python 3", 36 | "language": "python", 37 | "name": "python3" 38 | }, 39 | "language_info": { 40 | "codemirror_mode": { 41 | "name": "ipython", 42 | "version": 3 43 | }, 44 | "file_extension": ".py", 45 | "mimetype": "text/x-python", 46 | "name": "python", 47 | "nbconvert_exporter": "python", 48 | "pygments_lexer": "ipython3", 49 | "version": "3.9.4" 50 | } 51 | }, 52 | "nbformat": 4, 53 | "nbformat_minor": 0 54 | } -------------------------------------------------------------------------------- /galleries/gallery_03/g_model_KdV.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Korteweg-deVries equation -- Interaction of solitons 3 | ==================================================== 4 | 5 | This example solves the Korteweg-deVries (KdV) equation, given by 6 | 7 | .. math:: 8 | \partial_t u = - \delta^2 \partial_x^3 u -u \partial_x u, 9 | 10 | wherein the evolution of the real-valued field :math:`u = u(t, x)` is 11 | determined by the parameter :math:`\delta=0.022`. 12 | 13 | The propagation scenario below considers the initial condition 14 | 15 | .. math:: 16 | u_0(x) = \cos(\pi x), \quad 0\leq x \leq 2, 17 | 18 | and uses a pseudospectral integrating factor method, i.e. the "Runge-Kutta in 19 | the interaction picture" method implemented in the `py-fmas` libragy, to 20 | reproduce the data shown in Fig. 2 of Ref. [1]. 21 | 22 | References: 23 | [1] N. J. Zabusky, M. D. Kruskal, Interaction of "Solitons" in a 24 | Collisionless Plasma and the Recurrence of Initial States, Phys. Rev. Lett. 25 | 15 (1965) 240, https://doi.org/10.1103/PhysRevLett.15.240. 26 | 27 | .. codeauthor:: Oliver Melchert 28 | """ 29 | import fmas 30 | import numpy as np 31 | import matplotlib as mpl 32 | import matplotlib.pyplot as plt 33 | import matplotlib.colors as col 34 | from fmas.config import FTFREQ, FT, IFT, C0 35 | from fmas.solver import IFM_RK4IP 36 | 37 | 38 | def plot_evolution_KdV(t, x, u): 39 | 40 | def _setColorbar(im, refPos): 41 | """colorbar helper""" 42 | x0, y0, w, h = refPos.x0, refPos.y0, refPos.width, refPos.height 43 | cax = f.add_axes([x0, y0+1.02*h, w, 0.03*h]) 44 | cbar = f.colorbar(im, cax=cax, orientation='horizontal') 45 | cbar.ax.tick_params(color='k', 46 | labelcolor='k', 47 | bottom=False, 48 | direction='out', 49 | labelbottom=False, 50 | labeltop=True, 51 | top=True, 52 | size=4, 53 | pad=0 54 | ) 55 | 56 | cbar.set_ticks((-1,-0.5,0,0.5,1)) 57 | cbar.ax.tick_params(which="minor", bottom=False, top=False ) 58 | return cbar 59 | 60 | f, ax1 = plt.subplots(1, 1, sharey=True, figsize=(2.5,4)) 61 | plt.subplots_adjust(left=0.2, right=0.9, bottom=0.12, top=0.84) 62 | cmap=mpl.cm.get_cmap('coolwarm') 63 | 64 | im1 = ax1.pcolorfast(x, t, u[:-1,:-1], 65 | norm=col.Normalize(vmin=-1,vmax=1), 66 | cmap=cmap 67 | ) 68 | cbar1 = _setColorbar(im1,ax1.get_position()) 69 | cbar1.ax.set_title(r"$u(x,t)$",color='k',y=3.5) 70 | ax1.xaxis.set_ticks_position('bottom') 71 | ax1.yaxis.set_ticks_position('left') 72 | ax1.set_xlim(x[0],x[-1]) 73 | ax1.set_xticks((0,0.5,1.,1.5,2)) 74 | ax1.set_ylim([0.,t.max()]) 75 | ax1.set_xlabel(r"Distance $x$") 76 | ax1.set_ylabel(r"Time $t$") 77 | 78 | plt.show() 79 | 80 | 81 | def main(): 82 | # -- DEFINE SIMULATION PARAMETERS 83 | x_min = 0. 84 | x_max = 2. 85 | Nx = 512 86 | t_min = 0. 87 | t_max = 6.0 88 | Nt = 30000 89 | n_skip = 10 90 | delta = 0.022 91 | 92 | # -- INITIALIZATION STAGE 93 | # ... COMPUTATIONAL DOMAIN 94 | x = np.linspace(x_min, x_max, Nx, endpoint=False) 95 | k = FTFREQ(x.size,d=x[1]-x[0])*2*np.pi 96 | # ... KORTEWEG DEVRIES MODEL 97 | Lk = -1j*k*k*k*delta*delta 98 | Nk_fun = lambda uk: 0.5j*k*FT(IFT(uk)**2) 99 | # ... SOLVER BASED ON INTEGRATING FACTOR METHOD 100 | solver = IFM_RK4IP(Lk, Nk_fun) 101 | # ... INITIAL CONDITION 102 | u_0x = np.cos(np.pi*x) 103 | solver.set_initial_condition(k, FT(u_0x)) 104 | 105 | # -- RUN SIMULATION 106 | solver.propagate(z_range = t_max, n_steps = Nt, n_skip = n_skip) 107 | 108 | plot_evolution_KdV( solver.z, x, np.real(solver.utz)) 109 | 110 | 111 | if __name__=='__main__': 112 | main() 113 | -------------------------------------------------------------------------------- /fmas/analytic_signal.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implements class `AnalyticSignal`, which uses the frequncy-domain algorithm 3 | detailed in [M1999]_ to compute the complex-valued analytic signal for a 4 | real-valued discrete-time field. 5 | 6 | .. [M1999] S. L. Marple, 7 | Computing the Discrete-Time Analytic signal via FFT, 8 | IEEE Transactions on Signal Processing, 47 (1999) 2600. 9 | 10 | .. module:: analytic_signal 11 | 12 | .. codeauthor:: Oliver Melchert 13 | """ 14 | import numpy as np 15 | from .config import FTFREQ, FT, IFT 16 | 17 | 18 | class AnalyticSignal: 19 | r"""Class converting real-valued field to analytic signal. 20 | 21 | Implements methods that take a real-valued :math:`N`-point discrete-time 22 | field :math:`E` and provide access to the complex-valued discrete-time 23 | analytic signal :math:`\mathcal{E}`, both in time-domain and 24 | Fourier-domain. 25 | 26 | Note: 27 | The class implements the frequency-domain algorithm specified in 28 | [M1999]_, given by the three-step procedure 29 | 30 | 1. Compute :math:`E_\omega`, i.e. the :math:`N`-point discrete 31 | Fourier-trasform (DFT) of the real-valued discrete-time field 32 | :math:`E`. 33 | 34 | 2. Compute the :math:`N`-point discrete-time analytic signal in the 35 | Fourier-domain, given by 36 | 37 | .. math:: \mathcal{E}_\omega[m] = \begin{cases} 38 | E_\omega[0], & m=0,\\ 39 | 2E_\omega[m], & 1\leq m \leq N/2-1,\\ 40 | E_\omega[N/2], & m = N/2,\\ 41 | 0, & N/2+1 \leq m \leq N - 1. 42 | \end{cases} 43 | 44 | 3. Compute the complex-valued :math:`N`-point discrete-time analytic 45 | signal :math:`\mathcal{E}` using an inverse DFT. 46 | 47 | Args: 48 | x (:obj:`numpy.ndarray`): Real-valued field :math:`E`. 49 | 50 | Attributes: 51 | x (:obj:`numpy.ndarray`): Real-valued field :math:`E`. 52 | num (:obj:`int`): Number :math:`N` of field points. 53 | 54 | """ 55 | 56 | def __init__(self, x): 57 | self.x = np.asarray(x) 58 | self.num = self.x.size 59 | 60 | @property 61 | def w_rep(self): 62 | r""":obj:`numpy.ndarray`: Frequency-domain representation :math:`\mathcal{E}_\omega` of the analytic signal.""" 63 | num, x = self.num, self.x 64 | tmp = FT(x) 65 | tmp[1 : int(num / 2)] = 2 * tmp[1 : int(num / 2)] 66 | tmp[int(num / 2) + 1] = tmp[int(num / 2) + 1] 67 | tmp[int(num / 2) + 1 :] = 0j 68 | return tmp 69 | 70 | @property 71 | def t_rep(self): 72 | r""":obj:`numpy.ndarray`: Time-domain representation :math:`\mathcal{E}` of the analytic signal.""" 73 | return IFT(self.w_rep) 74 | 75 | def test_recover_original_field(self): 76 | r"""Check if real part of analytic signal equals original field. 77 | 78 | Real part of the discrete-time analytic signal must be equal to the original field, i.e. 79 | 80 | .. math:: \mathsf{Re}(\mathcal{E}[n]) = E[n], \quad 0\leq n\leq N-1, 81 | 82 | see Eq. (6) of [M1999]_. 83 | """ 84 | z = self.t_rep 85 | np.testing.assert_allclose(self.x, np.real(z), rtol=1e-8) 86 | 87 | def test_orthogonality(self): 88 | r"""Check if real and imaginary parts are orthogonal. 89 | 90 | Real and imaginary parts of the analytic signal must be orthogonal, i.e. 91 | 92 | .. math:: \sum_{n=0}^{N-1} \mathsf{Re}(\mathcal{E}[n])\,\mathsf{Im}(\mathcal{E}[n]) = 0, 93 | 94 | see Eq. (7) of [M1999]_. 95 | """ 96 | z = self.t_rep 97 | z_r, z_im = np.real(z), np.imag(z) 98 | assert np.sum(z_r * z_im) < 1e-10 99 | 100 | 101 | AS = AnalyticSignal 102 | 103 | if __name__ == "__main__": 104 | x = [4, 2, -2, -1, 3, 1, -3, 1] 105 | Z = AnalyticSignal(x) 106 | Z.test_orthogonality() 107 | Z.test_recover_original_field() 108 | -------------------------------------------------------------------------------- /docs/_downloads/ccccfbf2a29a392f75915612a6959a6a/g_model_KdV.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Korteweg-deVries equation -- Interaction of solitons 3 | ==================================================== 4 | 5 | This example solves the Korteweg-deVries (KdV) equation, given by 6 | 7 | .. math:: 8 | \partial_t u = - \delta^2 \partial_x^3 u -u \partial_x u, 9 | 10 | wherein the evolution of the real-valued field :math:`u = u(t, x)` is 11 | determined by the parameter :math:`\delta=0.022`. 12 | 13 | The propagation scenario below considers the initial condition 14 | 15 | .. math:: 16 | u_0(x) = \cos(\pi x), \quad 0\leq x \leq 2, 17 | 18 | and uses a pseudospectral integrating factor method, i.e. the "Runge-Kutta in 19 | the interaction picture" method implemented in the `py-fmas` libragy, to 20 | reproduce the data shown in Fig. 2 of Ref. [1]. 21 | 22 | References: 23 | [1] N. J. Zabusky, M. D. Kruskal, Interaction of "Solitons" in a 24 | Collisionless Plasma and the Recurrence of Initial States, Phys. Rev. Lett. 25 | 15 (1965) 240, https://doi.org/10.1103/PhysRevLett.15.240. 26 | 27 | .. codeauthor:: Oliver Melchert 28 | """ 29 | import fmas 30 | import numpy as np 31 | import matplotlib as mpl 32 | import matplotlib.pyplot as plt 33 | import matplotlib.colors as col 34 | from fmas.config import FTFREQ, FT, IFT, C0 35 | from fmas.solver import IFM_RK4IP 36 | 37 | 38 | def plot_evolution_KdV(t, x, u): 39 | 40 | def _setColorbar(im, refPos): 41 | """colorbar helper""" 42 | x0, y0, w, h = refPos.x0, refPos.y0, refPos.width, refPos.height 43 | cax = f.add_axes([x0, y0+1.02*h, w, 0.03*h]) 44 | cbar = f.colorbar(im, cax=cax, orientation='horizontal') 45 | cbar.ax.tick_params(color='k', 46 | labelcolor='k', 47 | bottom=False, 48 | direction='out', 49 | labelbottom=False, 50 | labeltop=True, 51 | top=True, 52 | size=4, 53 | pad=0 54 | ) 55 | 56 | cbar.set_ticks((-1,-0.5,0,0.5,1)) 57 | cbar.ax.tick_params(which="minor", bottom=False, top=False ) 58 | return cbar 59 | 60 | f, ax1 = plt.subplots(1, 1, sharey=True, figsize=(2.5,4)) 61 | plt.subplots_adjust(left=0.2, right=0.9, bottom=0.12, top=0.84) 62 | cmap=mpl.cm.get_cmap('coolwarm') 63 | 64 | im1 = ax1.pcolorfast(x, t, u[:-1,:-1], 65 | norm=col.Normalize(vmin=-1,vmax=1), 66 | cmap=cmap 67 | ) 68 | cbar1 = _setColorbar(im1,ax1.get_position()) 69 | cbar1.ax.set_title(r"$u(x,t)$",color='k',y=3.5) 70 | ax1.xaxis.set_ticks_position('bottom') 71 | ax1.yaxis.set_ticks_position('left') 72 | ax1.set_xlim(x[0],x[-1]) 73 | ax1.set_xticks((0,0.5,1.,1.5,2)) 74 | ax1.set_ylim([0.,t.max()]) 75 | ax1.set_xlabel(r"Distance $x$") 76 | ax1.set_ylabel(r"Time $t$") 77 | 78 | plt.show() 79 | 80 | 81 | def main(): 82 | # -- DEFINE SIMULATION PARAMETERS 83 | x_min = 0. 84 | x_max = 2. 85 | Nx = 512 86 | t_min = 0. 87 | t_max = 6.0 88 | Nt = 30000 89 | n_skip = 10 90 | delta = 0.022 91 | 92 | # -- INITIALIZATION STAGE 93 | # ... COMPUTATIONAL DOMAIN 94 | x = np.linspace(x_min, x_max, Nx, endpoint=False) 95 | k = FTFREQ(x.size,d=x[1]-x[0])*2*np.pi 96 | # ... KORTEWEG DEVRIES MODEL 97 | Lk = -1j*k*k*k*delta*delta 98 | Nk_fun = lambda uk: 0.5j*k*FT(IFT(uk)**2) 99 | # ... SOLVER BASED ON INTEGRATING FACTOR METHOD 100 | solver = IFM_RK4IP(Lk, Nk_fun) 101 | # ... INITIAL CONDITION 102 | u_0x = np.cos(np.pi*x) 103 | solver.set_initial_condition(k, FT(u_0x)) 104 | 105 | # -- RUN SIMULATION 106 | solver.propagate(z_range = t_max, n_steps = Nt, n_skip = n_skip) 107 | 108 | plot_evolution_KdV( solver.z, x, np.real(solver.utz)) 109 | 110 | 111 | if __name__=='__main__': 112 | main() 113 | -------------------------------------------------------------------------------- /docs/_sources/auto_tutorials/attenuation/g_test.rst.txt: -------------------------------------------------------------------------------- 1 | 2 | .. DO NOT EDIT. 3 | .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. 4 | .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: 5 | .. "auto_tutorials/attenuation/g_test.py" 6 | .. LINE NUMBERS ARE GIVEN BELOW. 7 | 8 | .. only:: html 9 | 10 | .. note:: 11 | :class: sphx-glr-download-link-note 12 | 13 | Click :ref:`here ` 14 | to download the full example code 15 | 16 | .. rst-class:: sphx-glr-example-title 17 | 18 | .. _sphx_glr_auto_tutorials_attenuation_g_test.py: 19 | 20 | 21 | Attenuation of a NLPM750 fiber 22 | ============================== 23 | 24 | This example demonstrates how to use models along with a realistic attenuation 25 | profile. 26 | 27 | .. codeauthor:: Oliver Melchert 28 | 29 | .. GENERATED FROM PYTHON SOURCE LINES 10-64 30 | 31 | 32 | 33 | .. image:: /auto_tutorials/attenuation/images/sphx_glr_g_test_001.png 34 | :alt: g test 35 | :class: sphx-glr-single-img 36 | 37 | 38 | 39 | 40 | 41 | .. code-block:: default 42 | 43 | import fmas 44 | import numpy as np 45 | from fmas.grid import Grid 46 | from fmas.models import FMAS_S 47 | from fmas.solver import IFM_RK4IP, SySSM 48 | from ng_fiber_details_nlpm750 import define_alpha_fun_NLPM750 49 | 50 | 51 | # -- INITIALIZATION STAGE 52 | # ... DEFINE SIMULATION PARAMETERS 53 | t_max = 1000. # (fs) 54 | t_num = 2**13 # (-) 55 | z_max = 1.0e5 # (micron) 56 | z_num = 1000 # (-) 57 | z_skip = 10 # (-) 58 | # ... PROPAGGATION CONSTANT 59 | alpha_fun = define_alpha_fun_NLPM750() 60 | # ... COMPUTATIONAL DOMAIN, MODEL, AND SOLVER 61 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 62 | model = FMAS_S( w = grid.w, beta_w = 0., alpha_w = alpha_fun(grid.w), n2 = 0.0) 63 | solver = SySSM( model.Lw, model.Nw) 64 | 65 | # -- SET UP INITIAL CONDITION 66 | u_0w = np.where(np.logical_and( grid.w>1, grid.w<6. ), 1, 0) 67 | solver.set_initial_condition( grid.w, u_0w) 68 | 69 | # -- PERFORM Z-PROPAGATION 70 | solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip) 71 | 72 | 73 | import matplotlib as mpl 74 | import matplotlib.pyplot as plt 75 | import matplotlib.colors as col 76 | 77 | f, ax = plt.subplots(1, 1, figsize=(5, 3)) 78 | plt.subplots_adjust(left=0.15, right=0.96, bottom=0.15, top=0.96, hspace=0.2) 79 | 80 | _dB = lambda x: np.where(x>1e-20,10.*np.log10(x),10*np.log10(1e-20)) 81 | w_mask = np.logical_and(grid.w>1,grid.w<5.) 82 | I0 = np.abs(solver.uwz[0,w_mask])**2 83 | Iz = np.abs(solver.uwz[-1,w_mask])**2 84 | lam =2*np.pi*0.3/grid.w[w_mask] 85 | loss = -_dB(Iz/I0)*1e9/z_max # (dB/km) attenuation 86 | ax.plot(lam, loss) 87 | 88 | ax.xaxis.set_ticks_position("bottom") 89 | ax.yaxis.set_ticks_position("left") 90 | ax.set_xlim([0.4, 1.6]) 91 | ax.set_ylim([0,200]) 92 | ax.ticklabel_format(useOffset=False, style="sci") 93 | ax.set_xlabel(r"Wavelength $\mathrm{(\mu m)}$") 94 | ax.set_ylabel(r"Loss $\mathrm{(dB/km)}$") 95 | 96 | plt.show() 97 | 98 | 99 | .. rst-class:: sphx-glr-timing 100 | 101 | **Total running time of the script:** ( 0 minutes 2.221 seconds) 102 | 103 | 104 | .. _sphx_glr_download_auto_tutorials_attenuation_g_test.py: 105 | 106 | 107 | .. only :: html 108 | 109 | .. container:: sphx-glr-footer 110 | :class: sphx-glr-footer-example 111 | 112 | 113 | 114 | .. container:: sphx-glr-download sphx-glr-download-python 115 | 116 | :download:`Download Python source code: g_test.py ` 117 | 118 | 119 | 120 | .. container:: sphx-glr-download sphx-glr-download-jupyter 121 | 122 | :download:`Download Jupyter notebook: g_test.ipynb ` 123 | 124 | 125 | .. only:: html 126 | 127 | .. rst-class:: sphx-glr-signature 128 | 129 | `Gallery generated by Sphinx-Gallery `_ 130 | -------------------------------------------------------------------------------- /galleries/gallery_01/g_four_pulse_interaction_ESM.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Four pulse interaction in a ESM PCF 3 | =================================== 4 | 5 | This examples demonstrates the interaction between a fundamental soliton and a 6 | three dispersive wave with pairwise distinct center frequencies in an 7 | "endlessly single mode" (ESM) photonic crystal fiber. For the numerical 8 | simualtion the simplified forward model for the analytic signal is used [3]. 9 | 10 | References: 11 | [1] A. Demircan, Sh. Amiranashvili, C. Bree, C. Mahnke, F. Mitschke, G. 12 | Steinmeyer, Rogue wave formation by accelerated solitons at an optical 13 | event horizon, Appl. Phys. B 115 (2014) 343, 14 | http://dx.doi.org/10.1007/s00340-013-5609-9 15 | 16 | .. codeauthor:: Oliver Melchert 17 | """ 18 | import fmas 19 | import numpy as np 20 | from fmas.grid import Grid 21 | from fmas.models import FMAS_S 22 | from fmas.solver import IFM_RK4IP 23 | from fmas.analytic_signal import AS 24 | from fmas.tools import change_reference_frame, plot_evolution 25 | from fmas.propagation_constant import PropConst 26 | 27 | 28 | def define_beta_fun_ESM(): 29 | r"""Custom propagation constant for an ESM photonic crystal fiber. 30 | 31 | Implements rational Pade-approximant of order [8/8] for the refractive 32 | index of a endlessly single mode (ESM) nonlinear photonic crystal fiber 33 | (PCF), see Ref. [1]. 34 | 35 | References: 36 | [1] Visibly 'white' light generation in uniform photonic crystal fiber 37 | using a microchip laser Stone, J.M. and Knight, J.C. Optics Express 16 38 | (2007) 2670. 39 | 40 | Returns: 41 | :obj:`callable`: Propagation constant for ESM PCF. 42 | """ 43 | p = np.poly1d( 44 | (16.89475, 0., -319.13216, 0., 34.82210, 0., -0.992495, 0., 0.0010671)[::-1]) 45 | q = np.poly1d( 46 | ( 1.00000, 0., -702.70157, 0., 78.28249, 0., -2.337086, 0., 0.0062267)[::-1]) 47 | n_idx = lambda w: 1+p(w)/q(w) # (-) 48 | c0 = 0.29979 # (micron/fs) 49 | return lambda w: n_idx(w)*w/c0 # (1/micron) 50 | 51 | 52 | def main(): 53 | 54 | # -- DEFINE SIMULATION PARAMETERS 55 | # ... COMPUTATIONAL DOMAIN 56 | t_max = 4000. # (fs) 57 | t_num = 2**14 # (-) 58 | z_max = 4.0e6 # (micron) 59 | z_num = 50000 # (-) 60 | z_skip =100 # (-) 61 | n2 = 3.0e-8 # (micron^2/W) 62 | 63 | beta_fun = define_beta_fun_ESM() 64 | pc = PropConst(beta_fun) 65 | 66 | # -- INITIALIZATION STAGE 67 | grid = Grid( t_max = t_max, t_num = t_num, z_max = z_max, z_num = z_num) 68 | model = FMAS_S(w=grid.w, beta_w=pc.beta(grid.w), n2=n2) 69 | solver = IFM_RK4IP( model.Lw, model.Nw, user_action = model.claw) 70 | 71 | # -- SET UP INITIAL CONDITION 72 | t = grid.t 73 | # ... FUNDAMENTAL NSE SOLITON 74 | w0_S, t0_S = 1.5, 20. # (rad/fs), (fs) 75 | A0 = np.sqrt(abs(pc.beta2(w0_S))*model.c0/w0_S/n2)/t0_S 76 | A0_S = A0/np.cosh(t/t0_S)*np.exp(1j*w0_S*t) 77 | # ... 1ST DISPERSIVE WAVE; UNITS (rad/fs), (fs), (fs), (-) 78 | w0_DW1, t0_DW1, t_off1, s1 = 2.06, 60., -600., 0.35 79 | A0_DW1 = s1*A0/np.cosh((t-t_off1)/t0_DW1)*np.exp(1j*w0_DW1*t) 80 | # ... 2ND DISPERSIVE WAVE; UNITS (rad/fs), (fs), (fs), (-) 81 | w0_DW2, t0_DW2, t_off2, s2 = 2.05, 60., -1200., 0.35 82 | A0_DW2 = s2*A0/np.cosh((t-t_off2)/t0_DW2)*np.exp(1j*w0_DW2*t) 83 | # ... 3RD DISPERSIVE WAVE; UNITS (rad/fs), (fs), (fs), (-) 84 | w0_DW3, t0_DW3, t_off3, s3 = 2.04, 60., -1800., 0.35 85 | A0_DW3 = s3*A0/np.cosh((t-t_off3)/t0_DW3)*np.exp(1j*w0_DW3*t) 86 | # ... ANALYTIC SIGNAL OF FULL ININITIAL CONDITION 87 | Eps_0w = AS(np.real(A0_S + A0_DW1 + A0_DW2 + A0_DW3)).w_rep 88 | 89 | solver.set_initial_condition( grid.w, Eps_0w) 90 | solver.propagate( z_range = z_max, n_steps = z_num, n_skip = z_skip) 91 | 92 | # -- SHOW RESULTS 93 | v0 = pc.vg(w0_S) 94 | utz = change_reference_frame(solver.w, solver.z, solver.uwz, v0) 95 | plot_evolution( solver.z, grid.t, utz, t_lim=(-4000,1000), w_lim=(1.1,2.4)) 96 | 97 | 98 | if __name__=='__main__': 99 | main() 100 | --------------------------------------------------------------------------------