Note
Click here to download the full example code
Visualize and compare model results¶
Visualize model results and compare to other model results or reference data.
from __future__ import annotations
import logging
import plotly.graph_objects as go
from gemseo.datasets.dataset import Dataset
from gemseo.post.dataset.bars import BarPlot
from gemseo.post.dataset.scatter_plot_matrix import ScatterMatrix
from numpy import atleast_1d
from pandas import DataFrame
from pandas import concat
from vimseo import EXAMPLE_RUNS_DIR
from vimseo.api import activate_logger
from vimseo.api import create_model
from vimseo.core.model_result import ModelResult
from vimseo.core.model_settings import IntegratedModelSettings
from vimseo.utilities.curves import Curve
from vimseo.utilities.fields import extract_line
from vimseo.utilities.plotting_utils import superpose_curves
activate_logger(level=logging.INFO)
After execution, the results of a model can be visualized. The curves are shown by default:
model_name = "BendingTestAnalytical"
load_case = "Cantilever"
model = create_model(
model_name,
load_case,
model_options=IntegratedModelSettings(
directory_archive_root=EXAMPLE_RUNS_DIR / "archive/visualize_model_result",
directory_scratch_root=EXAMPLE_RUNS_DIR / "scratch/visualize_model_result",
cache_file_path=EXAMPLE_RUNS_DIR
/ f"caches/visualize_model_result/{model_name}_{load_case}_cache.hdf",
),
)
model.cache = None
model.execute()
result = ModelResult.from_data({
"inputs": model.get_input_data(),
"outputs": model.get_output_data(),
})
figs = model.plot_results(show=True, save=False)
figs["dplt_vs_dplt_grid"]
Out:
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\genson\schema\strategies\base.py:42: UserWarning:
Schema incompatible. Keyword 'description' has conflicting values ('Value of the reaction forces at the imposed displacement location' vs. ''). Using 'Value of the reaction forces at the imposed displacement location'
INFO - 09:44:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\visualize_model_result\BendingTestAnalytical\Cantilever\1.
{'text/html': '<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="9e2f4bee-ce6d-4523-9b5e-668c86a7219a" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("9e2f4bee-ce6d-4523-9b5e-668c86a7219a")) { Plotly.newPlot( "9e2f4bee-ce6d-4523-9b5e-668c86a7219a", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue"},"mode":"lines","name":"dplt","x":[0.0,6.0606060606060606,12.121212121212121,18.18181818181818,24.242424242424242,30.303030303030305,36.36363636363636,42.42424242424242,48.484848484848484,54.54545454545455,60.60606060606061,66.66666666666667,72.72727272727272,78.78787878787878,84.84848484848484,90.9090909090909,96.96969696969697,103.03030303030303,109.0909090909091,115.15151515151516,121.21212121212122,127.27272727272727,133.33333333333334,139.3939393939394,145.45454545454544,151.5151515151515,157.57575757575756,163.63636363636363,169.6969696969697,175.75757575757575,181.8181818181818,187.87878787878788,193.93939393939394,200.0,206.06060606060606,212.12121212121212,218.1818181818182,224.24242424242425,230.3030303030303,236.36363636363637,242.42424242424244,248.48484848484847,254.54545454545453,260.6060606060606,266.6666666666667,272.72727272727275,278.7878787878788,284.8484848484849,290.9090909090909,296.96969696969694,303.030303030303,309.09090909090907,315.1515151515151,321.2121212121212,327.27272727272725,333.3333333333333,339.3939393939394,345.45454545454544,351.5151515151515,357.57575757575756,363.6363636363636,369.6969696969697,375.75757575757575,381.8181818181818,387.8787878787879,393.93939393939394,400.0,406.06060606060606,412.1212121212121,418.1818181818182,424.24242424242425,430.3030303030303,436.3636363636364,442.42424242424244,448.4848484848485,454.54545454545456,460.6060606060606,466.6666666666667,472.72727272727275,478.7878787878788,484.8484848484849,490.9090909090909,496.96969696969694,503.030303030303,509.09090909090907,515.1515151515151,521.2121212121212,527.2727272727273,533.3333333333334,539.3939393939394,545.4545454545455,551.5151515151515,557.5757575757576,563.6363636363636,569.6969696969697,575.7575757575758,581.8181818181818,587.8787878787879,593.9393939393939,600.0],"y":[0.0,-0.0007626515125749902,-0.003040299948778674,-0.006817486156329135,-0.01207875098294445,-0.01880863527634269,-0.026991679884241906,-0.03661242565436021,-0.047655413434415636,-0.060105184072126276,-0.0739462784152102,-0.08916323731138551,-0.10574060160837022,-0.12366291215388246,-0.1429147097956403,-0.16348053538136179,-0.18534492975876504,-0.20849243377556811,-0.23290758827948913,-0.2585749341182458,-0.28547901213955673,-0.31360436319113977,-0.3429355281207131,-0.37345704777599464,-0.40515346300470234,-0.43800931465455467,-0.47200914357326945,-0.5071374906085647,-0.5433788966081587,-0.5807179024197694,-0.6191390488911149,-0.6586268768699133,-0.6991659272038825,-0.7407407407407407,-0.7833358583282061,-0.8269358208139966,-0.8715251690458303,-0.9170884438714254,-0.9636101861384999,-1.0110749366947718,-1.059467236387959,-1.10877162606578,-1.1589726465759527,-1.2100548387661951,-1.2620027434842254,-1.3148009015777615,-1.3684338538945218,-1.4228861412822236,-1.4781423045885853,-1.5341868846613258,-1.5910044223481628,-1.6485794584968139,-1.706896533954997,-1.7659401895704312,-1.825694966190834,-1.8861454046639228,-1.9472760458374168,-2.009071430559034,-2.0715160996764914,-2.1345945940375075,-2.198291454489801,-2.2625912218810895,-2.327478437059092,-2.392937640871524,-2.4589533741661076,-2.525510177790556,-2.592592592592592,-2.6601851594199304,-2.7282724191202914,-2.7968389125413906,-2.865869180530949,-2.935347763936682,-3.00525920360631,-3.0755880403875495,-3.146318815128119,-3.217436068675736,-3.2889243418781207,-3.3607681755829875,-3.4329521106380594,-3.50546068789105,-3.57827844818968,-3.651389932381665,-3.7247796813147245,-3.798432235836579,-3.8723321367949435,-3.9464639250375373,-4.020812141412077,-4.09536132676628,-4.17009602194787,-4.245000767804559,-4.3200601051840675,-4.395258574934114,-4.470580717902416,-4.54601107493669,-4.621534186884657,-4.697134594594031,-4.7727968389125355,-4.848505460687886,-4.924245000767797,-4.999999999999994],"type":"scatter"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"title":{"text":"dplt_grid"}},"yaxis":{"title":{"font":{"color":"blue"},"text":"dplt"},"tickfont":{"color":"blue"}}}, {"responsive": true} ) }; </script> </div>'}
INFO - 09:44:03: Plot BendingTestAnalytical_Cantilever_dplt_vs_dplt_grid.html is saved in .
{'text/html': '<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="17be1b01-c62c-4d44-9665-a124db6a2986" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("17be1b01-c62c-4d44-9665-a124db6a2986")) { Plotly.newPlot( "17be1b01-c62c-4d44-9665-a124db6a2986", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue"},"mode":"lines","name":"moment","x":[0.0,600.0],"y":[1400000.0,0.0],"type":"scatter"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"title":{"text":"moment_grid"}},"yaxis":{"title":{"font":{"color":"blue"},"text":"moment"},"tickfont":{"color":"blue"}}}, {"responsive": true} ) }; </script> </div>'}
INFO - 09:44:03: Plot BendingTestAnalytical_Cantilever_moment_vs_moment_grid.html is saved in .
figs["moment_vs_moment_grid"]
Scalar outputs can be visualized in a scatter matrix:
figs = model.plot_results(
show=True,
save=True,
data="SCALARS",
scalar_names=["young_modulus", "reaction_forces"],
)
figs["scalars"]
Out:
INFO - 09:44:03: Saving plots to C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\visualize_model_result\BendingTestAnalytical\Cantilever\1
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\pandas\plotting\_matplotlib\misc.py:91: UserWarning:
Attempting to set identical low and high xlims makes transformation singular; automatically expanding.
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\pandas\plotting\_matplotlib\misc.py:100: UserWarning:
Attempting to set identical low and high xlims makes transformation singular; automatically expanding.
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\pandas\plotting\_matplotlib\misc.py:101: UserWarning:
Attempting to set identical low and high ylims makes transformation singular; automatically expanding.
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\gemseo\utils\matplotlib_figure.py:126: UserWarning:
FigureCanvasAgg is non-interactive, and thus cannot be shown
[<Figure size 640x480 with 4 Axes>]
Results can be obtained by querying the archive.
For a DirectoryArchive, the path to access to the current result is:
model.archive_manager.job_directory
Out:
WindowsPath('C:/Users/sebastien.bocquet/Dev/vd017/docs/runnable_examples/model_runs/archive/visualize_model_result/BendingTestAnalytical/Cantilever/1')
A result can be retrieved from this path:
result = ModelResult.from_data(
model.archive_manager.get_result(model.archive_manager.job_directory)
)
print(result)
Out:
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\genson\schema\strategies\base.py:42: UserWarning:
Schema incompatible. Keyword 'description' has conflicting values ('Value of the reaction forces at the imposed displacement location' vs. ''). Using 'Value of the reaction forces at the imposed displacement location'
Scalars:
{'young_modulus': np.float64(210000.0), 'nu_p': np.float64(0.3), 'length': np.float64(600.0), 'width': np.float64(30.0), 'height': np.float64(40.0), 'imposed_dplt': np.float64(-5.0), 'relative_dplt_location': np.float64(1.0), 'reaction_forces': np.float64(-2333.3333333333335), 'dplt_at_force_location': np.float64(-4.999999999999994), 'maximum_dplt': np.float64(-4.999999999999994), 'location_max_dplt': np.float64(600.0)}
Vectors:
{}
Curves:
('dplt_grid', 'dplt')
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
dplt_grid 0.0 6.060606 12.121212 18.181818 24.242424 30.303030 36.363636 42.424242 48.484848 54.545455 60.606061 66.666667 72.727273 78.787879 84.848485 90.909091 96.969697 103.030303 109.090909 115.151515 121.212121 127.272727 133.333333 139.393939 145.454545 151.515152 157.575758 163.636364 169.696970 175.757576 181.818182 187.878788 193.939394 200.000000 206.060606 212.121212 218.181818 224.242424 230.30303 236.363636 242.424242 248.484848 254.545455 260.606061 266.666667 272.727273 278.787879 284.848485 290.909091 296.969697 303.030303 309.090909 315.151515 321.212121 327.272727 333.333333 339.393939 345.454545 351.515152 357.575758 363.636364 369.696970 375.757576 381.818182 387.878788 393.939394 400.000000 406.060606 412.121212 418.181818 424.242424 430.303030 436.363636 442.424242 448.484848 454.545455 460.606061 466.666667 472.727273 478.787879 484.848485 490.909091 496.969697 503.030303 509.090909 515.151515 521.212121 527.272727 533.333333 539.393939 545.454545 551.515152 557.575758 563.636364 569.696970 575.757576 581.818182 587.878788 593.939394 600.0
dplt 0.0 -0.000763 -0.003040 -0.006817 -0.012079 -0.018809 -0.026992 -0.036612 -0.047655 -0.060105 -0.073946 -0.089163 -0.105741 -0.123663 -0.142915 -0.163481 -0.185345 -0.208492 -0.232908 -0.258575 -0.285479 -0.313604 -0.342936 -0.373457 -0.405153 -0.438009 -0.472009 -0.507137 -0.543379 -0.580718 -0.619139 -0.658627 -0.699166 -0.740741 -0.783336 -0.826936 -0.871525 -0.917088 -0.96361 -1.011075 -1.059467 -1.108772 -1.158973 -1.210055 -1.262003 -1.314801 -1.368434 -1.422886 -1.478142 -1.534187 -1.591004 -1.648579 -1.706897 -1.765940 -1.825695 -1.886145 -1.947276 -2.009071 -2.071516 -2.134595 -2.198291 -2.262591 -2.327478 -2.392938 -2.458953 -2.525510 -2.592593 -2.660185 -2.728272 -2.796839 -2.865869 -2.935348 -3.005259 -3.075588 -3.146319 -3.217436 -3.288924 -3.360768 -3.432952 -3.505461 -3.578278 -3.651390 -3.724780 -3.798432 -3.872332 -3.946464 -4.020812 -4.095361 -4.170096 -4.245001 -4.320060 -4.395259 -4.470581 -4.546011 -4.621534 -4.697135 -4.772797 -4.848505 -4.924245 -5.0
('moment_grid', 'moment')
0 1
moment_grid 0.0 600.0
moment 1400000.0 0.0
Fields:
{}
Two model results can be compared. We first generate a second result:
model.execute({"young_modulus": atleast_1d(1.95e5), "imposed_dplt": atleast_1d(-10.0)})
result_2 = ModelResult.from_data({
"inputs": model.get_input_data(),
"outputs": model.get_output_data(),
})
result_2
Out:
INFO - 09:44:03: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\visualize_model_result\BendingTestAnalytical\Cantilever\2.
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\genson\schema\strategies\base.py:42: UserWarning:
Schema incompatible. Keyword 'description' has conflicting values ('Value of the reaction forces at the imposed displacement location' vs. ''). Using 'Value of the reaction forces at the imposed displacement location'
ModelResult(metadata=ToolResultMetadata(generic={'datetime': '28-10-2026_09-44-03', 'version': '0.1.8.dev0+g5ba602a7e.d20261028'}, misc={}, settings={}, report={<MetaDataNames.model: 'model'>: np.str_('BendingTestAnalytical'), <MetaDataNames.load_case: 'load_case'>: np.str_('Cantilever'), <MetaDataNames.error_code: 'error_code'>: np.int64(-1), <MetaDataNames.description: 'description'>: np.str_(''), <MetaDataNames.job_name: 'job_name'>: np.str_(''), <MetaDataNames.persistent_result_files: 'persistent_result_files'>: np.str_(''), <MetaDataNames.n_cpus: 'n_cpus'>: np.int64(0), <MetaDataNames.date: 'date'>: np.str_('2026-10-28 09:44:03.905212'), <MetaDataNames.cpu_time: 'cpu_time'>: np.float64(0.003026247024536133), <MetaDataNames.user: 'user'>: np.str_('sebastien.bocquet'), <MetaDataNames.machine: 'machine'>: np.str_('PCBM20250036'), <MetaDataNames.vims_git_version: 'vims_git_version'>: np.str_('5ba602a7e3571a2fc5a0a3604673c7e5410711b0'), <MetaDataNames.directory_archive_root: 'directory_archive_root'>: np.str_('C:\\Users\\sebastien.bocquet\\Dev\\vd017\\docs\\runnable_examples\\model_runs\\archive\\visualize_model_result'), <MetaDataNames.directory_archive_job: 'directory_archive_job'>: np.str_('C:\\Users\\sebastien.bocquet\\Dev\\vd017\\docs\\runnable_examples\\model_runs\\archive\\visualize_model_result\\BendingTestAnalytical\\Cantilever\\2'), <MetaDataNames.directory_scratch_root: 'directory_scratch_root'>: np.str_('C:\\Users\\sebastien.bocquet\\Dev\\vd017\\docs\\runnable_examples\\model_runs\\scratch\\visualize_model_result'), <MetaDataNames.directory_scratch_job: 'directory_scratch_job'>: np.str_('')}, model=ModelDescription(name='BendingTestAnalytical', summary=' An analytical model for the bending of a parallelepipedic beam', load_case=Beam_Cantilever(name=np.str_('Cantilever'), domain='Beam', summary='A cantilever load case.', bc_variable_names=['imposed_dplt', 'relative_dplt_location'], load=Load(direction='', sign='', type='')), dataflow={'model_inputs': ['length', 'width', 'height', 'imposed_dplt', 'relative_dplt_location', 'young_modulus', 'nu_p'], 'model_outputs': ['reaction_forces', 'moment', 'moment_grid', 'dplt', 'dplt_grid', 'maximum_dplt', 'location_max_dplt', 'dplt_at_force_location', 'model', 'load_case', 'error_code', 'description', 'job_name', 'persistent_result_files', 'n_cpus', 'date', 'cpu_time', 'user', 'machine', 'vims_git_version', 'directory_archive_root', 'directory_archive_job', 'directory_scratch_root', 'directory_scratch_job'], 'PreBendingTestAnalytical_Cantilever': {'inputs': ['length', 'width', 'height', 'imposed_dplt', 'relative_dplt_location', 'young_modulus', 'nu_p'], 'outputs': ['imposed_dplt_location', 'quadratic_moment', 'reaction_forces', 'moment', 'moment_grid', 'solver', 'boundary']}, 'RunBendingTestAnalytical': {'inputs': ['solver', 'boundary', 'moment', 'moment_grid', 'young_modulus', 'quadratic_moment', 'nu_p'], 'outputs': ['dplt', 'dplt_grid']}, 'PostBendingTestAnalytical_Cantilever': {'inputs': ['dplt', 'dplt_grid', 'moment', 'moment_grid', 'imposed_dplt_location', 'reaction_forces'], 'outputs': ['reaction_forces', 'maximum_dplt', 'dplt_grid', 'location_max_dplt', 'dplt', 'moment', 'moment_grid', 'dplt_at_force_location']}, 'subroutine_names': []}, default_inputs={<InputGroupNames.NUMERICAL_VARS: 'numerical variables'>: {}, <InputGroupNames.BC_VARS: 'boundary conditions variables'>: {'imposed_dplt': [-5.0], 'relative_dplt_location': [1.0]}, <InputGroupNames.GEOMETRICAL_VARS: 'geometrical variables'>: {'length': [600.0], 'width': [30.0], 'height': [40.0]}, <InputGroupNames.MATERIAL_VARS: 'material variables'>: {'young_modulus': [210000.0], 'nu_p': [0.3]}}, verbose=False)), scalars={'length': np.float64(600.0), 'width': np.float64(30.0), 'height': np.float64(40.0), 'imposed_dplt': np.float64(-10.0), 'relative_dplt_location': np.float64(1.0), 'young_modulus': np.float64(195000.0), 'nu_p': np.float64(0.3), 'reaction_forces': np.float64(-4333.333333333333), 'dplt_at_force_location': np.float64(-9.999999999999991), 'maximum_dplt': np.float64(-9.999999999999991), 'location_max_dplt': np.float64(600.0)}, vectors={}, curves=[<vimseo.utilities.curves.Curve object at 0x000001506B073470>, <vimseo.utilities.curves.Curve object at 0x000001506B073710>], plots=[<vimseo.utilities.curves.CurveSet object at 0x000001506B0736E0>, <vimseo.utilities.curves.CurveSet object at 0x000001506B0737D0>], fields={}, snapshots=[])
The scalars can be compared in a scatter matrix:
variable_names = ["young_modulus", "reaction_forces"]
df = DataFrame([
result.get_numeric_scalars(variable_names=variable_names),
result_2.get_numeric_scalars(variable_names=variable_names),
])
df["color"] = range(len(df))
plot = ScatterMatrix(Dataset.from_dataframe(df), classifier="color")
plot.labels = ["result", "result 2"]
fig = plot.execute(
save=False,
show=True,
)
fig

