.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/RunModel/opensees_example.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_RunModel_opensees_example.py: Third-party - OpenSees ================================== .. GENERATED FROM PYTHON SOURCE LINES 8-9 Import the necessary libraries. .. GENERATED FROM PYTHON SOURCE LINES 12-19 .. code-block:: default import numpy as np from UQpy.distributions import Uniform from UQpy.run_model.RunModel import RunModel from UQpy.run_model.model_execution.ThirdPartyModel import ThirdPartyModel from UQpy.sampling import MonteCarloSampling .. GENERATED FROM PYTHON SOURCE LINES 20-21 Define the distribution objects. .. GENERATED FROM PYTHON SOURCE LINES 24-29 .. code-block:: default dist1 = Uniform(location=15000, scale=10000) dist2 = Uniform(location=450000, scale=80000) dist3 = Uniform(location=2.0e8, scale=0.5e8) .. GENERATED FROM PYTHON SOURCE LINES 30-31 Draw the samples using MCS. .. GENERATED FROM PYTHON SOURCE LINES 34-38 .. code-block:: default x = MonteCarloSampling(distributions=[dist1, dist2, dist3] * 6, samples_number=5, random_state=938475) samples = np.array(x.samples).round(2) .. GENERATED FROM PYTHON SOURCE LINES 39-40 Run the model. .. GENERATED FROM PYTHON SOURCE LINES 43-54 .. code-block:: default names_ = ['fc1', 'fy1', 'Es1', 'fc2', 'fy2', 'Es2', 'fc3', 'fy3', 'Es3', 'fc4', 'fy4', 'Es4', 'fc5', 'fy5', 'Es5', 'fc6', 'fy6', 'Es6'] m = ThirdPartyModel(model_script='opensees_model.py', input_template='import_variables.tcl', var_names=names_, model_object_name="opensees_run", output_script='process_opensees_output.py', output_object_name='read_output') opensees_rc6_model = RunModel(samples=samples, ntasks=5, model=m) outputs = opensees_rc6_model.qoi_list print(outputs) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_RunModel_opensees_example.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/SURGroup/UQpy/master?urlpath=lab/tree/notebooks/auto_examples/RunModel/opensees_example.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: opensees_example.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: opensees_example.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_