Out:
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\gemseo\utils\matplotlib_figure.py:126: UserWarning:
FigureCanvasAgg is non-interactive, and thus cannot be shown
[<Figure size 640x480 with 4 Axes>]
.. note::
Since the compared data are in a ``Pandas.DataFrame``,
other plotting library can be used, like ``Seaborn``:
``sns.pairplot(df)``
The curves can also be compared:
superpose_curves(
[
result.get_curve(("dplt_grid", "dplt")),
result_2.get_curve(("dplt_grid", "dplt")),
],
labels=["result", "result 2"],
)
Out:
{'text/html': '<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="b8296b4b-64b6-463a-8094-0ecb3ab9a122" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("b8296b4b-64b6-463a-8094-0ecb3ab9a122")) { Plotly.newPlot( "b8296b4b-64b6-463a-8094-0ecb3ab9a122", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue"},"mode":"lines","name":"result - dplt","x":[0.0,6.0606060606060606,12.121212121212121,18.18181818181818,24.242424242424242,30.303030303030305,36.36363636363636,42.42424242424242,48.484848484848484,54.54545454545455,60.60606060606061,66.66666666666667,72.72727272727272,78.78787878787878,84.84848484848484,90.9090909090909,96.96969696969697,103.03030303030303,109.0909090909091,115.15151515151516,121.21212121212122,127.27272727272727,133.33333333333334,139.3939393939394,145.45454545454544,151.5151515151515,157.57575757575756,163.63636363636363,169.6969696969697,175.75757575757575,181.8181818181818,187.87878787878788,193.93939393939394,200.0,206.06060606060606,212.12121212121212,218.1818181818182,224.24242424242425,230.3030303030303,236.36363636363637,242.42424242424244,248.48484848484847,254.54545454545453,260.6060606060606,266.6666666666667,272.72727272727275,278.7878787878788,284.8484848484849,290.9090909090909,296.96969696969694,303.030303030303,309.09090909090907,315.1515151515151,321.2121212121212,327.27272727272725,333.3333333333333,339.3939393939394,345.45454545454544,351.5151515151515,357.57575757575756,363.6363636363636,369.6969696969697,375.75757575757575,381.8181818181818,387.8787878787879,393.93939393939394,400.0,406.06060606060606,412.1212121212121,418.1818181818182,424.24242424242425,430.3030303030303,436.3636363636364,442.42424242424244,448.4848484848485,454.54545454545456,460.6060606060606,466.6666666666667,472.72727272727275,478.7878787878788,484.8484848484849,490.9090909090909,496.96969696969694,503.030303030303,509.09090909090907,515.1515151515151,521.2121212121212,527.2727272727273,533.3333333333334,539.3939393939394,545.4545454545455,551.5151515151515,557.5757575757576,563.6363636363636,569.6969696969697,575.7575757575758,581.8181818181818,587.8787878787879,593.9393939393939,600.0],"y":[0.0,-0.0007626515125749902,-0.003040299948778674,-0.006817486156329135,-0.01207875098294445,-0.01880863527634269,-0.026991679884241906,-0.03661242565436021,-0.047655413434415636,-0.060105184072126276,-0.0739462784152102,-0.08916323731138551,-0.10574060160837022,-0.12366291215388246,-0.1429147097956403,-0.16348053538136179,-0.18534492975876504,-0.20849243377556811,-0.23290758827948913,-0.2585749341182458,-0.28547901213955673,-0.31360436319113977,-0.3429355281207131,-0.37345704777599464,-0.40515346300470234,-0.43800931465455467,-0.47200914357326945,-0.5071374906085647,-0.5433788966081587,-0.5807179024197694,-0.6191390488911149,-0.6586268768699133,-0.6991659272038825,-0.7407407407407407,-0.7833358583282061,-0.8269358208139966,-0.8715251690458303,-0.9170884438714254,-0.9636101861384999,-1.0110749366947718,-1.059467236387959,-1.10877162606578,-1.1589726465759527,-1.2100548387661951,-1.2620027434842254,-1.3148009015777615,-1.3684338538945218,-1.4228861412822236,-1.4781423045885853,-1.5341868846613258,-1.5910044223481628,-1.6485794584968139,-1.706896533954997,-1.7659401895704312,-1.825694966190834,-1.8861454046639228,-1.9472760458374168,-2.009071430559034,-2.0715160996764914,-2.1345945940375075,-2.198291454489801,-2.2625912218810895,-2.327478437059092,-2.392937640871524,-2.4589533741661076,-2.525510177790556,-2.592592592592592,-2.6601851594199304,-2.7282724191202914,-2.7968389125413906,-2.865869180530949,-2.935347763936682,-3.00525920360631,-3.0755880403875495,-3.146318815128119,-3.217436068675736,-3.2889243418781207,-3.3607681755829875,-3.4329521106380594,-3.50546068789105,-3.57827844818968,-3.651389932381665,-3.7247796813147245,-3.798432235836579,-3.8723321367949435,-3.9464639250375373,-4.020812141412077,-4.09536132676628,-4.17009602194787,-4.245000767804559,-4.3200601051840675,-4.395258574934114,-4.470580717902416,-4.54601107493669,-4.621534186884657,-4.697134594594031,-4.7727968389125355,-4.848505460687886,-4.924245000767797,-4.999999999999994],"type":"scatter"},{"line":{"color":"red","dash":"solid"},"marker":{"color":"red"},"mode":"lines","name":"result 2 - dplt","x":[0.0,6.0606060606060606,12.121212121212121,18.18181818181818,24.242424242424242,30.303030303030305,36.36363636363636,42.42424242424242,48.484848484848484,54.54545454545455,60.60606060606061,66.66666666666667,72.72727272727272,78.78787878787878,84.84848484848484,90.9090909090909,96.96969696969697,103.03030303030303,109.0909090909091,115.15151515151516,121.21212121212122,127.27272727272727,133.33333333333334,139.3939393939394,145.45454545454544,151.5151515151515,157.57575757575756,163.63636363636363,169.6969696969697,175.75757575757575,181.8181818181818,187.87878787878788,193.93939393939394,200.0,206.06060606060606,212.12121212121212,218.1818181818182,224.24242424242425,230.3030303030303,236.36363636363637,242.42424242424244,248.48484848484847,254.54545454545453,260.6060606060606,266.6666666666667,272.72727272727275,278.7878787878788,284.8484848484849,290.9090909090909,296.96969696969694,303.030303030303,309.09090909090907,315.1515151515151,321.2121212121212,327.27272727272725,333.3333333333333,339.3939393939394,345.45454545454544,351.5151515151515,357.57575757575756,363.6363636363636,369.6969696969697,375.75757575757575,381.8181818181818,387.8787878787879,393.93939393939394,400.0,406.06060606060606,412.1212121212121,418.1818181818182,424.24242424242425,430.3030303030303,436.3636363636364,442.42424242424244,448.4848484848485,454.54545454545456,460.6060606060606,466.6666666666667,472.72727272727275,478.7878787878788,484.8484848484849,490.9090909090909,496.96969696969694,503.030303030303,509.09090909090907,515.1515151515151,521.2121212121212,527.2727272727273,533.3333333333334,539.3939393939394,545.4545454545455,551.5151515151515,557.5757575757576,563.6363636363636,569.6969696969697,575.7575757575758,581.8181818181818,587.8787878787879,593.9393939393939,600.0],"y":[0.0,-0.0015253030251499795,-0.00608059989755735,-0.013634972312658273,-0.024157501965888912,-0.037617270552685385,-0.05398335976848382,-0.07322485130872042,-0.09531082686883129,-0.12021036814425255,-0.1478925568304204,-0.17832647462277096,-0.21148120321674035,-0.24732582430776487,-0.2858294195912806,-0.32696107076272357,-0.3706898595175301,-0.41698486755113623,-0.4658151765589782,-0.5171498682364916,-0.5709580242791135,-0.6272087263822796,-0.6858710562414263,-0.7469140955519895,-0.810306926009405,-0.8760186293091097,-0.9440182871465395,-1.0142749812171301,-1.0867577932163184,-1.1614358048395397,-1.238278097782231,-1.3172537537398277,-1.3983318544077663,-1.481481481481483,-1.5666717166564137,-1.6538716416279946,-1.7430503380916627,-1.8341768877428526,-1.9272203722770014,-2.0221498733895458,-2.1189344727759205,-2.2175432521315623,-2.3179452931519076,-2.4201096775323934,-2.5240054869684534,-2.6296018031555253,-2.7368677077890458,-2.8457722825644507,-2.956284609177174,-3.068373769322655,-3.1820088446963277,-3.297158916993631,-3.4137930679099977,-3.5318803791408655,-3.6513899323816705,-3.7722908093278487,-3.894552091674837,-4.018142861118071,-4.1430321993529855,-4.269189188075019,-4.396582908979606,-4.525182443762183,-4.654956874118186,-4.785875281743052,-4.917906748332219,-5.051020355581116,-5.185185185185187,-5.320370318839863,-5.4565448382405854,-5.593677825082783,-5.7317383610618995,-5.870695527873367,-6.010518407212622,-6.151176080775099,-6.292637630256241,-6.434872137351474,-6.577848683756244,-6.721536351165977,-6.865904221276119,-7.0109213757821,-7.156556896379361,-7.302779864763331,-7.449559362629452,-7.596864471673159,-7.744664273589886,-7.892927850075074,-8.041624282824156,-8.190722653532562,-8.34019204389574,-8.490001535609117,-8.640120210368137,-8.79051714986823,-8.94116143580483,-9.09202214987338,-9.243068373769315,-9.394269189188064,-9.545593677825071,-9.697010921375773,-9.848490001535598,-9.999999999999991],"type":"scatter"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"title":{"text":"dplt_grid"}},"yaxis":{"title":{"font":{"color":"black"},"text":"dplt"},"tickfont":{"color":"black"}}}, {"responsive": true} ) }; </script> </div>'}
A model result can be compared to a data.
A synthetic data is generated as a Pandas.DataFrame:
df = DataFrame.from_dict({
"young_modulus": atleast_1d(9e4),
"nu_p": atleast_1d(0.25),
"reaction_forces": atleast_1d(1e3),
})
variable_names = list(df.columns.values)
The model result is added to the DataFrame, and the latter is plotted:
df = concat(
[
df,
DataFrame([result.get_numeric_scalars(variable_names=variable_names)]),
],
ignore_index=True,
)
The dataframe is plotted to compare the model result to the synthetic result. First, we compare with a bar plot:
plot = BarPlot(Dataset.from_dataframe(df))
plot.title = "Comparison of model result with data"
plot.font_size = 20
plot.labels = ["data", "model result"]
fig = plot.execute(save=True, show=True, file_format="html")[0]
fig
Out:
{'text/html': '<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="3e82bf0c-90c0-4937-a7db-d8abe3b25cbe" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("3e82bf0c-90c0-4937-a7db-d8abe3b25cbe")) { Plotly.newPlot( "3e82bf0c-90c0-4937-a7db-d8abe3b25cbe", [{"marker":{"color":"rgba(127,0,255,1.0)"},"name":"0","text":["90000.0","0.25","1000.0"],"width":0.375,"x":[0.1875,1.1875,2.1875],"y":[90000.0,0.25,1000.0],"type":"bar","textangle":0.0,"textposition":"outside"},{"marker":{"color":"rgba(255,0,0,1.0)"},"name":"1","text":["210000.0","0.3","-2333.3333333333335"],"width":0.375,"x":[0.5625,1.5625,2.5625],"y":[210000.0,0.3,-2333.3333333333335],"type":"bar","textangle":0.0,"textposition":"outside"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"font":{"size":20},"title":{"font":{"size":24.0},"text":"Comparison of model result with data"},"xaxis":{"title":{"text":""},"showgrid":true,"tickvals":[0.375,1.375,2.375],"ticktext":["young_modulus","nu_p","reaction_forces"],"tickangle":0.0},"yaxis":{"title":{"text":""},"showgrid":true}}, {"responsive": true} ) }; </script> </div>'}
And with a scatter matrix. For a small number of data to compare (two here), it is less relevant than the bar plot, It may become more interesting for a larger number of data to compare:
df["color"] = range(len(df))
plot = ScatterMatrix(Dataset.from_dataframe(df), classifier="color")
plot.labels = ["data", "model result"]
fig = plot.execute(
save=False,
show=True,
)
fig

Out:
C:\Users\sebastien.bocquet\Dev\vd017\.tox\doc\Lib\site-packages\gemseo\utils\matplotlib_figure.py:126: UserWarning:
FigureCanvasAgg is non-interactive, and thus cannot be shown
[<Figure size 640x480 with 9 Axes>]
Retrieve and manipulate a field¶
The models above expose scalar outputs and curves. Some models also produce fields -- variables defined over a mesh -- which can be retrieved from a result and post-processed: probed at a point, sampled along a line, or reshaped onto a grid. Here we use the analytic Tan open-hole model, which computes the membrane stress field around a hole in a loaded composite plate.
Note
Executing TanOpenHole requires the mesh extra
(pip install "vimseo[mesh]"): the field is read back with pyvista.
field_model_name = "TanOpenHole"
field_load_case = "Tension"
field_model = create_model(
field_model_name,
field_load_case,
model_options=IntegratedModelSettings(
directory_archive_root=EXAMPLE_RUNS_DIR / "archive/visualize_model_result",
directory_scratch_root=EXAMPLE_RUNS_DIR / "scratch/visualize_model_result",
cache_file_path=EXAMPLE_RUNS_DIR
/ f"caches/visualize_model_result/{field_model_name}_{field_load_case}_cache.hdf",
),
)
field_model.cache = None
field_output = field_model.execute()
Out:
INFO - 09:44:04: Current scratch directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\scratch\visualize_model_result\TanOpenHole\Tension\1.
INFO - 09:44:04: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\visualize_model_result\TanOpenHole\Tension\1.
The field is retrieved by rebuilding a ModelResult with load_fields=True.
result.fields maps each field name to a list of MeshField objects:
field_result = ModelResult.from_data(
{"inputs": field_model.get_input_data(), "outputs": field_output},
model=field_model,
load_fields=True,
)
flux_field = field_result.fields["flux"][0]
flux_field.point_variable_names
Out:
['N_xx', 'N_yy', 'N_xy', 'sigma_xx', 'sigma_yy', 'sigma_xy']
The mesh file backing the field is kept on disk, ready to be opened in an external tool such as ParaView:
flux_field.path
Out:
'C:\\Users\\sebastien.bocquet\\Dev\\vd017\\docs\\runnable_examples\\model_runs\\archive\\visualize_model_result\\TanOpenHole\\Tension\\1\\flux.vtk'
We read the plate geometry and the applied far-field stress from the inputs:
inputs = field_model.get_input_data()
length = float(inputs["length"][0])
width = float(inputs["width"][0])
radius = float(inputs["radius"][0])
d0 = float(inputs["d0"][0])
applied_stress = float(inputs["load"][0])
Whole-field view. Before probing into it, the field can be looked at as a
whole. MeshField.to_structured_grid reshapes one component back onto the
grid it is defined on, returning the x and y axes and the 2-D array of
values (nan inside the blanked hole), which plots directly as a heatmap.
The stress concentration at the hole edge and the relaxation towards the
applied far-field stress away from it are both visible:
grid_x, grid_y, sigma_xx_grid = flux_field.to_structured_grid("sigma_xx")
fig = go.Figure(
go.Heatmap(
x=grid_x,
y=grid_y,
z=sigma_xx_grid.T,
colorscale="Viridis",
colorbar={"title": "sigma_xx (MPa)"},
)
)
fig.update_layout(
title="sigma_xx field over the plate",
xaxis_title="x (mm)",
yaxis_title="y (mm)",
)
# Equal aspect ratio so the hole stays circular:
fig.update_yaxes(scaleanchor="x")
fig
Probing. MeshField.probe bilinearly interpolates a component at an
arbitrary point. Walking outward from the hole along the transverse mid-section
(x = length / 2), sigma_xx decays from its peak towards the applied
stress. The field is blanked inside r < radius + d0, so a point in that
region returns nan:
probe_x = 0.5 * length
blank_edge_y = 0.5 * width + radius + d0
probe_ys = [
0.5 * width,
blank_edge_y + 0.5,
blank_edge_y + 2.0,
blank_edge_y + 5.0,
blank_edge_y + 9.0,
]
probe_values = [flux_field.probe("sigma_xx", probe_x, y) for y in probe_ys]
for y, value in zip(probe_ys, probe_values, strict=False):
print(f"sigma_xx at (x={probe_x:.1f}, y={y:5.2f}) = {value:8.1f} MPa")
Out:
sigma_xx at (x=40.0, y=16.00) = nan MPa
sigma_xx at (x=40.0, y=20.39) = 1737.3 MPa
sigma_xx at (x=40.0, y=21.89) = 1332.3 MPa
sigma_xx at (x=40.0, y=24.89) = 1138.9 MPa
sigma_xx at (x=40.0, y=28.89) = 1083.7 MPa
Line extraction. extract_line samples the field along a segment. We cut
the full transverse section at x = length / 2. It returns the sampling
coords, the curvilinear distance dist from the first point, and one
array per requested field; points falling in the blanked hole come back
nan:
line = extract_line(
flux_field.path,
point_a=(probe_x, 0.0, 0.0),
point_b=(probe_x, width, 0.0),
n_points=200,
fields=["sigma_xx"],
)
line["sigma_xx"].shape
Out:
(201,)
The extracted profile, the probe points and the model's own centre-line output
(line_center_sigma_xx, sampled internally over the same segment) are drawn
together. They overlap, which confirms the three retrieval routes are
consistent:
fig = go.Figure()
fig.add_trace(
go.Scatter(
x=line["coords"][:, 1],
y=line["sigma_xx"],
mode="lines",
name="extract_line",
)
)
fig.add_trace(
go.Scatter(
x=field_output["line_center_y"],
y=field_output["line_center_sigma_xx"],
mode="lines",
line={"dash": "dot"},
name="line_center output",
)
)
fig.add_trace(
go.Scatter(
x=probe_ys,
y=probe_values,
mode="markers",
marker={"size": 9, "symbol": "x"},
name="probe",
)
)
fig.add_hline(y=applied_stress, line_dash="dash", annotation_text="applied stress")
fig.update_layout(
title="sigma_xx across the transverse mid-section",
xaxis_title="y (mm)",
yaxis_title="sigma_xx (MPa)",
)
fig
Compare a field between two designs¶
Running the same extraction on a second design turns the field into a
quantitative comparison. We re-execute with a 0-dominated layup, wrap each
transverse profile in a Curve, and overlay them with superpose_curves (the
same helper used for the beam curves above), which gives each line its own
colour and legend entry. Away from the hole both profiles relax to the applied
far-field stress (~1000 MPa); they differ around the concentration:
field_output_ud = field_model.execute({"layup": atleast_1d([0.0] * 8)})
flux_field_ud = ModelResult.from_data(
{"inputs": field_model.get_input_data(), "outputs": field_output_ud},
model=field_model,
load_fields=True,
).fields["flux"][0]
line_ud = extract_line(
flux_field_ud.path,
point_a=(probe_x, 0.0, 0.0),
point_b=(probe_x, width, 0.0),
n_points=200,
fields=["sigma_xx"],
)
quasi_iso_curve = Curve({"y": line["coords"][:, 1], "sigma_xx": line["sigma_xx"]})
ud_curve = Curve({"y": line_ud["coords"][:, 1], "sigma_xx": line_ud["sigma_xx"]})
superpose_curves(
[quasi_iso_curve, ud_curve],
labels=["quasi-isotropic", "0-dominated"],
)
Out:
INFO - 09:44:05: Current scratch directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\scratch\visualize_model_result\TanOpenHole\Tension\2.
INFO - 09:44:05: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\visualize_model_result\TanOpenHole\Tension\2.
{'text/html': '<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="46c319a7-cea2-4077-8ebd-8cc0dda30cae" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("46c319a7-cea2-4077-8ebd-8cc0dda30cae")) { Plotly.newPlot( "46c319a7-cea2-4077-8ebd-8cc0dda30cae", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue"},"mode":"lines","name":"quasi-isotropic - sigma_xx","x":[0.0,0.1599999964237213,0.3199999928474426,0.47999998927116394,0.6399999856948853,0.800000011920929,0.9599999785423279,1.1200000047683716,1.2799999713897705,1.440000057220459,1.600000023841858,1.7599999904632568,1.9199999570846558,2.0799999237060547,2.240000009536743,2.4000000953674316,2.559999942779541,2.7200000286102295,2.880000114440918,3.0399999618530273,3.200000047683716,3.359999895095825,3.5199999809265137,3.680000066757202,3.8399999141693115,4.0,4.159999847412109,4.320000171661377,4.480000019073486,4.639999866485596,4.800000190734863,4.960000038146973,5.119999885559082,5.28000020980835,5.440000057220459,5.599999904632568,5.760000228881836,5.920000076293945,6.079999923706055,6.239999771118164,6.400000095367432,6.559999942779541,6.71999979019165,6.880000114440918,7.039999961853027,7.199999809265137,7.360000133514404,7.519999980926514,7.679999828338623,7.840000152587891,8.0,8.15999984741211,8.319999694824219,8.479999542236328,8.640000343322754,8.800000190734863,8.960000038146973,9.119999885559082,9.279999732971191,9.4399995803833,9.600000381469727,9.760000228881836,9.920000076293945,10.079999923706055,10.239999771118164,10.399999618530273,10.5600004196167,10.720000267028809,10.880000114440918,11.039999961853027,11.199999809265137,11.359999656677246,11.520000457763672,11.680000305175781,11.84000015258789,12.0,12.15999984741211,12.319999694824219,12.479999542236328,12.640000343322754,12.800000190734863,12.960000038146973,13.119999885559082,13.279999732971191,13.4399995803833,13.600000381469727,13.760000228881836,13.920000076293945,14.079999923706055,14.239999771118164,14.399999618530273,14.5600004196167,14.720000267028809,14.880000114440918,15.039999961853027,15.199999809265137,15.359999656677246,15.520000457763672,15.680000305175781,15.84000015258789,16.0,16.15999984741211,16.31999969482422,16.479999542236328,16.639999389648438,16.799999237060547,16.959999084472656,17.1200008392334,17.280000686645508,17.440000534057617,17.600000381469727,17.760000228881836,17.920000076293945,18.079999923706055,18.239999771118164,18.399999618530273,18.559999465942383,18.719999313354492,18.8799991607666,19.040000915527344,19.200000762939453,19.360000610351562,19.520000457763672,19.68000030517578,19.84000015258789,20.0,20.15999984741211,20.31999969482422,20.479999542236328,20.639999389648438,20.799999237060547,20.959999084472656,21.1200008392334,21.280000686645508,21.440000534057617,21.600000381469727,21.760000228881836,21.920000076293945,22.079999923706055,22.239999771118164,22.399999618530273,22.559999465942383,22.719999313354492,22.8799991607666,23.040000915527344,23.200000762939453,23.360000610351562,23.520000457763672,23.68000030517578,23.84000015258789,24.0,24.15999984741211,24.31999969482422,24.479999542236328,24.639999389648438,24.799999237060547,24.959999084472656,25.1200008392334,25.280000686645508,25.440000534057617,25.600000381469727,25.760000228881836,25.920000076293945,26.079999923706055,26.239999771118164,26.399999618530273,26.559999465942383,26.719999313354492,26.8799991607666,27.040000915527344,27.200000762939453,27.360000610351562,27.520000457763672,27.68000030517578,27.84000015258789,28.0,28.15999984741211,28.31999969482422,28.479999542236328,28.639999389648438,28.799999237060547,28.959999084472656,29.1200008392334,29.280000686645508,29.440000534057617,29.600000381469727,29.760000228881836,29.920000076293945,30.079999923706055,30.239999771118164,30.399999618530273,30.559999465942383,30.719999313354492,30.8799991607666,31.040000915527344,31.200000762939453,31.360000610351562,31.520000457763672,31.68000030517578,31.84000015258789,32.0],"y":[1069.0033710226182,1069.5343984600443,1070.0654258974703,1070.6343096980652,1071.2039740440118,1071.81439394592,1072.4265296423955,1073.0827132862353,1073.7417384791108,1074.4484532081412,1075.15935985868,1075.921902223235,1076.6902463452354,1077.5147822339893,1078.3470693527188,1079.2405405248737,1080.1440877128991,1081.1145762962055,1082.0979690111244,1083.1545520799373,1084.2274015368994,1085.3807089514253,1086.5543876094616,1087.816702356663,1089.1043397820376,1090.4899256561714,1091.906852377883,1093.4323759659046,1094.9965718083706,1096.6816371420975,1098.4143745167694,1100.282125050962,1102.2085789530386,1104.2864326221556,1106.4365874975972,1108.7572764303784,1111.1671749632865,1113.7700130796673,1116.483105974278,1119.4156247210958,1122.484844616533,1125.8048382395934,1129.2948540017214,1133.0731517089275,1137.0638485269656,1141.3878957413958,1145.9786376696832,1150.9573814593164,1156.2728929260868,1162.0432036000511,1168.2415273593485,1174.9769598033768,1182.2604633898948,1190.183466152911,1198.814058194961,1208.2128775431788,1218.533625344635,1229.7861753698915,1242.252236754873,1255.860467614455,1271.0845559907307,1287.724690095527,1306.543479211677,1327.1403147453018,1350.7165809437106,1376.5561909974963,1406.5347027122764,1439.4382930478105,1478.1923456873567,1520.7908466274444,1571.8223285758395,1628.0004996436805,1696.602234256697,1772.2358810529972,1866.6221791403946,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1866.6221675295599,1772.2358694419231,1696.602218464508,1628.0008869986905,1571.8226095236218,1520.7911275771557,1478.1920756804109,1439.438000047931,1406.534454355592,1376.5561213257702,1350.716548429828,1327.1403397097747,1306.5435040613195,1287.7246804602282,1271.0845327702477,1255.8605351359147,1242.2522743669028,1229.786189988626,1218.5335201664018,1208.2128183468349,1198.8140237040393,1190.1834716097717,1182.2604633898948,1174.9769598033768,1168.2415273593488,1162.0432036000511,1156.2729004047949,1150.9573716897687,1145.9786245204211,1141.387913521839,1137.0638646506486,1133.0731030181612,1129.2948209605702,1125.804833934124,1122.4848586903756,1119.4156479418775,1116.4831159573855,1113.7699885752731,1111.1671285139728,1108.7572371678084,1106.4365494369815,1104.286400306338,1102.2085611733944,1100.2821015501167,1098.4143641888709,1096.6816319781483,1094.9965606435076,1093.4323418078668,1091.9068180030567,1090.4899372631135,1089.1043881435276,1087.816750722733,1086.5544375571717,1085.3807606434414,1084.2274446474225,1083.154556559211,1082.0979335434165,1081.1145710295182,1080.1441045255415,1079.2405343489822,1078.347044891804,1077.5147590132183,1076.6902223036286,1075.9218672597922,1075.1593161670462,1074.4484215404711,1073.741719133143,1073.0827059255766,1072.42652622182,1071.8143909814214,1071.2039705282805,1070.6342722254042,1070.065355933412,1069.5343634780152,1069.0033710226182],"type":"scatter"},{"line":{"color":"red","dash":"solid"},"marker":{"color":"red"},"mode":"lines","name":"0-dominated - sigma_xx","x":[0.0,0.1599999964237213,0.3199999928474426,0.47999998927116394,0.6399999856948853,0.800000011920929,0.9599999785423279,1.1200000047683716,1.2799999713897705,1.440000057220459,1.600000023841858,1.7599999904632568,1.9199999570846558,2.0799999237060547,2.240000009536743,2.4000000953674316,2.559999942779541,2.7200000286102295,2.880000114440918,3.0399999618530273,3.200000047683716,3.359999895095825,3.5199999809265137,3.680000066757202,3.8399999141693115,4.0,4.159999847412109,4.320000171661377,4.480000019073486,4.639999866485596,4.800000190734863,4.960000038146973,5.119999885559082,5.28000020980835,5.440000057220459,5.599999904632568,5.760000228881836,5.920000076293945,6.079999923706055,6.239999771118164,6.400000095367432,6.559999942779541,6.71999979019165,6.880000114440918,7.039999961853027,7.199999809265137,7.360000133514404,7.519999980926514,7.679999828338623,7.840000152587891,8.0,8.15999984741211,8.319999694824219,8.479999542236328,8.640000343322754,8.800000190734863,8.960000038146973,9.119999885559082,9.279999732971191,9.4399995803833,9.600000381469727,9.760000228881836,9.920000076293945,10.079999923706055,10.239999771118164,10.399999618530273,10.5600004196167,10.720000267028809,10.880000114440918,11.039999961853027,11.199999809265137,11.359999656677246,11.520000457763672,11.680000305175781,11.84000015258789,12.0,12.15999984741211,12.319999694824219,12.479999542236328,12.640000343322754,12.800000190734863,12.960000038146973,13.119999885559082,13.279999732971191,13.4399995803833,13.600000381469727,13.760000228881836,13.920000076293945,14.079999923706055,14.239999771118164,14.399999618530273,14.5600004196167,14.720000267028809,14.880000114440918,15.039999961853027,15.199999809265137,15.359999656677246,15.520000457763672,15.680000305175781,15.84000015258789,16.0,16.15999984741211,16.31999969482422,16.479999542236328,16.639999389648438,16.799999237060547,16.959999084472656,17.1200008392334,17.280000686645508,17.440000534057617,17.600000381469727,17.760000228881836,17.920000076293945,18.079999923706055,18.239999771118164,18.399999618530273,18.559999465942383,18.719999313354492,18.8799991607666,19.040000915527344,19.200000762939453,19.360000610351562,19.520000457763672,19.68000030517578,19.84000015258789,20.0,20.15999984741211,20.31999969482422,20.479999542236328,20.639999389648438,20.799999237060547,20.959999084472656,21.1200008392334,21.280000686645508,21.440000534057617,21.600000381469727,21.760000228881836,21.920000076293945,22.079999923706055,22.239999771118164,22.399999618530273,22.559999465942383,22.719999313354492,22.8799991607666,23.040000915527344,23.200000762939453,23.360000610351562,23.520000457763672,23.68000030517578,23.84000015258789,24.0,24.15999984741211,24.31999969482422,24.479999542236328,24.639999389648438,24.799999237060547,24.959999084472656,25.1200008392334,25.280000686645508,25.440000534057617,25.600000381469727,25.760000228881836,25.920000076293945,26.079999923706055,26.239999771118164,26.399999618530273,26.559999465942383,26.719999313354492,26.8799991607666,27.040000915527344,27.200000762939453,27.360000610351562,27.520000457763672,27.68000030517578,27.84000015258789,28.0,28.15999984741211,28.31999969482422,28.479999542236328,28.639999389648438,28.799999237060547,28.959999084472656,29.1200008392334,29.280000686645508,29.440000534057617,29.600000381469727,29.760000228881836,29.920000076293945,30.079999923706055,30.239999771118164,30.399999618530273,30.559999465942383,30.719999313354492,30.8799991607666,31.040000915527344,31.200000762939453,31.360000610351562,31.520000457763672,31.68000030517578,31.84000015258789,32.0],"y":[1067.4832232119472,1067.9511639930436,1068.41910477414,1068.9182803396086,1069.418099922719,1069.951394186224,1070.4860977098524,1071.056739489753,1071.629699645594,1072.241314534452,1072.8563271520454,1073.5129968680938,1074.1743471504076,1074.880683353347,1075.5932250588373,1076.3544538703914,1077.1237005794942,1077.9457633876566,1078.7780074118957,1079.6676841690219,1080.5701253295165,1081.5351859487516,1082.5161013872726,1083.5654840504487,1084.6344271849612,1085.7784551488642,1086.9465080610903,1088.1971670248538,1089.477242331309,1090.8485049791352,1092.2557330525524,1093.7639947856667,1095.3161858324852,1096.9807821579038,1098.699057271064,1100.5429154725882,1102.452468971696,1104.5029905279882,1106.6340681344946,1108.924209661051,1111.3134476605999,1113.8831663237831,1116.5752494792744,1119.4734078503266,1122.5233963963533,1125.81026888789,1129.2866594045643,1133.0374266291383,1137.0263407459015,1141.3358058219928,1145.9469410968277,1150.936127225168,1156.311080273854,1162.1367823959324,1168.4612281332713,1175.3297960430555,1182.851351514172,1191.0393550422023,1200.0952919868698,1209.9813441011802,1221.0417821866595,1233.157136343374,1246.8955274464383,1262.007733959366,1279.4220107217966,1298.6801981014041,1321.3102728370845,1346.512514851674,1376.8593151981288,1410.9828723107296,1453.3909258171104,1501.754225418675,1564.4927604571021,1637.680062182505,1738.731434450678,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1738.7314344506779,1637.6800621825064,1564.4927604571017,1501.7545993676117,1453.3911785890477,1410.9831250826674,1376.8591343169312,1346.512333970476,1321.310137952003,1298.6801981014037,1279.4220107217964,1262.0077339593659,1246.8955274464377,1233.1571363433734,1221.041782186659,1209.9814100261983,1200.095345964512,1191.039409019844,1182.8513066821647,1175.329751211049,1168.461190436826,1162.1367823959322,1156.3110802738536,1150.9361272251676,1145.9469410968277,1141.3358058219928,1137.0263526338035,1133.03743851704,1129.2866697649945,1125.8102896087505,1122.523414575719,1119.4733896709608,1116.575241456234,1113.8831583007427,1111.3134405401304,1108.924209661051,1106.6340681344948,1104.5029905279885,1102.4524689716964,1100.54292116349,1098.6990623919282,1096.9807872787678,1095.3161950842737,1093.7639855338782,1092.2557246648364,1090.8485007852773,1089.4772385163837,1088.1971632099285,1086.94650806109,1085.778455148864,1084.634428777812,1083.5654856432996,1082.5161043106268,1081.5351903337828,1080.5701293637405,1079.6676895479875,1078.7780024513377,1077.9457596672382,1077.1236982869584,1076.3544515778558,1075.5932239970684,1074.880683353347,1074.174347643152,1073.5129978535829,1072.8563285267062,1072.2413163673327,1071.6297022069264,1071.0567424779738,1070.4860947219631,1069.9513915967198,1069.4180980607462,1068.9182789431288,1068.4191039025327,1067.9511635572399,1067.4832232119472],"type":"scatter"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"title":{"text":"y"}},"yaxis":{"title":{"font":{"color":"black"},"text":"sigma_xx"},"tickfont":{"color":"black"}}}, {"responsive": true} ) }; </script> </div>'}
Figures holding several lines¶
The figures of a model are declared in its PLOTS class attribute, either as a
tuple of variable names whose first one is the abscissa, or as a Plot object
when the lines shall be styled, drawn against a secondary ordinate axis or
completed with horizontal reference lines.
The MockMultiCurves model declares two such figures:
multi_curve_model = create_model(
"MockMultiCurves",
"Dummy",
model_options=IntegratedModelSettings(
directory_archive_root=EXAMPLE_RUNS_DIR / "archive/visualize_model_result",
directory_scratch_root=EXAMPLE_RUNS_DIR / "scratch/visualize_model_result",
),
)
multi_curve_model.cache = None
for spec in multi_curve_model.plots:
print(f"{spec.get_name()}: {[trace.get_label() for trace in spec.traces]}")
Out:
energy_strain_history_and_2_more_vs_displacement_history: ['energy_strain_history', 'energy_damage_history', 'energy_viscous_history']
crack_propagation: ['force', 'crack position', 'critical crack position']
Comparing variables within a result
Several ordinates sharing an abscissa are drawn on a single figure. Here the
three energies are declared as a ``Plot`` object without any custom style, so the
colours are taken from the default palette. Since the axis holds several lines, it
is labelled with the variable names and drawn in black:
<!-- GENERATED FROM PYTHON SOURCE LINES 404-408 -->
```{.python }
multi_curve_model.execute()
multi_figs = multi_curve_model.plot_results(show=True, save=False)
multi_figs["energy_strain_history_and_2_more_vs_displacement_history"]
```
Out:
{: .mkd-glr-script-out }
```{.shell .mkd-glr-script-out-disp }
INFO - 09:44:06: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\visualize_model_result\MockMultiCurves\Dummy\1.
{'text/html': '<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="466c4eaf-b659-4623-91a6-517a5e44364e" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("466c4eaf-b659-4623-91a6-517a5e44364e")) { Plotly.newPlot( "466c4eaf-b659-4623-91a6-517a5e44364e", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue"},"mode":"lines","name":"energy_strain_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.020824656393169515,0.08329862557267806,0.1874219075385256,0.33319450229071224,0.5206164098292378,0.7496876301541024,1.0204081632653061,1.332778009162849,1.6867971678467306,2.0824656393169514,2.5197834235735117,2.99875052061641,3.5193669304456474,4.081632653061225,4.685547688463141,5.331112036651396,6.018325697625989,6.7471886713869225,7.517700957934196,8.329862557267806,9.183673469387754,10.079133694294047,11.016243231986675,11.99500208246564,13.015410245730944,14.07746772178259,15.181174510620577,16.3265306122449,17.513536026655558,18.742190753852565,20.012494793835906,21.324448146605583,22.678050812161597,24.073302790503956,25.510204081632654,26.98875468554769,28.508954602249062,30.070803831736782,31.674302374010832,33.31945022907122,35.00624739691795,36.73469387755102,38.504789670970425,40.31653477717619,42.16992919616827,44.0649729279467,46.00166597251146,47.98000832986256,50.0],"type":"scatter"},{"line":{"color":"red","dash":"solid"},"marker":{"color":"red"},"mode":"lines","name":"energy_damage_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.01843893679398472,0.05215318897958693,0.09581152609419816,0.14751149435187777,0.20615358052085933,0.27099591926815747,0.34149388838125533,0.41722551183669543,0.4978512934375875,0.5830903790087464,0.6727053836659866,0.7664922087535853,0.8642729169847693,0.9658905768325904,1.0712054268731102,1.1800919548150222,1.2924366284366766,1.4081361024488475,1.527095780114952,1.6492286441668746,1.7744542954517681,1.9026981541236692,2.0338907896581424,2.1679673541452598,2.30486709924809,2.4445329615832336,2.5869112045433504,2.7319511070500426,2.879604691614377,3.0298264855432264,3.182573310270725,3.3378040946935634,3.49547970910381,3.6555628168858094,3.818017741606063,3.9828103475007,4.149907931672535,4.319279126562574,4.490893811470137,4.664723032069971,4.8407389270202925,5.0189146608781705,5.199224362641935,5.381643069327893,5.566146674063203,5.752711878240537,5.941316147334716,6.131937670028682,6.324555320336759],"type":"scatter"},{"line":{"color":"green","dash":"solid"},"marker":{"color":"green"},"mode":"lines","name":"energy_viscous_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.010204081632653062,0.020408163265306124,0.030612244897959186,0.04081632653061225,0.05102040816326531,0.06122448979591837,0.07142857142857144,0.0816326530612245,0.09183673469387756,0.10204081632653061,0.11224489795918369,0.12244897959183675,0.1326530612244898,0.14285714285714288,0.15306122448979595,0.163265306122449,0.17346938775510204,0.1836734693877551,0.19387755102040818,0.20408163265306123,0.2142857142857143,0.22448979591836737,0.23469387755102045,0.2448979591836735,0.25510204081632654,0.2653061224489796,0.2755102040816327,0.28571428571428575,0.29591836734693877,0.3061224489795919,0.3163265306122449,0.326530612244898,0.33673469387755106,0.3469387755102041,0.3571428571428572,0.3673469387755102,0.3775510204081633,0.38775510204081637,0.39795918367346944,0.40816326530612246,0.41836734693877553,0.4285714285714286,0.4387755102040816,0.44897959183673475,0.4591836734693878,0.4693877551020409,0.4795918367346939,0.489795918367347,0.5],"type":"scatter"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"title":{"text":"Displacement"}},"yaxis":{"title":{"font":{"color":"black"},"text":"energy_strain_history, energy_damage_history, energy_viscous_history"},"tickfont":{"color":"black"}}}, {"responsive": true} ) }; </script> </div>'}
INFO - 09:44:06: Plot MockMultiCurves_Dummy_energy_strain_history_and_2_more_vs_displacement_history.html is saved in .
{'text/html': '<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="339b3118-a1ed-4aec-985e-ca67087ead31" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("339b3118-a1ed-4aec-985e-ca67087ead31")) { Plotly.newPlot( "339b3118-a1ed-4aec-985e-ca67087ead31", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue","symbol":"circle"},"mode":"lines+markers","name":"force","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.1959194778133628,0.37616752950927546,0.5416843127457299,0.6933598502598469,0.8320365362729214,0.9585115226043914,1.0735389901075514,1.1778323107832753,1.2720661056830163,1.356878203478359,1.4328715043509772,1.5006157536434686,1.5606492295078076,1.6134803485935976,1.6595891936325464,1.699428966598211,1.7334273709507164,1.7619879263144482,1.7854912187823628,1.804296089893166,1.8187407671869282,1.8291439391103743,1.8358057769148712,1.8390089060677466,1.8390193295807193,1.8360873055477285,1.830448181077973,1.8223231847084023,1.8119201792829165,1.799434377192991,1.7850490197861304,1.768936022664251,1.7512565885136837,1.7321617890317,1.7117931174412553,1.69028301301574,1.6677553589688423,1.6443259550010259,1.6201029657333956,1.5951873462018462,1.5696732455291011,1.5436483898395916,1.5171944454318025,1.4903873631747873,1.4632977050497957,1.4359909537143192,1.4085278059242619,1.3809644506102332,1.353352832366127],"type":"scatter","xaxis":"x","yaxis":"y"},{"line":{"color":"red","dash":"dash"},"marker":{"color":"red"},"mode":"lines","name":"crack position","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[20.0,20.612244897959183,21.224489795918366,21.836734693877553,22.448979591836736,23.06122448979592,23.6734693877551,24.285714285714285,24.89795918367347,25.510204081632654,26.122448979591837,26.73469387755102,27.346938775510203,27.959183673469386,28.57142857142857,29.183673469387756,29.79591836734694,30.408163265306122,31.02040816326531,31.63265306122449,32.244897959183675,32.85714285714286,33.46938775510204,34.08163265306123,34.69387755102041,35.30612244897959,35.91836734693877,36.53061224489796,37.14285714285714,37.755102040816325,38.36734693877551,38.9795918367347,39.59183673469388,40.20408163265306,40.816326530612244,41.42857142857143,42.04081632653062,42.6530612244898,43.26530612244898,43.87755102040816,44.48979591836735,45.10204081632653,45.714285714285715,46.326530612244895,46.93877551020408,47.55102040816327,48.163265306122454,48.775510204081634,49.38775510204081,50.0],"type":"scatter","xaxis":"x","yaxis":"y2"},{"line":{"color":"black","dash":"dot"},"marker":{"color":"black"},"mode":"lines","name":"critical crack position","x":[0.0,10.0],"y":[35.0,35.0],"type":"scatter","xaxis":"x","yaxis":"y2"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"anchor":"y","domain":[0.0,0.94],"title":{"text":"Displacement"}},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"font":{"color":"blue"},"text":"Force"},"tickfont":{"color":"blue"}},"yaxis2":{"anchor":"x","overlaying":"y","side":"right","title":{"font":{"color":"black"},"text":"Crack position"},"tickfont":{"color":"black"}},"title":{"text":"Crack propagation"}}, {"responsive": true} ) }; </script> </div>'}
INFO - 09:44:06: Plot MockMultiCurves_Dummy_crack_propagation.html is saved in .
```
<div class="output_subarea output_html rendered_html output_result">
<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="337770c6-5a7f-4f19-a48c-7d5c7a48ce54" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("337770c6-5a7f-4f19-a48c-7d5c7a48ce54")) { Plotly.newPlot( "337770c6-5a7f-4f19-a48c-7d5c7a48ce54", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue"},"mode":"lines","name":"energy_strain_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.020824656393169515,0.08329862557267806,0.1874219075385256,0.33319450229071224,0.5206164098292378,0.7496876301541024,1.0204081632653061,1.332778009162849,1.6867971678467306,2.0824656393169514,2.5197834235735117,2.99875052061641,3.5193669304456474,4.081632653061225,4.685547688463141,5.331112036651396,6.018325697625989,6.7471886713869225,7.517700957934196,8.329862557267806,9.183673469387754,10.079133694294047,11.016243231986675,11.99500208246564,13.015410245730944,14.07746772178259,15.181174510620577,16.3265306122449,17.513536026655558,18.742190753852565,20.012494793835906,21.324448146605583,22.678050812161597,24.073302790503956,25.510204081632654,26.98875468554769,28.508954602249062,30.070803831736782,31.674302374010832,33.31945022907122,35.00624739691795,36.73469387755102,38.504789670970425,40.31653477717619,42.16992919616827,44.0649729279467,46.00166597251146,47.98000832986256,50.0],"type":"scatter"},{"line":{"color":"red","dash":"solid"},"marker":{"color":"red"},"mode":"lines","name":"energy_damage_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.01843893679398472,0.05215318897958693,0.09581152609419816,0.14751149435187777,0.20615358052085933,0.27099591926815747,0.34149388838125533,0.41722551183669543,0.4978512934375875,0.5830903790087464,0.6727053836659866,0.7664922087535853,0.8642729169847693,0.9658905768325904,1.0712054268731102,1.1800919548150222,1.2924366284366766,1.4081361024488475,1.527095780114952,1.6492286441668746,1.7744542954517681,1.9026981541236692,2.0338907896581424,2.1679673541452598,2.30486709924809,2.4445329615832336,2.5869112045433504,2.7319511070500426,2.879604691614377,3.0298264855432264,3.182573310270725,3.3378040946935634,3.49547970910381,3.6555628168858094,3.818017741606063,3.9828103475007,4.149907931672535,4.319279126562574,4.490893811470137,4.664723032069971,4.8407389270202925,5.0189146608781705,5.199224362641935,5.381643069327893,5.566146674063203,5.752711878240537,5.941316147334716,6.131937670028682,6.324555320336759],"type":"scatter"},{"line":{"color":"green","dash":"solid"},"marker":{"color":"green"},"mode":"lines","name":"energy_viscous_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.010204081632653062,0.020408163265306124,0.030612244897959186,0.04081632653061225,0.05102040816326531,0.06122448979591837,0.07142857142857144,0.0816326530612245,0.09183673469387756,0.10204081632653061,0.11224489795918369,0.12244897959183675,0.1326530612244898,0.14285714285714288,0.15306122448979595,0.163265306122449,0.17346938775510204,0.1836734693877551,0.19387755102040818,0.20408163265306123,0.2142857142857143,0.22448979591836737,0.23469387755102045,0.2448979591836735,0.25510204081632654,0.2653061224489796,0.2755102040816327,0.28571428571428575,0.29591836734693877,0.3061224489795919,0.3163265306122449,0.326530612244898,0.33673469387755106,0.3469387755102041,0.3571428571428572,0.3673469387755102,0.3775510204081633,0.38775510204081637,0.39795918367346944,0.40816326530612246,0.41836734693877553,0.4285714285714286,0.4387755102040816,0.44897959183673475,0.4591836734693878,0.4693877551020409,0.4795918367346939,0.489795918367347,0.5],"type":"scatter"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"title":{"text":"Displacement"}},"yaxis":{"title":{"font":{"color":"black"},"text":"energy_strain_history, energy_damage_history, energy_viscous_history"},"tickfont":{"color":"black"}}}, {"responsive": true} ) }; </script> </div>
</div>
<!-- GENERATED FROM PYTHON SOURCE LINES 409-415 -->
When the quantities have different magnitudes, a line can be drawn against a
secondary ordinate axis. This second figure is declared as a ``Plot`` object: the
force keeps the left axis, the crack position moves to the right one, and a
horizontal reference line shows the critical crack position prescribed as a model
input.
Each axis takes the colour of its line when it holds a single one:
<!-- GENERATED FROM PYTHON SOURCE LINES 415-417 -->
```{.python }
multi_figs["crack_propagation"]
```
<div class="output_subarea output_html rendered_html output_result">
<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="8b26f8c0-16c0-4a88-955d-32735ed67815" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("8b26f8c0-16c0-4a88-955d-32735ed67815")) { Plotly.newPlot( "8b26f8c0-16c0-4a88-955d-32735ed67815", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue","symbol":"circle"},"mode":"lines+markers","name":"force","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.1959194778133628,0.37616752950927546,0.5416843127457299,0.6933598502598469,0.8320365362729214,0.9585115226043914,1.0735389901075514,1.1778323107832753,1.2720661056830163,1.356878203478359,1.4328715043509772,1.5006157536434686,1.5606492295078076,1.6134803485935976,1.6595891936325464,1.699428966598211,1.7334273709507164,1.7619879263144482,1.7854912187823628,1.804296089893166,1.8187407671869282,1.8291439391103743,1.8358057769148712,1.8390089060677466,1.8390193295807193,1.8360873055477285,1.830448181077973,1.8223231847084023,1.8119201792829165,1.799434377192991,1.7850490197861304,1.768936022664251,1.7512565885136837,1.7321617890317,1.7117931174412553,1.69028301301574,1.6677553589688423,1.6443259550010259,1.6201029657333956,1.5951873462018462,1.5696732455291011,1.5436483898395916,1.5171944454318025,1.4903873631747873,1.4632977050497957,1.4359909537143192,1.4085278059242619,1.3809644506102332,1.353352832366127],"type":"scatter","xaxis":"x","yaxis":"y"},{"line":{"color":"red","dash":"dash"},"marker":{"color":"red"},"mode":"lines","name":"crack position","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[20.0,20.612244897959183,21.224489795918366,21.836734693877553,22.448979591836736,23.06122448979592,23.6734693877551,24.285714285714285,24.89795918367347,25.510204081632654,26.122448979591837,26.73469387755102,27.346938775510203,27.959183673469386,28.57142857142857,29.183673469387756,29.79591836734694,30.408163265306122,31.02040816326531,31.63265306122449,32.244897959183675,32.85714285714286,33.46938775510204,34.08163265306123,34.69387755102041,35.30612244897959,35.91836734693877,36.53061224489796,37.14285714285714,37.755102040816325,38.36734693877551,38.9795918367347,39.59183673469388,40.20408163265306,40.816326530612244,41.42857142857143,42.04081632653062,42.6530612244898,43.26530612244898,43.87755102040816,44.48979591836735,45.10204081632653,45.714285714285715,46.326530612244895,46.93877551020408,47.55102040816327,48.163265306122454,48.775510204081634,49.38775510204081,50.0],"type":"scatter","xaxis":"x","yaxis":"y2"},{"line":{"color":"black","dash":"dot"},"marker":{"color":"black"},"mode":"lines","name":"critical crack position","x":[0.0,10.0],"y":[35.0,35.0],"type":"scatter","xaxis":"x","yaxis":"y2"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"anchor":"y","domain":[0.0,0.94],"title":{"text":"Displacement"}},"yaxis":{"anchor":"x","domain":[0.0,1.0],"title":{"font":{"color":"blue"},"text":"Force"},"tickfont":{"color":"blue"}},"yaxis2":{"anchor":"x","overlaying":"y","side":"right","title":{"font":{"color":"black"},"text":"Crack position"},"tickfont":{"color":"black"}},"title":{"text":"Crack propagation"}}, {"responsive": true} ) }; </script> </div>
</div>
<!-- GENERATED FROM PYTHON SOURCE LINES 418-422 -->
A subset of the lines can be drawn, by passing the ordinate names to keep.
The figures of a result are available as ``ModelResult.plots``, which groups the
curves per figure, while ``ModelResult.curves`` remains the flat list of all of
them:
<!-- GENERATED FROM PYTHON SOURCE LINES 422-436 -->
```{.python }
multi_result = ModelResult.from_data(
{
"inputs": multi_curve_model.get_input_data(),
"outputs": multi_curve_model.get_output_data(),
},
model=multi_curve_model,
)
superpose_curves(
multi_result.plots[0],
variable_names=["energy_strain_history", "energy_damage_history"],
show=True,
save=False,
)
```
Out:
{: .mkd-glr-script-out }
```{.shell .mkd-glr-script-out-disp }
{'text/html': '<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="86ce0095-623b-4eee-9894-42b4829d5f17" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("86ce0095-623b-4eee-9894-42b4829d5f17")) { Plotly.newPlot( "86ce0095-623b-4eee-9894-42b4829d5f17", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue"},"mode":"lines","name":"energy_strain_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.020824656393169515,0.08329862557267806,0.1874219075385256,0.33319450229071224,0.5206164098292378,0.7496876301541024,1.0204081632653061,1.332778009162849,1.6867971678467306,2.0824656393169514,2.5197834235735117,2.99875052061641,3.5193669304456474,4.081632653061225,4.685547688463141,5.331112036651396,6.018325697625989,6.7471886713869225,7.517700957934196,8.329862557267806,9.183673469387754,10.079133694294047,11.016243231986675,11.99500208246564,13.015410245730944,14.07746772178259,15.181174510620577,16.3265306122449,17.513536026655558,18.742190753852565,20.012494793835906,21.324448146605583,22.678050812161597,24.073302790503956,25.510204081632654,26.98875468554769,28.508954602249062,30.070803831736782,31.674302374010832,33.31945022907122,35.00624739691795,36.73469387755102,38.504789670970425,40.31653477717619,42.16992919616827,44.0649729279467,46.00166597251146,47.98000832986256,50.0],"type":"scatter"},{"line":{"color":"red","dash":"solid"},"marker":{"color":"red"},"mode":"lines","name":"energy_damage_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.01843893679398472,0.05215318897958693,0.09581152609419816,0.14751149435187777,0.20615358052085933,0.27099591926815747,0.34149388838125533,0.41722551183669543,0.4978512934375875,0.5830903790087464,0.6727053836659866,0.7664922087535853,0.8642729169847693,0.9658905768325904,1.0712054268731102,1.1800919548150222,1.2924366284366766,1.4081361024488475,1.527095780114952,1.6492286441668746,1.7744542954517681,1.9026981541236692,2.0338907896581424,2.1679673541452598,2.30486709924809,2.4445329615832336,2.5869112045433504,2.7319511070500426,2.879604691614377,3.0298264855432264,3.182573310270725,3.3378040946935634,3.49547970910381,3.6555628168858094,3.818017741606063,3.9828103475007,4.149907931672535,4.319279126562574,4.490893811470137,4.664723032069971,4.8407389270202925,5.0189146608781705,5.199224362641935,5.381643069327893,5.566146674063203,5.752711878240537,5.941316147334716,6.131937670028682,6.324555320336759],"type":"scatter"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"title":{"text":"Displacement"}},"yaxis":{"title":{"font":{"color":"black"},"text":"energy_strain_history, energy_damage_history"},"tickfont":{"color":"black"}}}, {"responsive": true} ) }; </script> </div>'}
```
<div class="output_subarea output_html rendered_html output_result">
<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="dcb98146-88e2-453b-b73d-551700a95938" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("dcb98146-88e2-453b-b73d-551700a95938")) { Plotly.newPlot( "dcb98146-88e2-453b-b73d-551700a95938", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue"},"mode":"lines","name":"energy_strain_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.020824656393169515,0.08329862557267806,0.1874219075385256,0.33319450229071224,0.5206164098292378,0.7496876301541024,1.0204081632653061,1.332778009162849,1.6867971678467306,2.0824656393169514,2.5197834235735117,2.99875052061641,3.5193669304456474,4.081632653061225,4.685547688463141,5.331112036651396,6.018325697625989,6.7471886713869225,7.517700957934196,8.329862557267806,9.183673469387754,10.079133694294047,11.016243231986675,11.99500208246564,13.015410245730944,14.07746772178259,15.181174510620577,16.3265306122449,17.513536026655558,18.742190753852565,20.012494793835906,21.324448146605583,22.678050812161597,24.073302790503956,25.510204081632654,26.98875468554769,28.508954602249062,30.070803831736782,31.674302374010832,33.31945022907122,35.00624739691795,36.73469387755102,38.504789670970425,40.31653477717619,42.16992919616827,44.0649729279467,46.00166597251146,47.98000832986256,50.0],"type":"scatter"},{"line":{"color":"red","dash":"solid"},"marker":{"color":"red"},"mode":"lines","name":"energy_damage_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.01843893679398472,0.05215318897958693,0.09581152609419816,0.14751149435187777,0.20615358052085933,0.27099591926815747,0.34149388838125533,0.41722551183669543,0.4978512934375875,0.5830903790087464,0.6727053836659866,0.7664922087535853,0.8642729169847693,0.9658905768325904,1.0712054268731102,1.1800919548150222,1.2924366284366766,1.4081361024488475,1.527095780114952,1.6492286441668746,1.7744542954517681,1.9026981541236692,2.0338907896581424,2.1679673541452598,2.30486709924809,2.4445329615832336,2.5869112045433504,2.7319511070500426,2.879604691614377,3.0298264855432264,3.182573310270725,3.3378040946935634,3.49547970910381,3.6555628168858094,3.818017741606063,3.9828103475007,4.149907931672535,4.319279126562574,4.490893811470137,4.664723032069971,4.8407389270202925,5.0189146608781705,5.199224362641935,5.381643069327893,5.566146674063203,5.752711878240537,5.941316147334716,6.131937670028682,6.324555320336759],"type":"scatter"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"title":{"text":"Displacement"}},"yaxis":{"title":{"font":{"color":"black"},"text":"energy_strain_history, energy_damage_history"},"tickfont":{"color":"black"}}}, {"responsive": true} ) }; </script> </div>
</div>
<!-- GENERATED FROM PYTHON SOURCE LINES 437-440 -->
Comparing a variable across results
multi_curve_model.execute({"max_displacement": atleast_1d(15.0)})
multi_result_2 = ModelResult.from_data(
{
"inputs": multi_curve_model.get_input_data(),
"outputs": multi_curve_model.get_output_data(),
},
model=multi_curve_model,
)
Out:
INFO - 09:44:06: Current archive directory is C:\Users\sebastien.bocquet\Dev\vd017\docs\runnable_examples\model_runs\archive\visualize_model_result\MockMultiCurves\Dummy\2.
The same curve coming from both results is superposed, each one identified by its label:
curve_name = ("displacement_history", "force_history")
superpose_curves(
[
multi_result.get_curve(curve_name),
multi_result_2.get_curve(curve_name),
],
labels=["result", "result 2"],
show=True,
save=False,
)
Out:
{'text/html': '<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="c8b1e24f-e404-44fa-b3ce-893d34275f00" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("c8b1e24f-e404-44fa-b3ce-893d34275f00")) { Plotly.newPlot( "c8b1e24f-e404-44fa-b3ce-893d34275f00", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue"},"mode":"lines","name":"result - force_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.1959194778133628,0.37616752950927546,0.5416843127457299,0.6933598502598469,0.8320365362729214,0.9585115226043914,1.0735389901075514,1.1778323107832753,1.2720661056830163,1.356878203478359,1.4328715043509772,1.5006157536434686,1.5606492295078076,1.6134803485935976,1.6595891936325464,1.699428966598211,1.7334273709507164,1.7619879263144482,1.7854912187823628,1.804296089893166,1.8187407671869282,1.8291439391103743,1.8358057769148712,1.8390089060677466,1.8390193295807193,1.8360873055477285,1.830448181077973,1.8223231847084023,1.8119201792829165,1.799434377192991,1.7850490197861304,1.768936022664251,1.7512565885136837,1.7321617890317,1.7117931174412553,1.69028301301574,1.6677553589688423,1.6443259550010259,1.6201029657333956,1.5951873462018462,1.5696732455291011,1.5436483898395916,1.5171944454318025,1.4903873631747873,1.4632977050497957,1.4359909537143192,1.4085278059242619,1.3809644506102332,1.353352832366127],"type":"scatter"},{"line":{"color":"red","dash":"solid"},"marker":{"color":"red"},"mode":"lines","name":"result 2 - force_history","x":[0.0,0.30612244897959184,0.6122448979591837,0.9183673469387755,1.2244897959183674,1.5306122448979593,1.836734693877551,2.142857142857143,2.4489795918367347,2.7551020408163267,3.0612244897959187,3.36734693877551,3.673469387755102,3.979591836734694,4.285714285714286,4.591836734693878,4.8979591836734695,5.204081632653061,5.510204081632653,5.816326530612245,6.122448979591837,6.428571428571429,6.73469387755102,7.040816326530613,7.346938775510204,7.653061224489796,7.959183673469388,8.26530612244898,8.571428571428571,8.877551020408163,9.183673469387756,9.489795918367347,9.795918367346939,10.10204081632653,10.408163265306122,10.714285714285715,11.020408163265307,11.326530612244898,11.63265306122449,11.938775510204081,12.244897959183675,12.551020408163266,12.857142857142858,13.16326530612245,13.46938775510204,13.775510204081632,14.081632653061225,14.387755102040817,14.693877551020408,15.0],"y":[0.0,0.2879424668154647,0.5416843127457299,0.7642721945115012,0.9585115226043914,1.1269843701831685,1.2720661056830163,1.3959408375665476,1.5006157536434686,1.5879344317849613,1.6595891936325464,1.71713256802467,1.7619879263144482,1.7954593475072458,1.8187407671869282,1.8329244605057922,1.8390089060677466,1.8379060743208075,1.830448181077973,1.8173939439906903,1.799434377192991,1.7771981569043422,1.7512565885136837,1.7221282035549859,1.69028301301574,1.656146441584541,1.6201029657333956,1.5824994769362386,1.5436483898395916,1.5038305138170804,1.4632977050497957,1.4222753150729803,1.3809644506102332,1.339544058473878,1.2981728483391435,1.2569910652955436,1.2161221232368244,1.1756741093668277,1.1357411693687565,1.0964047821058585,1.0577349320891494,1.0197911873591987,0.9826236898813039,0.9462740650437422,0.9107762563746467,0.8761572911520017,0.842437982170995,0.8096335705514511,0.7777543141132714,0.7468060255179592],"type":"scatter"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"title":{"text":"displacement_history"}},"yaxis":{"title":{"font":{"color":"black"},"text":"force_history"},"tickfont":{"color":"black"}}}, {"responsive": true} ) }; </script> </div>'}
Whole figures can be superposed as well. In that case the colour identifies the result and the dash pattern identifies the variable, so that a given energy stays comparable from one result to the other:
superpose_curves(
[multi_result.plots[0], multi_result_2.plots[0]],
labels=["result", "result 2"],
show=True,
save=False,
)
Out:
{'text/html': '<div> <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script type="text/javascript">if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: \'local\'};</script>\n <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.0.min.js"></script> <div id="3dabd0f8-9d92-4fca-8c4a-69d6a30edab6" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("3dabd0f8-9d92-4fca-8c4a-69d6a30edab6")) { Plotly.newPlot( "3dabd0f8-9d92-4fca-8c4a-69d6a30edab6", [{"line":{"color":"blue","dash":"solid"},"marker":{"color":"blue"},"mode":"lines","name":"result - energy_strain_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.020824656393169515,0.08329862557267806,0.1874219075385256,0.33319450229071224,0.5206164098292378,0.7496876301541024,1.0204081632653061,1.332778009162849,1.6867971678467306,2.0824656393169514,2.5197834235735117,2.99875052061641,3.5193669304456474,4.081632653061225,4.685547688463141,5.331112036651396,6.018325697625989,6.7471886713869225,7.517700957934196,8.329862557267806,9.183673469387754,10.079133694294047,11.016243231986675,11.99500208246564,13.015410245730944,14.07746772178259,15.181174510620577,16.3265306122449,17.513536026655558,18.742190753852565,20.012494793835906,21.324448146605583,22.678050812161597,24.073302790503956,25.510204081632654,26.98875468554769,28.508954602249062,30.070803831736782,31.674302374010832,33.31945022907122,35.00624739691795,36.73469387755102,38.504789670970425,40.31653477717619,42.16992919616827,44.0649729279467,46.00166597251146,47.98000832986256,50.0],"type":"scatter"},{"line":{"color":"blue","dash":"dash"},"marker":{"color":"blue"},"mode":"lines","name":"result - energy_damage_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.01843893679398472,0.05215318897958693,0.09581152609419816,0.14751149435187777,0.20615358052085933,0.27099591926815747,0.34149388838125533,0.41722551183669543,0.4978512934375875,0.5830903790087464,0.6727053836659866,0.7664922087535853,0.8642729169847693,0.9658905768325904,1.0712054268731102,1.1800919548150222,1.2924366284366766,1.4081361024488475,1.527095780114952,1.6492286441668746,1.7744542954517681,1.9026981541236692,2.0338907896581424,2.1679673541452598,2.30486709924809,2.4445329615832336,2.5869112045433504,2.7319511070500426,2.879604691614377,3.0298264855432264,3.182573310270725,3.3378040946935634,3.49547970910381,3.6555628168858094,3.818017741606063,3.9828103475007,4.149907931672535,4.319279126562574,4.490893811470137,4.664723032069971,4.8407389270202925,5.0189146608781705,5.199224362641935,5.381643069327893,5.566146674063203,5.752711878240537,5.941316147334716,6.131937670028682,6.324555320336759],"type":"scatter"},{"line":{"color":"blue","dash":"dot"},"marker":{"color":"blue"},"mode":"lines","name":"result - energy_viscous_history","x":[0.0,0.20408163265306123,0.40816326530612246,0.6122448979591837,0.8163265306122449,1.0204081632653061,1.2244897959183674,1.4285714285714286,1.6326530612244898,1.836734693877551,2.0408163265306123,2.2448979591836737,2.4489795918367347,2.6530612244897958,2.857142857142857,3.0612244897959187,3.2653061224489797,3.4693877551020407,3.673469387755102,3.8775510204081636,4.081632653061225,4.285714285714286,4.4897959183673475,4.6938775510204085,4.8979591836734695,5.1020408163265305,5.3061224489795915,5.510204081632653,5.714285714285714,5.918367346938775,6.122448979591837,6.326530612244898,6.530612244897959,6.73469387755102,6.938775510204081,7.142857142857143,7.346938775510204,7.551020408163265,7.755102040816327,7.959183673469388,8.16326530612245,8.36734693877551,8.571428571428571,8.775510204081632,8.979591836734695,9.183673469387756,9.387755102040817,9.591836734693878,9.795918367346939,10.0],"y":[0.0,0.010204081632653062,0.020408163265306124,0.030612244897959186,0.04081632653061225,0.05102040816326531,0.06122448979591837,0.07142857142857144,0.0816326530612245,0.09183673469387756,0.10204081632653061,0.11224489795918369,0.12244897959183675,0.1326530612244898,0.14285714285714288,0.15306122448979595,0.163265306122449,0.17346938775510204,0.1836734693877551,0.19387755102040818,0.20408163265306123,0.2142857142857143,0.22448979591836737,0.23469387755102045,0.2448979591836735,0.25510204081632654,0.2653061224489796,0.2755102040816327,0.28571428571428575,0.29591836734693877,0.3061224489795919,0.3163265306122449,0.326530612244898,0.33673469387755106,0.3469387755102041,0.3571428571428572,0.3673469387755102,0.3775510204081633,0.38775510204081637,0.39795918367346944,0.40816326530612246,0.41836734693877553,0.4285714285714286,0.4387755102040816,0.44897959183673475,0.4591836734693878,0.4693877551020409,0.4795918367346939,0.489795918367347,0.5],"type":"scatter"},{"line":{"color":"red","dash":"solid"},"marker":{"color":"red"},"mode":"lines","name":"result 2 - energy_strain_history","x":[0.0,0.30612244897959184,0.6122448979591837,0.9183673469387755,1.2244897959183674,1.5306122448979593,1.836734693877551,2.142857142857143,2.4489795918367347,2.7551020408163267,3.0612244897959187,3.36734693877551,3.673469387755102,3.979591836734694,4.285714285714286,4.591836734693878,4.8979591836734695,5.204081632653061,5.510204081632653,5.816326530612245,6.122448979591837,6.428571428571429,6.73469387755102,7.040816326530613,7.346938775510204,7.653061224489796,7.959183673469388,8.26530612244898,8.571428571428571,8.877551020408163,9.183673469387756,9.489795918367347,9.795918367346939,10.10204081632653,10.408163265306122,10.714285714285715,11.020408163265307,11.326530612244898,11.63265306122449,11.938775510204081,12.244897959183675,12.551020408163266,12.857142857142858,13.16326530612245,13.46938775510204,13.775510204081632,14.081632653061225,14.387755102040817,14.693877551020408,15.0],"y":[0.0,0.0468554768846314,0.1874219075385256,0.42169929196168265,0.7496876301541024,1.1713869221157853,1.6867971678467306,2.2959183673469385,2.99875052061641,3.7952936276551443,4.685547688463141,5.669512703040399,6.7471886713869225,7.918575593502708,9.183673469387754,10.542482299042067,11.99500208246564,13.541232819658475,15.181174510620577,16.914827155351936,18.742190753852565,20.66326530612245,22.678050812161597,24.786547271970015,26.98875468554769,29.284673052894625,31.674302374010832,34.15764264889629,36.73469387755102,39.405456059975,42.16992919616827,45.02811328613078,47.98000832986256,51.0256143273636,54.1649312786339,57.39795918367348,60.72469804248231,64.1451478550604,67.65930862140775,71.26718034152437,74.96876301541026,78.7640566430654,82.6530612244898,86.63577675968347,90.71220324864639,94.88234069137859,99.14618908788006,103.50374843815078,107.95501874219076,112.5],"type":"scatter"},{"line":{"color":"red","dash":"dash"},"marker":{"color":"red"},"mode":"lines","name":"result 2 - energy_damage_history","x":[0.0,0.30612244897959184,0.6122448979591837,0.9183673469387755,1.2244897959183674,1.5306122448979593,1.836734693877551,2.142857142857143,2.4489795918367347,2.7551020408163267,3.0612244897959187,3.36734693877551,3.673469387755102,3.979591836734694,4.285714285714286,4.591836734693878,4.8979591836734695,5.204081632653061,5.510204081632653,5.816326530612245,6.122448979591837,6.428571428571429,6.73469387755102,7.040816326530613,7.346938775510204,7.653061224489796,7.959183673469388,8.26530612244898,8.571428571428571,8.877551020408163,9.183673469387756,9.489795918367347,9.795918367346939,10.10204081632653,10.408163265306122,10.714285714285715,11.020408163265307,11.326530612244898,11.63265306122449,11.938775510204081,12.244897959183675,12.551020408163266,12.857142857142858,13.16326530612245,13.46938775510204,13.775510204081632,14.081632653061225,14.387755102040817,14.693877551020408,15.0],"y":[0.0,0.033874489908519684,0.09581152609419816,0.17601701280610593,0.27099591926815747,0.3787283106929033,0.4978512934375875,0.6273643326097713,0.7664922087535853,0.9146112275300315,1.0712054268731102,1.2358387029036422,1.4081361024488475,1.5877707338396174,1.7744542954517681,1.9679300291545194,2.1679673541452598,2.374357698414685,2.5869112045433504,2.8054540872292875,3.0298264855432264,3.259880696809993,3.49547970910381,3.7364959704065983,3.9828103475007,4.23431123856496,4.490893811470137,4.752459345764859,5.0189146608781705,5.290171616534799,5.566146674063203,5.846760509372735,6.131937670028682,6.421606270167382,6.715697718046029,7.014146471871185,7.316889820240252,7.623867684094822,7.935022437549382,8.250298745343413,8.569643414984881,8.89300526192059,9.220334986293896,9.551585060039873,9.886709623229137,10.225664388708386,10.56840655420286,10.914894721146341,11.26508881959078,11.618950038622252],"type":"scatter"},{"line":{"color":"red","dash":"dot"},"marker":{"color":"red"},"mode":"lines","name":"result 2 - energy_viscous_history","x":[0.0,0.30612244897959184,0.6122448979591837,0.9183673469387755,1.2244897959183674,1.5306122448979593,1.836734693877551,2.142857142857143,2.4489795918367347,2.7551020408163267,3.0612244897959187,3.36734693877551,3.673469387755102,3.979591836734694,4.285714285714286,4.591836734693878,4.8979591836734695,5.204081632653061,5.510204081632653,5.816326530612245,6.122448979591837,6.428571428571429,6.73469387755102,7.040816326530613,7.346938775510204,7.653061224489796,7.959183673469388,8.26530612244898,8.571428571428571,8.877551020408163,9.183673469387756,9.489795918367347,9.795918367346939,10.10204081632653,10.408163265306122,10.714285714285715,11.020408163265307,11.326530612244898,11.63265306122449,11.938775510204081,12.244897959183675,12.551020408163266,12.857142857142858,13.16326530612245,13.46938775510204,13.775510204081632,14.081632653061225,14.387755102040817,14.693877551020408,15.0],"y":[0.0,0.015306122448979593,0.030612244897959186,0.04591836734693878,0.06122448979591837,0.07653061224489797,0.09183673469387756,0.10714285714285715,0.12244897959183675,0.13775510204081634,0.15306122448979595,0.16836734693877553,0.1836734693877551,0.19897959183673472,0.2142857142857143,0.2295918367346939,0.2448979591836735,0.2602040816326531,0.2755102040816327,0.29081632653061223,0.3061224489795919,0.32142857142857145,0.33673469387755106,0.35204081632653067,0.3673469387755102,0.38265306122448983,0.39795918367346944,0.413265306122449,0.4285714285714286,0.44387755102040816,0.4591836734693878,0.4744897959183674,0.489795918367347,0.5051020408163266,0.5204081632653061,0.5357142857142858,0.5510204081632654,0.5663265306122449,0.5816326530612245,0.5969387755102041,0.6122448979591838,0.6275510204081634,0.6428571428571429,0.6581632653061225,0.6734693877551021,0.6887755102040817,0.7040816326530613,0.7193877551020409,0.7346938775510204,0.75],"type":"scatter"}], {"template":{"data":{"candlestick":[{"decreasing":{"line":{"color":"#000033"}},"increasing":{"line":{"color":"#000032"}},"type":"candlestick"}],"contourcarpet":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contourcarpet"}],"contour":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"contour"}],"heatmap":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"heatmap"}],"histogram2d":[{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"type":"histogram2d"}],"icicle":[{"textfont":{"color":"white"},"type":"icicle"}],"sankey":[{"textfont":{"color":"#000036"},"type":"sankey"}],"scatter":[{"marker":{"line":{"width":0}},"type":"scatter"}],"table":[{"cells":{"fill":{"color":"#000038"},"font":{"color":"#000037"},"line":{"color":"#000039"}},"header":{"fill":{"color":"#000040"},"font":{"color":"#000036"},"line":{"color":"#000039"}},"type":"table"}],"waterfall":[{"connector":{"line":{"color":"#000036","width":2}},"decreasing":{"marker":{"color":"#000033"}},"increasing":{"marker":{"color":"#000032"}},"totals":{"marker":{"color":"#000034"}},"type":"waterfall"}]},"layout":{"coloraxis":{"colorscale":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorscale":{"diverging":[[0.0,"#000021"],[0.1,"#000022"],[0.2,"#000023"],[0.3,"#000024"],[0.4,"#000025"],[0.5,"#000026"],[0.6,"#000027"],[0.7,"#000028"],[0.8,"#000029"],[0.9,"#000030"],[1.0,"#000031"]],"sequential":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]],"sequentialminus":[[0.0,"#000011"],[0.1111111111111111,"#000012"],[0.2222222222222222,"#000013"],[0.3333333333333333,"#000014"],[0.4444444444444444,"#000015"],[0.5555555555555556,"#000016"],[0.6666666666666666,"#000017"],[0.7777777777777778,"#000018"],[0.8888888888888888,"#000019"],[1.0,"#000020"]]},"colorway":["#000001","#000002","#000003","#000004","#000005","#000006","#000007","#000008","#000009","#000010"]}},"xaxis":{"title":{"text":"Displacement"}},"yaxis":{"title":{"font":{"color":"black"},"text":"energy_strain_history, energy_damage_history, energy_viscous_history"},"tickfont":{"color":"black"}}}, {"responsive": true} ) }; </script> </div>'}
Total running time of the script: ( 0 minutes 2.834 seconds)
Download Python source code: plot_02_visualize-model_result.py
Download Jupyter notebook: plot_02_visualize-model_result.ipynb