diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f2daa098..00000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.vscode/ -examples/src/.ipynb_checkpoints/ -Manifest.toml diff --git a/examples/Project.toml b/examples/Project.toml deleted file mode 100644 index c2c217e5..00000000 --- a/examples/Project.toml +++ /dev/null @@ -1,16 +0,0 @@ -name = "Examples" - -[deps] -BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" -DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" -FMI = "14a09403-18e3-468f-ad8a-74f8dda2d9ac" -FMICore = "8af89139-c281-408e-bce2-3005eb87462f" -FMIZoo = "724179cf-c260-40a9-bd27-cccc6fe2f195" -Folds = "41a02a25-b8f0-4f67-bc48-60067656b558" -IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" -Optim = "429524aa-4258-5aef-a3af-852621145aeb" -Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[compat] -julia = "1.6" diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 8e41e396..00000000 --- a/examples/README.md +++ /dev/null @@ -1,39 +0,0 @@ -![FMI.jl Logo](https://github.com/ThummeTo/FMI.jl/blob/main/logo/dark/fmijl_logo_640_320.png?raw=true "FMI.jl Logo") - -# Structure - -Examples can be found in the [examples folder in the examples branch](https://github.com/ThummeTo/FMI.jl/tree/examples/examples) or the [examples section of the documentation](https://thummeto.github.io/FMI.jl/dev/examples/overview/). All examples are available as Julia-Script (*.jl*), Jupyter-Notebook (*.ipynb*) and Markdown (*.md*). - - -# Getting Started - -## Install Jupyter in Visual Studio Code -The Jupyter Notebooks extension for Visual Studio Code can be [here](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter). - -## Add Julia Kernel to Jupyter -To run Julia as kernel in a jupyter notebook it is necessary to add the **IJulia** package. - -1. Start the Julia REPL. - - ``` - julia - ``` - -2. Select your environment. - ```julia - using Pkg - Pkg.activate("Your Env") - ``` - -3. Add and build the IJulia package by typing inside the Julia REPL. - - ```julia - using Pkg - Pkg.add("IJulia") - Pkg.build("IJulia") - ``` - -4. Now you should be able to choose a Julia kernel in a Jupyter notebook. - - -More information can be found [here](https://towardsdatascience.com/how-to-best-use-julia-with-jupyter-82678a482677). diff --git a/examples/pluto-src/FMUExplorer/FMUExplorer.html b/examples/pluto-src/FMUExplorer/FMUExplorer.html deleted file mode 100644 index c0ce0bc8..00000000 --- a/examples/pluto-src/FMUExplorer/FMUExplorer.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - -
\ No newline at end of file diff --git a/examples/pluto-src/FMUExplorer/FMUExplorer.jl b/examples/pluto-src/FMUExplorer/FMUExplorer.jl deleted file mode 100644 index 0e2f3ec8..00000000 --- a/examples/pluto-src/FMUExplorer/FMUExplorer.jl +++ /dev/null @@ -1,3212 +0,0 @@ -### A Pluto.jl notebook ### -# v0.19.46 - -using Markdown -using InteractiveUtils - -# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). -macro bind(def, element) - quote - local iv = try - Base.loaded_modules[Base.PkgId( - Base.UUID("6e696c72-6542-2067-7265-42206c756150"), - "AbstractPlutoDingetjes", - )].Bonds.initial_value - catch - b -> missing - end - local el = $(esc(element)) - global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el) - el - end -end - -# ╔═╡ 551e8e92-6a04-427d-b363-d0dab3c01551 -using PlutoUI - -# ╔═╡ d7bfcca8-4637-414b-acfa-b8a71f5012ca -using FMI, FMIZoo - -# ╔═╡ ad740af3-d51a-47ae-a407-d9128c5bcaeb -using Plots - -# ╔═╡ 63ed5ca7-43bc-4ecf-87ab-72fed9b2ac56 -using DifferentialEquations - -# ╔═╡ fcea9c60-2f14-11ef-2397-15d157a03c3b -md""" -# FMUExplorer v0.1.0 - -by Tobias Thummerer (University of Augsburg) - -Powered by: $br -$(Resource("https://github.com/ThummeTo/FMI.jl/blob/main/logo/dark/fmijl_logo_640_320.png?raw=true", :width=>150)) - -Keywords: $br -*#FMI, #FMU* - -## Description -FMUExplorer is a *Pluto.jl* notebook that allows - as the name suggests - to explore FMUs. Technically, it is a very light-weight wrapper around the Julia library *FMI.jl* (unfold code sections to find out how). - -## Required Packages -""" - -# ╔═╡ e85d6e42-0bd8-45bb-9c00-f3c76c808294 -import PlotlyJS - -# ╔═╡ 57d2a3e8-835d-40bb-8e47-47ea5c0eedf0 -begin - plotlyjs() - - function lastn(str, n::Integer) - if length(str) > n - 3 - return "..." * last(str, n - 3) - else - return str - end - end - - md""" Source Code. """ -end - -# ╔═╡ 92514cc6-a468-4d87-9104-d4459025de02 -TableOfContents() - -# ╔═╡ 53c080e8-389c-420e-bc05-4eec2b98074b -md""" -# Choose File -""" - -# ╔═╡ 3dfd18c3-b66c-483b-86f5-b2608eb7b469 -md""" -FMU source: $(@bind mode Select([:zoo => "FMIZoo.jl", :local => "Local file", :url => "Online URL"])) -""" - -# ╔═╡ 9aa11335-eb16-4310-9fc0-0672c64f3be1 -begin - if mode == :zoo - tools_path = joinpath( - (splitpath(FMIZoo.get_model_filename("BouncingBall1D", "Dymola", "2022x"))[1:end-4])..., - ) - tools = readdir(tools_path) - md""" - Exporting-Tool: $(@bind zoo_pick_tool Select(tools)) - """ - else - nothing - end -end - -# ╔═╡ d4769552-4083-4a3e-a477-168ac288b742 -begin - if mode == :zoo - versions_path = joinpath(tools_path, zoo_pick_tool) - versions = readdir(versions_path) - md""" - Tool Version: $(@bind zoo_pick_version Select(versions)) - """ - else - nothing - end -end - -# ╔═╡ 876653d2-6a68-4c5a-a3c6-a3ca23629989 -begin - if mode == :zoo - fmivers_path = joinpath(versions_path, zoo_pick_version) - fmivers = readdir(fmivers_path) - filter!(e -> e == "2.0", fmivers) # ToDo! - md""" - FMI version: $(@bind zoo_pick_fmiver Select(fmivers)) - """ - else - nothing - end -end - -# ╔═╡ 445f18d6-66db-4cf2-9205-f98fc3dd8d83 -begin - if mode == :zoo - fmus_path = joinpath(fmivers_path, zoo_pick_fmiver) - fmus = readdir(fmus_path) - filter!(e -> endswith(e, ".fmu"), fmus) - md""" - FMU: $(@bind zoo_pick_fmu Select(fmus)) - """ - else - nothing - end -end - -# ╔═╡ cd8ddd20-2ce8-4b5e-a431-47078416bbc9 -begin - if mode == :local - md""" - Local file path: $(@bind fmu_path confirm(TextField(), label="Load")) - """ - elseif mode == :url - md""" - Online URL: $(@bind fmu_path confirm(TextField(), label="Load")) - """ - elseif mode == :zoo - fmu_path = joinpath(fmus_path, zoo_pick_fmu) - nothing - else - md""" - Fatal error. Unknown mode `$(mode)`. - """ - end -end - -# ╔═╡ 6d0232ef-b181-42d4-9160-b2f0ffcee84b -if (mode ∈ (:local, :zoo) && isfile(fmu_path)) || - (mode == :url && startswith(fmu_path, "http")) - if endswith(fmu_path, ".fmu") - fmu = loadFMU(fmu_path) - fmu.executionConfig.loggingOn = true - fmu.executionConfig.externalCallbacks = true - descr = fmu.modelDescription - md""" - ✔️ Sucessfully loaded FMU *$(fmu.modelName)*. - """ - else - fmu = nothing - descr = nothing - md"""❌ *$(fmu_path)* does not end with `.fmu`""" - end -else - fmu = nothing - descr = nothing - if mode == :url - md"""❌ *$(fmu_path)* is not a valid URL!""" - else - md"""❌ *$(fmu_path)* is not a valid file path!""" - end -end - -# ╔═╡ 98663a7e-69a0-4938-9ac2-b7d8f248592d -md""" -# FMU information -## General information -""" - -# ╔═╡ dfaee7a3-03af-45b2-a2e4-84c103b0001a -if !isnothing(fmu) - md""" - | | | - | -------- | ------- | - | File path | $(lastn(fmu_path, 48)) | - | File size | $(round(filesize(fmu_path) / 2^20; digits=1))MB | - | Model name | $(lastn(fmu.modelName, 48)) | - | Number of variables | $(length(descr.valueReferences)) | - | Number of continuous states / derivatives | $(length(descr.stateValueReferences)) | - | Number of inputs | $(length(descr.inputValueReferences)) | - | Number of outputs | $(length(descr.outputValueReferences)) | - | Number of parameters | $(length(descr.parameterValueReferences)) | - """ -else - md""" - ⚠️ No FMU loaded. - """ -end - -# ╔═╡ a41ce5ae-4e0c-40de-b63f-e469c982367b -md""" -## Model-Exchange (ME) -""" - -# ╔═╡ 1ab6b2c8-d58e-48c5-95cb-cc35936413a9 -if !isnothing(fmu) - md""" - | | | - | -------- | ------- | - | ME supported | $(!isnothing(descr.modelExchange) ? "✔️" : "❌") | - | Model identifier | $(!isnothing(descr.modelExchange) ? lastn(descr.modelExchange.modelIdentifier, 48) : "n.a.") | - | Directional derivatives | $(!isnothing(descr.modelExchange) && descr.modelExchange.providesDirectionalDerivative == FMI.fmi2True ? "✔️" : "❌") | - """ -else - md""" - ⚠️ No FMU loaded. - """ -end - -# ╔═╡ 6472cac2-cd31-4272-95cd-8e8e7245058d -md""" -## Co-Simulation (CS) -""" - -# ╔═╡ 0cd23f48-18c7-4012-ae77-4a9f77934b60 -if !isnothing(fmu) - md""" - | | | - | -------- | ------- | - | CS supported | $(!isnothing(descr.coSimulation) ? "✔️" : "❌") | - | Model identifier | $(!isnothing(descr.coSimulation) ? lastn(descr.coSimulation.modelIdentifier, 48) : "n.a.") | - | Directional derivatives | $(!isnothing(descr.coSimulation) && descr.coSimulation.providesDirectionalDerivative == FMI.fmi2True ? "✔️" : "❌") | - """ -else - md""" - ⚠️ No FMU loaded. - """ -end - -# ╔═╡ 1eb6c4fc-be1b-491b-95e0-bc6ca060216c -begin - state_vrs = fmu.modelDescription.stateValueReferences - ders_vrs = fmu.modelDescription.derivativeValueReferences - input_vrs = fmu.modelDescription.inputValueReferences - output_vrs = fmu.modelDescription.outputValueReferences - param_vrs = fmu.modelDescription.parameterValueReferences - - internal_vrs = copy(fmu.modelDescription.valueReferences) - filter!(e -> e ∉ state_vrs, internal_vrs) - filter!(e -> e ∉ ders_vrs, internal_vrs) - filter!(e -> e ∉ input_vrs, internal_vrs) - filter!(e -> e ∉ output_vrs, internal_vrs) - filter!(e -> e ∉ param_vrs, internal_vrs) - - modes = Vector{Pair{Symbol,String}}() - if !isnothing(descr.modelExchange) - push!(modes, :ME => "Model Exchange (ME)") - end - if !isnothing(descr.coSimulation) - push!(modes, :CS => "Co-Simulation (CS)") - end - if hasproperty(descr, :scheduledExecution) && !isnothing(descr.scheduledExecution) - push!(modes, :SE => "Scheduled Execution (SE)") - end - - def_start = FMI.fmi2GetDefaultStartTime(descr) - if isnothing(def_start) - def_start = 0.0 - end - - def_stop = FMI.fmi2GetDefaultStopTime(descr) - if isnothing(def_stop) - def_stop = 0.0 - end - - md""" - # Simulation - ## General Setup - Select simulation mode: $(@bind sim_mode Select(modes)) - - Simulate from $(@bind t_start_str TextField(default=string(def_start)))s to $(@bind t_stop_str TextField(default=string(def_stop)))s. - """ -end - -# ╔═╡ 831e1919-9ac8-4934-80ce-03a691ea1a41 -if sim_mode == :CS - solver_sym = :none - md""" - ℹ️ For CS, the ODE solver is part of the compiled FMU. Choose ME or SE if you want to pick solvers. - """ -else - md""" - Solver: $(@bind solver_sym Select([:Tsit5 => "Tsit5"])) - ℹ️ Additional solvers will be deployed soon. - """ # :auto => "auto (DifferentialEquations.jl heurisitc)", - #:Rosenbrock23 => "Rosenbrock23" -end - -# ╔═╡ 43021052-25b4-43a9-a9e6-47f3c56d1341 -md""" -## Parameterization -Select parameters to change parameterization (select multiple by holding *Ctrl*): -""" - -# ╔═╡ df122e2a-f4af-4ac7-b332-4c07e7aa4b0e -if length(param_vrs) > 0 - @bind changeParameters MultiSelect( - collect( - param_vrs[i] => FMI.fmi2ValueReferenceToString(fmu, param_vrs[i])[1] for - i = 1:length(param_vrs) - ), - ) -else - changeParameters = [] - md""" - ℹ️ The FMU doesn't contain parameters. - """ -end - -# ╔═╡ dbaf5ff3-9ee2-4355-aad2-e48c25eee514 -begin - function parameter_input(ps::Vector) - - return PlutoUI.combine() do Child - - inputs = [ - md""" $(FMI.fmi2ValueReferenceToString(fmu, vr)[1]): $( - Child(string(vr), TextField(default=string(FMI.fmi2GetStartValue(fmu, vr)))) - ) default: $(FMI.fmi2GetStartValue(fmu, vr))""" - - for vr in ps - ] - - md""" - $(inputs) - """ - end - end - nothing -end - -# ╔═╡ 942e6e27-04a1-4dce-9364-ccafd105facb -md""" -Change parameter values: -""" - -# ╔═╡ 095b6d5a-58af-4e3a-8ce0-b08a25629b38 -if length(changeParameters) == 0 - md""" - ℹ️ No parameters selected above. - """ -else - @bind params parameter_input(changeParameters) -end - -# ╔═╡ 43cab175-38df-42dd-b012-e28deec442b0 -md""" -Changed parameters: -""" - -# ╔═╡ 21178414-11ae-479b-9aae-b495f3c9c76e -begin - if length(changeParameters) == 0 - parameters = nothing - md""" - ℹ️ No parameters selected above. - """ - else - # parse named tuple to Dict - parameters = Dict{FMI.fmi2ValueReference,Any}() - for i = 1:length(params) - k = parse(FMI.fmi2ValueReference, string(keys(params)[i])) - v = values(params)[i] - typ = FMI.fmi2DataTypeForValueReference(descr, k) - if typ != FMI.fmi2String - v = parse(typ, v) - end - parameters[k] = v - end - parameters - end -end - -# ╔═╡ 82c6de3e-66f2-4965-8bad-2faae667fb7e -md""" -## Record values -### States -$(@bind recordStates MultiSelect(collect(state_vrs[i] => FMI.fmi2ValueReferenceToString(fmu, state_vrs[i])[1] for i in 1:length(state_vrs)))) - -### Derivatives -$(@bind recordDerivatives MultiSelect(collect(ders_vrs[i] => FMI.fmi2ValueReferenceToString(fmu, ders_vrs[i])[1] for i in 1:length(ders_vrs)))) - -### Inputs -$(@bind recordInputs MultiSelect(collect(input_vrs[i] => FMI.fmi2ValueReferenceToString(fmu, input_vrs[i])[1] for i in 1:length(input_vrs)))) - -### Outputs -$(@bind recordOutputs MultiSelect(collect(output_vrs[i] => FMI.fmi2ValueReferenceToString(fmu, output_vrs[i])[1] for i in 1:length(output_vrs)))) - -### Parameters -$(@bind recordParameters MultiSelect(collect(param_vrs[i] => FMI.fmi2ValueReferenceToString(fmu, param_vrs[i])[1] for i in 1:length(param_vrs)))) - -### Internal values -$(@bind recordInternals MultiSelect(collect(internal_vrs[i] => FMI.fmi2ValueReferenceToString(fmu, internal_vrs[i])[1] * " [" * string(internal_vrs[i]) * "]" for i in 1:length(internal_vrs)))) -""" - -# ╔═╡ d28612f7-1405-4f6b-87db-56e3ebb852ff -begin - fmu_path - - solver_sym - sim_mode - t_start_str - t_stop_str - - recordStates - recordDerivatives - recordInputs - recordOutputs - recordParameters - recordInternals - - parameters - - md""" - ## Run Simulation - Select to start simulation: $(@bind simulation_trigger CheckBox(default=false)) - """ -end - -# ╔═╡ 05d51ac1-4804-4641-b8b1-f4f4e10dcae6 -begin - t_start = parse(Float64, t_start_str) - t_stop = parse(Float64, t_stop_str) - - recordValues = Vector{FMI.fmi2ValueReference}([ - recordStates..., - recordDerivatives..., - recordInputs..., - recordOutputs..., - recordParameters..., - recordInternals..., - ]) - - if sim_mode == :ME || sim_mode == :SE - if solver_sym == :auto - solver = nothing - elseif solver_sym == :Tsit5 - solver = Tsit5() - elseif solver_sym == :Rosenbrock23 - solver = Rosenbrock23(autodiff = false) - else - md""" - ⛔ Unknwon solver `$(solver_sym)`. - """ - return nothing - end - end - - if simulation_trigger - try - global solution - if sim_mode == :ME - solution = fmiSimulateME( - fmu, - (t_start, t_stop); - recordValues = recordValues, - parameters = parameters, - solver = solver, - ) - nothing - elseif sim_mode == :CS - solution = fmiSimulateCS( - fmu, - (t_start, t_stop); - recordValues = recordValues, - parameters = parameters, - ) - nothing - elseif sim_mode == :SE - solution = nothing - md"""🚧 SE not supported for now.""" - else - solution = nothing - md"""⛔ Unknown simulation mode.""" - end - catch e - global solution - solution = nothing - md"""⛔ Simulation failed. Reasons might be $br - the FMU couldn't be initialized because of insufficient default values $br - ... $br The error message is: $br $(e)""" - end - else - solution = nothing - md"""ℹ️ Start simulation to show results.""" - end -end - -# ╔═╡ 5058777f-beb6-43f4-b3d2-1127abbe1ac9 -md""" -# Results -## Plot -""" - -# ╔═╡ 7588298c-a54c-4b61-b32a-a3cf89cd8b3b -md""" -x-axis: $(@bind xaxis Select([0 => "time", collect(recordValues[i] => FMI.fmi2ValueReferenceToString(fmu, recordValues[i])[1] for i in 1:length(recordValues))...])) -""" - -# ╔═╡ a8b53f45-5ff7-41dd-89d9-040dcf0e9898 -begin - function get_xaxis(xaxis, recordValues) - xaxis_vals = nothing - for i = 1:length(recordValues) - rv = recordValues[i] - if xaxis == rv - xaxis_vals = collect(vals[i] for vals in solution.values.saveval) - break - end - end - return xaxis_vals - end - - if isnothing(solution) - md"""ℹ️ Please run simulation in order to plot.""" - elseif isnothing(solution.values) || - length(solution.values.saveval) == 0 || - length(solution.values.saveval[1]) == 0 - md"""ℹ️ Simulation successfull, but no values recorded. Please select at least one value to be recorded in order to plot some results.""" - else - if xaxis == 0 # time - xaxis_vals = solution.values.t - nothing - else - xaxis_vals = get_xaxis(xaxis, recordValues) - md""" - ℹ️ Plotting of events is disabled if x-axis is not `time`. - """ - end - end -end - -# ╔═╡ 28026b82-83ba-42cc-89f9-a521daef717a -begin - function plotResults() - fig = Plots.plot() - _min = Inf - _max = -Inf - for i = 1:length(recordValues) - rv = recordValues[i] - if xaxis != rv - vals = collect(vals[i] for vals in solution.values.saveval) - _min = min(_min, vals...) - _max = max(_max, vals...) - Plots.plot!( - fig, - xaxis_vals, - vals; - label = FMI.fmi2ValueReferenceToString(fmu, rv)[1] * - " [" * - string(rv) * - "]", - ) - end - end - - if xaxis == 0 - firstTime = true - firstState = true - for i = 1:length(solution.events) - event = solution.events[i] - if event.indicator == 0 - plot!( - fig, - [event.t, event.t], - [_min, _max]; - label = (firstTime ? "Time-Event" : :none), - style = :dash, - color = :red, - ) - firstTime = false - else - plot!( - fig, - [event.t, event.t], - [_min, _max]; - label = (firstState ? "State-Event" : :none), - style = :dash, - color = :blue, - ) - firstState = false - end - end - end - - fig - end - - if isnothing(solution) - md"""ℹ️ Please run simulation in order to plot.""" - elseif isnothing(solution.values) || - length(solution.values.saveval) == 0 || - length(solution.values.saveval[1]) == 0 - md"""ℹ️ Simulation successfull, but no values recorded. Please select at least one value to be recorded in order to plot some results.""" - else - plotResults() - end -end - -# ╔═╡ c7cceb40-ff26-4d3d-912a-199c6ddd49d2 -md""" -## Statistics -""" - -# ╔═╡ ca0ba941-8eb1-4641-ae4b-0925df73dedd -if isnothing(solution) || isnothing(solution.states) - if sim_mode == :ME - md"""ℹ️ Please run simulation in order to display statistics.""" - else - md"""ℹ️ Please switch simulation mode to ME to show solver statistics.""" - end -else - solution.states.destats -end - -# ╔═╡ 00000000-0000-0000-0000-000000000001 -PLUTO_PROJECT_TOML_CONTENTS = """ -[deps] -DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" -FMI = "14a09403-18e3-468f-ad8a-74f8dda2d9ac" -FMIZoo = "724179cf-c260-40a9-bd27-cccc6fe2f195" -PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a" -Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8" - -[compat] -DifferentialEquations = "~7.13.0" -FMI = "~0.13.3" -PlotlyJS = "~0.18.13" -Plots = "~1.40.4" -PlutoUI = "~0.7.59" -""" - -# ╔═╡ 00000000-0000-0000-0000-000000000002 -PLUTO_MANIFEST_TOML_CONTENTS = """ -# This file is machine-generated - editing it directly is not advised - -julia_version = "1.10.3" -manifest_format = "2.0" -project_hash = "9d301af976b87c2855da6d1e06ec4a3aa9b766e2" - -[[deps.ADTypes]] -git-tree-sha1 = "fa0822e5baee6e23081c2685ae27265dabee23d8" -uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" -version = "1.4.0" -weakdeps = ["ChainRulesCore", "EnzymeCore"] - - [deps.ADTypes.extensions] - ADTypesChainRulesCoreExt = "ChainRulesCore" - ADTypesEnzymeCoreExt = "EnzymeCore" - -[[deps.AbstractPlutoDingetjes]] -deps = ["Pkg"] -git-tree-sha1 = "6e1d2a35f2f90a4bc7c2ed98079b2ba09c35b83a" -uuid = "6e696c72-6542-2067-7265-42206c756150" -version = "1.3.2" - -[[deps.Accessors]] -deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "MacroTools", "Markdown", "Test"] -git-tree-sha1 = "c0d491ef0b135fd7d63cbc6404286bc633329425" -uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" -version = "0.1.36" - - [deps.Accessors.extensions] - AccessorsAxisKeysExt = "AxisKeys" - AccessorsIntervalSetsExt = "IntervalSets" - AccessorsStaticArraysExt = "StaticArrays" - AccessorsStructArraysExt = "StructArrays" - AccessorsUnitfulExt = "Unitful" - - [deps.Accessors.weakdeps] - AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5" - IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" - Requires = "ae029012-a4dd-5104-9daa-d747884805df" - StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" - StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" - Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" - -[[deps.Adapt]] -deps = ["LinearAlgebra", "Requires"] -git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099" -uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "4.0.4" -weakdeps = ["StaticArrays"] - - [deps.Adapt.extensions] - AdaptStaticArraysExt = "StaticArrays" - -[[deps.AliasTables]] -deps = ["PtrArrays", "Random"] -git-tree-sha1 = "9876e1e164b144ca45e9e3198d0b689cadfed9ff" -uuid = "66dad0bd-aa9a-41b7-9441-69ab47430ed8" -version = "1.1.3" - -[[deps.ArgTools]] -uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" -version = "1.1.1" - -[[deps.ArnoldiMethod]] -deps = ["LinearAlgebra", "Random", "StaticArrays"] -git-tree-sha1 = "d57bd3762d308bded22c3b82d033bff85f6195c6" -uuid = "ec485272-7323-5ecc-a04f-4719b315124d" -version = "0.4.0" - -[[deps.ArrayInterface]] -deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "ed2ec3c9b483842ae59cd273834e5b46206d6dda" -uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -version = "7.11.0" - - [deps.ArrayInterface.extensions] - ArrayInterfaceBandedMatricesExt = "BandedMatrices" - ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" - ArrayInterfaceCUDAExt = "CUDA" - ArrayInterfaceCUDSSExt = "CUDSS" - ArrayInterfaceChainRulesExt = "ChainRules" - ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" - ArrayInterfaceReverseDiffExt = "ReverseDiff" - ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" - ArrayInterfaceTrackerExt = "Tracker" - - [deps.ArrayInterface.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" - CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" - CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" - ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" - GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - -[[deps.ArrayLayouts]] -deps = ["FillArrays", "LinearAlgebra"] -git-tree-sha1 = "420e2853770f50e5306b9d96b5a66f26e7c73bc6" -uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" -version = "1.9.4" -weakdeps = ["SparseArrays"] - - [deps.ArrayLayouts.extensions] - ArrayLayoutsSparseArraysExt = "SparseArrays" - -[[deps.Artifacts]] -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" - -[[deps.AssetRegistry]] -deps = ["Distributed", "JSON", "Pidfile", "SHA", "Test"] -git-tree-sha1 = "b25e88db7944f98789130d7b503276bc34bc098e" -uuid = "bf4720bc-e11a-5d0c-854e-bdca1663c893" -version = "0.1.0" - -[[deps.AxisAlgorithms]] -deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"] -git-tree-sha1 = "01b8ccb13d68535d73d2b0c23e39bd23155fb712" -uuid = "13072b0f-2c55-5437-9ae7-d433b7a33950" -version = "1.1.0" - -[[deps.BandedMatrices]] -deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "PrecompileTools"] -git-tree-sha1 = "71f605effb24081b09cae943ba39ef9ca90c04f4" -uuid = "aae01518-5342-5314-be14-df237901396f" -version = "1.7.2" -weakdeps = ["SparseArrays"] - - [deps.BandedMatrices.extensions] - BandedMatricesSparseArraysExt = "SparseArrays" - -[[deps.Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[deps.BitFlags]] -git-tree-sha1 = "0691e34b3bb8be9307330f88d1a3c3f25466c24d" -uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" -version = "0.1.9" - -[[deps.BitTwiddlingConvenienceFunctions]] -deps = ["Static"] -git-tree-sha1 = "0c5f81f47bbbcf4aea7b2959135713459170798b" -uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b" -version = "0.1.5" - -[[deps.Blink]] -deps = ["Base64", "Distributed", "HTTP", "JSExpr", "JSON", "Lazy", "Logging", "MacroTools", "Mustache", "Mux", "Pkg", "Reexport", "Sockets", "WebIO"] -git-tree-sha1 = "bc93511973d1f949d45b0ea17878e6cb0ad484a1" -uuid = "ad839575-38b3-5650-b840-f874b8c74a25" -version = "0.12.9" - -[[deps.BoundaryValueDiffEq]] -deps = ["ADTypes", "Adapt", "ArrayInterface", "BandedMatrices", "ConcreteStructs", "DiffEqBase", "FastAlmostBandedMatrices", "FastClosures", "ForwardDiff", "LinearAlgebra", "LinearSolve", "Logging", "NonlinearSolve", "OrdinaryDiffEq", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays", "SparseDiffTools"] -git-tree-sha1 = "98d44493d9e615651e24628391a1e555c44a54c6" -uuid = "764a87c0-6b3e-53db-9096-fe964310641d" -version = "5.8.0" - - [deps.BoundaryValueDiffEq.extensions] - BoundaryValueDiffEqODEInterfaceExt = "ODEInterface" - - [deps.BoundaryValueDiffEq.weakdeps] - ODEInterface = "54ca160b-1b9f-5127-a996-1867f4bc2a2c" - -[[deps.BufferedStreams]] -git-tree-sha1 = "4ae47f9a4b1dc19897d3743ff13685925c5202ec" -uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d" -version = "1.2.1" - -[[deps.Bzip2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd" -uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" -version = "1.0.8+1" - -[[deps.CEnum]] -git-tree-sha1 = "389ad5c84de1ae7cf0e28e381131c98ea87d54fc" -uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" -version = "0.5.0" - -[[deps.CPUSummary]] -deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] -git-tree-sha1 = "585a387a490f1c4bd88be67eea15b93da5e85db7" -uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" -version = "0.2.5" - -[[deps.Cairo_jll]] -deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"] -git-tree-sha1 = "a2f1c8c668c8e3cb4cca4e57a8efdb09067bb3fd" -uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a" -version = "1.18.0+2" - -[[deps.Calculus]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad" -uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" -version = "0.5.1" - -[[deps.ChainRulesCore]] -deps = ["Compat", "LinearAlgebra"] -git-tree-sha1 = "71acdbf594aab5bbb2cec89b208c41b4c411e49f" -uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.24.0" -weakdeps = ["SparseArrays"] - - [deps.ChainRulesCore.extensions] - ChainRulesCoreSparseArraysExt = "SparseArrays" - -[[deps.CloseOpenIntervals]] -deps = ["Static", "StaticArrayInterface"] -git-tree-sha1 = "70232f82ffaab9dc52585e0dd043b5e0c6b714f1" -uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9" -version = "0.1.12" - -[[deps.CodecZlib]] -deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "59939d8a997469ee05c4b4944560a820f9ba0d73" -uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.4" - -[[deps.ColorSchemes]] -deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "PrecompileTools", "Random"] -git-tree-sha1 = "4b270d6465eb21ae89b732182c20dc165f8bf9f2" -uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4" -version = "3.25.0" - -[[deps.ColorTypes]] -deps = ["FixedPointNumbers", "Random"] -git-tree-sha1 = "b10d0b65641d57b8b4d5e234446582de5047050d" -uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" -version = "0.11.5" - -[[deps.ColorVectorSpace]] -deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "Requires", "Statistics", "TensorCore"] -git-tree-sha1 = "a1f44953f2382ebb937d60dafbe2deea4bd23249" -uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4" -version = "0.10.0" -weakdeps = ["SpecialFunctions"] - - [deps.ColorVectorSpace.extensions] - SpecialFunctionsExt = "SpecialFunctions" - -[[deps.Colors]] -deps = ["ColorTypes", "FixedPointNumbers", "Reexport"] -git-tree-sha1 = "362a287c3aa50601b0bc359053d5c2468f0e7ce0" -uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" -version = "0.12.11" - -[[deps.CommonSolve]] -git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" -uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" -version = "0.2.4" - -[[deps.CommonSubexpressions]] -deps = ["MacroTools", "Test"] -git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" -uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" -version = "0.3.0" - -[[deps.Compat]] -deps = ["TOML", "UUIDs"] -git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.15.0" -weakdeps = ["Dates", "LinearAlgebra"] - - [deps.Compat.extensions] - CompatLinearAlgebraExt = "LinearAlgebra" - -[[deps.CompilerSupportLibraries_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.1.1+0" - -[[deps.CompositionsBase]] -git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad" -uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b" -version = "0.1.2" -weakdeps = ["InverseFunctions"] - - [deps.CompositionsBase.extensions] - CompositionsBaseInverseFunctionsExt = "InverseFunctions" - -[[deps.ConcreteStructs]] -git-tree-sha1 = "f749037478283d372048690eb3b5f92a79432b34" -uuid = "2569d6c7-a4a2-43d3-a901-331e8e4be471" -version = "0.2.3" - -[[deps.ConcurrentUtilities]] -deps = ["Serialization", "Sockets"] -git-tree-sha1 = "6cbbd4d241d7e6579ab354737f4dd95ca43946e1" -uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" -version = "2.4.1" - -[[deps.ConstructionBase]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "260fd2400ed2dab602a7c15cf10c1933c59930a2" -uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.5.5" - - [deps.ConstructionBase.extensions] - ConstructionBaseIntervalSetsExt = "IntervalSets" - ConstructionBaseStaticArraysExt = "StaticArrays" - - [deps.ConstructionBase.weakdeps] - IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" - StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" - -[[deps.Contour]] -git-tree-sha1 = "439e35b0b36e2e5881738abc8857bd92ad6ff9a8" -uuid = "d38c429a-6771-53c6-b99e-75d170b6e991" -version = "0.6.3" - -[[deps.CpuId]] -deps = ["Markdown"] -git-tree-sha1 = "fcbb72b032692610bfbdb15018ac16a36cf2e406" -uuid = "adafc99b-e345-5852-983c-f28acb93d879" -version = "0.3.1" - -[[deps.DataAPI]] -git-tree-sha1 = "abe83f3a2f1b857aac70ef8b269080af17764bbe" -uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.16.0" - -[[deps.DataStructures]] -deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "1d0a14036acb104d9e89698bd408f63ab58cdc82" -uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.20" - -[[deps.DataValueInterfaces]] -git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" -uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" -version = "1.0.0" - -[[deps.Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[deps.DelayDiffEq]] -deps = ["ArrayInterface", "DataStructures", "DiffEqBase", "LinearAlgebra", "Logging", "OrdinaryDiffEq", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SimpleUnPack"] -git-tree-sha1 = "5959ae76ebd198f70e9af81153644543da0cfaf2" -uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb" -version = "5.47.3" - -[[deps.DelimitedFiles]] -deps = ["Mmap"] -git-tree-sha1 = "9e2f36d3c96a820c678f2f1f1782582fcf685bae" -uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" -version = "1.9.1" - -[[deps.DiffEqBase]] -deps = ["ArrayInterface", "ConcreteStructs", "DataStructures", "DocStringExtensions", "EnumX", "EnzymeCore", "FastBroadcast", "FastClosures", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "Parameters", "PreallocationTools", "PrecompileTools", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Static", "StaticArraysCore", "Statistics", "Tricks", "TruncatedStacktraces"] -git-tree-sha1 = "2c6b7bf16fd850c551a765e313e7522ba455cbfd" -uuid = "2b5f629d-d688-5b77-993f-72d75c75574e" -version = "6.151.4" - - [deps.DiffEqBase.extensions] - DiffEqBaseCUDAExt = "CUDA" - DiffEqBaseChainRulesCoreExt = "ChainRulesCore" - DiffEqBaseDistributionsExt = "Distributions" - DiffEqBaseEnzymeExt = ["ChainRulesCore", "Enzyme"] - DiffEqBaseGeneralizedGeneratedExt = "GeneralizedGenerated" - DiffEqBaseMPIExt = "MPI" - DiffEqBaseMeasurementsExt = "Measurements" - DiffEqBaseMonteCarloMeasurementsExt = "MonteCarloMeasurements" - DiffEqBaseReverseDiffExt = "ReverseDiff" - DiffEqBaseTrackerExt = "Tracker" - DiffEqBaseUnitfulExt = "Unitful" - - [deps.DiffEqBase.weakdeps] - CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" - Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" - GeneralizedGenerated = "6b9d7cbe-bcb9-11e9-073f-15a7a543e2eb" - MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" - Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" - MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" - -[[deps.DiffEqCallbacks]] -deps = ["DataStructures", "DiffEqBase", "ForwardDiff", "Functors", "LinearAlgebra", "Markdown", "NonlinearSolve", "Parameters", "RecipesBase", "RecursiveArrayTools", "SciMLBase", "StaticArraysCore"] -git-tree-sha1 = "c959cfd2657d16beada157a74d52269e8556500e" -uuid = "459566f4-90b8-5000-8ac3-15dfb0a30def" -version = "3.6.2" -weakdeps = ["OrdinaryDiffEq", "Sundials"] - -[[deps.DiffEqNoiseProcess]] -deps = ["DiffEqBase", "Distributions", "GPUArraysCore", "LinearAlgebra", "Markdown", "Optim", "PoissonRandom", "QuadGK", "Random", "Random123", "RandomNumbers", "RecipesBase", "RecursiveArrayTools", "Requires", "ResettableStacks", "SciMLBase", "StaticArraysCore", "Statistics"] -git-tree-sha1 = "65cbbe1450ced323b4b17228ccd96349d96795a7" -uuid = "77a26b50-5914-5dd7-bc55-306e6241c503" -version = "5.21.0" - - [deps.DiffEqNoiseProcess.extensions] - DiffEqNoiseProcessReverseDiffExt = "ReverseDiff" - - [deps.DiffEqNoiseProcess.weakdeps] - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - -[[deps.DiffResults]] -deps = ["StaticArraysCore"] -git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621" -uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" -version = "1.1.0" - -[[deps.DiffRules]] -deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] -git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" -uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.15.1" - -[[deps.DifferentialEquations]] -deps = ["BoundaryValueDiffEq", "DelayDiffEq", "DiffEqBase", "DiffEqCallbacks", "DiffEqNoiseProcess", "JumpProcesses", "LinearAlgebra", "LinearSolve", "NonlinearSolve", "OrdinaryDiffEq", "Random", "RecursiveArrayTools", "Reexport", "SciMLBase", "SteadyStateDiffEq", "StochasticDiffEq", "Sundials"] -git-tree-sha1 = "81042254a307980b8ab5b67033aca26c2e157ebb" -uuid = "0c46a032-eb83-5123-abaf-570d42b7fbaa" -version = "7.13.0" - -[[deps.DifferentiationInterface]] -deps = ["ADTypes", "Compat", "DocStringExtensions", "FillArrays", "LinearAlgebra", "PackageExtensionCompat", "SparseArrays", "SparseMatrixColorings"] -git-tree-sha1 = "23c6df13ad8fcffde4b0596d798911d2e309fc2c" -uuid = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63" -version = "0.5.5" - - [deps.DifferentiationInterface.extensions] - DifferentiationInterfaceChainRulesCoreExt = "ChainRulesCore" - DifferentiationInterfaceDiffractorExt = "Diffractor" - DifferentiationInterfaceEnzymeExt = "Enzyme" - DifferentiationInterfaceFastDifferentiationExt = "FastDifferentiation" - DifferentiationInterfaceFiniteDiffExt = "FiniteDiff" - DifferentiationInterfaceFiniteDifferencesExt = "FiniteDifferences" - DifferentiationInterfaceForwardDiffExt = "ForwardDiff" - DifferentiationInterfacePolyesterForwardDiffExt = "PolyesterForwardDiff" - DifferentiationInterfaceReverseDiffExt = "ReverseDiff" - DifferentiationInterfaceSymbolicsExt = "Symbolics" - DifferentiationInterfaceTapirExt = "Tapir" - DifferentiationInterfaceTrackerExt = "Tracker" - DifferentiationInterfaceZygoteExt = ["Zygote", "ForwardDiff"] - - [deps.DifferentiationInterface.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - Diffractor = "9f5e2b26-1114-432f-b630-d3fe2085c51c" - Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" - FastDifferentiation = "eb9bf01b-bf85-4b60-bf87-ee5de06c00be" - FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" - FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000" - ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" - PolyesterForwardDiff = "98d1487c-24ca-40b6-b7ab-df2af84e126b" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" - Tapir = "07d77754-e150-4737-8c94-cd238a1fb45b" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" - -[[deps.Distances]] -deps = ["LinearAlgebra", "Statistics", "StatsAPI"] -git-tree-sha1 = "66c4c81f259586e8f002eacebc177e1fb06363b0" -uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" -version = "0.10.11" -weakdeps = ["ChainRulesCore", "SparseArrays"] - - [deps.Distances.extensions] - DistancesChainRulesCoreExt = "ChainRulesCore" - DistancesSparseArraysExt = "SparseArrays" - -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[deps.Distributions]] -deps = ["AliasTables", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"] -git-tree-sha1 = "9c405847cc7ecda2dc921ccf18b47ca150d7317e" -uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" -version = "0.25.109" - - [deps.Distributions.extensions] - DistributionsChainRulesCoreExt = "ChainRulesCore" - DistributionsDensityInterfaceExt = "DensityInterface" - DistributionsTestExt = "Test" - - [deps.Distributions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d" - Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[deps.DocStringExtensions]] -deps = ["LibGit2"] -git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" -uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.9.3" - -[[deps.Downloads]] -deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] -uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" -version = "1.6.0" - -[[deps.DualNumbers]] -deps = ["Calculus", "NaNMath", "SpecialFunctions"] -git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566" -uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74" -version = "0.6.8" - -[[deps.EnumX]] -git-tree-sha1 = "bdb1942cd4c45e3c678fd11569d5cccd80976237" -uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" -version = "1.0.4" - -[[deps.EnzymeCore]] -git-tree-sha1 = "88bc63137eb033acc3afe1b9875717889c718c46" -uuid = "f151be2c-9106-41f4-ab19-57ee4f262869" -version = "0.7.5" -weakdeps = ["Adapt"] - - [deps.EnzymeCore.extensions] - AdaptExt = "Adapt" - -[[deps.EpollShim_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "8e9441ee83492030ace98f9789a654a6d0b1f643" -uuid = "2702e6a9-849d-5ed8-8c21-79e8b8f9ee43" -version = "0.0.20230411+0" - -[[deps.ExceptionUnwrapping]] -deps = ["Test"] -git-tree-sha1 = "dcb08a0d93ec0b1cdc4af184b26b591e9695423a" -uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" -version = "0.1.10" - -[[deps.Expat_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "1c6317308b9dc757616f0b5cb379db10494443a7" -uuid = "2e619515-83b5-522b-bb60-26c02a35a201" -version = "2.6.2+0" - -[[deps.ExponentialUtilities]] -deps = ["Adapt", "ArrayInterface", "GPUArraysCore", "GenericSchur", "LinearAlgebra", "PrecompileTools", "Printf", "SparseArrays", "libblastrampoline_jll"] -git-tree-sha1 = "8e18940a5ba7f4ddb41fe2b79b6acaac50880a86" -uuid = "d4d017d3-3776-5f7e-afef-a10c40355c18" -version = "1.26.1" - -[[deps.ExprTools]] -git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" -uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" -version = "0.1.10" - -[[deps.EzXML]] -deps = ["Printf", "XML2_jll"] -git-tree-sha1 = "380053d61bb9064d6aa4a9777413b40429c79901" -uuid = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" -version = "1.2.0" - -[[deps.FFMPEG]] -deps = ["FFMPEG_jll"] -git-tree-sha1 = "b57e3acbe22f8484b4b5ff66a7499717fe1a9cc8" -uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a" -version = "0.4.1" - -[[deps.FFMPEG_jll]] -deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "PCRE2_jll", "Zlib_jll", "libaom_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"] -git-tree-sha1 = "466d45dc38e15794ec7d5d63ec03d776a9aff36e" -uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5" -version = "4.4.4+1" - -[[deps.FMI]] -deps = ["DifferentialEquations", "Downloads", "FMIExport", "FMIImport", "LinearAlgebra", "ProgressMeter", "Requires", "ThreadPools"] -git-tree-sha1 = "476e0317e86ecb2702d2ad744eb3a02626674fb1" -uuid = "14a09403-18e3-468f-ad8a-74f8dda2d9ac" -version = "0.13.3" - -[[deps.FMICore]] -deps = ["ChainRulesCore", "Dates", "Requires"] -git-tree-sha1 = "ba0fb5ec972d3d2bb7f8c1ebd2f84a58268ab30b" -uuid = "8af89139-c281-408e-bce2-3005eb87462f" -version = "0.20.1" - -[[deps.FMIExport]] -deps = ["Dates", "EzXML", "FMICore", "UUIDs"] -git-tree-sha1 = "daf601e31aeb73fb0010fe7ff942367bc75d5088" -uuid = "31b88311-cab6-44ed-ba9c-fe5a9abbd67a" -version = "0.3.2" - -[[deps.FMIImport]] -deps = ["Downloads", "EzXML", "FMICore", "Libdl", "RelocatableFolders", "ZipFile"] -git-tree-sha1 = "b5b245bf7f1fc044ad16b016c7e2f08a2333a6f1" -uuid = "9fcbc62e-52a0-44e9-a616-1359a0008194" -version = "0.16.4" - -[[deps.FMIZoo]] -deps = ["Downloads", "EzXML", "FilePaths", "FilePathsBase", "Glob", "Interpolations", "MAT", "Optim", "Requires", "ZipFile"] -git-tree-sha1 = "47f7e240ab988c1a24cc028f668eb70f73af5bd3" -uuid = "724179cf-c260-40a9-bd27-cccc6fe2f195" -version = "0.3.3" - -[[deps.FastAlmostBandedMatrices]] -deps = ["ArrayInterface", "ArrayLayouts", "BandedMatrices", "ConcreteStructs", "LazyArrays", "LinearAlgebra", "MatrixFactorizations", "PrecompileTools", "Reexport"] -git-tree-sha1 = "aee47d984d8eddc4ef5fd6b637e7285a16b1283f" -uuid = "9d29842c-ecb8-4973-b1e9-a27b1157504e" -version = "0.1.2" - -[[deps.FastBroadcast]] -deps = ["ArrayInterface", "LinearAlgebra", "Polyester", "Static", "StaticArrayInterface", "StrideArraysCore"] -git-tree-sha1 = "2be93e36303143c6fffd07e2222bbade35194d9e" -uuid = "7034ab61-46d4-4ed7-9d0f-46aef9175898" -version = "0.3.3" - -[[deps.FastClosures]] -git-tree-sha1 = "acebe244d53ee1b461970f8910c235b259e772ef" -uuid = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a" -version = "0.3.2" - -[[deps.FastLapackInterface]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "cbf5edddb61a43669710cbc2241bc08b36d9e660" -uuid = "29a986be-02c6-4525-aec4-84b980013641" -version = "2.0.4" - -[[deps.FilePaths]] -deps = ["FilePathsBase", "MacroTools", "Reexport", "Requires"] -git-tree-sha1 = "919d9412dbf53a2e6fe74af62a73ceed0bce0629" -uuid = "8fc22ac5-c921-52a6-82fd-178b2807b824" -version = "0.8.3" - -[[deps.FilePathsBase]] -deps = ["Compat", "Dates", "Mmap", "Printf", "Test", "UUIDs"] -git-tree-sha1 = "9f00e42f8d99fdde64d40c8ea5d14269a2e2c1aa" -uuid = "48062228-2e41-5def-b9a4-89aafe57970f" -version = "0.9.21" - -[[deps.FileWatching]] -uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" - -[[deps.FillArrays]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "0653c0a2396a6da5bc4766c43041ef5fd3efbe57" -uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" -version = "1.11.0" -weakdeps = ["PDMats", "SparseArrays", "Statistics"] - - [deps.FillArrays.extensions] - FillArraysPDMatsExt = "PDMats" - FillArraysSparseArraysExt = "SparseArrays" - FillArraysStatisticsExt = "Statistics" - -[[deps.FiniteDiff]] -deps = ["ArrayInterface", "LinearAlgebra", "Requires", "Setfield", "SparseArrays"] -git-tree-sha1 = "2de436b72c3422940cbe1367611d137008af7ec3" -uuid = "6a86dc24-6348-571c-b903-95158fe2bd41" -version = "2.23.1" - - [deps.FiniteDiff.extensions] - FiniteDiffBandedMatricesExt = "BandedMatrices" - FiniteDiffBlockBandedMatricesExt = "BlockBandedMatrices" - FiniteDiffStaticArraysExt = "StaticArrays" - - [deps.FiniteDiff.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" - StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" - -[[deps.FixedPointNumbers]] -deps = ["Statistics"] -git-tree-sha1 = "05882d6995ae5c12bb5f36dd2ed3f61c98cbb172" -uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" -version = "0.8.5" - -[[deps.Fontconfig_jll]] -deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Zlib_jll"] -git-tree-sha1 = "db16beca600632c95fc8aca29890d83788dd8b23" -uuid = "a3f928ae-7b40-5064-980b-68af3947d34b" -version = "2.13.96+0" - -[[deps.Format]] -git-tree-sha1 = "9c68794ef81b08086aeb32eeaf33531668d5f5fc" -uuid = "1fa38f19-a742-5d3f-a2b9-30dd87b9d5f8" -version = "1.3.7" - -[[deps.ForwardDiff]] -deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions"] -git-tree-sha1 = "cf0fe81336da9fb90944683b8c41984b08793dad" -uuid = "f6369f11-7733-5829-9624-2563aa707210" -version = "0.10.36" -weakdeps = ["StaticArrays"] - - [deps.ForwardDiff.extensions] - ForwardDiffStaticArraysExt = "StaticArrays" - -[[deps.FreeType2_jll]] -deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Zlib_jll"] -git-tree-sha1 = "5c1d8ae0efc6c2e7b1fc502cbe25def8f661b7bc" -uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7" -version = "2.13.2+0" - -[[deps.FriBidi_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "1ed150b39aebcc805c26b93a8d0122c940f64ce2" -uuid = "559328eb-81f9-559d-9380-de523a88c83c" -version = "1.0.14+0" - -[[deps.FunctionWrappers]] -git-tree-sha1 = "d62485945ce5ae9c0c48f124a84998d755bae00e" -uuid = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e" -version = "1.1.3" - -[[deps.FunctionWrappersWrappers]] -deps = ["FunctionWrappers"] -git-tree-sha1 = "b104d487b34566608f8b4e1c39fb0b10aa279ff8" -uuid = "77dc65aa-8811-40c2-897b-53d922fa7daf" -version = "0.1.3" - -[[deps.FunctionalCollections]] -deps = ["Test"] -git-tree-sha1 = "04cb9cfaa6ba5311973994fe3496ddec19b6292a" -uuid = "de31a74c-ac4f-5751-b3fd-e18cd04993ca" -version = "0.5.0" - -[[deps.Functors]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "8a66c07630d6428eaab3506a0eabfcf4a9edea05" -uuid = "d9f16b24-f501-4c13-a1f2-28368ffc5196" -version = "0.4.11" - -[[deps.Future]] -deps = ["Random"] -uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" - -[[deps.GLFW_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"] -git-tree-sha1 = "ff38ba61beff76b8f4acad8ab0c97ef73bb670cb" -uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89" -version = "3.3.9+0" - -[[deps.GPUArraysCore]] -deps = ["Adapt"] -git-tree-sha1 = "ec632f177c0d990e64d955ccc1b8c04c485a0950" -uuid = "46192b85-c4d5-4398-a991-12ede77f4527" -version = "0.1.6" - -[[deps.GR]] -deps = ["Artifacts", "Base64", "DelimitedFiles", "Downloads", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Preferences", "Printf", "Random", "Serialization", "Sockets", "TOML", "Tar", "Test", "p7zip_jll"] -git-tree-sha1 = "3e527447a45901ea392fe12120783ad6ec222803" -uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" -version = "0.73.6" - -[[deps.GR_jll]] -deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "FreeType2_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Qt6Base_jll", "Zlib_jll", "libpng_jll"] -git-tree-sha1 = "182c478a179b267dd7a741b6f8f4c3e0803795d6" -uuid = "d2c73de3-f751-5644-a686-071e5b155ba9" -version = "0.73.6+0" - -[[deps.GenericSchur]] -deps = ["LinearAlgebra", "Printf"] -git-tree-sha1 = "af49a0851f8113fcfae2ef5027c6d49d0acec39b" -uuid = "c145ed77-6b09-5dd9-b285-bf645a82121e" -version = "0.5.4" - -[[deps.Gettext_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"] -git-tree-sha1 = "9b02998aba7bf074d14de89f9d37ca24a1a0b046" -uuid = "78b55507-aeef-58d4-861c-77aaff3498b1" -version = "0.21.0+0" - -[[deps.Glib_jll]] -deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE2_jll", "Zlib_jll"] -git-tree-sha1 = "7c82e6a6cd34e9d935e9aa4051b66c6ff3af59ba" -uuid = "7746bdde-850d-59dc-9ae8-88ece973131d" -version = "2.80.2+0" - -[[deps.Glob]] -git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496" -uuid = "c27321d9-0574-5035-807b-f59d2c89b15c" -version = "1.3.1" - -[[deps.Graphite2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "344bf40dcab1073aca04aa0df4fb092f920e4011" -uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472" -version = "1.3.14+0" - -[[deps.Graphs]] -deps = ["ArnoldiMethod", "Compat", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] -git-tree-sha1 = "334d300809ae0a68ceee3444c6e99ded412bf0b3" -uuid = "86223c79-3864-5bf0-83f7-82e725a168b6" -version = "1.11.1" - -[[deps.Grisu]] -git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2" -uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe" -version = "1.0.2" - -[[deps.HDF5]] -deps = ["Compat", "HDF5_jll", "Libdl", "MPIPreferences", "Mmap", "Preferences", "Printf", "Random", "Requires", "UUIDs"] -git-tree-sha1 = "e856eef26cf5bf2b0f95f8f4fc37553c72c8641c" -uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" -version = "0.17.2" - - [deps.HDF5.extensions] - MPIExt = "MPI" - - [deps.HDF5.weakdeps] - MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" - -[[deps.HDF5_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "LibCURL_jll", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "OpenSSL_jll", "TOML", "Zlib_jll", "libaec_jll"] -git-tree-sha1 = "82a471768b513dc39e471540fdadc84ff80ff997" -uuid = "0234f1f7-429e-5d53-9886-15a909be8d59" -version = "1.14.3+3" - -[[deps.HTTP]] -deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] -git-tree-sha1 = "d1d712be3164d61d1fb98e7ce9bcbc6cc06b45ed" -uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" -version = "1.10.8" - -[[deps.HarfBuzz_jll]] -deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "Graphite2_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg"] -git-tree-sha1 = "129acf094d168394e80ee1dc4bc06ec835e510a3" -uuid = "2e76f6c2-a576-52d4-95c1-20adfe4de566" -version = "2.8.1+1" - -[[deps.Hiccup]] -deps = ["MacroTools", "Test"] -git-tree-sha1 = "6187bb2d5fcbb2007c39e7ac53308b0d371124bd" -uuid = "9fb69e20-1954-56bb-a84f-559cc56a8ff7" -version = "0.2.2" - -[[deps.HostCPUFeatures]] -deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"] -git-tree-sha1 = "eb8fed28f4994600e29beef49744639d985a04b2" -uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" -version = "0.1.16" - -[[deps.Hwloc_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "1d334207121865ac8c1c97eb7f42d0339e4635bf" -uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" -version = "2.11.0+0" - -[[deps.HypergeometricFunctions]] -deps = ["DualNumbers", "LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"] -git-tree-sha1 = "f218fe3736ddf977e0e772bc9a586b2383da2685" -uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a" -version = "0.3.23" - -[[deps.Hyperscript]] -deps = ["Test"] -git-tree-sha1 = "179267cfa5e712760cd43dcae385d7ea90cc25a4" -uuid = "47d2ed2b-36de-50cf-bf87-49c2cf4b8b91" -version = "0.0.5" - -[[deps.HypertextLiteral]] -deps = ["Tricks"] -git-tree-sha1 = "7134810b1afce04bbc1045ca1985fbe81ce17653" -uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" -version = "0.9.5" - -[[deps.IOCapture]] -deps = ["Logging", "Random"] -git-tree-sha1 = "b6d6bfdd7ce25b0f9b2f6b3dd56b2673a66c8770" -uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" -version = "0.2.5" - -[[deps.IfElse]] -git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" -uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" -version = "0.1.1" - -[[deps.Inflate]] -git-tree-sha1 = "d1b1b796e47d94588b3757fe84fbf65a5ec4a80d" -uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" -version = "0.1.5" - -[[deps.IntelOpenMP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "be50fe8df3acbffa0274a744f1a99d29c45a57f4" -uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0" -version = "2024.1.0+0" - -[[deps.InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[deps.Interpolations]] -deps = ["Adapt", "AxisAlgorithms", "ChainRulesCore", "LinearAlgebra", "OffsetArrays", "Random", "Ratios", "Requires", "SharedArrays", "SparseArrays", "StaticArrays", "WoodburyMatrices"] -git-tree-sha1 = "88a101217d7cb38a7b481ccd50d21876e1d1b0e0" -uuid = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" -version = "0.15.1" -weakdeps = ["Unitful"] - - [deps.Interpolations.extensions] - InterpolationsUnitfulExt = "Unitful" - -[[deps.InverseFunctions]] -deps = ["Test"] -git-tree-sha1 = "e7cbed5032c4c397a6ac23d1493f3289e01231c4" -uuid = "3587e190-3f89-42d0-90ee-14403ec27112" -version = "0.1.14" -weakdeps = ["Dates"] - - [deps.InverseFunctions.extensions] - DatesExt = "Dates" - -[[deps.IrrationalConstants]] -git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" -uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" -version = "0.2.2" - -[[deps.IteratorInterfaceExtensions]] -git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" -uuid = "82899510-4779-5014-852e-03e436cf321d" -version = "1.0.0" - -[[deps.JLFzf]] -deps = ["Pipe", "REPL", "Random", "fzf_jll"] -git-tree-sha1 = "a53ebe394b71470c7f97c2e7e170d51df21b17af" -uuid = "1019f520-868f-41f5-a6de-eb00f4b6a39c" -version = "0.1.7" - -[[deps.JLLWrappers]] -deps = ["Artifacts", "Preferences"] -git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" -uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.5.0" - -[[deps.JSExpr]] -deps = ["JSON", "MacroTools", "Observables", "WebIO"] -git-tree-sha1 = "b413a73785b98474d8af24fd4c8a975e31df3658" -uuid = "97c1335a-c9c5-57fe-bc5d-ec35cebe8660" -version = "0.5.4" - -[[deps.JSON]] -deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" -uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.4" - -[[deps.JpegTurbo_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "c84a835e1a09b289ffcd2271bf2a337bbdda6637" -uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" -version = "3.0.3+0" - -[[deps.JumpProcesses]] -deps = ["ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "FunctionWrappers", "Graphs", "LinearAlgebra", "Markdown", "PoissonRandom", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "SciMLBase", "StaticArrays", "SymbolicIndexingInterface", "UnPack"] -git-tree-sha1 = "ed08d89318be7d625613f3c435d1f6678fba4850" -uuid = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5" -version = "9.11.1" -weakdeps = ["FastBroadcast"] - - [deps.JumpProcesses.extensions] - JumpProcessFastBroadcastExt = "FastBroadcast" - -[[deps.KLU]] -deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"] -git-tree-sha1 = "07649c499349dad9f08dde4243a4c597064663e9" -uuid = "ef3ab10e-7fda-4108-b977-705223b18434" -version = "0.6.0" - -[[deps.Kaleido_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "43032da5832754f58d14a91ffbe86d5f176acda9" -uuid = "f7e6163d-2fa5-5f23-b69c-1db539e41963" -version = "0.2.1+0" - -[[deps.Krylov]] -deps = ["LinearAlgebra", "Printf", "SparseArrays"] -git-tree-sha1 = "267dad6b4b7b5d529c76d40ff48d33f7e94cb834" -uuid = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" -version = "0.9.6" - -[[deps.LAME_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "170b660facf5df5de098d866564877e119141cbd" -uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d" -version = "3.100.2+0" - -[[deps.LERC_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "bf36f528eec6634efc60d7ec062008f171071434" -uuid = "88015f11-f218-50d7-93a8-a6af411a945d" -version = "3.0.0+1" - -[[deps.LLVMOpenMP_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "d986ce2d884d49126836ea94ed5bfb0f12679713" -uuid = "1d63c593-3942-5779-bab2-d838dc0a180e" -version = "15.0.7+0" - -[[deps.LZO_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "70c5da094887fd2cae843b8db33920bac4b6f07d" -uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" -version = "2.10.2+0" - -[[deps.LaTeXStrings]] -git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec" -uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" -version = "1.3.1" - -[[deps.Latexify]] -deps = ["Format", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "OrderedCollections", "Requires"] -git-tree-sha1 = "e0b5cd21dc1b44ec6e64f351976f961e6f31d6c4" -uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" -version = "0.16.3" - - [deps.Latexify.extensions] - DataFramesExt = "DataFrames" - SymEngineExt = "SymEngine" - - [deps.Latexify.weakdeps] - DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" - SymEngine = "123dc426-2d89-5057-bbad-38513e3affd8" - -[[deps.LayoutPointers]] -deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] -git-tree-sha1 = "62edfee3211981241b57ff1cedf4d74d79519277" -uuid = "10f19ff3-798f-405d-979b-55457f8fc047" -version = "0.1.15" - -[[deps.Lazy]] -deps = ["MacroTools"] -git-tree-sha1 = "1370f8202dac30758f3c345f9909b97f53d87d3f" -uuid = "50d2b5c4-7a5e-59d5-8109-a42b560f39c0" -version = "0.15.1" - -[[deps.LazyArrays]] -deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "MacroTools", "SparseArrays"] -git-tree-sha1 = "899d44fa1a575653df5721a7fccb4988f7f09b62" -uuid = "5078a376-72f3-5289-bfd5-ec5146d43c02" -version = "2.0.4" - - [deps.LazyArrays.extensions] - LazyArraysBandedMatricesExt = "BandedMatrices" - LazyArraysBlockArraysExt = "BlockArrays" - LazyArraysBlockBandedMatricesExt = "BlockBandedMatrices" - LazyArraysStaticArraysExt = "StaticArrays" - - [deps.LazyArrays.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e" - BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" - StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" - -[[deps.LazyArtifacts]] -deps = ["Artifacts", "Pkg"] -uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" - -[[deps.LevyArea]] -deps = ["LinearAlgebra", "Random", "SpecialFunctions"] -git-tree-sha1 = "56513a09b8e0ae6485f34401ea9e2f31357958ec" -uuid = "2d8b4e74-eb68-11e8-0fb9-d5eb67b50637" -version = "1.0.0" - -[[deps.LibCURL]] -deps = ["LibCURL_jll", "MozillaCACerts_jll"] -uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" -version = "0.6.4" - -[[deps.LibCURL_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] -uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "8.4.0+0" - -[[deps.LibGit2]] -deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[deps.LibGit2_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] -uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" -version = "1.6.4+0" - -[[deps.LibSSH2_jll]] -deps = ["Artifacts", "Libdl", "MbedTLS_jll"] -uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" -version = "1.11.0+1" - -[[deps.Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[deps.Libffi_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "0b4a5d71f3e5200a7dff793393e09dfc2d874290" -uuid = "e9f186c6-92d2-5b65-8a66-fee21dc1b490" -version = "3.2.2+1" - -[[deps.Libgcrypt_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgpg_error_jll"] -git-tree-sha1 = "9fd170c4bbfd8b935fdc5f8b7aa33532c991a673" -uuid = "d4300ac3-e22c-5743-9152-c294e39db1e4" -version = "1.8.11+0" - -[[deps.Libglvnd_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll", "Xorg_libXext_jll"] -git-tree-sha1 = "6f73d1dd803986947b2c750138528a999a6c7733" -uuid = "7e76a0d4-f3c7-5321-8279-8d96eeed0f29" -version = "1.6.0+0" - -[[deps.Libgpg_error_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "fbb1f2bef882392312feb1ede3615ddc1e9b99ed" -uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8" -version = "1.49.0+0" - -[[deps.Libiconv_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" -uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" -version = "1.17.0+0" - -[[deps.Libmount_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "0c4f9c4f1a50d8f35048fa0532dabbadf702f81e" -uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9" -version = "2.40.1+0" - -[[deps.Libtiff_jll]] -deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "LERC_jll", "Libdl", "XZ_jll", "Zlib_jll", "Zstd_jll"] -git-tree-sha1 = "2da088d113af58221c52828a80378e16be7d037a" -uuid = "89763e89-9b03-5906-acba-b20f662cd828" -version = "4.5.1+1" - -[[deps.Libuuid_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "5ee6203157c120d79034c748a2acba45b82b8807" -uuid = "38a345b3-de98-5d2b-a5d3-14cd9215e700" -version = "2.40.1+0" - -[[deps.LineSearches]] -deps = ["LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "Printf"] -git-tree-sha1 = "7bbea35cec17305fc70a0e5b4641477dc0789d9d" -uuid = "d3d80556-e9d4-5f37-9878-2ab0fcc64255" -version = "7.2.0" - -[[deps.LinearAlgebra]] -deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - -[[deps.LinearSolve]] -deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "DocStringExtensions", "EnumX", "FastLapackInterface", "GPUArraysCore", "InteractiveUtils", "KLU", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveFactorization", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Sparspak", "StaticArraysCore", "UnPack"] -git-tree-sha1 = "7648cc20100504f4b453917aacc8520e9c0ecfb3" -uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" -version = "2.30.1" - - [deps.LinearSolve.extensions] - LinearSolveBandedMatricesExt = "BandedMatrices" - LinearSolveBlockDiagonalsExt = "BlockDiagonals" - LinearSolveCUDAExt = "CUDA" - LinearSolveCUDSSExt = "CUDSS" - LinearSolveEnzymeExt = ["Enzyme", "EnzymeCore"] - LinearSolveFastAlmostBandedMatricesExt = ["FastAlmostBandedMatrices"] - LinearSolveHYPREExt = "HYPRE" - LinearSolveIterativeSolversExt = "IterativeSolvers" - LinearSolveKernelAbstractionsExt = "KernelAbstractions" - LinearSolveKrylovKitExt = "KrylovKit" - LinearSolveMetalExt = "Metal" - LinearSolvePardisoExt = "Pardiso" - LinearSolveRecursiveArrayToolsExt = "RecursiveArrayTools" - - [deps.LinearSolve.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockDiagonals = "0a1fb500-61f7-11e9-3c65-f5ef3456f9f0" - CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" - CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" - Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" - EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" - FastAlmostBandedMatrices = "9d29842c-ecb8-4973-b1e9-a27b1157504e" - HYPRE = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771" - IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153" - KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" - KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" - Metal = "dde4c033-4e86-420c-a63e-0dd931031962" - Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2" - RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" - -[[deps.LogExpFunctions]] -deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "a2d09619db4e765091ee5c6ffe8872849de0feea" -uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.28" - - [deps.LogExpFunctions.extensions] - LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" - LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" - LogExpFunctionsInverseFunctionsExt = "InverseFunctions" - - [deps.LogExpFunctions.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" - InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" - -[[deps.Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[deps.LoggingExtras]] -deps = ["Dates", "Logging"] -git-tree-sha1 = "c1dd6d7978c12545b4179fb6153b9250c96b0075" -uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" -version = "1.0.3" - -[[deps.LoopVectorization]] -deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"] -git-tree-sha1 = "8f6786d8b2b3248d79db3ad359ce95382d5a6df8" -uuid = "bdcacae8-1622-11e9-2a5c-532679323890" -version = "0.12.170" -weakdeps = ["ChainRulesCore", "ForwardDiff", "SpecialFunctions"] - - [deps.LoopVectorization.extensions] - ForwardDiffExt = ["ChainRulesCore", "ForwardDiff"] - SpecialFunctionsExt = "SpecialFunctions" - -[[deps.MAT]] -deps = ["BufferedStreams", "CodecZlib", "HDF5", "SparseArrays"] -git-tree-sha1 = "1d2dd9b186742b0f317f2530ddcbf00eebb18e96" -uuid = "23992714-dd62-5051-b70f-ba57cb901cac" -version = "0.10.7" - -[[deps.MIMEs]] -git-tree-sha1 = "65f28ad4b594aebe22157d6fac869786a255b7eb" -uuid = "6c6e2e6c-3030-632d-7369-2d6c69616d65" -version = "0.1.4" - -[[deps.MKL_jll]] -deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "oneTBB_jll"] -git-tree-sha1 = "80b2833b56d466b3858d565adcd16a4a05f2089b" -uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7" -version = "2024.1.0+0" - -[[deps.MPICH_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "4099bb6809ac109bfc17d521dad33763bcf026b7" -uuid = "7cb0a576-ebde-5e09-9194-50597f1243b4" -version = "4.2.1+1" - -[[deps.MPIPreferences]] -deps = ["Libdl", "Preferences"] -git-tree-sha1 = "c105fe467859e7f6e9a852cb15cb4301126fac07" -uuid = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" -version = "0.1.11" - -[[deps.MPItrampoline_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "8c35d5420193841b2f367e658540e8d9e0601ed0" -uuid = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748" -version = "5.4.0+0" - -[[deps.MacroTools]] -deps = ["Markdown", "Random"] -git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df" -uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.13" - -[[deps.ManualMemory]] -git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd" -uuid = "d125e4d3-2237-4719-b19c-fa641b8a4667" -version = "0.1.8" - -[[deps.Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[deps.MatrixFactorizations]] -deps = ["ArrayLayouts", "LinearAlgebra", "Printf", "Random"] -git-tree-sha1 = "07c98fdf57c9b45b987cf250c4bdc7200fa39eb2" -uuid = "a3b82374-2e81-5b9e-98ce-41277c0e4c87" -version = "3.0.0" -weakdeps = ["BandedMatrices"] - - [deps.MatrixFactorizations.extensions] - MatrixFactorizationsBandedMatricesExt = "BandedMatrices" - -[[deps.MaybeInplace]] -deps = ["ArrayInterface", "LinearAlgebra", "MacroTools", "SparseArrays"] -git-tree-sha1 = "1b9e613f2ca3b6cdcbfe36381e17ca2b66d4b3a1" -uuid = "bb5d69b7-63fc-4a16-80bd-7e42200c7bdb" -version = "0.1.3" - -[[deps.MbedTLS]] -deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"] -git-tree-sha1 = "c067a280ddc25f196b5e7df3877c6b226d390aaf" -uuid = "739be429-bea8-5141-9913-cc70e7f3736d" -version = "1.1.9" - -[[deps.MbedTLS_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.28.2+1" - -[[deps.Measures]] -git-tree-sha1 = "c13304c81eec1ed3af7fc20e75fb6b26092a1102" -uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e" -version = "0.3.2" - -[[deps.MicrosoftMPI_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f12a29c4400ba812841c6ace3f4efbb6dbb3ba01" -uuid = "9237b28f-5490-5468-be7b-bb81f5f5e6cf" -version = "10.1.4+2" - -[[deps.Missings]] -deps = ["DataAPI"] -git-tree-sha1 = "ec4f7fbeab05d7747bdf98eb74d130a2a2ed298d" -uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" -version = "1.2.0" - -[[deps.Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[deps.MozillaCACerts_jll]] -uuid = "14a3606d-f60d-562e-9121-12d972cd8159" -version = "2023.1.10" - -[[deps.MuladdMacro]] -git-tree-sha1 = "cac9cc5499c25554cba55cd3c30543cff5ca4fab" -uuid = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221" -version = "0.2.4" - -[[deps.Mustache]] -deps = ["Printf", "Tables"] -git-tree-sha1 = "a7cefa21a2ff993bff0456bf7521f46fc077ddf1" -uuid = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70" -version = "1.0.19" - -[[deps.Mux]] -deps = ["AssetRegistry", "Base64", "HTTP", "Hiccup", "MbedTLS", "Pkg", "Sockets"] -git-tree-sha1 = "7295d849103ac4fcbe3b2e439f229c5cc77b9b69" -uuid = "a975b10e-0019-58db-a62f-e48ff68538c9" -version = "1.0.2" - -[[deps.NLSolversBase]] -deps = ["DiffResults", "Distributed", "FiniteDiff", "ForwardDiff"] -git-tree-sha1 = "a0b464d183da839699f4c79e7606d9d186ec172c" -uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" -version = "7.8.3" - -[[deps.NLsolve]] -deps = ["Distances", "LineSearches", "LinearAlgebra", "NLSolversBase", "Printf", "Reexport"] -git-tree-sha1 = "019f12e9a1a7880459d0173c182e6a99365d7ac1" -uuid = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" -version = "4.5.1" - -[[deps.NaNMath]] -deps = ["OpenLibm_jll"] -git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" -uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" -version = "1.0.2" - -[[deps.NetworkOptions]] -uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" -version = "1.2.0" - -[[deps.NonlinearSolve]] -deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "FastBroadcast", "FastClosures", "FiniteDiff", "ForwardDiff", "LazyArrays", "LineSearches", "LinearAlgebra", "LinearSolve", "MaybeInplace", "PrecompileTools", "Preferences", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SparseArrays", "SparseDiffTools", "StaticArraysCore", "SymbolicIndexingInterface", "TimerOutputs"] -git-tree-sha1 = "40325dcea1cb84a108efe05966bbb1f4b98e5eea" -uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" -version = "3.13.0" - - [deps.NonlinearSolve.extensions] - NonlinearSolveBandedMatricesExt = "BandedMatrices" - NonlinearSolveFastLevenbergMarquardtExt = "FastLevenbergMarquardt" - NonlinearSolveFixedPointAccelerationExt = "FixedPointAcceleration" - NonlinearSolveLeastSquaresOptimExt = "LeastSquaresOptim" - NonlinearSolveMINPACKExt = "MINPACK" - NonlinearSolveNLSolversExt = "NLSolvers" - NonlinearSolveNLsolveExt = "NLsolve" - NonlinearSolveSIAMFANLEquationsExt = "SIAMFANLEquations" - NonlinearSolveSpeedMappingExt = "SpeedMapping" - NonlinearSolveSymbolicsExt = "Symbolics" - NonlinearSolveZygoteExt = "Zygote" - - [deps.NonlinearSolve.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - FastLevenbergMarquardt = "7a0df574-e128-4d35-8cbd-3d84502bf7ce" - FixedPointAcceleration = "817d07cb-a79a-5c30-9a31-890123675176" - LeastSquaresOptim = "0fc2ff8b-aaa3-5acd-a817-1944a5e08891" - MINPACK = "4854310b-de5a-5eb6-a2a5-c1dee2bd17f9" - NLSolvers = "337daf1e-9722-11e9-073e-8b9effe078ba" - NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" - SIAMFANLEquations = "084e46ad-d928-497d-ad5e-07fa361a48c4" - SpeedMapping = "f1835b91-879b-4a3f-a438-e4baacf14412" - Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" - Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" - -[[deps.Observables]] -git-tree-sha1 = "7438a59546cf62428fc9d1bc94729146d37a7225" -uuid = "510215fc-4207-5dde-b226-833fc4488ee2" -version = "0.5.5" - -[[deps.OffsetArrays]] -git-tree-sha1 = "e64b4f5ea6b7389f6f046d13d4896a8f9c1ba71e" -uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.14.0" -weakdeps = ["Adapt"] - - [deps.OffsetArrays.extensions] - OffsetArraysAdaptExt = "Adapt" - -[[deps.Ogg_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "887579a3eb005446d514ab7aeac5d1d027658b8f" -uuid = "e7412a2a-1a6e-54c0-be00-318e2571c051" -version = "1.3.5+1" - -[[deps.OpenBLAS_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] -uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.23+4" - -[[deps.OpenLibm_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "05823500-19ac-5b8b-9628-191a04bc5112" -version = "0.8.1+2" - -[[deps.OpenMPI_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "e25c1778a98e34219a00455d6e4384e017ea9762" -uuid = "fe0851c0-eecd-5654-98d4-656369965a5c" -version = "4.1.6+0" - -[[deps.OpenSSL]] -deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] -git-tree-sha1 = "38cb508d080d21dc1128f7fb04f20387ed4c0af4" -uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" -version = "1.4.3" - -[[deps.OpenSSL_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "a028ee3cb5641cccc4c24e90c36b0a4f7707bdf5" -uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "3.0.14+0" - -[[deps.OpenSpecFun_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" -uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.5+0" - -[[deps.Optim]] -deps = ["Compat", "FillArrays", "ForwardDiff", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"] -git-tree-sha1 = "d9b79c4eed437421ac4285148fcadf42e0700e89" -uuid = "429524aa-4258-5aef-a3af-852621145aeb" -version = "1.9.4" - - [deps.Optim.extensions] - OptimMOIExt = "MathOptInterface" - - [deps.Optim.weakdeps] - MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" - -[[deps.Opus_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "51a08fb14ec28da2ec7a927c4337e4332c2a4720" -uuid = "91d4177d-7536-5919-b921-800302f37372" -version = "1.3.2+0" - -[[deps.OrderedCollections]] -git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" -uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.6.3" - -[[deps.OrdinaryDiffEq]] -deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "ExponentialUtilities", "FastBroadcast", "FastClosures", "FillArrays", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "IfElse", "InteractiveUtils", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "MacroTools", "MuladdMacro", "NonlinearSolve", "Polyester", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleNonlinearSolve", "SimpleUnPack", "SparseArrays", "SparseDiffTools", "StaticArrayInterface", "StaticArrays", "TruncatedStacktraces"] -git-tree-sha1 = "a6a006cbf1e563035c0e32b63234e039b599f6b2" -uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" -version = "6.83.2" - -[[deps.PCRE2_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "efcefdf7-47ab-520b-bdef-62a2eaa19f15" -version = "10.42.0+1" - -[[deps.PDMats]] -deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "949347156c25054de2db3b166c52ac4728cbad65" -uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" -version = "0.11.31" - -[[deps.PackageExtensionCompat]] -git-tree-sha1 = "fb28e33b8a95c4cee25ce296c817d89cc2e53518" -uuid = "65ce6f38-6b18-4e1d-a461-8949797d7930" -version = "1.0.2" -weakdeps = ["Requires", "TOML"] - -[[deps.Parameters]] -deps = ["OrderedCollections", "UnPack"] -git-tree-sha1 = "34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe" -uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" -version = "0.12.3" - -[[deps.Parsers]] -deps = ["Dates", "PrecompileTools", "UUIDs"] -git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" -uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.8.1" - -[[deps.Pidfile]] -deps = ["FileWatching", "Test"] -git-tree-sha1 = "2d8aaf8ee10df53d0dfb9b8ee44ae7c04ced2b03" -uuid = "fa939f87-e72e-5be4-a000-7fc836dbe307" -version = "1.3.0" - -[[deps.Pipe]] -git-tree-sha1 = "6842804e7867b115ca9de748a0cf6b364523c16d" -uuid = "b98c9c47-44ae-5843-9183-064241ee97a0" -version = "1.3.0" - -[[deps.Pixman_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl"] -git-tree-sha1 = "35621f10a7531bc8fa58f74610b1bfb70a3cfc6b" -uuid = "30392449-352a-5448-841d-b1acce4e97dc" -version = "0.43.4+0" - -[[deps.Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.10.0" - -[[deps.PlotThemes]] -deps = ["PlotUtils", "Statistics"] -git-tree-sha1 = "6e55c6841ce3411ccb3457ee52fc48cb698d6fb0" -uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a" -version = "3.2.0" - -[[deps.PlotUtils]] -deps = ["ColorSchemes", "Colors", "Dates", "PrecompileTools", "Printf", "Random", "Reexport", "Statistics"] -git-tree-sha1 = "7b1a9df27f072ac4c9c7cbe5efb198489258d1f5" -uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043" -version = "1.4.1" - -[[deps.PlotlyBase]] -deps = ["ColorSchemes", "Dates", "DelimitedFiles", "DocStringExtensions", "JSON", "LaTeXStrings", "Logging", "Parameters", "Pkg", "REPL", "Requires", "Statistics", "UUIDs"] -git-tree-sha1 = "56baf69781fc5e61607c3e46227ab17f7040ffa2" -uuid = "a03496cd-edff-5a9b-9e67-9cda94a718b5" -version = "0.8.19" - -[[deps.PlotlyJS]] -deps = ["Base64", "Blink", "DelimitedFiles", "JSExpr", "JSON", "Kaleido_jll", "Markdown", "Pkg", "PlotlyBase", "PlotlyKaleido", "REPL", "Reexport", "Requires", "WebIO"] -git-tree-sha1 = "e62d886d33b81c371c9d4e2f70663c0637f19459" -uuid = "f0f68f2c-4968-5e81-91da-67840de0976a" -version = "0.18.13" - - [deps.PlotlyJS.extensions] - CSVExt = "CSV" - DataFramesExt = ["DataFrames", "CSV"] - IJuliaExt = "IJulia" - JSON3Ext = "JSON3" - - [deps.PlotlyJS.weakdeps] - CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" - DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" - IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" - JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" - -[[deps.PlotlyKaleido]] -deps = ["Base64", "JSON", "Kaleido_jll"] -git-tree-sha1 = "2650cd8fb83f73394996d507b3411a7316f6f184" -uuid = "f2990250-8cf9-495f-b13a-cce12b45703c" -version = "2.2.4" - -[[deps.Plots]] -deps = ["Base64", "Contour", "Dates", "Downloads", "FFMPEG", "FixedPointNumbers", "GR", "JLFzf", "JSON", "LaTeXStrings", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "Pkg", "PlotThemes", "PlotUtils", "PrecompileTools", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "RelocatableFolders", "Requires", "Scratch", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs", "UnicodeFun", "UnitfulLatexify", "Unzip"] -git-tree-sha1 = "442e1e7ac27dd5ff8825c3fa62fbd1e86397974b" -uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -version = "1.40.4" - - [deps.Plots.extensions] - FileIOExt = "FileIO" - GeometryBasicsExt = "GeometryBasics" - IJuliaExt = "IJulia" - ImageInTerminalExt = "ImageInTerminal" - UnitfulExt = "Unitful" - - [deps.Plots.weakdeps] - FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" - GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326" - IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" - ImageInTerminal = "d8c32880-2388-543b-8c61-d9f865259254" - Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" - -[[deps.PlutoUI]] -deps = ["AbstractPlutoDingetjes", "Base64", "ColorTypes", "Dates", "FixedPointNumbers", "Hyperscript", "HypertextLiteral", "IOCapture", "InteractiveUtils", "JSON", "Logging", "MIMEs", "Markdown", "Random", "Reexport", "URIs", "UUIDs"] -git-tree-sha1 = "ab55ee1510ad2af0ff674dbcced5e94921f867a9" -uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8" -version = "0.7.59" - -[[deps.PoissonRandom]] -deps = ["Random"] -git-tree-sha1 = "a0f1159c33f846aa77c3f30ebbc69795e5327152" -uuid = "e409e4f3-bfea-5376-8464-e040bb5c01ab" -version = "0.4.4" - -[[deps.Polyester]] -deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Requires", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"] -git-tree-sha1 = "b3e2bae88cf07baf0a051fe09666b8ef97aefe93" -uuid = "f517fe37-dbe3-4b94-8317-1923a5111588" -version = "0.7.14" - -[[deps.PolyesterWeave]] -deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"] -git-tree-sha1 = "240d7170f5ffdb285f9427b92333c3463bf65bf6" -uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" -version = "0.2.1" - -[[deps.PositiveFactorizations]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "17275485f373e6673f7e7f97051f703ed5b15b20" -uuid = "85a6dd25-e78a-55b7-8502-1745935b8125" -version = "0.2.4" - -[[deps.PreallocationTools]] -deps = ["Adapt", "ArrayInterface", "ForwardDiff"] -git-tree-sha1 = "406c29a7f46706d379a3bce45671b4e3a39ddfbc" -uuid = "d236fae5-4411-538c-8e31-a6e3d9e00b46" -version = "0.4.22" - - [deps.PreallocationTools.extensions] - PreallocationToolsReverseDiffExt = "ReverseDiff" - - [deps.PreallocationTools.weakdeps] - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - -[[deps.PrecompileTools]] -deps = ["Preferences"] -git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" -uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.2.1" - -[[deps.Preferences]] -deps = ["TOML"] -git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" -uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.4.3" - -[[deps.Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[deps.ProgressMeter]] -deps = ["Distributed", "Printf"] -git-tree-sha1 = "00099623ffee15972c16111bcf84c58a0051257c" -uuid = "92933f4c-e287-5a05-a399-4b506db050ca" -version = "1.9.0" - -[[deps.PtrArrays]] -git-tree-sha1 = "f011fbb92c4d401059b2212c05c0601b70f8b759" -uuid = "43287f4e-b6f4-7ad1-bb20-aadabca52c3d" -version = "1.2.0" - -[[deps.Qt6Base_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Vulkan_Loader_jll", "Xorg_libSM_jll", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_cursor_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "libinput_jll", "xkbcommon_jll"] -git-tree-sha1 = "492601870742dcd38f233b23c3ec629628c1d724" -uuid = "c0090381-4147-56d7-9ebc-da0b1113ec56" -version = "6.7.1+1" - -[[deps.QuadGK]] -deps = ["DataStructures", "LinearAlgebra"] -git-tree-sha1 = "9b23c31e76e333e6fb4c1595ae6afa74966a729e" -uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" -version = "2.9.4" - -[[deps.REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[deps.Random]] -deps = ["SHA"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[deps.Random123]] -deps = ["Random", "RandomNumbers"] -git-tree-sha1 = "4743b43e5a9c4a2ede372de7061eed81795b12e7" -uuid = "74087812-796a-5b5d-8853-05524746bad3" -version = "1.7.0" - -[[deps.RandomNumbers]] -deps = ["Random", "Requires"] -git-tree-sha1 = "043da614cc7e95c703498a491e2c21f58a2b8111" -uuid = "e6cf234a-135c-5ec9-84dd-332b85af5143" -version = "1.5.3" - -[[deps.Ratios]] -deps = ["Requires"] -git-tree-sha1 = "1342a47bf3260ee108163042310d26f2be5ec90b" -uuid = "c84ed2f1-dad5-54f0-aa8e-dbefe2724439" -version = "0.4.5" -weakdeps = ["FixedPointNumbers"] - - [deps.Ratios.extensions] - RatiosFixedPointNumbersExt = "FixedPointNumbers" - -[[deps.RecipesBase]] -deps = ["PrecompileTools"] -git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" -uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -version = "1.3.4" - -[[deps.RecipesPipeline]] -deps = ["Dates", "NaNMath", "PlotUtils", "PrecompileTools", "RecipesBase"] -git-tree-sha1 = "45cf9fd0ca5839d06ef333c8201714e888486342" -uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c" -version = "0.6.12" - -[[deps.RecursiveArrayTools]] -deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "SparseArrays", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] -git-tree-sha1 = "3400ce27995422fb88ffcd3af9945565aad947f0" -uuid = "731186ca-8d62-57ce-b412-fbd966d074cd" -version = "3.23.1" - - [deps.RecursiveArrayTools.extensions] - RecursiveArrayToolsFastBroadcastExt = "FastBroadcast" - RecursiveArrayToolsForwardDiffExt = "ForwardDiff" - RecursiveArrayToolsMeasurementsExt = "Measurements" - RecursiveArrayToolsMonteCarloMeasurementsExt = "MonteCarloMeasurements" - RecursiveArrayToolsReverseDiffExt = ["ReverseDiff", "Zygote"] - RecursiveArrayToolsTrackerExt = "Tracker" - RecursiveArrayToolsZygoteExt = "Zygote" - - [deps.RecursiveArrayTools.weakdeps] - FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898" - ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" - Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" - MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" - -[[deps.RecursiveFactorization]] -deps = ["LinearAlgebra", "LoopVectorization", "Polyester", "PrecompileTools", "StrideArraysCore", "TriangularSolve"] -git-tree-sha1 = "6db1a75507051bc18bfa131fbc7c3f169cc4b2f6" -uuid = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" -version = "0.2.23" - -[[deps.Reexport]] -git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" -uuid = "189a3867-3050-52da-a836-e630ba90ab69" -version = "1.2.2" - -[[deps.RelocatableFolders]] -deps = ["SHA", "Scratch"] -git-tree-sha1 = "ffdaf70d81cf6ff22c2b6e733c900c3321cab864" -uuid = "05181044-ff0b-4ac5-8273-598c1e38db00" -version = "1.0.1" - -[[deps.Requires]] -deps = ["UUIDs"] -git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" -uuid = "ae029012-a4dd-5104-9daa-d747884805df" -version = "1.3.0" - -[[deps.ResettableStacks]] -deps = ["StaticArrays"] -git-tree-sha1 = "256eeeec186fa7f26f2801732774ccf277f05db9" -uuid = "ae5879a3-cd67-5da8-be7f-38c6eb64a37b" -version = "1.1.1" - -[[deps.Rmath]] -deps = ["Random", "Rmath_jll"] -git-tree-sha1 = "f65dcb5fa46aee0cf9ed6274ccbd597adc49aa7b" -uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" -version = "0.7.1" - -[[deps.Rmath_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "d483cd324ce5cf5d61b77930f0bbd6cb61927d21" -uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" -version = "0.4.2+0" - -[[deps.RuntimeGeneratedFunctions]] -deps = ["ExprTools", "SHA", "Serialization"] -git-tree-sha1 = "04c968137612c4a5629fa531334bb81ad5680f00" -uuid = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" -version = "0.5.13" - -[[deps.SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" -version = "0.7.0" - -[[deps.SIMDTypes]] -git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c" -uuid = "94e857df-77ce-4151-89e5-788b33177be4" -version = "0.1.0" - -[[deps.SLEEFPirates]] -deps = ["IfElse", "Static", "VectorizationBase"] -git-tree-sha1 = "3aac6d68c5e57449f5b9b865c9ba50ac2970c4cf" -uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" -version = "0.6.42" - -[[deps.SciMLBase]] -deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] -git-tree-sha1 = "7a6c5c8c38d2e37f45d4686c3598c20c1aebf48e" -uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "2.41.3" - - [deps.SciMLBase.extensions] - SciMLBaseChainRulesCoreExt = "ChainRulesCore" - SciMLBaseMakieExt = "Makie" - SciMLBasePartialFunctionsExt = "PartialFunctions" - SciMLBasePyCallExt = "PyCall" - SciMLBasePythonCallExt = "PythonCall" - SciMLBaseRCallExt = "RCall" - SciMLBaseZygoteExt = "Zygote" - - [deps.SciMLBase.weakdeps] - ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" - PartialFunctions = "570af359-4316-4cb7-8c74-252c00c2016b" - PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" - PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d" - RCall = "6f49c342-dc21-5d91-9882-a32aef131414" - Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" - -[[deps.SciMLOperators]] -deps = ["ArrayInterface", "DocStringExtensions", "LinearAlgebra", "MacroTools", "Setfield", "SparseArrays", "StaticArraysCore"] -git-tree-sha1 = "10499f619ef6e890f3f4a38914481cc868689cd5" -uuid = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" -version = "0.3.8" - -[[deps.SciMLStructures]] -deps = ["ArrayInterface"] -git-tree-sha1 = "6ab4beaf88dcdd2639bead916f2347f81dcacd0e" -uuid = "53ae85a6-f571-4167-b2af-e1d143709226" -version = "1.3.0" - -[[deps.Scratch]] -deps = ["Dates"] -git-tree-sha1 = "3bac05bc7e74a75fd9cba4295cde4045d9fe2386" -uuid = "6c6a2e73-6563-6170-7368-637461726353" -version = "1.2.1" - -[[deps.Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[deps.Setfield]] -deps = ["ConstructionBase", "Future", "MacroTools", "StaticArraysCore"] -git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" -uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" -version = "1.1.1" - -[[deps.SharedArrays]] -deps = ["Distributed", "Mmap", "Random", "Serialization"] -uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" - -[[deps.Showoff]] -deps = ["Dates", "Grisu"] -git-tree-sha1 = "91eddf657aca81df9ae6ceb20b959ae5653ad1de" -uuid = "992d4aef-0814-514b-bc4d-f2e9a6c4116f" -version = "1.0.3" - -[[deps.SimpleBufferStream]] -git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" -uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" -version = "1.1.0" - -[[deps.SimpleNonlinearSolve]] -deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "DiffResults", "DifferentiationInterface", "FastClosures", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "MaybeInplace", "PrecompileTools", "Reexport", "SciMLBase", "Setfield", "StaticArraysCore"] -git-tree-sha1 = "913754ccbbc78720a4542b56a6bdfbab1c84c8f2" -uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7" -version = "1.10.0" - - [deps.SimpleNonlinearSolve.extensions] - SimpleNonlinearSolveChainRulesCoreExt = "ChainRulesCore" - SimpleNonlinearSolveReverseDiffExt = "ReverseDiff" - SimpleNonlinearSolveTrackerExt = "Tracker" - SimpleNonlinearSolveZygoteExt = "Zygote" - - [deps.SimpleNonlinearSolve.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" - -[[deps.SimpleTraits]] -deps = ["InteractiveUtils", "MacroTools"] -git-tree-sha1 = "5d7e3f4e11935503d3ecaf7186eac40602e7d231" -uuid = "699a6c99-e7fa-54fc-8d76-47d257e15c1d" -version = "0.9.4" - -[[deps.SimpleUnPack]] -git-tree-sha1 = "58e6353e72cde29b90a69527e56df1b5c3d8c437" -uuid = "ce78b400-467f-4804-87d8-8f486da07d0a" -version = "1.1.0" - -[[deps.Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[deps.SortingAlgorithms]] -deps = ["DataStructures"] -git-tree-sha1 = "66e0a8e672a0bdfca2c3f5937efb8538b9ddc085" -uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "1.2.1" - -[[deps.SparseArrays]] -deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -version = "1.10.0" - -[[deps.SparseDiffTools]] -deps = ["ADTypes", "Adapt", "ArrayInterface", "Compat", "DataStructures", "FiniteDiff", "ForwardDiff", "Graphs", "LinearAlgebra", "PackageExtensionCompat", "Random", "Reexport", "SciMLOperators", "Setfield", "SparseArrays", "StaticArrayInterface", "StaticArrays", "Tricks", "UnPack", "VertexSafeGraphs"] -git-tree-sha1 = "469f51f8c4741ce944be2c0b65423b518b1405b0" -uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804" -version = "2.19.0" - - [deps.SparseDiffTools.extensions] - SparseDiffToolsEnzymeExt = "Enzyme" - SparseDiffToolsPolyesterExt = "Polyester" - SparseDiffToolsPolyesterForwardDiffExt = "PolyesterForwardDiff" - SparseDiffToolsSymbolicsExt = "Symbolics" - SparseDiffToolsZygoteExt = "Zygote" - - [deps.SparseDiffTools.weakdeps] - Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" - Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588" - PolyesterForwardDiff = "98d1487c-24ca-40b6-b7ab-df2af84e126b" - Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" - Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" - -[[deps.SparseMatrixColorings]] -deps = ["ADTypes", "Compat", "DocStringExtensions", "LinearAlgebra", "Random", "SparseArrays"] -git-tree-sha1 = "eed2446b3c3dd58f6ded3168998b8b2cb3fc9229" -uuid = "0a514795-09f3-496d-8182-132a7b665d35" -version = "0.3.3" - -[[deps.Sparspak]] -deps = ["Libdl", "LinearAlgebra", "Logging", "OffsetArrays", "Printf", "SparseArrays", "Test"] -git-tree-sha1 = "342cf4b449c299d8d1ceaf00b7a49f4fbc7940e7" -uuid = "e56a9233-b9d6-4f03-8d0f-1825330902ac" -version = "0.3.9" - -[[deps.SpecialFunctions]] -deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "2f5d4697f21388cbe1ff299430dd169ef97d7e14" -uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.4.0" -weakdeps = ["ChainRulesCore"] - - [deps.SpecialFunctions.extensions] - SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" - -[[deps.Static]] -deps = ["IfElse"] -git-tree-sha1 = "d2fdac9ff3906e27f7a618d47b676941baa6c80c" -uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" -version = "0.8.10" - -[[deps.StaticArrayInterface]] -deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] -git-tree-sha1 = "5d66818a39bb04bf328e92bc933ec5b4ee88e436" -uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" -version = "1.5.0" -weakdeps = ["OffsetArrays", "StaticArrays"] - - [deps.StaticArrayInterface.extensions] - StaticArrayInterfaceOffsetArraysExt = "OffsetArrays" - StaticArrayInterfaceStaticArraysExt = "StaticArrays" - -[[deps.StaticArrays]] -deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] -git-tree-sha1 = "6e00379a24597be4ae1ee6b2d882e15392040132" -uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.9.5" -weakdeps = ["ChainRulesCore", "Statistics"] - - [deps.StaticArrays.extensions] - StaticArraysChainRulesCoreExt = "ChainRulesCore" - StaticArraysStatisticsExt = "Statistics" - -[[deps.StaticArraysCore]] -git-tree-sha1 = "192954ef1208c7019899fbf8049e717f92959682" -uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.3" - -[[deps.Statistics]] -deps = ["LinearAlgebra", "SparseArrays"] -uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -version = "1.10.0" - -[[deps.StatsAPI]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed" -uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" -version = "1.7.0" - -[[deps.StatsBase]] -deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] -git-tree-sha1 = "5cf7606d6cef84b543b483848d4ae08ad9832b21" -uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" -version = "0.34.3" - -[[deps.StatsFuns]] -deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"] -git-tree-sha1 = "cef0472124fab0695b58ca35a77c6fb942fdab8a" -uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" -version = "1.3.1" -weakdeps = ["ChainRulesCore", "InverseFunctions"] - - [deps.StatsFuns.extensions] - StatsFunsChainRulesCoreExt = "ChainRulesCore" - StatsFunsInverseFunctionsExt = "InverseFunctions" - -[[deps.SteadyStateDiffEq]] -deps = ["ConcreteStructs", "DiffEqBase", "DiffEqCallbacks", "LinearAlgebra", "Reexport", "SciMLBase"] -git-tree-sha1 = "1158cfdf0da5b0eacdfcfba7c16b174a37bdf6c7" -uuid = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f" -version = "2.2.0" - -[[deps.StochasticDiffEq]] -deps = ["Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DiffEqNoiseProcess", "DocStringExtensions", "FiniteDiff", "ForwardDiff", "JumpProcesses", "LevyArea", "LinearAlgebra", "Logging", "MuladdMacro", "NLsolve", "OrdinaryDiffEq", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SparseArrays", "SparseDiffTools", "StaticArrays", "UnPack"] -git-tree-sha1 = "97e5d0b7e5ec2e68eec6626af97c59e9f6b6c3d0" -uuid = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" -version = "6.65.1" - -[[deps.StrideArraysCore]] -deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"] -git-tree-sha1 = "25349bf8f63aa36acbff5e3550a86e9f5b0ef682" -uuid = "7792a7ef-975c-4747-a70f-980b88e8d1da" -version = "0.5.6" - -[[deps.SuiteSparse]] -deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] -uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" - -[[deps.SuiteSparse_jll]] -deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] -uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "7.2.1+1" - -[[deps.Sundials]] -deps = ["CEnum", "DataStructures", "DiffEqBase", "Libdl", "LinearAlgebra", "Logging", "PrecompileTools", "Reexport", "SciMLBase", "SparseArrays", "Sundials_jll"] -git-tree-sha1 = "e15f5a73f0d14b9079b807a9d1dac13e4302e997" -uuid = "c3572dad-4567-51f8-b174-8c6c989267f4" -version = "4.24.0" - -[[deps.Sundials_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "SuiteSparse_jll", "libblastrampoline_jll"] -git-tree-sha1 = "ba4d38faeb62de7ef47155ed321dce40a549c305" -uuid = "fb77eaff-e24c-56d4-86b1-d163f2edb164" -version = "5.2.2+0" - -[[deps.SymbolicIndexingInterface]] -deps = ["Accessors", "ArrayInterface", "RuntimeGeneratedFunctions", "StaticArraysCore"] -git-tree-sha1 = "a5f6f138b740c9d93d76f0feddd3092e6ef002b7" -uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5" -version = "0.3.22" - -[[deps.TOML]] -deps = ["Dates"] -uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -version = "1.0.3" - -[[deps.TableTraits]] -deps = ["IteratorInterfaceExtensions"] -git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" -uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" -version = "1.0.1" - -[[deps.Tables]] -deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"] -git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d" -uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.11.1" - -[[deps.Tar]] -deps = ["ArgTools", "SHA"] -uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" -version = "1.10.0" - -[[deps.TensorCore]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "1feb45f88d133a655e001435632f019a9a1bcdb6" -uuid = "62fd8b95-f654-4bbd-a8a5-9c27f68ccd50" -version = "0.1.1" - -[[deps.Test]] -deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[deps.ThreadPools]] -deps = ["Printf", "RecipesBase", "Statistics"] -git-tree-sha1 = "50cb5f85d5646bc1422aa0238aa5bfca99ca9ae7" -uuid = "b189fb0b-2eb5-4ed4-bc0c-d34c51242431" -version = "2.1.1" - -[[deps.ThreadingUtilities]] -deps = ["ManualMemory"] -git-tree-sha1 = "eda08f7e9818eb53661b3deb74e3159460dfbc27" -uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5" -version = "0.5.2" - -[[deps.TimerOutputs]] -deps = ["ExprTools", "Printf"] -git-tree-sha1 = "5a13ae8a41237cff5ecf34f73eb1b8f42fff6531" -uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" -version = "0.5.24" - -[[deps.TranscodingStreams]] -git-tree-sha1 = "a947ea21087caba0a798c5e494d0bb78e3a1a3a0" -uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.10.9" -weakdeps = ["Random", "Test"] - - [deps.TranscodingStreams.extensions] - TestExt = ["Test", "Random"] - -[[deps.TriangularSolve]] -deps = ["CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "LoopVectorization", "Polyester", "Static", "VectorizationBase"] -git-tree-sha1 = "66c68a20907800c0b7c04ff8a6164115e8747de2" -uuid = "d5829a12-d9aa-46ab-831f-fb7c9ab06edf" -version = "0.2.0" - -[[deps.Tricks]] -git-tree-sha1 = "eae1bb484cd63b36999ee58be2de6c178105112f" -uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775" -version = "0.1.8" - -[[deps.TruncatedStacktraces]] -deps = ["InteractiveUtils", "MacroTools", "Preferences"] -git-tree-sha1 = "ea3e54c2bdde39062abf5a9758a23735558705e1" -uuid = "781d530d-4396-4725-bb49-402e4bee1e77" -version = "1.4.0" - -[[deps.URIs]] -git-tree-sha1 = "67db6cc7b3821e19ebe75791a9dd19c9b1188f2b" -uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" -version = "1.5.1" - -[[deps.UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[deps.UnPack]] -git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" -uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" -version = "1.0.2" - -[[deps.Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[deps.UnicodeFun]] -deps = ["REPL"] -git-tree-sha1 = "53915e50200959667e78a92a418594b428dffddf" -uuid = "1cfade01-22cf-5700-b092-accc4b62d6e1" -version = "0.4.1" - -[[deps.Unitful]] -deps = ["Dates", "LinearAlgebra", "Random"] -git-tree-sha1 = "dd260903fdabea27d9b6021689b3cd5401a57748" -uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.20.0" -weakdeps = ["ConstructionBase", "InverseFunctions"] - - [deps.Unitful.extensions] - ConstructionBaseUnitfulExt = "ConstructionBase" - InverseFunctionsUnitfulExt = "InverseFunctions" - -[[deps.UnitfulLatexify]] -deps = ["LaTeXStrings", "Latexify", "Unitful"] -git-tree-sha1 = "e2d817cc500e960fdbafcf988ac8436ba3208bfd" -uuid = "45397f5d-5981-4c77-b2b3-fc36d6e9b728" -version = "1.6.3" - -[[deps.Unzip]] -git-tree-sha1 = "ca0969166a028236229f63514992fc073799bb78" -uuid = "41fe7b60-77ed-43a1-b4f0-825fd5a5650d" -version = "0.2.0" - -[[deps.VectorizationBase]] -deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"] -git-tree-sha1 = "e863582a41c5731f51fd050563ae91eb33cf09be" -uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" -version = "0.21.68" - -[[deps.VertexSafeGraphs]] -deps = ["Graphs"] -git-tree-sha1 = "8351f8d73d7e880bfc042a8b6922684ebeafb35c" -uuid = "19fa3120-7c27-5ec5-8db8-b0b0aa330d6f" -version = "0.2.0" - -[[deps.Vulkan_Loader_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Wayland_jll", "Xorg_libX11_jll", "Xorg_libXrandr_jll", "xkbcommon_jll"] -git-tree-sha1 = "2f0486047a07670caad3a81a075d2e518acc5c59" -uuid = "a44049a8-05dd-5a78-86c9-5fde0876e88c" -version = "1.3.243+0" - -[[deps.Wayland_jll]] -deps = ["Artifacts", "EpollShim_jll", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"] -git-tree-sha1 = "7558e29847e99bc3f04d6569e82d0f5c54460703" -uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89" -version = "1.21.0+1" - -[[deps.Wayland_protocols_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "93f43ab61b16ddfb2fd3bb13b3ce241cafb0e6c9" -uuid = "2381bf8a-dfd0-557d-9999-79630e7b1b91" -version = "1.31.0+0" - -[[deps.WebIO]] -deps = ["AssetRegistry", "Base64", "Distributed", "FunctionalCollections", "JSON", "Logging", "Observables", "Pkg", "Random", "Requires", "Sockets", "UUIDs", "WebSockets", "Widgets"] -git-tree-sha1 = "0eef0765186f7452e52236fa42ca8c9b3c11c6e3" -uuid = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29" -version = "0.8.21" - -[[deps.WebSockets]] -deps = ["Base64", "Dates", "HTTP", "Logging", "Sockets"] -git-tree-sha1 = "4162e95e05e79922e44b9952ccbc262832e4ad07" -uuid = "104b5d7c-a370-577a-8038-80a2059c5097" -version = "1.6.0" - -[[deps.Widgets]] -deps = ["Colors", "Dates", "Observables", "OrderedCollections"] -git-tree-sha1 = "fcdae142c1cfc7d89de2d11e08721d0f2f86c98a" -uuid = "cc8bc4a8-27d6-5769-a93b-9d913e69aa62" -version = "0.6.6" - -[[deps.WoodburyMatrices]] -deps = ["LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "c1a7aa6219628fcd757dede0ca95e245c5cd9511" -uuid = "efce3f68-66dc-5838-9240-27a6d6f5f9b6" -version = "1.0.0" - -[[deps.XML2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] -git-tree-sha1 = "52ff2af32e591541550bd753c0da8b9bc92bb9d9" -uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.12.7+0" - -[[deps.XSLT_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Libgpg_error_jll", "Libiconv_jll", "Pkg", "XML2_jll", "Zlib_jll"] -git-tree-sha1 = "91844873c4085240b95e795f692c4cec4d805f8a" -uuid = "aed1982a-8fda-507f-9586-7b0439959a61" -version = "1.1.34+0" - -[[deps.XZ_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "ac88fb95ae6447c8dda6a5503f3bafd496ae8632" -uuid = "ffd25f8a-64ca-5728-b0f7-c24cf3aae800" -version = "5.4.6+0" - -[[deps.Xorg_libICE_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "326b4fea307b0b39892b3e85fa451692eda8d46c" -uuid = "f67eecfb-183a-506d-b269-f58e52b52d7c" -version = "1.1.1+0" - -[[deps.Xorg_libSM_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libICE_jll"] -git-tree-sha1 = "3796722887072218eabafb494a13c963209754ce" -uuid = "c834827a-8449-5923-a945-d239c165b7dd" -version = "1.2.4+0" - -[[deps.Xorg_libX11_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxcb_jll", "Xorg_xtrans_jll"] -git-tree-sha1 = "afead5aba5aa507ad5a3bf01f58f82c8d1403495" -uuid = "4f6342f7-b3d2-589e-9d20-edeb45f2b2bc" -version = "1.8.6+0" - -[[deps.Xorg_libXau_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "6035850dcc70518ca32f012e46015b9beeda49d8" -uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec" -version = "1.0.11+0" - -[[deps.Xorg_libXcursor_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll", "Xorg_libXrender_jll"] -git-tree-sha1 = "12e0eb3bc634fa2080c1c37fccf56f7c22989afd" -uuid = "935fb764-8cf2-53bf-bb30-45bb1f8bf724" -version = "1.2.0+4" - -[[deps.Xorg_libXdmcp_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "34d526d318358a859d7de23da945578e8e8727b7" -uuid = "a3789734-cfe1-5b06-b2d0-1dd0d9d62d05" -version = "1.1.4+0" - -[[deps.Xorg_libXext_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libX11_jll"] -git-tree-sha1 = "d2d1a5c49fae4ba39983f63de6afcbea47194e85" -uuid = "1082639a-0dae-5f34-9b06-72781eeb8cb3" -version = "1.3.6+0" - -[[deps.Xorg_libXfixes_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] -git-tree-sha1 = "0e0dc7431e7a0587559f9294aeec269471c991a4" -uuid = "d091e8ba-531a-589c-9de9-94069b037ed8" -version = "5.0.3+4" - -[[deps.Xorg_libXi_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXfixes_jll"] -git-tree-sha1 = "89b52bc2160aadc84d707093930ef0bffa641246" -uuid = "a51aa0fd-4e3c-5386-b890-e753decda492" -version = "1.7.10+4" - -[[deps.Xorg_libXinerama_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll"] -git-tree-sha1 = "26be8b1c342929259317d8b9f7b53bf2bb73b123" -uuid = "d1454406-59df-5ea1-beac-c340f2130bc3" -version = "1.1.4+4" - -[[deps.Xorg_libXrandr_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll"] -git-tree-sha1 = "34cea83cb726fb58f325887bf0612c6b3fb17631" -uuid = "ec84b674-ba8e-5d96-8ba1-2a689ba10484" -version = "1.5.2+4" - -[[deps.Xorg_libXrender_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libX11_jll"] -git-tree-sha1 = "47e45cd78224c53109495b3e324df0c37bb61fbe" -uuid = "ea2f1a96-1ddc-540d-b46f-429655e07cfa" -version = "0.9.11+0" - -[[deps.Xorg_libpthread_stubs_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "8fdda4c692503d44d04a0603d9ac0982054635f9" -uuid = "14d82f49-176c-5ed1-bb49-ad3f5cbd8c74" -version = "0.1.1+0" - -[[deps.Xorg_libxcb_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"] -git-tree-sha1 = "b4bfde5d5b652e22b9c790ad00af08b6d042b97d" -uuid = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b" -version = "1.15.0+0" - -[[deps.Xorg_libxkbfile_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libX11_jll"] -git-tree-sha1 = "730eeca102434283c50ccf7d1ecdadf521a765a4" -uuid = "cc61e674-0454-545c-8b26-ed2c68acab7a" -version = "1.1.2+0" - -[[deps.Xorg_xcb_util_cursor_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_jll", "Xorg_xcb_util_renderutil_jll"] -git-tree-sha1 = "04341cb870f29dcd5e39055f895c39d016e18ccd" -uuid = "e920d4aa-a673-5f3a-b3d7-f755a4d47c43" -version = "0.1.4+0" - -[[deps.Xorg_xcb_util_image_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "0fab0a40349ba1cba2c1da699243396ff8e94b97" -uuid = "12413925-8142-5f55-bb0e-6d7ca50bb09b" -version = "0.4.0+1" - -[[deps.Xorg_xcb_util_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll"] -git-tree-sha1 = "e7fd7b2881fa2eaa72717420894d3938177862d1" -uuid = "2def613f-5ad1-5310-b15b-b15d46f528f5" -version = "0.4.0+1" - -[[deps.Xorg_xcb_util_keysyms_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "d1151e2c45a544f32441a567d1690e701ec89b00" -uuid = "975044d2-76e6-5fbe-bf08-97ce7c6574c7" -version = "0.4.0+1" - -[[deps.Xorg_xcb_util_renderutil_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "dfd7a8f38d4613b6a575253b3174dd991ca6183e" -uuid = "0d47668e-0667-5a69-a72c-f761630bfb7e" -version = "0.3.9+1" - -[[deps.Xorg_xcb_util_wm_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "e78d10aab01a4a154142c5006ed44fd9e8e31b67" -uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361" -version = "0.4.1+1" - -[[deps.Xorg_xkbcomp_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxkbfile_jll"] -git-tree-sha1 = "330f955bc41bb8f5270a369c473fc4a5a4e4d3cb" -uuid = "35661453-b289-5fab-8a00-3d9160c6a3a4" -version = "1.4.6+0" - -[[deps.Xorg_xkeyboard_config_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xkbcomp_jll"] -git-tree-sha1 = "691634e5453ad362044e2ad653e79f3ee3bb98c3" -uuid = "33bec58e-1273-512f-9401-5d533626f822" -version = "2.39.0+0" - -[[deps.Xorg_xtrans_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "e92a1a012a10506618f10b7047e478403a046c77" -uuid = "c5fb5394-a638-5e4d-96e5-b29de1b5cf10" -version = "1.5.0+0" - -[[deps.ZipFile]] -deps = ["Libdl", "Printf", "Zlib_jll"] -git-tree-sha1 = "f492b7fe1698e623024e873244f10d89c95c340a" -uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea" -version = "0.10.1" - -[[deps.Zlib_jll]] -deps = ["Libdl"] -uuid = "83775a58-1f1d-513f-b197-d71354ab007a" -version = "1.2.13+1" - -[[deps.Zstd_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "e678132f07ddb5bfa46857f0d7620fb9be675d3b" -uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" -version = "1.5.6+0" - -[[deps.eudev_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "gperf_jll"] -git-tree-sha1 = "431b678a28ebb559d224c0b6b6d01afce87c51ba" -uuid = "35ca27e7-8b34-5b7f-bca9-bdc33f59eb06" -version = "3.2.9+0" - -[[deps.fzf_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "a68c9655fbe6dfcab3d972808f1aafec151ce3f8" -uuid = "214eeab7-80f7-51ab-84ad-2988db7cef09" -version = "0.43.0+0" - -[[deps.gperf_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "3516a5630f741c9eecb3720b1ec9d8edc3ecc033" -uuid = "1a1c6b14-54f6-533d-8383-74cd7377aa70" -version = "3.1.1+0" - -[[deps.libaec_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "46bf7be2917b59b761247be3f317ddf75e50e997" -uuid = "477f73a3-ac25-53e9-8cc3-50b2fa2566f0" -version = "1.1.2+0" - -[[deps.libaom_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "1827acba325fdcdf1d2647fc8d5301dd9ba43a9d" -uuid = "a4ae2306-e953-59d6-aa16-d00cac43593b" -version = "3.9.0+0" - -[[deps.libass_jll]] -deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "HarfBuzz_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] -git-tree-sha1 = "5982a94fcba20f02f42ace44b9894ee2b140fe47" -uuid = "0ac62f75-1d6f-5e53-bd7c-93b484bb37c0" -version = "0.15.1+0" - -[[deps.libblastrampoline_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.8.0+1" - -[[deps.libevdev_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "141fe65dc3efabb0b1d5ba74e91f6ad26f84cc22" -uuid = "2db6ffa8-e38f-5e21-84af-90c45d0032cc" -version = "1.11.0+0" - -[[deps.libfdk_aac_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "daacc84a041563f965be61859a36e17c4e4fcd55" -uuid = "f638f0a6-7fb0-5443-88ba-1cc74229b280" -version = "2.0.2+0" - -[[deps.libinput_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "eudev_jll", "libevdev_jll", "mtdev_jll"] -git-tree-sha1 = "ad50e5b90f222cfe78aa3d5183a20a12de1322ce" -uuid = "36db933b-70db-51c0-b978-0f229ee0e533" -version = "1.18.0+0" - -[[deps.libpng_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"] -git-tree-sha1 = "d7015d2e18a5fd9a4f47de711837e980519781a4" -uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" -version = "1.6.43+1" - -[[deps.libvorbis_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Ogg_jll", "Pkg"] -git-tree-sha1 = "b910cb81ef3fe6e78bf6acee440bda86fd6ae00c" -uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a" -version = "1.3.7+1" - -[[deps.mtdev_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "814e154bdb7be91d78b6802843f76b6ece642f11" -uuid = "009596ad-96f7-51b1-9f1b-5ce2d5e8a71e" -version = "1.1.6+0" - -[[deps.nghttp2_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.52.0+1" - -[[deps.oneTBB_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "7d0ea0f4895ef2f5cb83645fa689e52cb55cf493" -uuid = "1317d2d5-d96f-522e-a858-c73665f53c3e" -version = "2021.12.0+0" - -[[deps.p7zip_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" -version = "17.4.0+2" - -[[deps.x264_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "4fea590b89e6ec504593146bf8b988b2c00922b2" -uuid = "1270edf5-f2f9-52d2-97e9-ab00b5d0237a" -version = "2021.5.5+0" - -[[deps.x265_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "ee567a171cce03570d77ad3a43e90218e38937a9" -uuid = "dfaa095f-4041-5dcd-9319-2fabd8486b76" -version = "3.5.0+0" - -[[deps.xkbcommon_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll", "Wayland_protocols_jll", "Xorg_libxcb_jll", "Xorg_xkeyboard_config_jll"] -git-tree-sha1 = "9c304562909ab2bab0262639bd4f444d7bc2be37" -uuid = "d8fb68d0-12a3-5cfd-a85a-d49703b185fd" -version = "1.4.1+1" -""" - -# ╔═╡ Cell order: -# ╟─fcea9c60-2f14-11ef-2397-15d157a03c3b -# ╠═551e8e92-6a04-427d-b363-d0dab3c01551 -# ╠═d7bfcca8-4637-414b-acfa-b8a71f5012ca -# ╠═ad740af3-d51a-47ae-a407-d9128c5bcaeb -# ╠═e85d6e42-0bd8-45bb-9c00-f3c76c808294 -# ╠═63ed5ca7-43bc-4ecf-87ab-72fed9b2ac56 -# ╟─57d2a3e8-835d-40bb-8e47-47ea5c0eedf0 -# ╟─92514cc6-a468-4d87-9104-d4459025de02 -# ╟─53c080e8-389c-420e-bc05-4eec2b98074b -# ╟─3dfd18c3-b66c-483b-86f5-b2608eb7b469 -# ╟─9aa11335-eb16-4310-9fc0-0672c64f3be1 -# ╟─d4769552-4083-4a3e-a477-168ac288b742 -# ╟─876653d2-6a68-4c5a-a3c6-a3ca23629989 -# ╟─445f18d6-66db-4cf2-9205-f98fc3dd8d83 -# ╟─cd8ddd20-2ce8-4b5e-a431-47078416bbc9 -# ╟─6d0232ef-b181-42d4-9160-b2f0ffcee84b -# ╟─98663a7e-69a0-4938-9ac2-b7d8f248592d -# ╟─dfaee7a3-03af-45b2-a2e4-84c103b0001a -# ╟─a41ce5ae-4e0c-40de-b63f-e469c982367b -# ╟─1ab6b2c8-d58e-48c5-95cb-cc35936413a9 -# ╟─6472cac2-cd31-4272-95cd-8e8e7245058d -# ╟─0cd23f48-18c7-4012-ae77-4a9f77934b60 -# ╟─1eb6c4fc-be1b-491b-95e0-bc6ca060216c -# ╟─831e1919-9ac8-4934-80ce-03a691ea1a41 -# ╟─43021052-25b4-43a9-a9e6-47f3c56d1341 -# ╟─df122e2a-f4af-4ac7-b332-4c07e7aa4b0e -# ╟─dbaf5ff3-9ee2-4355-aad2-e48c25eee514 -# ╟─942e6e27-04a1-4dce-9364-ccafd105facb -# ╟─095b6d5a-58af-4e3a-8ce0-b08a25629b38 -# ╟─43cab175-38df-42dd-b012-e28deec442b0 -# ╟─21178414-11ae-479b-9aae-b495f3c9c76e -# ╟─82c6de3e-66f2-4965-8bad-2faae667fb7e -# ╟─d28612f7-1405-4f6b-87db-56e3ebb852ff -# ╟─05d51ac1-4804-4641-b8b1-f4f4e10dcae6 -# ╟─5058777f-beb6-43f4-b3d2-1127abbe1ac9 -# ╟─28026b82-83ba-42cc-89f9-a521daef717a -# ╟─7588298c-a54c-4b61-b32a-a3cf89cd8b3b -# ╟─a8b53f45-5ff7-41dd-89d9-040dcf0e9898 -# ╟─c7cceb40-ff26-4d3d-912a-199c6ddd49d2 -# ╟─ca0ba941-8eb1-4641-ae4b-0925df73dedd -# ╟─00000000-0000-0000-0000-000000000001 -# ╟─00000000-0000-0000-0000-000000000002 diff --git a/examples/pluto-src/index.html b/examples/pluto-src/index.html deleted file mode 100644 index 3a33b9d0..00000000 --- a/examples/pluto-src/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - -

Notebooks

- - - - diff --git a/examples/pluto-src/pluto_export.json b/examples/pluto-src/pluto_export.json deleted file mode 100644 index 98e92cbd..00000000 --- a/examples/pluto-src/pluto_export.json +++ /dev/null @@ -1 +0,0 @@ -{"notebooks":{"FMUExplorer/FMUExplorer.jl":{"id":"FMUExplorer/FMUExplorer.jl","hash":"skk-usn2fuZ51Nz88pnKXE9Gd_xEz8RaPJ_CWE6CBd0","html_path":"FMUExplorer/FMUExplorer.html","statefile_path":null,"notebookfile_path":null,"current_hash":"skk-usn2fuZ51Nz88pnKXE9Gd_xEz8RaPJ_CWE6CBd0","desired_hash":"skk-usn2fuZ51Nz88pnKXE9Gd_xEz8RaPJ_CWE6CBd0","frontmatter":{"title":"FMUExplorer"}}},"pluto_version":"0.19.46","julia_version":"1.10.5","format_version":"1","title":null,"description":null,"collections":null,"binder_url":"https://mybinder.org/v2/gh/fonsp/pluto-on-binder/v0.19.46","slider_server_url":null} \ No newline at end of file diff --git a/examples/src/.gitignore b/examples/src/.gitignore deleted file mode 100644 index 761fabac..00000000 --- a/examples/src/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -FMI_*_Benchmark/ -tmp/ \ No newline at end of file diff --git a/examples/src/inputs.ipynb b/examples/src/inputs.ipynb deleted file mode 100644 index 5b1e0b77..00000000 --- a/examples/src/inputs.ipynb +++ /dev/null @@ -1,233 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Simulate an FMU with inputs\n", - "Tutorial by Tobias Thummerer\n", - "\n", - "🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧\n", - "\n", - "## License" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:28:04.723000Z", - "iopub.status.busy": "2022-10-22T13:28:04.017000Z", - "iopub.status.idle": "2022-10-22T13:28:04.999000Z", - "shell.execute_reply": "2022-10-22T13:28:04.926000Z" - } - }, - "outputs": [], - "source": [ - "# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar\n", - "# Licensed under the MIT license. \n", - "# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Introduction to the example\n", - "This example shows how to add custom inputs to a FMU, that are used during simulation.\n", - "\n", - "## Other formats\n", - "Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/inputs.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/inputs.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/inputs.md) corresponding to the notebook. \n", - "\n", - "## Code section" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:28:05.004000Z", - "iopub.status.busy": "2022-10-22T13:28:05.004000Z", - "iopub.status.idle": "2022-10-22T13:28:49.082000Z", - "shell.execute_reply": "2022-10-22T13:28:49.082000Z" - } - }, - "outputs": [], - "source": [ - "# imports\n", - "using FMI\n", - "using FMIZoo\n", - "using Plots\n", - "using DifferentialEquations" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulation setup\n", - "\n", - "Next, the start time and end time of the simulation are set. Finally, a step size is specified to store the results of the simulation at these time steps." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:28:51.448000Z", - "iopub.status.busy": "2022-10-22T13:28:49.085000Z", - "iopub.status.idle": "2022-10-22T13:28:52.234000Z", - "shell.execute_reply": "2022-10-22T13:28:52.233000Z" - } - }, - "outputs": [], - "source": [ - "tStart = 0.0\n", - "tStep = 0.01\n", - "tStop = 8.0\n", - "tSave = tStart:tStep:tStop" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Import FMU\n", - "\n", - "Next, the FMU model from *FMIZoo.jl* is loaded." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:28:52.238000Z", - "iopub.status.busy": "2022-10-22T13:28:52.237000Z", - "iopub.status.idle": "2022-10-22T13:28:57.034000Z", - "shell.execute_reply": "2022-10-22T13:28:57.034000Z" - } - }, - "outputs": [], - "source": [ - "# we use an FMU from the FMIZoo.jl\n", - "fmu = loadFMU(\"SpringPendulumExtForce1D\", \"Dymola\", \"2022x\"; type=:ME) # load FMU in ME-Mode (\"Model Exchange\")" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Simulate as Model-Exchange\n", - "\n", - "In the function `simulate()` the FMU is simulated with an adaptive step size but with fixed save points `tSave`. In addition, the start and end time are specified. Note, that the dynamics of the input variables are not considered by the steps ize control of the solver, so it is highly recommended to limit the solver step size with the keyword argument `dtmax` if the input is more dynamic than the system." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:29:04.979000Z", - "iopub.status.busy": "2022-10-22T13:29:04.978000Z", - "iopub.status.idle": "2022-10-22T13:29:21.052000Z", - "shell.execute_reply": "2022-10-22T13:29:21.052000Z" - } - }, - "outputs": [], - "source": [ - "# input function format \"t\", dependent on `t` (time)\n", - "function extForce_t(t::Real, u::AbstractArray{<:Real})\n", - " u[1] = sin(t)\n", - "end \n", - "\n", - "# simulate while setting inputs\n", - "data_extForce_t = simulate(fmu, (tStart, tStop); # FMU, start and stop time\n", - " solver = Tsit5(),\n", - " saveat=tSave, # timepoints for the ODE solution to be saved\n", - " inputValueReferences=[\"extForce\"], # the value references that should be set (inputs)\n", - " inputFunction=extForce_t, # the input function to be used\n", - " dtmax=1e-2, # limit max step size to capture inputs\n", - " showProgress=false) # disable progress bar\n", - "plot(data_extForce_t)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# input function format \"cxt\", dependent on `c` (component), `x` (state) and `t` (time)\n", - "function extForce_cxt(c::Union{FMU2Component, Nothing}, x::Union{AbstractArray{<:Real}, Nothing}, t::Real, u::AbstractArray{<:Real})\n", - " x1 = 0.0\n", - " if x != nothing # this check is important, because inputs may be needed before the system state is known\n", - " x1 = x[1] \n", - " end\n", - " u[1] = sin(t) * x1\n", - " nothing\n", - "end \n", - "\n", - "# simulate while setting inputs\n", - "data_extForce_cxt = simulate(fmu, (tStart, tStop); saveat=tSave, inputValueReferences=[\"extForce\"], inputFunction=extForce_cxt, dtmax=1e-2, showProgress=false)\n", - "plot(data_extForce_cxt)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Unload FMU\n", - "\n", - "After plotting the data, the FMU is unloaded and all unpacked data on disc is removed." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:30:01.970000Z", - "iopub.status.busy": "2022-10-22T13:30:01.970000Z", - "iopub.status.idle": "2022-10-22T13:30:02.010000Z", - "shell.execute_reply": "2022-10-22T13:30:02.010000Z" - } - }, - "outputs": [], - "source": [ - "unloadFMU(fmu)" - ] - } - ], - "metadata": { - "interpreter": { - "hash": "037537ff7419c497b9325f7d495147943224d408cf5d5ed915294a5b960167b0" - }, - "jupytext": { - "cell_metadata_filter": "-all", - "comment_magics": "false", - "notebook_metadata_filter": "-all" - }, - "kernelspec": { - "display_name": "Julia 1.10.4", - "language": "julia", - "name": "julia-1.10" - }, - "language_info": { - "file_extension": ".jl", - "mimetype": "application/julia", - "name": "julia", - "version": "1.10.5" - }, - "nteract": { - "version": "0.28.0" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/examples/src/inputs.jl b/examples/src/inputs.jl deleted file mode 100644 index bfadd274..00000000 --- a/examples/src/inputs.jl +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. - -# imports -using FMI -using FMIZoo -using Plots -using DifferentialEquations - -tStart = 0.0 -tStep = 0.01 -tStop = 8.0 -tSave = tStart:tStep:tStop - -# we use an FMU from the FMIZoo.jl -fmu = loadFMU("SpringPendulumExtForce1D", "Dymola", "2022x"; type=:ME) # load FMU in ME-Mode ("Model Exchange") - -# input function format "t", dependent on `t` (time) -function extForce_t(t::Real, u::AbstractArray{<:Real}) - u[1] = sin(t) -end - -# simulate while setting inputs -data_extForce_t = simulate(fmu, (tStart, tStop); # FMU, start and stop time - solver = Tsit5(), - saveat=tSave, # timepoints for the ODE solution to be saved - inputValueReferences=["extForce"], # the value references that should be set (inputs) - inputFunction=extForce_t, # the input function to be used - dtmax=1e-2, # limit max step size to capture inputs - showProgress=false) # disable progress bar -plot(data_extForce_t) - -# input function format "cxt", dependent on `c` (component), `x` (state) and `t` (time) -function extForce_cxt(c::Union{FMU2Component, Nothing}, x::Union{AbstractArray{<:Real}, Nothing}, t::Real, u::AbstractArray{<:Real}) - x1 = 0.0 - if x != nothing # this check is important, because inputs may be needed before the system state is known - x1 = x[1] - end - u[1] = sin(t) * x1 - nothing -end - -# simulate while setting inputs -data_extForce_cxt = simulate(fmu, (tStart, tStop); saveat=tSave, inputValueReferences=["extForce"], inputFunction=extForce_cxt, dtmax=1e-2, showProgress=false) -plot(data_extForce_cxt) - -unloadFMU(fmu) diff --git a/examples/src/inputs.md b/examples/src/inputs.md deleted file mode 100644 index 2df82dee..00000000 --- a/examples/src/inputs.md +++ /dev/null @@ -1,225 +0,0 @@ -# Simulate an FMU with inputs -Tutorial by Tobias Thummerer - -🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧 - -## License - - -```julia -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. -``` - -## Introduction to the example -This example shows how to add custom inputs to a FMU, that are used during simulation. - -## Other formats -Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/inputs.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/inputs.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/inputs.md) corresponding to the notebook. - -## Code section - - -```julia -# imports -using FMI -using FMIZoo -using Plots -using DifferentialEquations -``` - -### Simulation setup - -Next, the start time and end time of the simulation are set. Finally, a step size is specified to store the results of the simulation at these time steps. - - -```julia -tStart = 0.0 -tStep = 0.01 -tStop = 8.0 -tSave = tStart:tStep:tStop -``` - - - - - 0.0:0.01:8.0 - - - -### Import FMU - -Next, the FMU model from *FMIZoo.jl* is loaded. - - -```julia -# we use an FMU from the FMIZoo.jl -fmu = loadFMU("SpringPendulumExtForce1D", "Dymola", "2022x"; type=:ME) # load FMU in ME-Mode ("Model Exchange") -``` - - - - - Model name: SpringPendulumExtForce1D - Type: 0 - - - -#### Simulate as Model-Exchange - -In the function `simulate()` the FMU is simulated with an adaptive step size but with fixed save points `tSave`. In addition, the start and end time are specified. Note, that the dynamics of the input variables are not considered by the steps ize control of the solver, so it is highly recommended to limit the solver step size with the keyword argument `dtmax` if the input is more dynamic than the system. - - -```julia -# input function format "t", dependent on `t` (time) -function extForce_t(t::Real, u::AbstractArray{<:Real}) - u[1] = sin(t) -end - -# simulate while setting inputs -data_extForce_t = simulate(fmu, (tStart, tStop); # FMU, start and stop time - solver = Tsit5(), - saveat=tSave, # timepoints for the ODE solution to be saved - inputValueReferences=["extForce"], # the value references that should be set (inputs) - inputFunction=extForce_t, # the input function to be used - dtmax=1e-2, # limit max step size to capture inputs - showProgress=false) # disable progress bar -plot(data_extForce_t) -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -```julia -# input function format "cxt", dependent on `c` (component), `x` (state) and `t` (time) -function extForce_cxt(c::Union{FMU2Component, Nothing}, x::Union{AbstractArray{<:Real}, Nothing}, t::Real, u::AbstractArray{<:Real}) - x1 = 0.0 - if x != nothing # this check is important, because inputs may be needed before the system state is known - x1 = x[1] - end - u[1] = sin(t) * x1 - nothing -end - -# simulate while setting inputs -data_extForce_cxt = simulate(fmu, (tStart, tStop); saveat=tSave, inputValueReferences=["extForce"], inputFunction=extForce_cxt, dtmax=1e-2, showProgress=false) -plot(data_extForce_cxt) -``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -### Unload FMU - -After plotting the data, the FMU is unloaded and all unpacked data on disc is removed. - - -```julia -unloadFMU(fmu) -``` diff --git a/examples/src/inputs_files/inputs_10_0.png b/examples/src/inputs_files/inputs_10_0.png deleted file mode 100644 index 90f173d0..00000000 Binary files a/examples/src/inputs_files/inputs_10_0.png and /dev/null differ diff --git a/examples/src/inputs_files/inputs_10_0.svg b/examples/src/inputs_files/inputs_10_0.svg deleted file mode 100644 index 6ef67a43..00000000 --- a/examples/src/inputs_files/inputs_10_0.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/src/inputs_files/inputs_9_0.png b/examples/src/inputs_files/inputs_9_0.png deleted file mode 100644 index 20d72aeb..00000000 Binary files a/examples/src/inputs_files/inputs_9_0.png and /dev/null differ diff --git a/examples/src/inputs_files/inputs_9_0.svg b/examples/src/inputs_files/inputs_9_0.svg deleted file mode 100644 index d81732ff..00000000 --- a/examples/src/inputs_files/inputs_9_0.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/src/manipulation.ipynb b/examples/src/manipulation.ipynb deleted file mode 100644 index e1021bb4..00000000 --- a/examples/src/manipulation.ipynb +++ /dev/null @@ -1,374 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Manipulate a function\n", - "Tutorial by Tobias Thummerer, Johannes Stoljar\n", - "\n", - "🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧\n", - "\n", - "## License" - ] - }, - { - "cell_type": "code", - "execution_count": 45, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:14:08.404000Z", - "iopub.status.busy": "2022-10-22T13:14:07.559000Z", - "iopub.status.idle": "2022-10-22T13:14:08.684000Z", - "shell.execute_reply": "2022-10-22T13:14:08.606000Z" - } - }, - "outputs": [], - "source": [ - "# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar\n", - "# Licensed under the MIT license. \n", - "# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Introduction to the example\n", - "This example shows how to overwrite a FMI function with a custom C-function. For this the FMU model is simulated first without changes. Then the function `fmi2GetReal()` is overwritten and simulated again. Both simulations are displayed in a graph to show the change caused by overwriting the function. The model used is a one-dimensional spring pendulum with friction. The object-orientated structure of the *SpringFrictionPendulum1D* can be seen in the following graphic.\n", - "\n", - "![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringFrictionPendulum1D.svg?raw=true) \n", - "\n", - "\n", - "## Other formats\n", - "Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/manipulation.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/manipulation.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/manipulation.md) corresponding to the notebook. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Code section\n", - "\n", - "To run the example, the previously installed packages must be included. " - ] - }, - { - "cell_type": "code", - "execution_count": 46, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:14:08.688000Z", - "iopub.status.busy": "2022-10-22T13:14:08.687000Z", - "iopub.status.idle": "2022-10-22T13:14:52.393000Z", - "shell.execute_reply": "2022-10-22T13:14:52.393000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "# imports\n", - "using FMI\n", - "using FMI: fmi2SetFctGetReal\n", - "using FMIZoo\n", - "using FMICore\n", - "using Plots\n", - "using DifferentialEquations # for auto solver detection" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulation setup\n", - "\n", - "Next, the start time and end time of the simulation are set." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:14:54.760000Z", - "iopub.status.busy": "2022-10-22T13:14:52.396000Z", - "iopub.status.idle": "2022-10-22T13:14:55.420000Z", - "shell.execute_reply": "2022-10-22T13:14:55.420000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "tStart = 0.0\n", - "tStop = 8.0" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Import FMU\n", - "\n", - "Next, the FMU model from *FMIZoo.jl* is loaded." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:14:55.461000Z", - "iopub.status.busy": "2022-10-22T13:14:55.461000Z", - "iopub.status.idle": "2022-10-22T13:15:00.391000Z", - "shell.execute_reply": "2022-10-22T13:15:00.391000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "# we use an FMU from the FMIZoo.jl\n", - "fmu = loadFMU(\"SpringFrictionPendulum1D\", \"Dymola\", \"2022x\"; type=:ME)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulate FMU\n", - "\n", - "In the next steps the recorded value is defined. The recorded value is the position of the mass. In the function `simulateME()` the FMU is simulated in model-exchange mode (ME) with an adaptive step size. In addition, the start and end time and the recorded variables are specified." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:15:00.394000Z", - "iopub.status.busy": "2022-10-22T13:15:00.394000Z", - "iopub.status.idle": "2022-10-22T13:15:22.896000Z", - "shell.execute_reply": "2022-10-22T13:15:22.896000Z" - } - }, - "outputs": [], - "source": [ - "# an array of value references... or just one\n", - "vrs = [\"mass.s\"]\n", - "\n", - "simData = simulate(fmu, (tStart, tStop); recordValues=vrs)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Plotting FMU\n", - "\n", - "After the simulation is finished, the result of the FMU for the model-exchange mode can be plotted. In the plot for the FMU it can be seen that the oscillation continues to decrease due to the effect of the friction. If you simulate long enough, the oscillation comes to a standstill in a certain time." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:15:22.900000Z", - "iopub.status.busy": "2022-10-22T13:15:22.900000Z", - "iopub.status.idle": "2022-10-22T13:16:03.717000Z", - "shell.execute_reply": "2022-10-22T13:16:03.717000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "fig = plot(simData, states=false)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Override Function\n", - "\n", - "After overwriting a function, the previous one is no longer accessible. The original function `fmi2GetReal()` is cached by storing the address of the pointer. The addresses of the pointers are kept in the FMU and are thus accessible." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:16:03.722000Z", - "iopub.status.busy": "2022-10-22T13:16:03.722000Z", - "iopub.status.idle": "2022-10-22T13:16:04.520000Z", - "shell.execute_reply": "2022-10-22T13:16:04.520000Z" - } - }, - "outputs": [], - "source": [ - "# save, where the original `fmi2GetReal` function was stored, so we can access it in our new function\n", - "originalGetReal = fmu.cGetReal" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To overwrite the function `fmi2GetReal!()`, the function header of the new custom function must be identical to the previous one. The function header looks like `fmi2GetReal!(cfunc::Ptr{Nothing}, c::fmi2Component, vr::Union{Array{fmi2ValueReference}, Ptr{fmi2ValueReference}}, nvr::Csize_t, value::Union{Array{fmi2Real}, Ptr{fmi2Real}})::fmi2Status`. The information how the FMI2 function are structured can be seen from [FMICore.jl](https://github.com/ThummeTo/FMICore.jl), the api of [`fmi2GetReal!`](@ref) or the FMI2.0.3-specification.\n", - "\n", - "In the new implementation the original function is called by the previously stored pointer. Next there is a special handling if `value` is a pointer to an array. In this case the pointer is treated as an array, so that the entries are accessible. Otherwise, each value in `value` is multiplied by two. Finally, the original state of the original function is output." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:16:04.525000Z", - "iopub.status.busy": "2022-10-22T13:16:04.524000Z", - "iopub.status.idle": "2022-10-22T13:16:05.526000Z", - "shell.execute_reply": "2022-10-22T13:16:05.526000Z" - } - }, - "outputs": [], - "source": [ - "function myGetReal!(c::fmi2Component, vr::Union{Array{fmi2ValueReference}, Ptr{fmi2ValueReference}}, \n", - " nvr::Csize_t, value::Union{Array{fmi2Real}, Ptr{fmi2Real}})\n", - " # first, we do what the original function does\n", - " status = fmi2GetReal!(originalGetReal, c, vr, nvr, value)\n", - "\n", - " # if we have a pointer to an array, we must interprete it as array to access elements\n", - " if isa(value, Ptr{fmi2Real})\n", - " value = unsafe_wrap(Array{fmi2Real}, value, nvr, own=false)\n", - " end\n", - "\n", - " # now, we multiply every value by two (just for fun!)\n", - " for i in 1:nvr \n", - " value[i] *= 2.0 \n", - " end \n", - "\n", - " # return the original status\n", - " return status\n", - "end" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the next command the original function is overwritten with the new defined function, for which the command `fmiSetFctGetReal()` is called." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:16:05.530000Z", - "iopub.status.busy": "2022-10-22T13:16:05.530000Z", - "iopub.status.idle": "2022-10-22T13:16:05.542000Z", - "shell.execute_reply": "2022-10-22T13:16:05.542000Z" - } - }, - "outputs": [], - "source": [ - "# no we overwrite the original function\n", - "fmi2SetFctGetReal(fmu, myGetReal!)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulate and Plot FMU with modified function\n", - "\n", - "As before, the identical command is called here for simulation. This is also a model exchange simulation. Immediately afterwards, the results are added to the previous graph as a dashed line." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:16:05.545000Z", - "iopub.status.busy": "2022-10-22T13:16:05.545000Z", - "iopub.status.idle": "2022-10-22T13:16:06.060000Z", - "shell.execute_reply": "2022-10-22T13:16:06.060000Z" - } - }, - "outputs": [], - "source": [ - "simData = simulate(fmu, (tStart, tStop); recordValues=vrs)\n", - "plot!(fig, simData; states=false, style=:dash)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As expected by overwriting the function, all values are doubled." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Unload FMU\n", - "\n", - "After plotting the data, the FMU is unloaded and all unpacked data on disc is removed." - ] - }, - { - "cell_type": "code", - "execution_count": 55, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:16:06.065000Z", - "iopub.status.busy": "2022-10-22T13:16:06.064000Z", - "iopub.status.idle": "2022-10-22T13:16:06.104000Z", - "shell.execute_reply": "2022-10-22T13:16:06.103000Z" - } - }, - "outputs": [], - "source": [ - "unloadFMU(fmu)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Summary\n", - "\n", - "In this tutorial it is shown how an existing function of the library can be replaced by an own implementation." - ] - } - ], - "metadata": { - "interpreter": { - "hash": "037537ff7419c497b9325f7d495147943224d408cf5d5ed915294a5b960167b0" - }, - "jupytext": { - "cell_metadata_filter": "-all", - "comment_magics": "false", - "notebook_metadata_filter": "-all" - }, - "kernelspec": { - "display_name": "Julia 1.10.5", - "language": "julia", - "name": "julia-1.10" - }, - "language_info": { - "file_extension": ".jl", - "mimetype": "application/julia", - "name": "julia", - "version": "1.10.5" - }, - "nteract": { - "version": "0.28.0" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/examples/src/manipulation.jl b/examples/src/manipulation.jl deleted file mode 100644 index 8c9985f6..00000000 --- a/examples/src/manipulation.jl +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. - -# imports -using FMI -using FMI: fmiSetFctGetReal -using FMIZoo -using FMICore -using Plots - -tStart = 0.0 -tStop = 8.0 - -# we use an FMU from the FMIZoo.jl -fmu = fmiLoad("SpringFrictionPendulum1D", "Dymola", "2022x"; type=:ME) - -# an array of value references... or just one -vrs = ["mass.s"] - -simData = fmiSimulate(fmu, (tStart, tStop); recordValues=vrs) - -fig = plot(simData, states=false) - -# save, where the original `fmi2GetReal` function was stored, so we can access it in our new function -originalGetReal = fmu.cGetReal - -function myGetReal!(c::fmi2Component, vr::Union{Array{fmi2ValueReference}, Ptr{fmi2ValueReference}}, - nvr::Csize_t, value::Union{Array{fmi2Real}, Ptr{fmi2Real}}) - # first, we do what the original function does - status = fmi2GetReal!(originalGetReal, c, vr, nvr, value) - - # if we have a pointer to an array, we must interprete it as array to access elements - if isa(value, Ptr{fmi2Real}) - value = unsafe_wrap(Array{fmi2Real}, value, nvr, own=false) - end - - # now, we multiply every value by two (just for fun!) - for i in 1:nvr - value[i] *= 2.0 - end - - # return the original status - return status -end - -# no we overwrite the original function -fmiSetFctGetReal(fmu, myGetReal!) - -simData = fmiSimulate(fmu, (tStart, tStop); recordValues=vrs) -plot!(fig, simData; states=false, style=:dash) - -fmiUnload(fmu) diff --git a/examples/src/manipulation.md b/examples/src/manipulation.md deleted file mode 100644 index c073b57f..00000000 --- a/examples/src/manipulation.md +++ /dev/null @@ -1,146 +0,0 @@ -# Manipulate a function -Tutorial by Tobias Thummerer, Johannes Stoljar - -🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧 - -## License - - -```julia -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. -``` - -## Introduction to the example -This example shows how to overwrite a FMI function with a custom C-function. For this the FMU model is simulated first without changes. Then the function `fmi2GetReal()` is overwritten and simulated again. Both simulations are displayed in a graph to show the change caused by overwriting the function. The model used is a one-dimensional spring pendulum with friction. The object-orientated structure of the *SpringFrictionPendulum1D* can be seen in the following graphic. - -![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringFrictionPendulum1D.svg?raw=true) - - -## Other formats -Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/manipulation.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/manipulation.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/manipulation.md) corresponding to the notebook. - -## Code section - -To run the example, the previously installed packages must be included. - - -```julia -# imports -using FMI -using FMI: fmiSetFctGetReal -using FMIZoo -using FMICore -using Plots -``` - -### Simulation setup - -Next, the start time and end time of the simulation are set. - - -```julia -tStart = 0.0 -tStop = 8.0 -``` - -### Import FMU - -Next, the FMU model from *FMIZoo.jl* is loaded. - - -```julia -# we use an FMU from the FMIZoo.jl -fmu = fmiLoad("SpringFrictionPendulum1D", "Dymola", "2022x"; type=:ME) -``` - -### Simulate FMU - -In the next steps the recorded value is defined. The recorded value is the position of the mass. In the function `fmiSimulateME()` the FMU is simulated in model-exchange mode (ME) with an adaptive step size. In addition, the start and end time and the recorded variables are specified. - - -```julia -# an array of value references... or just one -vrs = ["mass.s"] - -simData = fmiSimulate(fmu, (tStart, tStop); recordValues=vrs) -``` - -### Plotting FMU - -After the simulation is finished, the result of the FMU for the model-exchange mode can be plotted. In the plot for the FMU it can be seen that the oscillation continues to decrease due to the effect of the friction. If you simulate long enough, the oscillation comes to a standstill in a certain time. - - -```julia -fig = plot(simData, states=false) -``` - -### Override Function - -After overwriting a function, the previous one is no longer accessible. The original function `fmi2GetReal()` is cached by storing the address of the pointer. The addresses of the pointers are kept in the FMU and are thus accessible. - - -```julia -# save, where the original `fmi2GetReal` function was stored, so we can access it in our new function -originalGetReal = fmu.cGetReal -``` - -To overwrite the function `fmi2GetReal!()`, the function header of the new custom function must be identical to the previous one. The function header looks like `fmi2GetReal!(cfunc::Ptr{Nothing}, c::fmi2Component, vr::Union{Array{fmi2ValueReference}, Ptr{fmi2ValueReference}}, nvr::Csize_t, value::Union{Array{fmi2Real}, Ptr{fmi2Real}})::fmi2Status`. The information how the FMI2 function are structured can be seen from [FMICore.jl](https://github.com/ThummeTo/FMICore.jl), the api of [`fmi2GetReal!`](@ref) or the FMI2.0.3-specification. - -In the new implementation the original function is called by the previously stored pointer. Next there is a special handling if `value` is a pointer to an array. In this case the pointer is treated as an array, so that the entries are accessible. Otherwise, each value in `value` is multiplied by two. Finally, the original state of the original function is output. - - -```julia -function myGetReal!(c::fmi2Component, vr::Union{Array{fmi2ValueReference}, Ptr{fmi2ValueReference}}, - nvr::Csize_t, value::Union{Array{fmi2Real}, Ptr{fmi2Real}}) - # first, we do what the original function does - status = fmi2GetReal!(originalGetReal, c, vr, nvr, value) - - # if we have a pointer to an array, we must interprete it as array to access elements - if isa(value, Ptr{fmi2Real}) - value = unsafe_wrap(Array{fmi2Real}, value, nvr, own=false) - end - - # now, we multiply every value by two (just for fun!) - for i in 1:nvr - value[i] *= 2.0 - end - - # return the original status - return status -end -``` - -In the next command the original function is overwritten with the new defined function, for which the command `fmiSetFctGetReal()` is called. - - -```julia -# no we overwrite the original function -fmiSetFctGetReal(fmu, myGetReal!) -``` - -### Simulate and Plot FMU with modified function - -As before, the identical command is called here for simulation. This is also a model exchange simulation. Immediately afterwards, the results are added to the previous graph as a dashed line. - - -```julia -simData = fmiSimulate(fmu, (tStart, tStop); recordValues=vrs) -plot!(fig, simData; states=false, style=:dash) -``` - -As expected by overwriting the function, all values are doubled. - -### Unload FMU - -After plotting the data, the FMU is unloaded and all unpacked data on disc is removed. - - -```julia -fmiUnload(fmu) -``` - -### Summary - -In this tutorial it is shown how an existing function of the library can be replaced by an own implementation. diff --git a/examples/src/manipulation_files/manipulation_12_0.png b/examples/src/manipulation_files/manipulation_12_0.png deleted file mode 100644 index 8e3029be..00000000 Binary files a/examples/src/manipulation_files/manipulation_12_0.png and /dev/null differ diff --git a/examples/src/manipulation_files/manipulation_12_0.svg b/examples/src/manipulation_files/manipulation_12_0.svg deleted file mode 100644 index 1f95423a..00000000 --- a/examples/src/manipulation_files/manipulation_12_0.svg +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/src/manipulation_files/manipulation_20_0.png b/examples/src/manipulation_files/manipulation_20_0.png deleted file mode 100644 index 0c01b4ec..00000000 Binary files a/examples/src/manipulation_files/manipulation_20_0.png and /dev/null differ diff --git a/examples/src/manipulation_files/manipulation_20_0.svg b/examples/src/manipulation_files/manipulation_20_0.svg deleted file mode 100644 index aa360adb..00000000 --- a/examples/src/manipulation_files/manipulation_20_0.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/src/modelica_conference_2021.ipynb b/examples/src/modelica_conference_2021.ipynb deleted file mode 100644 index bf148af9..00000000 --- a/examples/src/modelica_conference_2021.ipynb +++ /dev/null @@ -1,354 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Example from the Modelica Conference 2021\n", - "Tutorial by Tobias Thummerer, Johannes Stoljar\n", - "\n", - "This example was updated over time to keep track with developments and changes in *FMI.jl*.\n", - "\n", - "🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧\n", - "\n", - "## License" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:16:18.554000Z", - "iopub.status.busy": "2022-10-22T13:16:17.709000Z", - "iopub.status.idle": "2022-10-22T13:16:18.840000Z", - "shell.execute_reply": "2022-10-22T13:16:18.765000Z" - } - }, - "outputs": [], - "source": [ - "# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar\n", - "# Licensed under the MIT license. \n", - "# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Introduction to the example\n", - "FMUs can be simulated in multiple ways using *FMI.jl*. You can use a very simple interface, that offers possibilities that satisfy almost any user requirement. However, if you need to build a custom simulation loop for your use case using the core FMI functions, we show that too.\n", - "\n", - "![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringFrictionPendulum1D.svg?raw=true) \n", - "\n", - "## Other formats\n", - "Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/modelica_conference_2021.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/modelica_conference_2021.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/modelica_conference_2021.md) corresponding to the notebook. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Code section\n", - "\n", - "To run the example, the previously installed packages must be included. " - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:16:18.843000Z", - "iopub.status.busy": "2022-10-22T13:16:18.843000Z", - "iopub.status.idle": "2022-10-22T13:17:02.927000Z", - "shell.execute_reply": "2022-10-22T13:17:02.927000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "# imports\n", - "using FMI\n", - "using FMIZoo\n", - "using Plots" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulation setup\n", - "\n", - "Next, the start time and end time of the simulation are set. Finally, a step size is specified to store the results of the simulation at these time steps." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:17:05.306000Z", - "iopub.status.busy": "2022-10-22T13:17:02.930000Z", - "iopub.status.idle": "2022-10-22T13:17:06.057000Z", - "shell.execute_reply": "2022-10-22T13:17:06.057000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "tStart = 0.0\n", - "tStep = 0.1\n", - "tStop = 8.0\n", - "tSave = tStart:tStep:tStop" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simple FMU Simulation\n", - "Next, the FMU model from *FMIZoo.jl* is loaded and the information about the FMU is shown." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:17:06.062000Z", - "iopub.status.busy": "2022-10-22T13:17:06.061000Z", - "iopub.status.idle": "2022-10-22T13:17:11.103000Z", - "shell.execute_reply": "2022-10-22T13:17:11.103000Z" - } - }, - "outputs": [], - "source": [ - "# we use an FMU from the FMIZoo.jl\n", - "fmu = loadFMU(\"SpringFrictionPendulum1D\", \"Dymola\", \"2022x\")\n", - "info(fmu)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Easy Simulation\n", - "In the next commands the FMU is simulated, for which the start and end time and recorded variables are declared. Afterwards the simulation result is plotted. In the plot for the FMU, it can be seen that the oscillation keeps decreasing due to the effect of friction. If one simulates long enough, the oscillation comes to a standstill after a certain time." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:17:11.106000Z", - "iopub.status.busy": "2022-10-22T13:17:11.106000Z", - "iopub.status.idle": "2022-10-22T13:18:05.013000Z", - "shell.execute_reply": "2022-10-22T13:18:05.013000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "simData = simulate(fmu, (tStart, tStop); recordValues=[\"mass.s\"], saveat=tSave)\n", - "plot(simData)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "After plotting the data, the FMU is unloaded and all unpacked data on disc is removed." - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:18:05.018000Z", - "iopub.status.busy": "2022-10-22T13:18:05.018000Z", - "iopub.status.idle": "2022-10-22T13:18:05.057000Z", - "shell.execute_reply": "2022-10-22T13:18:05.057000Z" - } - }, - "outputs": [], - "source": [ - "unloadFMU(fmu)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Custom Simulation\n", - "\n", - "In the following type of simulation a more advanced variant is presented, which allows intervening more in the simulation process. Analogous to the simple variant, an FMU model must be loaded." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:18:05.061000Z", - "iopub.status.busy": "2022-10-22T13:18:05.060000Z", - "iopub.status.idle": "2022-10-22T13:18:05.160000Z", - "shell.execute_reply": "2022-10-22T13:18:05.160000Z" - } - }, - "outputs": [], - "source": [ - "fmu = loadFMU(\"SpringFrictionPendulum1D\", \"Dymola\", \"2022x\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Next, it is necessary to create an instance of the FMU, this is achieved by the command `fmi2Instantiate!()`. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:18:05.163000Z", - "iopub.status.busy": "2022-10-22T13:18:05.163000Z", - "iopub.status.idle": "2022-10-22T13:18:05.510000Z", - "shell.execute_reply": "2022-10-22T13:18:05.510000Z" - } - }, - "outputs": [], - "source": [ - "instanceFMU = fmi2Instantiate!(fmu)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the following code block, start and end time for the simulation is set by the `fmi2SetupExperiment()` command. Next, the FMU is initialized by the calls of `fmi2EnterInitializationMode()` and `fmi2ExitInitializationMode()`. It would also be possible to set initial states, parameters or inputs at this place in code." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:18:05.514000Z", - "iopub.status.busy": "2022-10-22T13:18:05.514000Z", - "iopub.status.idle": "2022-10-22T13:18:05.780000Z", - "shell.execute_reply": "2022-10-22T13:18:05.780000Z" - } - }, - "outputs": [], - "source": [ - "fmi2SetupExperiment(instanceFMU, tStart, tStop)\n", - "# set initial model states\n", - "fmi2EnterInitializationMode(instanceFMU)\n", - "# get initial model states\n", - "fmi2ExitInitializationMode(instanceFMU)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The actual simulation loop is shown in the following block. Here a simulation step `fmi2DoStep()` with the fixed step size `tStep` is executed. As indicated in the code by the comments, the input values and output values of the FMU could be changed in the simulation loop as desired, whereby the higher possibility of adjustments arises." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:18:05.785000Z", - "iopub.status.busy": "2022-10-22T13:18:05.784000Z", - "iopub.status.idle": "2022-10-22T13:18:05.818000Z", - "shell.execute_reply": "2022-10-22T13:18:05.818000Z" - } - }, - "outputs": [], - "source": [ - "values = []\n", - "\n", - "for t in tSave\n", - " # set model inputs if any\n", - " # ...\n", - "\n", - " fmi2DoStep(instanceFMU, tStep)\n", - " \n", - " # get model outputs\n", - " value = fmi2GetReal(instanceFMU, \"mass.s\")\n", - " push!(values, value)\n", - "end\n", - "\n", - "plot(tSave, values)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The instantiated FMU must be terminated and then the memory area for the instance can also be deallocated. The last step is to unload the FMU to remove all unpacked data on disc. " - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:18:05.822000Z", - "iopub.status.busy": "2022-10-22T13:18:05.822000Z", - "iopub.status.idle": "2022-10-22T13:18:05.833000Z", - "shell.execute_reply": "2022-10-22T13:18:05.833000Z" - } - }, - "outputs": [], - "source": [ - "fmi2Terminate(instanceFMU)\n", - "fmi2FreeInstance!(instanceFMU)\n", - "unloadFMU(fmu)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Summary\n", - "\n", - "The tutorial has shown how to use the default simulation command and how to deploy a custom simulation loop." - ] - } - ], - "metadata": { - "interpreter": { - "hash": "037537ff7419c497b9325f7d495147943224d408cf5d5ed915294a5b960167b0" - }, - "jupytext": { - "cell_metadata_filter": "-all", - "comment_magics": "false", - "notebook_metadata_filter": "-all" - }, - "kernelspec": { - "display_name": "Julia 1.10.5", - "language": "julia", - "name": "julia-1.10" - }, - "language_info": { - "file_extension": ".jl", - "mimetype": "application/julia", - "name": "julia", - "version": "1.10.5" - }, - "nteract": { - "version": "0.28.0" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/examples/src/modelica_conference_2021.jl b/examples/src/modelica_conference_2021.jl deleted file mode 100644 index ab6f37c4..00000000 --- a/examples/src/modelica_conference_2021.jl +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. - -# imports -using FMI -using FMIZoo -using Plots - -tStart = 0.0 -tStep = 0.1 -tStop = 8.0 -tSave = tStart:tStep:tStop - -# we use an FMU from the FMIZoo.jl -fmu = fmiLoad("SpringFrictionPendulum1D", "Dymola", "2022x") -fmiInfo(fmu) - -simData = fmiSimulate(fmu, (tStart, tStop); recordValues=["mass.s"], saveat=tSave) -plot(simData) - -fmiUnload(fmu) - -fmu = fmiLoad(pathToFMU) - -instanceFMU = fmi2Instantiate!(fmu) - -fmi2SetupExperiment(instanceFMU, tStart, tStop) -# set initial model states -fmi2EnterInitializationMode(instanceFMU) -# get initial model states -fmi2ExitInitializationMode(instanceFMU) - -values = [] - -for t in tSave - # set model inputs if any - # ... - - fmi2DoStep(instanceFMU, tStep) - - # get model outputs - value = fmi2GetReal(instanceFMU, "mass.s") - push!(values, value) -end - -plot(tSave, values) - -fmi2Terminate(instanceFMU) -fmi2FreeInstance!(instanceFMU) -fmi2Unload(fmu) diff --git a/examples/src/modelica_conference_2021.md b/examples/src/modelica_conference_2021.md deleted file mode 100644 index 1a71a5c0..00000000 --- a/examples/src/modelica_conference_2021.md +++ /dev/null @@ -1,133 +0,0 @@ -# Example from the Modelica Conference 2021 -Tutorial by Tobias Thummerer, Johannes Stoljar - -This example was updated over time to keep track with developments and changes in *FMI.jl*. - -🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧 - -## License - - -```julia -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. -``` - -## Introduction to the example -FMUs can be simulated in multiple ways using *FMI.jl*. You can use a very simple interface, that offers possibilities that satisfy almost any user requirement. However, if you need to build a custom simulation loop for your use case using the core FMI functions, we show that too. - -![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringFrictionPendulum1D.svg?raw=true) - -## Other formats -Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/modelica_conference_2021.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/modelica_conference_2021.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/modelica_conference_2021.md) corresponding to the notebook. - -## Code section - -To run the example, the previously installed packages must be included. - - -```julia -# imports -using FMI -using FMIZoo -using Plots -``` - -### Simulation setup - -Next, the start time and end time of the simulation are set. Finally, a step size is specified to store the results of the simulation at these time steps. - - -```julia -tStart = 0.0 -tStep = 0.1 -tStop = 8.0 -tSave = tStart:tStep:tStop -``` - -### Simple FMU Simulation -Next, the FMU model from *FMIZoo.jl* is loaded and the information about the FMU is shown. - - -```julia -# we use an FMU from the FMIZoo.jl -fmu = fmiLoad("SpringFrictionPendulum1D", "Dymola", "2022x") -fmiInfo(fmu) -``` - -### Easy Simulation -In the next commands the FMU is simulated, for which the start and end time and recorded variables are declared. Afterwards the simulation result is plotted. In the plot for the FMU, it can be seen that the oscillation keeps decreasing due to the effect of friction. If one simulates long enough, the oscillation comes to a standstill after a certain time. - - -```julia -simData = fmiSimulate(fmu, (tStart, tStop); recordValues=["mass.s"], saveat=tSave) -plot(simData) -``` - -After plotting the data, the FMU is unloaded and all unpacked data on disc is removed. - - -```julia -fmiUnload(fmu) -``` - -### Custom Simulation - -In the following type of simulation a more advanced variant is presented, which allows intervening more in the simulation process. Analogous to the simple variant, an FMU model must be loaded. - - -```julia -fmu = fmiLoad(pathToFMU) -``` - -Next, it is necessary to create an instance of the FMU, this is achieved by the command `fmi2Instantiate!()`. - - -```julia -instanceFMU = fmi2Instantiate!(fmu) -``` - -In the following code block, start and end time for the simulation is set by the `fmi2SetupExperiment()` command. Next, the FMU is initialized by the calls of `fmi2EnterInitializationMode()` and `fmi2ExitInitializationMode()`. It would also be possible to set initial states, parameters or inputs at this place in code. - - -```julia -fmi2SetupExperiment(instanceFMU, tStart, tStop) -# set initial model states -fmi2EnterInitializationMode(instanceFMU) -# get initial model states -fmi2ExitInitializationMode(instanceFMU) -``` - -The actual simulation loop is shown in the following block. Here a simulation step `fmi2DoStep()` with the fixed step size `tStep` is executed. As indicated in the code by the comments, the input values and output values of the FMU could be changed in the simulation loop as desired, whereby the higher possibility of adjustments arises. - - -```julia -values = [] - -for t in tSave - # set model inputs if any - # ... - - fmi2DoStep(instanceFMU, tStep) - - # get model outputs - value = fmi2GetReal(instanceFMU, "mass.s") - push!(values, value) -end - -plot(tSave, values) -``` - -The instantiated FMU must be terminated and then the memory area for the instance can also be deallocated. The last step is to unload the FMU to remove all unpacked data on disc. - - -```julia -fmi2Terminate(instanceFMU) -fmi2FreeInstance!(instanceFMU) -fmi2Unload(fmu) -``` - -### Summary - -The tutorial has shown how to use the default simulation command and how to deploy a custom simulation loop. diff --git a/examples/src/modelica_conference_2021_files/modelica_conference_2021_10_0.png b/examples/src/modelica_conference_2021_files/modelica_conference_2021_10_0.png deleted file mode 100644 index dc08671d..00000000 Binary files a/examples/src/modelica_conference_2021_files/modelica_conference_2021_10_0.png and /dev/null differ diff --git a/examples/src/modelica_conference_2021_files/modelica_conference_2021_10_0.svg b/examples/src/modelica_conference_2021_files/modelica_conference_2021_10_0.svg deleted file mode 100644 index 557a35cd..00000000 --- a/examples/src/modelica_conference_2021_files/modelica_conference_2021_10_0.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/src/modelica_conference_2021_files/modelica_conference_2021_20_0.png b/examples/src/modelica_conference_2021_files/modelica_conference_2021_20_0.png deleted file mode 100644 index 056696c8..00000000 Binary files a/examples/src/modelica_conference_2021_files/modelica_conference_2021_20_0.png and /dev/null differ diff --git a/examples/src/modelica_conference_2021_files/modelica_conference_2021_20_0.svg b/examples/src/modelica_conference_2021_files/modelica_conference_2021_20_0.svg deleted file mode 100644 index 264663fd..00000000 --- a/examples/src/modelica_conference_2021_files/modelica_conference_2021_20_0.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/src/multiple_instances.ipynb b/examples/src/multiple_instances.ipynb deleted file mode 100644 index af2bcdd8..00000000 --- a/examples/src/multiple_instances.ipynb +++ /dev/null @@ -1,388 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Multiple Instances of an FMU\n", - "Tutorial by Johannes Stoljar, Tobias Thummerer\n", - "\n", - "🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧\n", - "\n", - "## License" - ] - }, - { - "cell_type": "code", - "execution_count": 73, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:18:17.738000Z", - "iopub.status.busy": "2022-10-22T13:18:17.035000Z", - "iopub.status.idle": "2022-10-22T13:18:18.022000Z", - "shell.execute_reply": "2022-10-22T13:18:17.946000Z" - } - }, - "outputs": [], - "source": [ - "# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar\n", - "# Licensed under the MIT license. \n", - "# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Motivation\n", - "This Julia Package *FMI.jl* is motivated by the use of simulation models in Julia. Here the FMI specification is implemented. FMI (*Functional Mock-up Interface*) is a free standard ([fmi-standard.org](https://fmi-standard.org/)) that defines a container and an interface to exchange dynamic models using a combination of XML files, binaries and C code zipped into a single file. The user can thus use simulation models in the form of an FMU (*Functional Mock-up Units*). Besides loading the FMU, the user can also set values for parameters and states and simulate the FMU both as co-simulation and model exchange simulation.\n", - "\n", - "## Introduction to the example\n", - "In this example we want to show that it is possible to create different instances of an FMU. The different instances can then be used to run independent simulations. After the FMU has been simulated, the simulation results are displayed in a graph. The used model is a one-dimensional spring pendulum without friction. The object-orientated structure of the *SpringPendulum1D* can be seen in the following graphic.\n", - "\n", - "![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringPendulum1D.svg?raw=true) \n", - "\n", - "\n", - "## Target group\n", - "The example is primarily intended for users who work in the field of simulations. The example wants to show how simple it is to use FMUs in Julia.\n", - "\n", - "\n", - "## Other formats\n", - "Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiple_instances.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiple_instances.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiple_instances.md) corresponding to the notebook. \n", - "\n", - "\n", - "## Getting started\n", - "\n", - "### Installation prerequisites\n", - "| | Description | Command | Alternative | \n", - "|:----|:----------------------------------|:--------------------------|:-----------------------------------------------|\n", - "| 1. | Enter Package Manager via | ] | |\n", - "| 2. | Install FMI via | add FMI | add \" https://github.com/ThummeTo/FMI.jl \" |\n", - "| 3. | Install FMIZoo via | add FMIZoo | add \" https://github.com/ThummeTo/FMIZoo.jl \" |\n", - "| 4. | Install Plots via | add Plots | |" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Code section\n", - "\n", - "To run the example, the previously installed packages must be included. " - ] - }, - { - "cell_type": "code", - "execution_count": 74, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:18:18.025000Z", - "iopub.status.busy": "2022-10-22T13:18:18.025000Z", - "iopub.status.idle": "2022-10-22T13:19:02.368000Z", - "shell.execute_reply": "2022-10-22T13:19:02.368000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "# imports\n", - "using FMI\n", - "using FMIZoo\n", - "using Plots" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulation setup\n", - "\n", - "Next, the start time and end time of the simulation are set. Finally, the recorded values are specified to store the results of the simulation." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:19:04.768000Z", - "iopub.status.busy": "2022-10-22T13:19:02.371000Z", - "iopub.status.idle": "2022-10-22T13:19:08.730000Z", - "shell.execute_reply": "2022-10-22T13:19:08.730000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "tStart = 0.0\n", - "tStop = 8.0\n", - "\n", - "vrs = [\"mass.s\"]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Import FMU\n", - "\n", - "In the next lines of code the FMU model from *FMIZoo.jl* is loaded and the information about the FMU is shown." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:19:08.735000Z", - "iopub.status.busy": "2022-10-22T13:19:08.734000Z", - "iopub.status.idle": "2022-10-22T13:19:14.412000Z", - "shell.execute_reply": "2022-10-22T13:19:14.412000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "# we use an FMU from the FMIZoo.jl\n", - "pathToFMU = get_model_filename(\"SpringPendulum1D\", \"Dymola\", \"2022x\")\n", - "\n", - "myFMU = loadFMU(pathToFMU)\n", - "info(myFMU)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### First Instance\n", - "\n", - "To create an instance of the FMU it is necessary to call the command `fmi2Instantiate!()`. With the component address you now have a unique instance of the FMU." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:19:14.415000Z", - "iopub.status.busy": "2022-10-22T13:19:14.415000Z", - "iopub.status.idle": "2022-10-22T13:19:14.932000Z", - "shell.execute_reply": "2022-10-22T13:19:14.932000Z" - } - }, - "outputs": [], - "source": [ - "c1 = fmi2Instantiate!(myFMU; loggingOn=true)\n", - "comp1Address = c1.addr\n", - "println(c1)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Next, a dictionary for the parameters is created. With this dictionary you can set the initial states of the variables of the FMU. For the spring constant `spring.c` a value of $10.0 \\frac{N}{m}$ and for the position of the mass `mass.s` a value of $1.0 m$ is set. The created dictionary with the specified variables for recording are passed to the command for simulation. In addition, other keywords are set. On the one hand the keyword `instantiate=false` is set, which prevents that in the simulation command a new instance is created. On the other hand the keyword `freeInstance=false` is set, this prevents that after the simulation command the instance is released. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:19:14.936000Z", - "iopub.status.busy": "2022-10-22T13:19:14.936000Z", - "iopub.status.idle": "2022-10-22T13:20:06.087000Z", - "shell.execute_reply": "2022-10-22T13:20:06.087000Z" - } - }, - "outputs": [], - "source": [ - "param1 = Dict(\"spring.c\"=>10.0, \"mass_s0\"=>1.0)\n", - "data1 = simulate(c1, (tStart, tStop); parameters=param1, recordValues=vrs, instantiate=false, freeInstance=false)\n", - "fig = plot(data1)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For control, you can compare again the address of the instance to the previous address, and it should be the same address. As soon as this is not the case an error would be thrown by the macro `@assert`." - ] - }, - { - "cell_type": "code", - "execution_count": 79, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:20:06.093000Z", - "iopub.status.busy": "2022-10-22T13:20:06.093000Z", - "iopub.status.idle": "2022-10-22T13:20:06.135000Z", - "shell.execute_reply": "2022-10-22T13:20:06.135000Z" - } - }, - "outputs": [], - "source": [ - "@assert c1.addr === comp1Address" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Second Instance\n", - "\n", - "To create a second instance of the FMU it is necessary to call the command `fmi2Instantiate!()`. With the component address you now have a unique instance of the FMU." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:20:06.139000Z", - "iopub.status.busy": "2022-10-22T13:20:06.138000Z", - "iopub.status.idle": "2022-10-22T13:20:06.141000Z", - "shell.execute_reply": "2022-10-22T13:20:06.141000Z" - } - }, - "outputs": [], - "source": [ - "c2 = fmi2Instantiate!(myFMU; loggingOn=true)\n", - "comp2Address = c2.addr\n", - "println(c2)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The addresses of the instantiated FMUs must differ, and you can see that in the comparison below." - ] - }, - { - "cell_type": "code", - "execution_count": 81, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:20:06.145000Z", - "iopub.status.busy": "2022-10-22T13:20:06.145000Z", - "iopub.status.idle": "2022-10-22T13:20:06.146000Z", - "shell.execute_reply": "2022-10-22T13:20:06.146000Z" - } - }, - "outputs": [], - "source": [ - "@assert comp1Address !== comp2Address" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Again, a dictionary for the parameters is created. With this dictionary you can set the initial states of the variables of the FMU. For the spring constant `spring.c` a value of $1.0 \\frac{N}{m}$ and for the position of the mass `mass.s` a value of $2.0 m$ is set. The created dictionary with the specified variables for recording are passed to the command for simulation. As before, the two keywords `instantiate=false` and `freeInstance=false` are set." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:20:06.148000Z", - "iopub.status.busy": "2022-10-22T13:20:06.148000Z", - "iopub.status.idle": "2022-10-22T13:20:06.248000Z", - "shell.execute_reply": "2022-10-22T13:20:06.248000Z" - } - }, - "outputs": [], - "source": [ - "param2 = Dict(\"spring.c\"=>1.0, \"mass.s\"=>2.0)\n", - "data2 = simulateCS(c2, (tStart, tStop); parameters=param2, recordValues=vrs, instantiate=false, freeInstance=false)\n", - "plot!(fig, data2)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For control, you can compare again the address of the instance `comp2` to the previous address `comp2Address` and it should be the same address." - ] - }, - { - "cell_type": "code", - "execution_count": 83, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:20:06.256000Z", - "iopub.status.busy": "2022-10-22T13:20:06.256000Z", - "iopub.status.idle": "2022-10-22T13:20:06.257000Z", - "shell.execute_reply": "2022-10-22T13:20:06.257000Z" - } - }, - "outputs": [], - "source": [ - "@assert c2.addr === comp2Address" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Unload FMU\n", - "\n", - "After plotting the data, the FMU is unloaded and all unpacked data on disc is removed." - ] - }, - { - "cell_type": "code", - "execution_count": 84, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:20:06.260000Z", - "iopub.status.busy": "2022-10-22T13:20:06.259000Z", - "iopub.status.idle": "2022-10-22T13:20:06.301000Z", - "shell.execute_reply": "2022-10-22T13:20:06.301000Z" - } - }, - "outputs": [], - "source": [ - "unloadFMU(myFMU)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Summary\n", - "\n", - "Based on the example it can be seen that it is possible to create different instances of an FMU. The different instances can then be used to perform different simulations." - ] - } - ], - "metadata": { - "interpreter": { - "hash": "037537ff7419c497b9325f7d495147943224d408cf5d5ed915294a5b960167b0" - }, - "jupytext": { - "cell_metadata_filter": "-all", - "comment_magics": "false", - "notebook_metadata_filter": "-all" - }, - "kernelspec": { - "display_name": "Julia 1.10.5", - "language": "julia", - "name": "julia-1.10" - }, - "language_info": { - "file_extension": ".jl", - "mimetype": "application/julia", - "name": "julia", - "version": "1.10.5" - }, - "nteract": { - "version": "0.28.0" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/examples/src/multiple_instances.jl b/examples/src/multiple_instances.jl deleted file mode 100644 index f53fdad4..00000000 --- a/examples/src/multiple_instances.jl +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. - -# imports -using FMI -using FMIZoo -using Plots - -tStart = 0.0 -tStop = 8.0 - -vrs = ["mass.s"] - -# we use an FMU from the FMIZoo.jl -pathToFMU = get_model_filename("SpringPendulum1D", "Dymola", "2022x") - -myFMU = fmiLoad(pathToFMU) -fmiInfo(myFMU) - -comp1 = fmiInstantiate!(myFMU; loggingOn=true) -comp1Address= comp1.compAddr -println(comp1) - -param1 = Dict("spring.c"=>10.0, "mass_s0"=>1.0) -data1 = fmiSimulate(comp1, (tStart, tStop); parameters=param1, recordValues=vrs, instantiate=false, freeInstance=false) -fig = fmiPlot(data1) - -@assert comp1.compAddr === comp1Address - -comp2 = fmiInstantiate!(myFMU; loggingOn=true) -comp2Address= comp2.compAddr -println(comp2) - -@assert comp1Address !== comp2Address - -param2 = Dict("spring.c"=>1.0, "mass.s"=>2.0) -data2 = fmiSimulateCS(comp2, (tStart, tStop); parameters=param2, recordValues=vrs, instantiate=false, freeInstance=false) -fmiPlot!(fig, data2) - -@assert comp2.compAddr === comp2Address - -fmiUnload(myFMU) diff --git a/examples/src/multiple_instances.md b/examples/src/multiple_instances.md deleted file mode 100644 index 3a0eebf3..00000000 --- a/examples/src/multiple_instances.md +++ /dev/null @@ -1,151 +0,0 @@ -# Multiple Instances of an FMU -Tutorial by Johannes Stoljar, Tobias Thummerer - -🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧 - -## License - - -```julia -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. -``` - -## Motivation -This Julia Package *FMI.jl* is motivated by the use of simulation models in Julia. Here the FMI specification is implemented. FMI (*Functional Mock-up Interface*) is a free standard ([fmi-standard.org](https://fmi-standard.org/)) that defines a container and an interface to exchange dynamic models using a combination of XML files, binaries and C code zipped into a single file. The user can thus use simulation models in the form of an FMU (*Functional Mock-up Units*). Besides loading the FMU, the user can also set values for parameters and states and simulate the FMU both as co-simulation and model exchange simulation. - -## Introduction to the example -In this example we want to show that it is possible to create different instances of an FMU. The different instances can then be used to run independent simulations. After the FMU has been simulated, the simulation results are displayed in a graph. The used model is a one-dimensional spring pendulum without friction. The object-orientated structure of the *SpringPendulum1D* can be seen in the following graphic. - -![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringPendulum1D.svg?raw=true) - - -## Target group -The example is primarily intended for users who work in the field of simulations. The example wants to show how simple it is to use FMUs in Julia. - - -## Other formats -Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiple_instances.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiple_instances.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiple_instances.md) corresponding to the notebook. - - -## Getting started - -### Installation prerequisites -| | Description | Command | Alternative | -|:----|:----------------------------------|:--------------------------|:-----------------------------------------------| -| 1. | Enter Package Manager via | ] | | -| 2. | Install FMI via | add FMI | add " https://github.com/ThummeTo/FMI.jl " | -| 3. | Install FMIZoo via | add FMIZoo | add " https://github.com/ThummeTo/FMIZoo.jl " | -| 4. | Install Plots via | add Plots | | - -## Code section - -To run the example, the previously installed packages must be included. - - -```julia -# imports -using FMI -using FMIZoo -using Plots -``` - -### Simulation setup - -Next, the start time and end time of the simulation are set. Finally, the recorded values are specified to store the results of the simulation. - - -```julia -tStart = 0.0 -tStop = 8.0 - -vrs = ["mass.s"] -``` - -### Import FMU - -In the next lines of code the FMU model from *FMIZoo.jl* is loaded and the information about the FMU is shown. - - -```julia -# we use an FMU from the FMIZoo.jl -pathToFMU = get_model_filename("SpringPendulum1D", "Dymola", "2022x") - -myFMU = fmiLoad(pathToFMU) -fmiInfo(myFMU) -``` - -### First Instance - -To create an instance of the FMU it is necessary to call the command `fmiInstantiate!()`. With the component address you now have a unique instance of the FMU. - - -```julia -comp1 = fmiInstantiate!(myFMU; loggingOn=true) -comp1Address= comp1.compAddr -println(comp1) -``` - -Next, a dictionary for the parameters is created. With this dictionary you can set the initial states of the variables of the FMU. For the spring constant `spring.c` a value of $10.0 \frac{N}{m}$ and for the position of the mass `mass.s` a value of $1.0 m$ is set. The created dictionary with the specified variables for recording are passed to the command for simulation. In addition, other keywords are set. On the one hand the keyword `instantiate=false` is set, which prevents that in the simulation command a new instance is created. On the other hand the keyword `freeInstance=false` is set, this prevents that after the simulation command the instance is released. - - -```julia -param1 = Dict("spring.c"=>10.0, "mass_s0"=>1.0) -data1 = fmiSimulate(comp1, (tStart, tStop); parameters=param1, recordValues=vrs, instantiate=false, freeInstance=false) -fig = fmiPlot(data1) -``` - -For control, you can compare again the address of the instance to the previous address, and it should be the same address. As soon as this is not the case an error would be thrown by the macro `@assert`. - - -```julia -@assert comp1.compAddr === comp1Address -``` - -### Second Instance - -To create a second instance of the FMU it is necessary to call the command `fmiInstantiate!()`. With the component address you now have a unique instance of the FMU. - - -```julia -comp2 = fmiInstantiate!(myFMU; loggingOn=true) -comp2Address= comp2.compAddr -println(comp2) -``` - -The addresses of the instantiated FMUs must differ, and you can see that in the comparison below. - - -```julia -@assert comp1Address !== comp2Address -``` - -Again, a dictionary for the parameters is created. With this dictionary you can set the initial states of the variables of the FMU. For the spring constant `spring.c` a value of $1.0 \frac{N}{m}$ and for the position of the mass `mass.s` a value of $2.0 m$ is set. The created dictionary with the specified variables for recording are passed to the command for simulation. As before, the two keywords `instantiate=false` and `freeInstance=false` are set. - - -```julia -param2 = Dict("spring.c"=>1.0, "mass.s"=>2.0) -data2 = fmiSimulateCS(comp2, (tStart, tStop); parameters=param2, recordValues=vrs, instantiate=false, freeInstance=false) -fmiPlot!(fig, data2) -``` - -For control, you can compare again the address of the instance `comp2` to the previous address `comp2Address` and it should be the same address. - - -```julia -@assert comp2.compAddr === comp2Address -``` - -### Unload FMU - -After plotting the data, the FMU is unloaded and all unpacked data on disc is removed. - - -```julia -fmiUnload(myFMU) -``` - -### Summary - -Based on the example it can be seen that it is possible to create different instances of an FMU. The different instances can then be used to perform different simulations. diff --git a/examples/src/multiple_instances_files/multiple_instances_12_0.png b/examples/src/multiple_instances_files/multiple_instances_12_0.png deleted file mode 100644 index f7839178..00000000 Binary files a/examples/src/multiple_instances_files/multiple_instances_12_0.png and /dev/null differ diff --git a/examples/src/multiple_instances_files/multiple_instances_12_0.svg b/examples/src/multiple_instances_files/multiple_instances_12_0.svg deleted file mode 100644 index dce225c8..00000000 --- a/examples/src/multiple_instances_files/multiple_instances_12_0.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/src/multiple_instances_files/multiple_instances_20_0.png b/examples/src/multiple_instances_files/multiple_instances_20_0.png deleted file mode 100644 index 5f2120f3..00000000 Binary files a/examples/src/multiple_instances_files/multiple_instances_20_0.png and /dev/null differ diff --git a/examples/src/multiple_instances_files/multiple_instances_20_0.svg b/examples/src/multiple_instances_files/multiple_instances_20_0.svg deleted file mode 100644 index ec42c5b5..00000000 --- a/examples/src/multiple_instances_files/multiple_instances_20_0.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/src/multiprocessing.ipynb b/examples/src/multiprocessing.ipynb deleted file mode 100644 index b0a9ae3f..00000000 --- a/examples/src/multiprocessing.ipynb +++ /dev/null @@ -1,510 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Multiprocessing\n", - "Tutorial by Jonas Wilfert, Tobias Thummerer\n", - "\n", - "🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧\n", - "\n", - "## License" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "execution": { - "iopub.execute_input": "2024-09-18T06:56:55.696000Z", - "iopub.status.busy": "2024-09-18T06:56:55.258000Z", - "iopub.status.idle": "2024-09-18T06:56:55.977000Z", - "shell.execute_reply": "2024-09-18T06:56:55.930000Z" - } - }, - "outputs": [], - "source": [ - "# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar, Jonas Wilfert\n", - "# Licensed under the MIT license. \n", - "# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Motivation\n", - "This Julia Package *FMI.jl* is motivated by the use of simulation models in Julia. Here the FMI specification is implemented. FMI (*Functional Mock-up Interface*) is a free standard ([fmi-standard.org](https://fmi-standard.org/)) that defines a container and an interface to exchange dynamic models using a combination of XML files, binaries and C code zipped into a single file. The user can thus use simulation models in the form of an FMU (*Functional Mock-up Units*). Besides loading the FMU, the user can also set values for parameters and states and simulate the FMU both as co-simulation and model exchange simulation.\n", - "\n", - "## Introduction to the example\n", - "This example shows how to parallelize the computation of an FMU in FMI.jl. We can compute a batch of FMU-evaluations in parallel with different initial settings.\n", - "Parallelization can be achieved using multithreading or using multiprocessing. This example shows **multiprocessing**, check `multithreading.ipynb` for multithreading.\n", - "Advantage of multithreading is a lower communication overhead as well as lower RAM usage.\n", - "However in some cases multiprocessing can be faster as the garbage collector is not shared.\n", - "\n", - "\n", - "The model used is a one-dimensional spring pendulum with friction. The object-orientated structure of the *SpringFrictionPendulum1D* can be seen in the following graphic.\n", - "\n", - "![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringFrictionPendulum1D.svg?raw=true) \n", - "\n", - "\n", - "## Target group\n", - "The example is primarily intended for users who work in the field of simulations. The example wants to show how simple it is to use FMUs in Julia.\n", - "\n", - "\n", - "## Other formats\n", - "Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiprocessing.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiprocessing.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiprocessing.md) corresponding to the notebook. \n", - "\n", - "\n", - "## Getting started\n", - "\n", - "### Installation prerequisites\n", - "| | Description | Command | Alternative | \n", - "|:----|:----------------------------------|:--------------------------|:-----------------------------------------------|\n", - "| 1. | Enter Package Manager via | ] | |\n", - "| 2. | Install FMI via | add FMI | add \" https://github.com/ThummeTo/FMI.jl \" |\n", - "| 3. | Install FMIZoo via | add FMIZoo | add \" https://github.com/ThummeTo/FMIZoo.jl \" |\n", - "| 4. | Install FMICore via | add FMICore | add \" https://github.com/ThummeTo/FMICore.jl \" |\n", - "| 5. | Install BenchmarkTools via | add BenchmarkTools | |" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Code section\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Adding your desired amount of processes:" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "execution": { - "iopub.execute_input": "2024-09-18T06:56:55.977000Z", - "iopub.status.busy": "2024-09-18T06:56:55.977000Z", - "iopub.status.idle": "2024-09-18T06:57:03.075000Z", - "shell.execute_reply": "2024-09-18T06:57:03.075000Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "2-element Vector{Int64}:\n", - " 2\n", - " 3" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "using Distributed\n", - "n_procs = 2\n", - "addprocs(n_procs; exeflags=`--project=$(Base.active_project()) --threads=auto`, restrict=false)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To run the example, the previously installed packages must be included. " - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "execution": { - "iopub.execute_input": "2024-09-18T06:57:03.107000Z", - "iopub.status.busy": "2024-09-18T06:57:03.107000Z", - "iopub.status.idle": "2024-09-18T06:57:24.919000Z", - "shell.execute_reply": "2024-09-18T06:57:24.919000Z" - } - }, - "outputs": [], - "source": [ - "# imports\n", - "@everywhere using FMI\n", - "@everywhere using FMIZoo\n", - "@everywhere using DifferentialEquations\n", - "@everywhere using BenchmarkTools" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Checking that we workers have been correctly initialized:" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "execution": { - "iopub.execute_input": "2024-09-18T06:57:25.060000Z", - "iopub.status.busy": "2024-09-18T06:57:24.919000Z", - "iopub.status.idle": "2024-09-18T06:57:25.123000Z", - "shell.execute_reply": "2024-09-18T06:57:25.123000Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello World!\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - " From worker 2:\tHello World!\n", - " From worker 3:\tHello World!" - ] - } - ], - "source": [ - "workers()\n", - "\n", - "@everywhere println(\"Hello World!\")\n", - "\n", - "# The following lines can be uncommented for more advanced information about the subprocesses\n", - "# @everywhere println(pwd())\n", - "# @everywhere println(Base.active_project())\n", - "# @everywhere println(gethostname())\n", - "# @everywhere println(VERSION)\n", - "# @everywhere println(Threads.nthreads())" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulation setup\n", - "\n", - "Next, the batch size and input values are defined." - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "execution": { - "iopub.execute_input": "2024-09-18T06:57:25.123000Z", - "iopub.status.busy": "2024-09-18T06:57:25.123000Z", - "iopub.status.idle": "2024-09-18T06:57:26.764000Z", - "shell.execute_reply": "2024-09-18T06:57:26.764000Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n" - ] - }, - { - "data": { - "text/plain": [ - "16-element Vector{Vector{Float64}}:\n", - " [0.8896151422243904, 0.19360331402643516]\n", - " [0.5667607315125027, 0.8469069630650393]\n", - " [0.4467595228412755, 0.11565682370854558]\n", - " [0.16792108625193536, 0.8851389775680923]\n", - " [0.8085429088036629, 0.1348042631253319]\n", - " [0.22403537940585305, 0.4003499683325523]\n", - " [0.6181748598004135, 0.03844117933163582]\n", - " [0.4406224572743377, 0.5926575758049457]\n", - " [0.2983365896614829, 0.553293392273904]\n", - " [0.024123375732912677, 0.3322971075005886]\n", - " [0.9602759520524581, 0.36629615676373006]\n", - " [0.5403567465763699, 0.48659208795242603]\n", - " [0.7055325623167514, 0.9113177671381074]\n", - " [0.9584900337743231, 0.7550085456804099]\n", - " [0.4928513219033166, 0.24472926422690866]\n", - " [0.6994234096332927, 0.8094366580173032]" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "\n", - "# Best if batchSize is a multiple of the threads/cores\n", - "batchSize = 16\n", - "\n", - "# Define an array of arrays randomly\n", - "input_values = collect(collect.(eachrow(rand(batchSize,2))))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Shared Module\n", - "For Distributed we need to embed the FMU into its own `module`. This prevents Distributed from trying to serialize and send the FMU over the network, as this can cause issues. This module needs to be made available on all processes using `@everywhere`." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "execution": { - "iopub.execute_input": "2024-09-18T06:57:26.764000Z", - "iopub.status.busy": "2024-09-18T06:57:26.764000Z", - "iopub.status.idle": "2024-09-18T06:57:35.285000Z", - "shell.execute_reply": "2024-09-18T06:57:35.285000Z" - } - }, - "outputs": [], - "source": [ - "@everywhere module SharedModule\n", - " using FMIZoo\n", - " using FMI\n", - "\n", - " t_start = 0.0\n", - " t_step = 0.1\n", - " t_stop = 10.0\n", - " tspan = (t_start, t_stop)\n", - " tData = collect(t_start:t_step:t_stop)\n", - "\n", - " model_fmu = loadFMU(\"SpringPendulum1D\", \"Dymola\", \"2022x\"; type=:ME)\n", - "end" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We define a helper function to calculate the FMU and combine it into an Matrix." - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "execution": { - "iopub.execute_input": "2024-09-18T06:57:35.285000Z", - "iopub.status.busy": "2024-09-18T06:57:35.285000Z", - "iopub.status.idle": "2024-09-18T06:57:35.363000Z", - "shell.execute_reply": "2024-09-18T06:57:35.363000Z" - } - }, - "outputs": [], - "source": [ - "@everywhere function runCalcFormatted(fmu, x0, recordValues=[\"mass.s\", \"mass.v\"])\n", - " data = simulateME(fmu, SharedModule.tspan; recordValues=recordValues, saveat=SharedModule.tData, x0=x0, showProgress=false, dtmax=1e-4)\n", - " return reduce(hcat, data.states.u)\n", - "end" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Running a single evaluation is pretty quick, therefore the speed can be better tested with BenchmarkTools." - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "execution": { - "iopub.execute_input": "2024-09-18T06:57:35.363000Z", - "iopub.status.busy": "2024-09-18T06:57:35.363000Z", - "iopub.status.idle": "2024-09-18T06:58:16.187000Z", - "shell.execute_reply": "2024-09-18T06:58:16.187000Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": [ - "BenchmarkTools.Trial: 2 samples with 1 evaluation.\n", - " Range \u001b[90m(\u001b[39m\u001b[36m\u001b[1mmin\u001b[22m\u001b[39m … \u001b[35mmax\u001b[39m\u001b[90m): \u001b[39m\u001b[36m\u001b[1m3.064 s\u001b[22m\u001b[39m … \u001b[35m 3.397 s\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmin … max\u001b[90m): \u001b[39m0.73% … 7.40%\n", - " Time \u001b[90m(\u001b[39m\u001b[34m\u001b[1mmedian\u001b[22m\u001b[39m\u001b[90m): \u001b[39m\u001b[34m\u001b[1m3.230 s \u001b[22m\u001b[39m\u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmedian\u001b[90m): \u001b[39m4.24%\n", - " Time \u001b[90m(\u001b[39m\u001b[32m\u001b[1mmean\u001b[22m\u001b[39m ± \u001b[32mσ\u001b[39m\u001b[90m): \u001b[39m\u001b[32m\u001b[1m3.230 s\u001b[22m\u001b[39m ± \u001b[32m235.653 ms\u001b[39m \u001b[90m┊\u001b[39m GC \u001b[90m(\u001b[39mmean ± σ\u001b[90m): \u001b[39m4.24% ± 4.72%\n", - "\n", - " \u001b[34m█\u001b[39m\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[32m \u001b[39m\u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m \u001b[39m█\u001b[39m \u001b[39m \n", - " \u001b[34m█\u001b[39m\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[32m▁\u001b[39m\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m▁\u001b[39m█\u001b[39m \u001b[39m▁\n", - " 3.06 s\u001b[90m Histogram: frequency by time\u001b[39m 3.4 s \u001b[0m\u001b[1m<\u001b[22m\n", - "\n", - " Memory estimate\u001b[90m: \u001b[39m\u001b[33m300.76 MiB\u001b[39m, allocs estimate\u001b[90m: \u001b[39m\u001b[33m7603698\u001b[39m." - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "@benchmark data = runCalcFormatted(SharedModule.model_fmu, rand(2))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Single Threaded Batch Execution\n", - "To compute a batch we can collect multiple evaluations. In a single threaded context we can use the same FMU for every call." - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "execution": { - "iopub.execute_input": "2024-09-18T06:58:16.187000Z", - "iopub.status.busy": "2024-09-18T06:58:16.187000Z", - "iopub.status.idle": "2024-09-18T07:00:45.253000Z", - "shell.execute_reply": "2024-09-18T07:00:45.253000Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Single Threaded\n" - ] - }, - { - "data": { - "text/plain": [ - "BenchmarkTools.Trial: 1 sample with 1 evaluation.\n", - " Single result which took \u001b[34m49.249 s\u001b[39m (0.94% GC) to evaluate,\n", - " with a memory estimate of \u001b[33m4.70 GiB\u001b[39m, over \u001b[33m121659156\u001b[39m allocations." - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "println(\"Single Threaded\")\n", - "@benchmark collect(runCalcFormatted(SharedModule.model_fmu, i) for i in input_values)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Multithreaded Batch Execution\n", - "In a multithreaded context we have to provide each thread it's own fmu, as they are not thread safe.\n", - "To spread the execution of a function to multiple processes, the function `pmap` can be used." - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "execution": { - "iopub.execute_input": "2024-09-18T07:00:45.268000Z", - "iopub.status.busy": "2024-09-18T07:00:45.268000Z", - "iopub.status.idle": "2024-09-18T07:02:35.412000Z", - "shell.execute_reply": "2024-09-18T07:02:35.412000Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Multi Threaded\n" - ] - }, - { - "data": { - "text/plain": [ - "BenchmarkTools.Trial: 1 sample with 1 evaluation.\n", - " Single result which took \u001b[34m29.315 s\u001b[39m (0.00% GC) to evaluate,\n", - " with a memory estimate of \u001b[33m99.25 KiB\u001b[39m, over \u001b[33m1583\u001b[39m allocations." - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "println(\"Multi Threaded\")\n", - "@benchmark pmap(i -> runCalcFormatted(SharedModule.model_fmu, i), input_values)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As you can see, there is a significant speed-up in the median execution time. But: The speed-up is often much smaller than `n_procs` (or the number of physical cores of your CPU), this has different reasons. For a rule of thumb, the speed-up should be around `n/2` on a `n`-core-processor with `n` Julia processes." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Unload FMU\n", - "\n", - "After calculating the data, the FMU is unloaded and all unpacked data on disc is removed." - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "execution": { - "iopub.execute_input": "2024-09-18T07:02:35.427000Z", - "iopub.status.busy": "2024-09-18T07:02:35.427000Z", - "iopub.status.idle": "2024-09-18T07:02:35.787000Z", - "shell.execute_reply": "2024-09-18T07:02:35.787000Z" - } - }, - "outputs": [], - "source": [ - "@everywhere unloadFMU(SharedModule.model_fmu)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Summary\n", - "\n", - "In this tutorial it is shown how multi processing with `Distributed.jl` can be used to improve the performance for calculating a Batch of FMUs." - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Julia 1.10.5", - "language": "julia", - "name": "julia-1.10" - }, - "language_info": { - "file_extension": ".jl", - "mimetype": "application/julia", - "name": "julia", - "version": "1.10.5" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/examples/src/multiprocessing.jl b/examples/src/multiprocessing.jl deleted file mode 100644 index a1464b29..00000000 --- a/examples/src/multiprocessing.jl +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar, Jonas Wilfert -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. - -using Distributed -n_procs = 2 -addprocs(n_procs; exeflags=`--project=$(Base.active_project()) --threads=auto`, restrict=false) - -# imports -@everywhere using FMI -@everywhere using FMIZoo -@everywhere using BenchmarkTools - -workers() - -@everywhere println("Hello World!") - -# The following lines can be uncommented for more advanced informations about the subprocesses -# @everywhere println(pwd()) -# @everywhere println(Base.active_project()) -# @everywhere println(gethostname()) -# @everywhere println(VERSION) -# @everywhere println(Threads.nthreads()) - - -# Best if batchSize is a multiple of the threads/cores -batchSize = 16 - -# Define an array of arrays randomly -input_values = collect(collect.(eachrow(rand(batchSize,2)))) - -@everywhere module SharedModule - using FMIZoo - using FMI - - t_start = 0.0 - t_step = 0.1 - t_stop = 10.0 - tspan = (t_start, t_stop) - tData = collect(t_start:t_step:t_stop) - - model_fmu = FMIZoo.fmiLoad("SpringPendulum1D", "Dymola", "2022x") -end - -@everywhere function runCalcFormatted(fmu, x0, recordValues=["mass.s", "mass.v"]) - data = fmiSimulateME(fmu, SharedModule.tspan; recordValues=recordValues, saveat=SharedModule.tData, x0=x0, showProgress=false, dtmax=1e-4) - return reduce(hcat, data.states.u) -end - -@benchmark data = runCalcFormatted(SharedModule.model_fmu, rand(2)) - -println("Single Threaded") -@benchmark collect(runCalcFormatted(SharedModule.model_fmu, i) for i in input_values) - -println("Multi Threaded") -@benchmark pmap(i -> runCalcFormatted(SharedModule.model_fmu, i), input_values) - -@everywhere fmiUnload(SharedModule.model_fmu) diff --git a/examples/src/multiprocessing.md b/examples/src/multiprocessing.md deleted file mode 100644 index 4250c5c5..00000000 --- a/examples/src/multiprocessing.md +++ /dev/null @@ -1,170 +0,0 @@ -# Multiprocessing -Tutorial by Jonas Wilfert, Tobias Thummerer - -🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧 - -## License - - -```julia -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar, Jonas Wilfert -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. -``` - -## Motivation -This Julia Package *FMI.jl* is motivated by the use of simulation models in Julia. Here the FMI specification is implemented. FMI (*Functional Mock-up Interface*) is a free standard ([fmi-standard.org](https://fmi-standard.org/)) that defines a container and an interface to exchange dynamic models using a combination of XML files, binaries and C code zipped into a single file. The user can thus use simulation models in the form of an FMU (*Functional Mock-up Units*). Besides loading the FMU, the user can also set values for parameters and states and simulate the FMU both as co-simulation and model exchange simulation. - -## Introduction to the example -This example shows how to parallelize the computation of an FMU in FMI.jl. We can compute a batch of FMU-evaluations in parallel with different initial settings. -Parallelization can be achieved using multithreading or using multiprocessing. This example shows **multiprocessing**, check `multithreading.ipynb` for multithreading. -Advantage of multithreading is a lower communication overhead as well as lower RAM usage. -However in some cases multiprocessing can be faster as the garbage collector is not shared. - - -The model used is a one-dimensional spring pendulum with friction. The object-orientated structure of the *SpringFrictionPendulum1D* can be seen in the following graphic. - -![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringFrictionPendulum1D.svg?raw=true) - - -## Target group -The example is primarily intended for users who work in the field of simulations. The example wants to show how simple it is to use FMUs in Julia. - - -## Other formats -Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiprocessing.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiprocessing.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multiprocessing.md) corresponding to the notebook. - - -## Getting started - -### Installation prerequisites -| | Description | Command | Alternative | -|:----|:----------------------------------|:--------------------------|:-----------------------------------------------| -| 1. | Enter Package Manager via | ] | | -| 2. | Install FMI via | add FMI | add " https://github.com/ThummeTo/FMI.jl " | -| 3. | Install FMIZoo via | add FMIZoo | add " https://github.com/ThummeTo/FMIZoo.jl " | -| 4. | Install FMICore via | add FMICore | add " https://github.com/ThummeTo/FMICore.jl " | -| 5. | Install BenchmarkTools via | add BenchmarkTools | | - -## Code section - - - -Adding your desired amount of processes: - - -```julia -using Distributed -n_procs = 2 -addprocs(n_procs; exeflags=`--project=$(Base.active_project()) --threads=auto`, restrict=false) -``` - -To run the example, the previously installed packages must be included. - - -```julia -# imports -@everywhere using FMI -@everywhere using FMIZoo -@everywhere using BenchmarkTools -``` - -Checking that we workers have been correctly initialized: - - -```julia -workers() - -@everywhere println("Hello World!") - -# The following lines can be uncommented for more advanced informations about the subprocesses -# @everywhere println(pwd()) -# @everywhere println(Base.active_project()) -# @everywhere println(gethostname()) -# @everywhere println(VERSION) -# @everywhere println(Threads.nthreads()) -``` - -### Simulation setup - -Next, the batch size and input values are defined. - - -```julia - -# Best if batchSize is a multiple of the threads/cores -batchSize = 16 - -# Define an array of arrays randomly -input_values = collect(collect.(eachrow(rand(batchSize,2)))) -``` - -### Shared Module -For Distributed we need to embed the FMU into its own `module`. This prevents Distributed from trying to serialize and send the FMU over the network, as this can cause issues. This module needs to be made available on all processes using `@everywhere`. - - -```julia -@everywhere module SharedModule - using FMIZoo - using FMI - - t_start = 0.0 - t_step = 0.1 - t_stop = 10.0 - tspan = (t_start, t_stop) - tData = collect(t_start:t_step:t_stop) - - model_fmu = FMIZoo.fmiLoad("SpringPendulum1D", "Dymola", "2022x") -end -``` - -We define a helper function to calculate the FMU and combine it into an Matrix. - - -```julia -@everywhere function runCalcFormatted(fmu, x0, recordValues=["mass.s", "mass.v"]) - data = fmiSimulateME(fmu, SharedModule.tspan; recordValues=recordValues, saveat=SharedModule.tData, x0=x0, showProgress=false, dtmax=1e-4) - return reduce(hcat, data.states.u) -end -``` - -Running a single evaluation is pretty quick, therefore the speed can be better tested with BenchmarkTools. - - -```julia -@benchmark data = runCalcFormatted(SharedModule.model_fmu, rand(2)) -``` - -### Single Threaded Batch Execution -To compute a batch we can collect multiple evaluations. In a single threaded context we can use the same FMU for every call. - - -```julia -println("Single Threaded") -@benchmark collect(runCalcFormatted(SharedModule.model_fmu, i) for i in input_values) -``` - -### Multithreaded Batch Execution -In a multithreaded context we have to provide each thread it's own fmu, as they are not thread safe. -To spread the execution of a function to multiple processes, the function `pmap` can be used. - - -```julia -println("Multi Threaded") -@benchmark pmap(i -> runCalcFormatted(SharedModule.model_fmu, i), input_values) -``` - -As you can see, there is a significant speed-up in the median execution time. But: The speed-up is often much smaller than `n_procs` (or the number of physical cores of your CPU), this has different reasons. For a rule of thumb, the speed-up should be around `n/2` on a `n`-core-processor with `n` Julia processes. - -### Unload FMU - -After calculating the data, the FMU is unloaded and all unpacked data on disc is removed. - - -```julia -@everywhere fmiUnload(SharedModule.model_fmu) -``` - -### Summary - -In this tutorial it is shown how multi processing with `Distributed.jl` can be used to improve the performance for calculating a Batch of FMUs. diff --git a/examples/src/multithreading.ipynb b/examples/src/multithreading.ipynb deleted file mode 100644 index 4f7f1edc..00000000 --- a/examples/src/multithreading.ipynb +++ /dev/null @@ -1,354 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Multithreading\n", - "Tutorial by Jonas Wilfert, Tobias Thummerer\n", - "\n", - "🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧\n", - "\n", - "## License" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:24:22.502000Z", - "iopub.status.busy": "2022-10-22T13:24:21.808000Z", - "iopub.status.idle": "2022-10-22T13:24:22.776000Z", - "shell.execute_reply": "2022-10-22T13:24:22.704000Z" - } - }, - "outputs": [], - "source": [ - "# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar, Jonas Wilfert\n", - "# Licensed under the MIT license. \n", - "# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Motivation\n", - "This Julia Package *FMI.jl* is motivated by the use of simulation models in Julia. Here the FMI specification is implemented. FMI (*Functional Mock-up Interface*) is a free standard ([fmi-standard.org](https://fmi-standard.org/)) that defines a container and an interface to exchange dynamic models using a combination of XML files, binaries and C code zipped into a single file. The user can thus use simulation models in the form of an FMU (*Functional Mock-up Units*). Besides loading the FMU, the user can also set values for parameters and states and simulate the FMU both as co-simulation and model exchange simulation.\n", - "\n", - "## Introduction to the example\n", - "This example shows how to parallelize the computation of an FMU in FMI.jl. We can compute a batch of FMU-evaluations in parallel with different initial settings.\n", - "Parallelization can be achieved using multithreading or using multiprocessing. This example shows **multithreading**, check `multiprocessing.ipynb` for multiprocessing.\n", - "Advantage of multithreading is a lower communication overhead as well as lower RAM usage.\n", - "However in some cases multiprocessing can be faster as the garbage collector is not shared.\n", - "\n", - "\n", - "The model used is a one-dimensional spring pendulum with friction. The object-orientated structure of the *SpringFrictionPendulum1D* can be seen in the following graphic.\n", - "\n", - "![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringFrictionPendulum1D.svg?raw=true) \n", - "\n", - "\n", - "## Target group\n", - "The example is primarily intended for users who work in the field of simulations. The example wants to show how simple it is to use FMUs in Julia.\n", - "\n", - "\n", - "## Other formats\n", - "Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multithreading.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multithreading.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multithreading.md) corresponding to the notebook. \n", - "\n", - "\n", - "## Getting started\n", - "\n", - "### Installation prerequisites\n", - "| | Description | Command | Alternative | \n", - "|:----|:----------------------------------|:--------------------------|:-----------------------------------------------|\n", - "| 1. | Enter Package Manager via | ] | |\n", - "| 2. | Install FMI via | add FMI | add \" https://github.com/ThummeTo/FMI.jl \" |\n", - "| 3. | Install FMIZoo via | add FMIZoo | add \" https://github.com/ThummeTo/FMIZoo.jl \" |\n", - "| 4. | Install FMICore via | add FMICore | add \" https://github.com/ThummeTo/FMICore.jl \" |\n", - "| 5. | Install Folds via | add Folds | |\n", - "| 6. | Install BenchmarkTools via | add BenchmarkTools | |" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Code section\n", - "\n", - "To run the example, the previously installed packages must be included. " - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:24:22.779000Z", - "iopub.status.busy": "2022-10-22T13:24:22.779000Z", - "iopub.status.idle": "2022-10-22T13:24:56.411000Z", - "shell.execute_reply": "2022-10-22T13:24:56.411000Z" - } - }, - "outputs": [], - "source": [ - "# imports\n", - "using FMI\n", - "using FMIZoo\n", - "using Folds\n", - "using BenchmarkTools\n", - "using DifferentialEquations" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "First, check the amount of available threads:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:24:56.610000Z", - "iopub.status.busy": "2022-10-22T13:24:56.414000Z", - "iopub.status.idle": "2022-10-22T13:24:57.213000Z", - "shell.execute_reply": "2022-10-22T13:24:57.212000Z" - } - }, - "outputs": [], - "source": [ - "Threads.nthreads()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If the number of available threads doesn't match your expections, you can increase the number of threads available to the Julia process like described [here](https://docs.julialang.org/en/v1/manual/multi-threading/#Starting-Julia-with-multiple-threads)." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulation setup\n", - "\n", - "Next, the start time and end time of the simulation are set. Here we also decide the size of the batch." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:24:57.217000Z", - "iopub.status.busy": "2022-10-22T13:24:57.217000Z", - "iopub.status.idle": "2022-10-22T13:25:02.608000Z", - "shell.execute_reply": "2022-10-22T13:25:02.608000Z" - } - }, - "outputs": [], - "source": [ - "t_start = 0.0\n", - "t_step = 0.1\n", - "t_stop = 10.0\n", - "tspan = (t_start, t_stop)\n", - "tData = collect(t_start:t_step:t_stop)\n", - "\n", - "# Best if batchSize is a multiple of the threads/cores\n", - "batchSize = Threads.nthreads()\n", - "\n", - "# Define an array of arrays randomly\n", - "input_values = collect(collect.(eachrow(rand(batchSize,2))))\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We need to instantiate one FMU for each parallel execution, as they cannot be easily shared among different threads." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:25:02.612000Z", - "iopub.status.busy": "2022-10-22T13:25:02.612000Z", - "iopub.status.idle": "2022-10-22T13:25:08.843000Z", - "shell.execute_reply": "2022-10-22T13:25:08.843000Z" - } - }, - "outputs": [], - "source": [ - "# a single FMU to compare the performance\n", - "realFMU = loadFMU(\"SpringPendulum1D\", \"Dymola\", \"2022x\")\n", - "\n", - "# the FMU batch\n", - "realFMUBatch = [loadFMU(\"SpringPendulum1D\", \"Dymola\", \"2022x\") for _ in 1:batchSize]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We define a helper function to calculate the FMU solution and combine it into an Matrix." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:25:08.847000Z", - "iopub.status.busy": "2022-10-22T13:25:08.847000Z", - "iopub.status.idle": "2022-10-22T13:25:09.898000Z", - "shell.execute_reply": "2022-10-22T13:25:09.898000Z" - } - }, - "outputs": [], - "source": [ - "function runCalcFormatted(fmu::FMU2, x0::Vector{Float64}, recordValues::Vector{String}=[\"mass.s\", \"mass.v\"])\n", - " data = simulateME(fmu, tspan; recordValues=recordValues, saveat=tData, x0=x0, showProgress=false, dtmax=1e-4)\n", - " return reduce(hcat, data.states.u)\n", - "end" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Running a single evaluation is pretty quick, therefore the speed can be better tested with BenchmarkTools." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:25:09.902000Z", - "iopub.status.busy": "2022-10-22T13:25:09.902000Z", - "iopub.status.idle": "2022-10-22T13:25:55.418000Z", - "shell.execute_reply": "2022-10-22T13:25:55.417000Z" - } - }, - "outputs": [], - "source": [ - "@benchmark data = runCalcFormatted(realFMU, rand(2))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Single Threaded Batch Execution\n", - "To compute a batch we can collect multiple evaluations. In a single threaded context we can use the same FMU for every call." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:25:55.422000Z", - "iopub.status.busy": "2022-10-22T13:25:55.422000Z", - "iopub.status.idle": "2022-10-22T13:26:13.196000Z", - "shell.execute_reply": "2022-10-22T13:26:13.196000Z" - } - }, - "outputs": [], - "source": [ - "println(\"Single Threaded\")\n", - "@benchmark collect(runCalcFormatted(realFMU, i) for i in input_values)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Multithreaded Batch Execution\n", - "In a multithreaded context we have to provide each thread it's own fmu, as they are not thread safe.\n", - "To spread the execution of a function to multiple threads, the library `Folds` can be used." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:26:13.200000Z", - "iopub.status.busy": "2022-10-22T13:26:13.200000Z", - "iopub.status.idle": "2022-10-22T13:26:34.238000Z", - "shell.execute_reply": "2022-10-22T13:26:34.238000Z" - } - }, - "outputs": [], - "source": [ - "println(\"Multi Threaded\")\n", - "@benchmark Folds.collect(runCalcFormatted(fmu, i) for (fmu, i) in zip(realFMUBatch, input_values))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As you can see, there is a significant speed-up in the median execution time. But: The speed-up is often much smaller than `Threads.nthreads()`, this has different reasons. For a rule of thumb, the speed-up should be around `n/2` on a `n`-core-processor with `n` threads for the Julia process." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Unload FMU\n", - "\n", - "After calculating the data, the FMU is unloaded and all unpacked data on disc is removed." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:26:34.242000Z", - "iopub.status.busy": "2022-10-22T13:26:34.242000Z", - "iopub.status.idle": "2022-10-22T13:26:35.698000Z", - "shell.execute_reply": "2022-10-22T13:26:35.698000Z" - } - }, - "outputs": [], - "source": [ - "unloadFMU(realFMU)\n", - "unloadFMU.(realFMUBatch)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Summary\n", - "\n", - "In this tutorial it is shown how multi threading with `Folds.jl` can be used to improve the performance for calculating a Batch of FMUs." - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Julia 1.10.5", - "language": "julia", - "name": "julia-1.10" - }, - "language_info": { - "file_extension": ".jl", - "mimetype": "application/julia", - "name": "julia", - "version": "1.10.5" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/examples/src/multithreading.jl b/examples/src/multithreading.jl deleted file mode 100644 index d33a9316..00000000 --- a/examples/src/multithreading.jl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar, Jonas Wilfert -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. - -# imports -using FMI -using FMIZoo -using Folds -using BenchmarkTools - -Threads.nthreads() - -t_start = 0.0 -t_step = 0.1 -t_stop = 10.0 -tspan = (t_start, t_stop) -tData = collect(t_start:t_step:t_stop) - -# Best if batchSize is a multiple of the threads/cores -batchSize = Threads.nthreads() - -# Define an array of arrays randomly -input_values = collect(collect.(eachrow(rand(batchSize,2)))) - - -# a single FMU to compare the performance -realFMU = fmiLoad("SpringPendulum1D", "Dymola", "2022x") - -# the FMU batch -realFMUBatch = [fmiLoad("SpringPendulum1D", "Dymola", "2022x") for _ in 1:batchSize] - -function runCalcFormatted(fmu::FMU2, x0::Vector{Float64}, recordValues::Vector{String}=["mass.s", "mass.v"]) - data = fmiSimulateME(fmu, tspan; recordValues=recordValues, saveat=tData, x0=x0, showProgress=false, dtmax=1e-4) - return reduce(hcat, data.states.u) -end - -@benchmark data = runCalcFormatted(realFMU, rand(2)) - -println("Single Threaded") -@benchmark collect(runCalcFormatted(realFMU, i) for i in input_values) - -println("Multi Threaded") -@benchmark Folds.collect(runCalcFormatted(fmu, i) for (fmu, i) in zip(realFMUBatch, input_values)) - -fmiUnload(realFMU) -fmiUnload.(realFMUBatch) diff --git a/examples/src/multithreading.md b/examples/src/multithreading.md deleted file mode 100644 index 5e69d3bf..00000000 --- a/examples/src/multithreading.md +++ /dev/null @@ -1,153 +0,0 @@ -# Multithreading -Tutorial by Jonas Wilfert, Tobias Thummerer - -🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧 - -## License - - -```julia -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar, Jonas Wilfert -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. -``` - -## Motivation -This Julia Package *FMI.jl* is motivated by the use of simulation models in Julia. Here the FMI specification is implemented. FMI (*Functional Mock-up Interface*) is a free standard ([fmi-standard.org](https://fmi-standard.org/)) that defines a container and an interface to exchange dynamic models using a combination of XML files, binaries and C code zipped into a single file. The user can thus use simulation models in the form of an FMU (*Functional Mock-up Units*). Besides loading the FMU, the user can also set values for parameters and states and simulate the FMU both as co-simulation and model exchange simulation. - -## Introduction to the example -This example shows how to parallelize the computation of an FMU in FMI.jl. We can compute a batch of FMU-evaluations in parallel with different initial settings. -Parallelization can be achieved using multithreading or using multiprocessing. This example shows **multithreading**, check `multiprocessing.ipynb` for multiprocessing. -Advantage of multithreading is a lower communication overhead as well as lower RAM usage. -However in some cases multiprocessing can be faster as the garbage collector is not shared. - - -The model used is a one-dimensional spring pendulum with friction. The object-orientated structure of the *SpringFrictionPendulum1D* can be seen in the following graphic. - -![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringFrictionPendulum1D.svg?raw=true) - - -## Target group -The example is primarily intended for users who work in the field of simulations. The example wants to show how simple it is to use FMUs in Julia. - - -## Other formats -Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multithreading.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multithreading.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/multithreading.md) corresponding to the notebook. - - -## Getting started - -### Installation prerequisites -| | Description | Command | Alternative | -|:----|:----------------------------------|:--------------------------|:-----------------------------------------------| -| 1. | Enter Package Manager via | ] | | -| 2. | Install FMI via | add FMI | add " https://github.com/ThummeTo/FMI.jl " | -| 3. | Install FMIZoo via | add FMIZoo | add " https://github.com/ThummeTo/FMIZoo.jl " | -| 4. | Install FMICore via | add FMICore | add " https://github.com/ThummeTo/FMICore.jl " | -| 5. | Install Folds via | add Folds | | -| 6. | Install BenchmarkTools via | add BenchmarkTools | | - -## Code section - -To run the example, the previously installed packages must be included. - - -```julia -# imports -using FMI -using FMIZoo -using Folds -using BenchmarkTools -``` - -First, check the amount of available threads: - - -```julia -Threads.nthreads() -``` - -If the number of available threads doesn't match your expections, you can increase the number of threads available to the Julia process like described [here](https://docs.julialang.org/en/v1/manual/multi-threading/#Starting-Julia-with-multiple-threads). - -### Simulation setup - -Next, the start time and end time of the simulation are set. Here we also decide the size of the batch. - - -```julia -t_start = 0.0 -t_step = 0.1 -t_stop = 10.0 -tspan = (t_start, t_stop) -tData = collect(t_start:t_step:t_stop) - -# Best if batchSize is a multiple of the threads/cores -batchSize = Threads.nthreads() - -# Define an array of arrays randomly -input_values = collect(collect.(eachrow(rand(batchSize,2)))) - -``` - -We need to instantiate one FMU for each parallel execution, as they cannot be easily shared among different threads. - - -```julia -# a single FMU to compare the performance -realFMU = fmiLoad("SpringPendulum1D", "Dymola", "2022x") - -# the FMU batch -realFMUBatch = [fmiLoad("SpringPendulum1D", "Dymola", "2022x") for _ in 1:batchSize] -``` - -We define a helper function to calculate the FMU solution and combine it into an Matrix. - - -```julia -function runCalcFormatted(fmu::FMU2, x0::Vector{Float64}, recordValues::Vector{String}=["mass.s", "mass.v"]) - data = fmiSimulateME(fmu, tspan; recordValues=recordValues, saveat=tData, x0=x0, showProgress=false, dtmax=1e-4) - return reduce(hcat, data.states.u) -end -``` - -Running a single evaluation is pretty quick, therefore the speed can be better tested with BenchmarkTools. - - -```julia -@benchmark data = runCalcFormatted(realFMU, rand(2)) -``` - -### Single Threaded Batch Execution -To compute a batch we can collect multiple evaluations. In a single threaded context we can use the same FMU for every call. - - -```julia -println("Single Threaded") -@benchmark collect(runCalcFormatted(realFMU, i) for i in input_values) -``` - -### Multithreaded Batch Execution -In a multithreaded context we have to provide each thread it's own fmu, as they are not thread safe. -To spread the execution of a function to multiple threads, the library `Folds` can be used. - - -```julia -println("Multi Threaded") -@benchmark Folds.collect(runCalcFormatted(fmu, i) for (fmu, i) in zip(realFMUBatch, input_values)) -``` - -As you can see, there is a significant speed-up in the median execution time. But: The speed-up is often much smaller than `Threads.nthreads()`, this has different reasons. For a rule of thumb, the speed-up should be around `n/2` on a `n`-core-processor with `n` threads for the Julia process. - -### Unload FMU - -After calculating the data, the FMU is unloaded and all unpacked data on disc is removed. - - -```julia -fmiUnload(realFMU) -fmiUnload.(realFMUBatch) -``` - -### Summary - -In this tutorial it is shown how multi threading with `Folds.jl` can be used to improve the performance for calculating a Batch of FMUs. diff --git a/examples/src/parameter_optimization.ipynb b/examples/src/parameter_optimization.ipynb deleted file mode 100644 index 585466bb..00000000 --- a/examples/src/parameter_optimization.ipynb +++ /dev/null @@ -1,356 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# FMU Parameter Optimization\n", - "Tutorial by Tobias Thummerer\n", - "\n", - "## License" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:26:47.623000Z", - "iopub.status.busy": "2022-10-22T13:26:46.768000Z", - "iopub.status.idle": "2022-10-22T13:26:47.904000Z", - "shell.execute_reply": "2022-10-22T13:26:47.830000Z" - } - }, - "outputs": [], - "source": [ - "# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons\n", - "# Licensed under the MIT license. \n", - "# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Introduction to the example\n", - "This example shows how a parameter optimization can be set up for a FMU. The goal is to fit FMU parameters (and initial states), so that a reference trajectory is fit as good as possible.\n", - "\n", - "Note, that this tutorial covers optimization *without* gradient information. Basically, *FMI.jl* supports gradient based optimization, too.\n", - "\n", - "## Other formats\n", - "Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameter_optimization.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameter_optimization.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameter_optimization.md) corresponding to the notebook. \n", - "\n", - "## Getting started\n", - "\n", - "### Installation prerequisites\n", - "| | Description | Command |\n", - "|:----|:----------------------------------|:--------------------------|\n", - "| 1. | Enter Package Manager via | ] |\n", - "| 2. | Install FMI via | add FMI | \n", - "| 3. | Install FMIZoo via | add FMIZoo | \n", - "| 4. | Install Optim via | add Optim | \n", - "| 5. | Install Plots via | add Plots | " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Code section\n", - "\n", - "To run the example, the previously installed packages must be included. " - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:26:47.908000Z", - "iopub.status.busy": "2022-10-22T13:26:47.907000Z", - "iopub.status.idle": "2022-10-22T13:27:21.215000Z", - "shell.execute_reply": "2022-10-22T13:27:21.215000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "# imports\n", - "using FMI\n", - "using FMIZoo\n", - "using Optim\n", - "using Plots\n", - "using DifferentialEquations" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulation setup\n", - "\n", - "Next, the start time and end time of the simulation are set." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:21.476000Z", - "iopub.status.busy": "2022-10-22T13:27:21.219000Z", - "iopub.status.idle": "2022-10-22T13:27:25.399000Z", - "shell.execute_reply": "2022-10-22T13:27:25.398000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "tStart = 0.0\n", - "tStop = 5.0\n", - "tStep = 0.1\n", - "tSave = tStart:tStep:tStop" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Import FMU\n", - "\n", - "In the next lines of code the FMU model from *FMIZoo.jl* is loaded and the information about the FMU is shown." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:25.403000Z", - "iopub.status.busy": "2022-10-22T13:27:25.403000Z", - "iopub.status.idle": "2022-10-22T13:27:30.244000Z", - "shell.execute_reply": "2022-10-22T13:27:30.244000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "# we use an FMU from the FMIZoo.jl\n", - "fmu = loadFMU(\"SpringPendulum1D\", \"Dymola\", \"2022x\"; type=:ME)\n", - "info(fmu)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now, the optimization objective (the function to minimize) needs to be defined. In this case, we just want to do a simulation and compare it to a regular `sin` wave." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:31.661000Z", - "iopub.status.busy": "2022-10-22T13:27:31.660000Z", - "iopub.status.idle": "2022-10-22T13:27:33.084000Z", - "shell.execute_reply": "2022-10-22T13:27:33.084000Z" - } - }, - "outputs": [], - "source": [ - "s_tar = 1.0 .+ sin.(tSave)\n", - "\n", - "# a function to simulate the FMU for given parameters\n", - "function simulateFMU(p)\n", - " s0, v0, c, m = p # unpack parameters: s0 (start position), v0 (start velocity), c (spring constant) and m (pendulum mass)\n", - "\n", - " # pack the parameters into a dictionary\n", - " paramDict = Dict{String, Any}()\n", - " paramDict[\"spring.c\"] = c \n", - " paramDict[\"mass.m\"] = m\n", - "\n", - " # pack the start state\n", - " x0 = [s0, v0]\n", - "\n", - " # simulate with given start stae and parameters\n", - " sol = simulate(fmu, (tStart, tStop); x0=x0, parameters=paramDict, saveat=tSave)\n", - "\n", - " # get state with index 1 (the position) from the solution\n", - " s_res = getState(sol, 1; isIndex=true) \n", - "\n", - " return s_res\n", - "end\n", - "\n", - "# the optimization objective\n", - "function objective(p)\n", - " s_res = simulateFMU(p)\n", - "\n", - " # return the position error sum between FMU simulation (s_res) and target (s_tar)\n", - " return sum(abs.(s_tar .- s_res)) \n", - "end" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now let's see how far we are away for our guess parameters:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:33.088000Z", - "iopub.status.busy": "2022-10-22T13:27:33.088000Z", - "iopub.status.idle": "2022-10-22T13:27:33.164000Z", - "shell.execute_reply": "2022-10-22T13:27:33.164000Z" - }, - "scrolled": true - }, - "outputs": [], - "source": [ - "s0 = 0.0 \n", - "v0 = 0.0\n", - "c = 1.0\n", - "m = 1.0 \n", - "p = [s0, v0, c, m]\n", - "\n", - "obj_before = objective(p) # not really good!" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Let's have a look on the differences:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:33.168000Z", - "iopub.status.busy": "2022-10-22T13:27:33.168000Z", - "iopub.status.idle": "2022-10-22T13:27:36.378000Z", - "shell.execute_reply": "2022-10-22T13:27:36.378000Z" - } - }, - "outputs": [], - "source": [ - "s_fmu = simulateFMU(p); # simulate the position\n", - "\n", - "plot(tSave, s_fmu; label=\"FMU\")\n", - "plot!(tSave, s_tar; label=\"Optimization target\")" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Not that good. So let's do a bit of optimization!" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:36.383000Z", - "iopub.status.busy": "2022-10-22T13:27:36.382000Z", - "iopub.status.idle": "2022-10-22T13:27:36.453000Z", - "shell.execute_reply": "2022-10-22T13:27:36.453000Z" - } - }, - "outputs": [], - "source": [ - "opt = Optim.optimize(objective, p; iterations=250) # do max. 250 iterations\n", - "obj_after = opt.minimum # much better!\n", - "p_res = opt.minimizer # the optimized parameters" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Looks promising, let's have a look on the results plot:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "s_fmu = simulateFMU(p_res); # simulate the position\n", - "\n", - "plot(tSave, s_fmu; label=\"FMU\")\n", - "plot!(tSave, s_tar; label=\"Optimization target\")" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Actually a pretty fit! If you have higher requirements, check out the *Optim.jl* library." - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "metadata": {}, - "outputs": [], - "source": [ - "unloadFMU(fmu)" - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Summary\n", - "\n", - "This tutorial showed how a parameter (and start value) optimization can be performed on a FMU with a gradient free optimizer. This tutorial will be extended soon to further show how convergence for large parameter spaces can be improoved!" - ] - } - ], - "metadata": { - "interpreter": { - "hash": "037537ff7419c497b9325f7d495147943224d408cf5d5ed915294a5b960167b0" - }, - "jupytext": { - "cell_metadata_filter": "-all", - "comment_magics": "false", - "notebook_metadata_filter": "-all" - }, - "kernelspec": { - "display_name": "Julia 1.10.5", - "language": "julia", - "name": "julia-1.10" - }, - "language_info": { - "file_extension": ".jl", - "mimetype": "application/julia", - "name": "julia", - "version": "1.10.5" - }, - "nteract": { - "version": "0.28.0" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/examples/src/parameter_optimization.jl b/examples/src/parameter_optimization.jl deleted file mode 100644 index 59bbaddc..00000000 --- a/examples/src/parameter_optimization.jl +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. - -# imports -using FMI -using FMIZoo -using Optim -using Plots - -tStart = 0.0 -tStop = 5.0 -tStep = 0.1 -tSave = tStart:tStep:tStop - -# we use an FMU from the FMIZoo.jl -fmu = loadFMU("SpringPendulum1D", "Dymola", "2022x"; type=:ME) -info(fmu) - -s_tar = 1.0 .+ sin.(tSave) - -# a function to simulate the FMU for given parameters -function simulateFMU(p) - s0, v0, c, m = p # unpack parameters: s0 (start position), v0 (start velocity), c (spring constant) and m (pendulum mass) - - # pack the parameters into a dictionary - paramDict = Dict{String, Any}() - paramDict["spring.c"] = c - paramDict["mass.m"] = m - - # pack the start state - x0 = [s0, v0] - - # simulate with given start stae and parameters - sol = simulate(fmu, (tStart, tStop); x0=x0, parameters=paramDict, saveat=tSave) - - # get state with index 1 (the position) from the solution - s_res = getState(sol, 1; isIndex=true) - - return s_res -end - -# the optimization objective -function objective(p) - s_res = simulateFMU(p) - - # return the position error sum between FMU simulation (s_res) and target (s_tar) - return sum(abs.(s_tar .- s_res)) -end - -s0 = 0.0 -v0 = 0.0 -c = 1.0 -m = 1.0 -p = [s0, v0, c, m] - -obj_before = objective(p) # not really good! - -s_fmu = simulateFMU(p); # simulate the position - -plot(tSave, s_fmu; label="FMU") -plot!(tSave, s_tar; label="Optimization target") - -opt = Optim.optimize(objective, p; iterations=250) # do max. 250 iterations -obj_after = opt.minimum # much better! -p_res = opt.minimizer # the optimized parameters - -s_fmu = simulateFMU(p_res); # simulate the position - -plot(tSave, s_fmu; label="FMU") -plot!(tSave, s_tar; label="Optimization target") diff --git a/examples/src/parameter_optimization.md b/examples/src/parameter_optimization.md deleted file mode 100644 index c346b700..00000000 --- a/examples/src/parameter_optimization.md +++ /dev/null @@ -1,150 +0,0 @@ -# FMU Parameter Optimization -Tutorial by Tobias Thummerer - -## License - - -```julia -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. -``` - -## Introduction to the example -This example shows how a parameter optimization can be set up for a FMU. The goal is to fit FMU parameters (and initial states), so that a reference trajectory is fit as good as possible. - -Note, that this tutorial covers optimization *without* gradient information. Basically, *FMI.jl* supports gradient based optimization, too. - -## Other formats -Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameter_optimization.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameter_optimization.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameter_optimization.md) corresponding to the notebook. - -## Getting started - -### Installation prerequisites -| | Description | Command | -|:----|:----------------------------------|:--------------------------| -| 1. | Enter Package Manager via | ] | -| 2. | Install FMI via | add FMI | -| 3. | Install FMIZoo via | add FMIZoo | -| 4. | Install Optim via | add Optim | -| 5. | Install Plots via | add Plots | - -## Code section - -To run the example, the previously installed packages must be included. - - -```julia -# imports -using FMI -using FMIZoo -using Optim -using Plots -``` - -### Simulation setup - -Next, the start time and end time of the simulation are set. - - -```julia -tStart = 0.0 -tStop = 5.0 -tStep = 0.1 -tSave = tStart:tStep:tStop -``` - -### Import FMU - -In the next lines of code the FMU model from *FMIZoo.jl* is loaded and the information about the FMU is shown. - - -```julia -# we use an FMU from the FMIZoo.jl -fmu = loadFMU("SpringPendulum1D", "Dymola", "2022x"; type=:ME) -info(fmu) -``` - -Now, the optimization objective (the function to minimize) needs to be defined. In this case, we just want to do a simulation and compare it to a regular `sin` wave. - - -```julia -s_tar = 1.0 .+ sin.(tSave) - -# a function to simulate the FMU for given parameters -function simulateFMU(p) - s0, v0, c, m = p # unpack parameters: s0 (start position), v0 (start velocity), c (spring constant) and m (pendulum mass) - - # pack the parameters into a dictionary - paramDict = Dict{String, Any}() - paramDict["spring.c"] = c - paramDict["mass.m"] = m - - # pack the start state - x0 = [s0, v0] - - # simulate with given start stae and parameters - sol = simulate(fmu, (tStart, tStop); x0=x0, parameters=paramDict, saveat=tSave) - - # get state with index 1 (the position) from the solution - s_res = getState(sol, 1; isIndex=true) - - return s_res -end - -# the optimization objective -function objective(p) - s_res = simulateFMU(p) - - # return the position error sum between FMU simulation (s_res) and target (s_tar) - return sum(abs.(s_tar .- s_res)) -end -``` - -Now let's see how far we are away for our guess parameters: - - -```julia -s0 = 0.0 -v0 = 0.0 -c = 1.0 -m = 1.0 -p = [s0, v0, c, m] - -obj_before = objective(p) # not really good! -``` - -Let's have a look on the differences: - - -```julia -s_fmu = simulateFMU(p); # simulate the position - -plot(tSave, s_fmu; label="FMU") -plot!(tSave, s_tar; label="Optimization target") -``` - -Not that good. So let's do a bit of optimization! - - -```julia -opt = Optim.optimize(objective, p; iterations=250) # do max. 250 iterations -obj_after = opt.minimum # much better! -p_res = opt.minimizer # the optimized parameters -``` - -Looks promising, let's have a look on the results plot: - - -```julia -s_fmu = simulateFMU(p_res); # simulate the position - -plot(tSave, s_fmu; label="FMU") -plot!(tSave, s_tar; label="Optimization target") -``` - -Actually a pretty fit! If you have higher requirements, check out the *Optim.jl* library. - -### Summary - -This tutorial showed how a parameter (and start value) optimization can be performed on a FMU with a gradient free optimizer. This tutorial will be extended soon to further show how convergence for large parameter spaces can be improoved! diff --git a/examples/src/parameter_optimization_files/parameter_optimization_14_0.png b/examples/src/parameter_optimization_files/parameter_optimization_14_0.png deleted file mode 100644 index e374aab0..00000000 Binary files a/examples/src/parameter_optimization_files/parameter_optimization_14_0.png and /dev/null differ diff --git a/examples/src/parameter_optimization_files/parameter_optimization_14_0.svg b/examples/src/parameter_optimization_files/parameter_optimization_14_0.svg deleted file mode 100644 index 456ea9a7..00000000 --- a/examples/src/parameter_optimization_files/parameter_optimization_14_0.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/src/parameter_optimization_files/parameter_optimization_18_0.png b/examples/src/parameter_optimization_files/parameter_optimization_18_0.png deleted file mode 100644 index f29a7542..00000000 Binary files a/examples/src/parameter_optimization_files/parameter_optimization_18_0.png and /dev/null differ diff --git a/examples/src/parameter_optimization_files/parameter_optimization_18_0.svg b/examples/src/parameter_optimization_files/parameter_optimization_18_0.svg deleted file mode 100644 index b9804ab2..00000000 --- a/examples/src/parameter_optimization_files/parameter_optimization_18_0.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/src/parameterize.ipynb b/examples/src/parameterize.ipynb deleted file mode 100644 index 80b7a458..00000000 --- a/examples/src/parameterize.ipynb +++ /dev/null @@ -1,647 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Parameterize a FMU\n", - "Tutorial by Tobias Thummerer, Johannes Stoljar\n", - "\n", - "Last update: 09.08.2023\n", - "\n", - "🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧\n", - "\n", - "## License" - ] - }, - { - "cell_type": "code", - "execution_count": 47, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:26:47.623000Z", - "iopub.status.busy": "2022-10-22T13:26:46.768000Z", - "iopub.status.idle": "2022-10-22T13:26:47.904000Z", - "shell.execute_reply": "2022-10-22T13:26:47.830000Z" - } - }, - "outputs": [], - "source": [ - "# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar\n", - "# Licensed under the MIT license. \n", - "# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Introduction\n", - "This example shows how to parameterize a FMU. We will show to possible ways to parameterize: The default option using the parameterization feature of `fmiSimulate`, `fmiSimulateME` or `fmiSimulateCS`. Second, a custom parameterization routine for advanced users. \n", - "\n", - "## Other formats\n", - "Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameterize.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameterize.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameterize.md) corresponding to the notebook. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Code section\n", - "\n", - "To run the example, the previously installed packages must be included. " - ] - }, - { - "cell_type": "code", - "execution_count": 48, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:26:47.908000Z", - "iopub.status.busy": "2022-10-22T13:26:47.907000Z", - "iopub.status.idle": "2022-10-22T13:27:21.215000Z", - "shell.execute_reply": "2022-10-22T13:27:21.215000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "# imports\n", - "using FMI\n", - "using FMIZoo" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulation setup\n", - "\n", - "Next, the start time and end time of the simulation are set." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:21.476000Z", - "iopub.status.busy": "2022-10-22T13:27:21.219000Z", - "iopub.status.idle": "2022-10-22T13:27:25.399000Z", - "shell.execute_reply": "2022-10-22T13:27:25.398000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "tStart = 0.0\n", - "tStop = 1.0\n", - "tSave = collect(tStart:tStop)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Import FMU\n", - "\n", - "In the next lines of code the FMU model from *FMIZoo.jl* is loaded and the information about the FMU is shown." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:25.403000Z", - "iopub.status.busy": "2022-10-22T13:27:25.403000Z", - "iopub.status.idle": "2022-10-22T13:27:30.244000Z", - "shell.execute_reply": "2022-10-22T13:27:30.244000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "# we use an FMU from the FMIZoo.jl\n", - "# just replace this line with a local path if you want to use your own FMU\n", - "pathToFMU = get_model_filename(\"IO\", \"Dymola\", \"2022x\")\n", - "\n", - "fmu = loadFMU(pathToFMU)\n", - "info(fmu)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Option A: Integrated parameterization feature of *FMI.jl*\n", - "If you are using the commands for simulation integrated in *FMI.jl*, the parameters and initial conditions are set at the correct locations during the initialization process of your FMU. This is the recommended way of parameterizing your model, if you don't have very uncommon requirements regarding initialization." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "dict = Dict{String, Any}()\n", - "dict" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Option B: Custom parameterization routine\n", - "If you have special requirements for initialization and parameterization, you can write your very own parameterization routine.\n", - "\n", - "### Instantiate and Setup FMU\n", - "\n", - "Next it is necessary to create an instance of the FMU. This is achieved by the command `fmiInstantiate!()`." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:30.247000Z", - "iopub.status.busy": "2022-10-22T13:27:30.247000Z", - "iopub.status.idle": "2022-10-22T13:27:31.208000Z", - "shell.execute_reply": "2022-10-22T13:27:31.208000Z" - } - }, - "outputs": [], - "source": [ - "c = fmi2Instantiate!(fmu; loggingOn=true)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the following code block, start and end time for the simulation is set by the `fmiSetupExperiment()` command." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:31.212000Z", - "iopub.status.busy": "2022-10-22T13:27:31.212000Z", - "iopub.status.idle": "2022-10-22T13:27:31.657000Z", - "shell.execute_reply": "2022-10-22T13:27:31.656000Z" - } - }, - "outputs": [], - "source": [ - "fmi2SetupExperiment(c, tStart, tStop)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Parameterize FMU\n", - "\n", - "In this example, for each data type (`real`, `boolean`, `integer` and `string`) a corresponding input or parameter is selected. From here on, the inputs and parameters will be referred to as parameters for simplicity." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:31.661000Z", - "iopub.status.busy": "2022-10-22T13:27:31.660000Z", - "iopub.status.idle": "2022-10-22T13:27:33.084000Z", - "shell.execute_reply": "2022-10-22T13:27:33.084000Z" - } - }, - "outputs": [], - "source": [ - "params = [\"p_real\", \"p_boolean\", \"p_integer\", \"p_string\"]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "At the beginning we want to display the initial state of these parameters, for which the FMU must be in initialization mode. The next function `fmiEnterInitializationMode()` informs the FMU to enter the initialization mode. Before calling this function, the variables can be set. Furthermore, `fmiSetupExperiment()` must be called at least once before calling `fmiEnterInitializationMode()`, in order that the start time is defined." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:33.088000Z", - "iopub.status.busy": "2022-10-22T13:27:33.088000Z", - "iopub.status.idle": "2022-10-22T13:27:33.164000Z", - "shell.execute_reply": "2022-10-22T13:27:33.164000Z" - }, - "scrolled": true - }, - "outputs": [], - "source": [ - "fmi2EnterInitializationMode(c)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The initial state of these parameters are displayed with the function `getValue()`." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:33.168000Z", - "iopub.status.busy": "2022-10-22T13:27:33.168000Z", - "iopub.status.idle": "2022-10-22T13:27:36.378000Z", - "shell.execute_reply": "2022-10-22T13:27:36.378000Z" - } - }, - "outputs": [], - "source": [ - "getValue(c, params)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The initialization mode is terminated with the function `fmi2ExitInitializationMode()`. (For the model exchange FMU type, this function switches off all initialization equations, and enters the event mode implicitly.)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:36.383000Z", - "iopub.status.busy": "2022-10-22T13:27:36.382000Z", - "iopub.status.idle": "2022-10-22T13:27:36.453000Z", - "shell.execute_reply": "2022-10-22T13:27:36.453000Z" - } - }, - "outputs": [], - "source": [ - "fmi2ExitInitializationMode(c)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the next step, a function is defined that generates a random value for each parameter. For the parameter `p_string` a random number is inserted into the string. All parameters are combined to a tuple and output." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:36.457000Z", - "iopub.status.busy": "2022-10-22T13:27:36.457000Z", - "iopub.status.idle": "2022-10-22T13:27:37.435000Z", - "shell.execute_reply": "2022-10-22T13:27:37.435000Z" - } - }, - "outputs": [], - "source": [ - "function generateRandomNumbers()\n", - " rndReal = 100 * rand()\n", - " rndBoolean = rand() > 0.5\n", - " rndInteger = round(Integer, 100 * rand())\n", - " rndString = \"Random number $(100 * rand())!\"\n", - "\n", - " return rndReal, rndBoolean, rndInteger, rndString\n", - "end" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The previously defined function is called and the results are displayed in the console." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:37.439000Z", - "iopub.status.busy": "2022-10-22T13:27:37.439000Z", - "iopub.status.idle": "2022-10-22T13:27:38.222000Z", - "shell.execute_reply": "2022-10-22T13:27:38.222000Z" - } - }, - "outputs": [], - "source": [ - "paramsVal = generateRandomNumbers()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### First variant\n", - "\n", - "To show the first variant, it is necessary to terminate and reset the FMU instance. Then, as before, the setup command must be called for the FMU. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:38.225000Z", - "iopub.status.busy": "2022-10-22T13:27:38.225000Z", - "iopub.status.idle": "2022-10-22T13:27:38.411000Z", - "shell.execute_reply": "2022-10-22T13:27:38.411000Z" - } - }, - "outputs": [], - "source": [ - "fmi2Terminate(c)\n", - "fmi2Reset(c)\n", - "fmi2SetupExperiment(c, tStart, tStop)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the next step it is possible to set the parameters for the FMU. With the first variant it is quickly possible to set all parameters at once. Even different data types can be set with only one command. The command `setValue()` selects itself which function is chosen for which data type. As long as the output of the function gives the status code 0, setting the parameters has worked." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:38.415000Z", - "iopub.status.busy": "2022-10-22T13:27:38.415000Z", - "iopub.status.idle": "2022-10-22T13:27:40.852000Z", - "shell.execute_reply": "2022-10-22T13:27:40.852000Z" - } - }, - "outputs": [], - "source": [ - "setValue(c, params, collect(paramsVal))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "After setting the parameters, it can be checked whether the corresponding parameters were set correctly. For this the function `getValue()` can be used as above. To be able to call the function `getValue()` the FMU must be in initialization mode." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:40.856000Z", - "iopub.status.busy": "2022-10-22T13:27:40.856000Z", - "iopub.status.idle": "2022-10-22T13:27:40.857000Z", - "shell.execute_reply": "2022-10-22T13:27:40.857000Z" - } - }, - "outputs": [], - "source": [ - "fmi2EnterInitializationMode(c)\n", - "# getValue(c, params)\n", - "fmi2ExitInitializationMode(c)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now the FMU has been initialized correctly, the FMU can be simulated. The `simulate()` command is used for this purpose. It must be pointed out that the keywords `instantiate=false`, `setup=false` must be set. The keyword `instantiate=false` prevents the simulation command from creating a new FMU instance, otherwise our parameterization will be lost. The keyword `setup=false` prevents the FMU from calling the initialization mode again. The additionally listed keyword `freeInstance=false` prevents that the instance is removed after the simulation. This is only needed in this example, because we want to continue working on the created instance. Another keyword is the `recordValues=parmas[1:3]`, which saves: `p_real`, `p_boolean` and `p_integer` as output. It should be noted that the `simulate()` function is not capable of outputting string values, so `p_string` is omitted." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:40.861000Z", - "iopub.status.busy": "2022-10-22T13:27:40.861000Z", - "iopub.status.idle": "2022-10-22T13:27:51.266000Z", - "shell.execute_reply": "2022-10-22T13:27:51.265000Z" - } - }, - "outputs": [], - "source": [ - "simData = simulate(c, (tStart, tStop); recordValues=params[1:3], saveat=tSave, \n", - " instantiate=false, setup=false, freeInstance=false, terminate=false, reset=false)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Second variant\n", - "\n", - "To show the second variant, it is necessary to terminate and reset the FMU instance. Then, as before, the setup command must be called for the FMU. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:51.270000Z", - "iopub.status.busy": "2022-10-22T13:27:51.269000Z", - "iopub.status.idle": "2022-10-22T13:27:51.271000Z", - "shell.execute_reply": "2022-10-22T13:27:51.271000Z" - } - }, - "outputs": [], - "source": [ - "fmi2Terminate(c)\n", - "fmi2Reset(c)\n", - "fmi2SetupExperiment(c, tStart, tStop)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To make sure that the functions work it is necessary to generate random numbers again. As shown already, we call the defined function `generateRandomNumbers()` and output the values." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:51.275000Z", - "iopub.status.busy": "2022-10-22T13:27:51.275000Z", - "iopub.status.idle": "2022-10-22T13:27:51.288000Z", - "shell.execute_reply": "2022-10-22T13:27:51.288000Z" - } - }, - "outputs": [], - "source": [ - "rndReal, rndBoolean, rndInteger, rndString = generateRandomNumbers()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In the second variant, the value for each data type is set separately by the corresponding command. By this variant one has the maximum control and can be sure that also the correct data type is set. " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:51.291000Z", - "iopub.status.busy": "2022-10-22T13:27:51.291000Z", - "iopub.status.idle": "2022-10-22T13:27:51.615000Z", - "shell.execute_reply": "2022-10-22T13:27:51.615000Z" - } - }, - "outputs": [], - "source": [ - "fmi2SetReal(c, \"p_real\", rndReal)\n", - "fmi2SetBoolean(c, \"p_boolean\", rndBoolean)\n", - "fmi2SetInteger(c, \"p_integer\", rndInteger)\n", - "fmi2SetString(c, \"p_string\", rndString)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To illustrate the functionality of the parameterization with the separate functions, the corresponding get function can be also called separately for each data type:\n", - "* `fmi2SetReal()` ⇔ `fmi2GetReal()`\n", - "* `fmi2SetBoolean()` ⇔ `fmi2GetBoolean()`\n", - "* `fmi2SetInteger()` ⇔ `fmi2GetInteger()`\n", - "* `fmi2SetString()` ⇔ `fmi2GetString()`.\n", - "\n", - "As before, the FMU must be in initialization mode." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:51.619000Z", - "iopub.status.busy": "2022-10-22T13:27:51.619000Z", - "iopub.status.idle": "2022-10-22T13:27:51.620000Z", - "shell.execute_reply": "2022-10-22T13:27:51.620000Z" - } - }, - "outputs": [], - "source": [ - "fmi2EnterInitializationMode(c)\n", - "# fmi2GetReal(c, \"u_real\")\n", - "# fmi2GetBoolean(c, \"u_boolean\")\n", - "# fmi2GetInteger(c, \"u_integer\")\n", - "# fmi2GetString(c, \"p_string\")\n", - "fmi2ExitInitializationMode(c)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "From here on, you may want to simulate the FMU. Please note, that with the default `executionConfig`, it is necessary to prevent a new instantiation using the keyword `instantiate=false`. Otherwise, a new instance is allocated for the simulation-call and the parameters set for the previous instance are not transfered." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:51.624000Z", - "iopub.status.busy": "2022-10-22T13:27:51.624000Z", - "iopub.status.idle": "2022-10-22T13:27:52.288000Z", - "shell.execute_reply": "2022-10-22T13:27:52.288000Z" - } - }, - "outputs": [], - "source": [ - "simData = simulate(c, (tStart, tStop); recordValues=params[1:3], saveat=tSave, \n", - " instantiate=false, setup=false)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Unload FMU\n", - "\n", - "The FMU will be unloaded and all unpacked data on disc will be removed." - ] - }, - { - "cell_type": "code", - "execution_count": 69, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:27:52.293000Z", - "iopub.status.busy": "2022-10-22T13:27:52.292000Z", - "iopub.status.idle": "2022-10-22T13:27:52.330000Z", - "shell.execute_reply": "2022-10-22T13:27:52.329000Z" - } - }, - "outputs": [], - "source": [ - "unloadFMU(fmu)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Summary\n", - "\n", - "Based on this tutorial it can be seen that there are two different variants to set and get parameters.These examples should make it clear to the user how parameters can also be set with different data types. As a small reminder, the sequence of commands for the manual parameterization of an FMU is summarized again. \n", - "\n", - "`loadFMU()` → `fmiInstantiate!()` → `fmiSetupExperiment()` → `fmiSetXXX()` → `fmiEnterInitializationMode()` → `fmiGetXXX()` → `fmiExitInitializationMode()` → `simualte()` → `unloadFMU()`" - ] - } - ], - "metadata": { - "interpreter": { - "hash": "037537ff7419c497b9325f7d495147943224d408cf5d5ed915294a5b960167b0" - }, - "jupytext": { - "cell_metadata_filter": "-all", - "comment_magics": "false", - "notebook_metadata_filter": "-all" - }, - "kernelspec": { - "display_name": "Julia 1.10.5", - "language": "julia", - "name": "julia-1.10" - }, - "language_info": { - "file_extension": ".jl", - "mimetype": "application/julia", - "name": "julia", - "version": "1.10.5" - }, - "nteract": { - "version": "0.28.0" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/examples/src/parameterize.jl b/examples/src/parameterize.jl deleted file mode 100644 index 845349de..00000000 --- a/examples/src/parameterize.jl +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. - -# imports -using FMI -using FMIZoo - -tStart = 0.0 -tStop = 1.0 -tSave = collect(tStart:tStop) - -# we use an FMU from the FMIZoo.jl -# just replace this line with a local path if you want to use your own FMU -pathToFMU = get_model_filename("IO", "Dymola", "2022x") - -fmu = fmiLoad(pathToFMU) -fmiInfo(fmu) - -dict = Dict{String, Any}() -dict - -fmiInstantiate!(fmu; loggingOn=true) - -fmiSetupExperiment(fmu, tStart, tStop) - -params = ["p_real", "p_boolean", "p_integer", "p_string"] - -fmiEnterInitializationMode(fmu) - -fmiGet(fmu, params) - -fmiExitInitializationMode(fmu) - -function generateRandomNumbers() - rndReal = 100 * rand() - rndBoolean = rand() > 0.5 - rndInteger = round(Integer, 100 * rand()) - rndString = "Random number $(100 * rand())!" - - return rndReal, rndBoolean, rndInteger, rndString -end - -paramsVal = generateRandomNumbers() - -fmiTerminate(fmu) -fmiReset(fmu) -fmiSetupExperiment(fmu, tStart, tStop) - -fmiSet(fmu, params, collect(paramsVal)) - -fmiEnterInitializationMode(fmu) -# fmiGet(fmu, params) -fmiExitInitializationMode(fmu) - -simData = fmiSimulate(fmu, (tStart, tStop); recordValues=params[1:3], saveat=tSave, - instantiate=false, setup=false, freeInstance=false, terminate=false, reset=false) - -fmiTerminate(fmu) -fmiReset(fmu) -fmiSetupExperiment(fmu, tStart, tStop) - -rndReal, rndBoolean, rndInteger, rndString = generateRandomNumbers() - -fmiSetReal(fmu, "p_real", rndReal) -fmiSetBoolean(fmu, "p_boolean", rndBoolean) -fmiSetInteger(fmu, "p_integer", rndInteger) -fmiSetString(fmu, "p_string", rndString) - -fmiEnterInitializationMode(fmu) -# fmiGetReal(fmu, "u_real") -# fmiGetBoolean(fmu, "u_boolean") -# fmiGetInteger(fmu, "u_integer") -# fmiGetString(fmu, "p_string") -fmiExitInitializationMode(fmu) - -simData = fmiSimulate(fmu, (tStart, tStop); recordValues=params[1:3], saveat=tSave, - instantiate=false, setup=false) - -fmiUnload(fmu) diff --git a/examples/src/parameterize.md b/examples/src/parameterize.md deleted file mode 100644 index 46a02a88..00000000 --- a/examples/src/parameterize.md +++ /dev/null @@ -1,240 +0,0 @@ -# Parameterize a FMU -Tutorial by Tobias Thummerer, Johannes Stoljar - -Last update: 09.08.2023 - -🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧 - -## License - - -```julia -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. -``` - -## Introduction -This example shows how to parameterize a FMU. We will show to possible ways to parameterize: The default option using the parameterization feature of `fmiSimulate`, `fmiSimulateME` or `fmiSimulateCS`. Second, a custom parameterization routine for advanced users. - -## Other formats -Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameterize.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameterize.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/parameterize.md) corresponding to the notebook. - -## Code section - -To run the example, the previously installed packages must be included. - - -```julia -# imports -using FMI -using FMIZoo -``` - -### Simulation setup - -Next, the start time and end time of the simulation are set. - - -```julia -tStart = 0.0 -tStop = 1.0 -tSave = collect(tStart:tStop) -``` - -### Import FMU - -In the next lines of code the FMU model from *FMIZoo.jl* is loaded and the information about the FMU is shown. - - -```julia -# we use an FMU from the FMIZoo.jl -# just replace this line with a local path if you want to use your own FMU -pathToFMU = get_model_filename("IO", "Dymola", "2022x") - -fmu = fmiLoad(pathToFMU) -fmiInfo(fmu) -``` - -### Option A: Integrated parameterization feature of *FMI.jl* -If you are using the commands for simulation integrated in *FMI.jl*, the parameters and initial conditions are set at the correct locations during the initialization process of your FMU. This is the recommended way of parameterizing your model, if you don't have very uncommon requirements regarding initialization. - - -```julia -dict = Dict{String, Any}() -dict -``` - -### Option B: Custom parameterization routine -If you have special requirements for initialization and parameterization, you can write your very own parameterization routine. - -### Instantiate and Setup FMU - -Next it is necessary to create an instance of the FMU. This is achieved by the command `fmiInstantiate!()`. - - -```julia -fmiInstantiate!(fmu; loggingOn=true) -``` - -In the following code block, start and end time for the simulation is set by the `fmiSetupExperiment()` command. - - -```julia -fmiSetupExperiment(fmu, tStart, tStop) -``` - -### Parameterize FMU - -In this example, for each data type (`real`, `boolean`, `integer` and `string`) a corresponding input or parameter is selected. From here on, the inputs and parameters will be referred to as parameters for simplicity. - - -```julia -params = ["p_real", "p_boolean", "p_integer", "p_string"] -``` - -At the beginning we want to display the initial state of these parameters, for which the FMU must be in initialization mode. The next function `fmiEnterInitializationMode()` informs the FMU to enter the initialization mode. Before calling this function, the variables can be set. Furthermore, `fmiSetupExperiment()` must be called at least once before calling `fmiEnterInitializationMode()`, in order that the start time is defined. - - -```julia -fmiEnterInitializationMode(fmu) -``` - -The initial state of these parameters are displayed with the function `fmiGet()`. - - -```julia -fmiGet(fmu, params) -``` - -The initialization mode is terminated with the function `fmiExitInitializationMode()`. (For the model exchange FMU type, this function switches off all initialization equations, and enters the event mode implicitly.) - - -```julia -fmiExitInitializationMode(fmu) -``` - -In the next step, a function is defined that generates a random value for each parameter. For the parameter `p_string` a random number is inserted into the string. All parameters are combined to a tuple and output. - - -```julia -function generateRandomNumbers() - rndReal = 100 * rand() - rndBoolean = rand() > 0.5 - rndInteger = round(Integer, 100 * rand()) - rndString = "Random number $(100 * rand())!" - - return rndReal, rndBoolean, rndInteger, rndString -end -``` - -The previously defined function is called and the results are displayed in the console. - - -```julia -paramsVal = generateRandomNumbers() -``` - -#### First variant - -To show the first variant, it is necessary to terminate and reset the FMU instance. Then, as before, the setup command must be called for the FMU. - - -```julia -fmiTerminate(fmu) -fmiReset(fmu) -fmiSetupExperiment(fmu, tStart, tStop) -``` - -In the next step it is possible to set the parameters for the FMU. With the first variant it is quickly possible to set all parameters at once. Even different data types can be set with only one command. The command `fmiSet()` selects itself which function is chosen for which data type. As long as the output of the function gives the status code 0, setting the parameters has worked. - - -```julia -fmiSet(fmu, params, collect(paramsVal)) -``` - -After setting the parameters, it can be checked whether the corresponding parameters were set correctly. For this the function `fmiGet()` can be used as above. To be able to call the function `fmiGet()` the FMU must be in initialization mode. - - -```julia -fmiEnterInitializationMode(fmu) -# fmiGet(fmu, params) -fmiExitInitializationMode(fmu) -``` - -Now the FMU has been initialized correctly, the FMU can be simulated. The `fmiSimulate()` command is used for this purpose. It must be pointed out that the keywords `instantiate=false`, `setup=false` must be set. The keyword `instantiate=false` prevents the simulation command from creating a new FMU instance, otherwise our parameterization will be lost. The keyword `setup=false` prevents the FMU from calling the initialization mode again. The additionally listed keyword `freeInstance=false` prevents that the instance is removed after the simulation. This is only needed in this example, because we want to continue working on the created instance. Another keyword is the `recordValues=parmas[1:3]`, which saves: `p_real`, `p_boolean` and `p_integer` as output. It should be noted that the `fmiSimulate()` function is not capable of outputting string values, so `p_string` is omitted. - - -```julia -simData = fmiSimulate(fmu, (tStart, tStop); recordValues=params[1:3], saveat=tSave, - instantiate=false, setup=false, freeInstance=false, terminate=false, reset=false) -``` - -#### Second variant - -To show the second variant, it is necessary to terminate and reset the FMU instance. Then, as before, the setup command must be called for the FMU. - - -```julia -fmiTerminate(fmu) -fmiReset(fmu) -fmiSetupExperiment(fmu, tStart, tStop) -``` - -To make sure that the functions work it is necessary to generate random numbers again. As shown already, we call the defined function `generateRandomNumbers()` and output the values. - - -```julia -rndReal, rndBoolean, rndInteger, rndString = generateRandomNumbers() -``` - -In the second variant, the value for each data type is set separately by the corresponding command. By this variant one has the maximum control and can be sure that also the correct data type is set. - - -```julia -fmiSetReal(fmu, "p_real", rndReal) -fmiSetBoolean(fmu, "p_boolean", rndBoolean) -fmiSetInteger(fmu, "p_integer", rndInteger) -fmiSetString(fmu, "p_string", rndString) -``` - -To illustrate the functionality of the parameterization with the separate functions, the corresponding get function can be also called separately for each data type: -* `fmiSetReal()` ⇔ `fmiGetReal()` -* `fmiSetBoolean()` ⇔ `fmiGetBoolean()` -* `fmiSetInteger()` ⇔ `fmiGetInteger()` -* `fmiSetString()` ⇔ `fmiGetString()`. - -As before, the FMU must be in initialization mode. - - -```julia -fmiEnterInitializationMode(fmu) -# fmiGetReal(fmu, "u_real") -# fmiGetBoolean(fmu, "u_boolean") -# fmiGetInteger(fmu, "u_integer") -# fmiGetString(fmu, "p_string") -fmiExitInitializationMode(fmu) -``` - -From here on, you may want to simulate the FMU. Please note, that with the default `executionConfig`, it is necessary to prevent a new instantiation using the keyword `instantiate=false`. Otherwise, a new instance is allocated for the simulation-call and the parameters set for the previous instance are not transfered. - - -```julia -simData = fmiSimulate(fmu, (tStart, tStop); recordValues=params[1:3], saveat=tSave, - instantiate=false, setup=false) -``` - -### Unload FMU - -The FMU will be unloaded and all unpacked data on disc will be removed. - - -```julia -fmiUnload(fmu) -``` - -### Summary - -Based on this tutorial it can be seen that there are two different variants to set and get parameters.These examples should make it clear to the user how parameters can also be set with different data types. As a small reminder, the sequence of commands for the manual parameterization of an FMU is summarized again. - -`fmiLoad()` → `fmiInstantiate!()` → `fmiSetupExperiment()` → `fmiSetXXX()` → `fmiEnterInitializationMode()` → `fmiGetXXX()` → `fmiExitInitializationMode()` → `fmiSimualte()` → `fmiUnload()` diff --git a/examples/src/simulate.ipynb b/examples/src/simulate.ipynb deleted file mode 100644 index 70442ab9..00000000 --- a/examples/src/simulate.ipynb +++ /dev/null @@ -1,323 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Simulate an FMU in different modes\n", - "Tutorial by Johannes Stoljar, Tobias Thummerer\n", - "\n", - "🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧\n", - "\n", - "## License" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:28:04.723000Z", - "iopub.status.busy": "2022-10-22T13:28:04.017000Z", - "iopub.status.idle": "2022-10-22T13:28:04.999000Z", - "shell.execute_reply": "2022-10-22T13:28:04.926000Z" - } - }, - "outputs": [], - "source": [ - "# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar\n", - "# Licensed under the MIT license. \n", - "# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details." - ] - }, - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Motivation\n", - "This Julia Package *FMI.jl* is motivated by the use of simulation models in Julia. Here the FMI specification is implemented. FMI (*Functional Mock-up Interface*) is a free standard ([fmi-standard.org](https://fmi-standard.org/)) that defines a container and an interface to exchange dynamic models using a combination of XML files, binaries and C code zipped into a single file. The user can thus use simulation models in the form of an FMU (*Functional Mock-up Units*). Besides loading the FMU, the user can also set values for parameters and states and simulate the FMU both as co-simulation and model exchange simulation.\n", - "\n", - "## Introduction to the example\n", - "In this example we want to show how fast and easy the simulation for an FMU is. For this purpose, the FMU is simulated in co-simulation mode and in model-exchange mode. After the FMU has been simulated, the simulation results are displayed in a graph. The graphs of the different modes are compared with each other. The used model is a one-dimensional spring pendulum with friction. The object-orientated structure of the *SpringFrictionPendulum1D* can be seen in the following graphic.\n", - "\n", - "![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringFrictionPendulum1D.svg?raw=true) \n", - "\n", - "\n", - "## Target group\n", - "The example is primarily intended for users who work in the field of simulations. The example wants to show how simple it is to use FMUs in Julia.\n", - "\n", - "\n", - "## Other formats\n", - "Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/simulate.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/simulate.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/simulate.md) corresponding to the notebook. \n", - "\n", - "\n", - "## Getting started\n", - "\n", - "### Installation prerequisites\n", - "| | Description | Command | Alternative | \n", - "|:----|:----------------------------------|:--------------------------|:-----------------------------------------------|\n", - "| 1. | Enter Package Manager via | ] | |\n", - "| 2. | Install FMI via | add FMI | add \" https://github.com/ThummeTo/FMI.jl \" |\n", - "| 3. | Install FMIZoo via | add FMIZoo | add \" https://github.com/ThummeTo/FMIZoo.jl \" |\n", - "| 4. | Install Plots via | add Plots | |" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Code section\n", - "\n", - "To run the example, the previously installed packages must be included. " - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:28:05.004000Z", - "iopub.status.busy": "2022-10-22T13:28:05.004000Z", - "iopub.status.idle": "2022-10-22T13:28:49.082000Z", - "shell.execute_reply": "2022-10-22T13:28:49.082000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "# imports\n", - "using FMI\n", - "using FMIZoo\n", - "using Plots\n", - "using DifferentialEquations" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulation setup\n", - "\n", - "Next, the start time and end time of the simulation are set. Finally, a step size is specified to store the results of the simulation at these time steps." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:28:51.448000Z", - "iopub.status.busy": "2022-10-22T13:28:49.085000Z", - "iopub.status.idle": "2022-10-22T13:28:52.234000Z", - "shell.execute_reply": "2022-10-22T13:28:52.233000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "tStart = 0.0\n", - "tStep = 0.01\n", - "tStop = 8.0\n", - "tSave = tStart:tStep:tStop" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Import FMU\n", - "\n", - "In the next lines of code the FMU model from *FMIZoo.jl* is loaded and the information about the FMU is shown." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:28:52.238000Z", - "iopub.status.busy": "2022-10-22T13:28:52.237000Z", - "iopub.status.idle": "2022-10-22T13:28:57.034000Z", - "shell.execute_reply": "2022-10-22T13:28:57.034000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "# we use an FMU from the FMIZoo.jl\n", - "pathToFMU = get_model_filename(\"SpringFrictionPendulum1D\", \"Dymola\", \"2022x\")\n", - "\n", - "myFMU = loadFMU(pathToFMU)\n", - "# loadFMU(\"path/to/myFMU.fmu\"; unpackPath = \"path/to/unpacked/fmu/\")\n", - "\n", - "info(myFMU)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Simulate FMU\n", - "\n", - "In the following, the FMU is simulated in the two different simulation modes.\n", - "\n", - "#### Simulate as Co-Simulation\n", - "\n", - "In the next steps the recorded values are defined. The first state is the position of the mass and the second state is the velocity. In the function `simulateCS()` the FMU is simulated in co-simulation mode (CS) with an adaptive step size but with fixed save points `tSave`. In addition, the start and end time and the recorded variables are specified." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:28:57.037000Z", - "iopub.status.busy": "2022-10-22T13:28:57.037000Z", - "iopub.status.idle": "2022-10-22T13:29:04.975000Z", - "shell.execute_reply": "2022-10-22T13:29:04.974000Z" - } - }, - "outputs": [], - "source": [ - "vrs = [\"mass.s\", \"mass.v\"]\n", - "\n", - "dataCS = simulateCS(myFMU, (tStart, tStop); recordValues=vrs, saveat=tSave)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Simulate as Model-Exchange\n", - "\n", - "In the function `simulateME()` the FMU is simulated in model-exchange mode (ME) with an adaptive step size but with fixed save points `tSave`. In addition, the start and end time are specified. In contrast to the co-simulation, the values to be stored are not specified here, since the states and events of the FMU are always output as well. The identifiers given above just correspond to the states of the FMU." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:29:04.979000Z", - "iopub.status.busy": "2022-10-22T13:29:04.978000Z", - "iopub.status.idle": "2022-10-22T13:29:21.052000Z", - "shell.execute_reply": "2022-10-22T13:29:21.052000Z" - } - }, - "outputs": [], - "source": [ - "dataME = simulateME(myFMU, (tStart, tStop); saveat=tSave)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Plotting FMU\n", - "\n", - "After the simulation is finished the results of the FMU for the co-simulation and model-exchange mode can be plotted. In the plot for the FMU it can be seen that the oscillation continues to decrease due to the effect of the friction. If you simulate long enough, the oscillation comes to a standstill in a certain time." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:29:21.056000Z", - "iopub.status.busy": "2022-10-22T13:29:21.056000Z", - "iopub.status.idle": "2022-10-22T13:30:01.756000Z", - "shell.execute_reply": "2022-10-22T13:30:01.756000Z" - }, - "scrolled": false - }, - "outputs": [], - "source": [ - "plot(dataCS)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:30:01.762000Z", - "iopub.status.busy": "2022-10-22T13:30:01.762000Z", - "iopub.status.idle": "2022-10-22T13:30:01.964000Z", - "shell.execute_reply": "2022-10-22T13:30:01.964000Z" - } - }, - "outputs": [], - "source": [ - "plot(dataME)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "From both graphs it can be seen that the simulation calculates exactly the same results." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Unload FMU\n", - "\n", - "After plotting the data, the FMU is unloaded and all unpacked data on disc is removed." - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": { - "execution": { - "iopub.execute_input": "2022-10-22T13:30:01.970000Z", - "iopub.status.busy": "2022-10-22T13:30:01.970000Z", - "iopub.status.idle": "2022-10-22T13:30:02.010000Z", - "shell.execute_reply": "2022-10-22T13:30:02.010000Z" - } - }, - "outputs": [], - "source": [ - "unloadFMU(myFMU)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Summary\n", - "\n", - "Based on this tutorial it can be seen that simulating in the different mode is very easy, and it only takes a few commands to simulate the FMU. " - ] - } - ], - "metadata": { - "interpreter": { - "hash": "037537ff7419c497b9325f7d495147943224d408cf5d5ed915294a5b960167b0" - }, - "jupytext": { - "cell_metadata_filter": "-all", - "comment_magics": "false", - "notebook_metadata_filter": "-all" - }, - "kernelspec": { - "display_name": "Julia 1.10.5", - "language": "julia", - "name": "julia-1.10" - }, - "language_info": { - "file_extension": ".jl", - "mimetype": "application/julia", - "name": "julia", - "version": "1.10.5" - }, - "nteract": { - "version": "0.28.0" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/examples/src/simulate.jl b/examples/src/simulate.jl deleted file mode 100644 index 8768c027..00000000 --- a/examples/src/simulate.jl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. - -# imports -using FMI -using FMIZoo -using Plots - -tStart = 0.0 -tStep = 0.01 -tStop = 8.0 -tSave = tStart:tStep:tStop - -# we use an FMU from the FMIZoo.jl -pathToFMU = get_model_filename("SpringFrictionPendulum1D", "Dymola", "2022x") - -myFMU = fmiLoad(pathToFMU) -# fmiLoad("path/to/myFMU.fmu"; unpackPath = "path/to/unpacked/fmu/") - -fmiInfo(myFMU) - -vrs = ["mass.s", "mass.v"] - -dataCS = fmiSimulateCS(myFMU, (tStart, tStop); recordValues=vrs, saveat=tSave) - -dataME = fmiSimulateME(myFMU, (tStart, tStop); saveat=tSave) - -fmiPlot(dataCS) - -fmiPlot(dataME) - -fmiUnload(myFMU) diff --git a/examples/src/simulate.md b/examples/src/simulate.md deleted file mode 100644 index 78937ff9..00000000 --- a/examples/src/simulate.md +++ /dev/null @@ -1,132 +0,0 @@ -# Simulate an FMU in different modes -Tutorial by Johannes Stoljar, Tobias Thummerer - -🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧 - -## License - - -```julia -# Copyright (c) 2021 Tobias Thummerer, Lars Mikelsons, Josef Kircher, Johannes Stoljar -# Licensed under the MIT license. -# See LICENSE (https://github.com/thummeto/FMI.jl/blob/main/LICENSE) file in the project root for details. -``` - -## Motivation -This Julia Package *FMI.jl* is motivated by the use of simulation models in Julia. Here the FMI specification is implemented. FMI (*Functional Mock-up Interface*) is a free standard ([fmi-standard.org](http://fmi-standard.org/)) that defines a container and an interface to exchange dynamic models using a combination of XML files, binaries and C code zipped into a single file. The user can thus use simulation models in the form of an FMU (*Functional Mock-up Units*). Besides loading the FMU, the user can also set values for parameters and states and simulate the FMU both as co-simulation and model exchange simulation. - -## Introduction to the example -In this example we want to show how fast and easy the simulation for an FMU is. For this purpose, the FMU is simulated in co-simulation mode and in model-exchange mode. After the FMU has been simulated, the simulation results are displayed in a graph. The graphs of the different modes are compared with each other. The used model is a one-dimensional spring pendulum with friction. The object-orientated structure of the *SpringFrictionPendulum1D* can be seen in the following graphic. - -![svg](https://github.com/thummeto/FMI.jl/blob/main/docs/src/examples/pics/SpringFrictionPendulum1D.svg?raw=true) - - -## Target group -The example is primarily intended for users who work in the field of simulations. The example wants to show how simple it is to use FMUs in Julia. - - -## Other formats -Besides, this [Jupyter Notebook](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/simulate.ipynb) there is also a [Julia file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/simulate.jl) with the same name, which contains only the code cells and for the documentation there is a [Markdown file](https://github.com/thummeto/FMI.jl/blob/examples/examples/src/simulate.md) corresponding to the notebook. - - -## Getting started - -### Installation prerequisites -| | Description | Command | Alternative | -|:----|:----------------------------------|:--------------------------|:-----------------------------------------------| -| 1. | Enter Package Manager via | ] | | -| 2. | Install FMI via | add FMI | add " https://github.com/ThummeTo/FMI.jl " | -| 3. | Install FMIZoo via | add FMIZoo | add " https://github.com/ThummeTo/FMIZoo.jl " | -| 4. | Install Plots via | add Plots | | - -## Code section - -To run the example, the previously installed packages must be included. - - -```julia -# imports -using FMI -using FMIZoo -using Plots -``` - -### Simulation setup - -Next, the start time and end time of the simulation are set. Finally, a step size is specified to store the results of the simulation at these time steps. - - -```julia -tStart = 0.0 -tStep = 0.01 -tStop = 8.0 -tSave = tStart:tStep:tStop -``` - -### Import FMU - -In the next lines of code the FMU model from *FMIZoo.jl* is loaded and the information about the FMU is shown. - - -```julia -# we use an FMU from the FMIZoo.jl -pathToFMU = get_model_filename("SpringFrictionPendulum1D", "Dymola", "2022x") - -myFMU = fmiLoad(pathToFMU) -# fmiLoad("path/to/myFMU.fmu"; unpackPath = "path/to/unpacked/fmu/") - -fmiInfo(myFMU) -``` - -### Simulate FMU - -In the following, the FMU is simulated in the two different simulation modes. - -#### Simulate as Co-Simulation - -In the next steps the recorded values are defined. The first state is the position of the mass and the second state is the velocity. In the function `fmiSimulateCS()` the FMU is simulated in co-simulation mode (CS) with an adaptive step size but with fixed save points `tSave`. In addition, the start and end time and the recorded variables are specified. - - -```julia -vrs = ["mass.s", "mass.v"] - -dataCS = fmiSimulateCS(myFMU, (tStart, tStop); recordValues=vrs, saveat=tSave) -``` - -#### Simulate as Model-Exchange - -In the function `fmiSimulateME()` the FMU is simulated in model-exchange mode (ME) with an adaptive step size but with fixed save points `tSave`. In addition, the start and end time are specified. In contrast to the co-simulation, the values to be stored are not specified here, since the states and events of the FMU are always output as well. The identifiers given above just correspond to the states of the FMU. - - -```julia -dataME = fmiSimulateME(myFMU, (tStart, tStop); saveat=tSave) -``` - -### Plotting FMU - -After the simulation is finished the results of the FMU for the co-simulation and model-exchange mode can be plotted. In the plot for the FMU it can be seen that the oscillation continues to decrease due to the effect of the friction. If you simulate long enough, the oscillation comes to a standstill in a certain time. - - -```julia -fmiPlot(dataCS) -``` - - -```julia -fmiPlot(dataME) -``` - -From both graphs it can be seen that the simulation calculates exactly the same results. - -### Unload FMU - -After plotting the data, the FMU is unloaded and all unpacked data on disc is removed. - - -```julia -fmiUnload(myFMU) -``` - -### Summary - -Based on this tutorial it can be seen that simulating in the different mode is very easy, and it only takes a few commands to simulate the FMU. diff --git a/examples/src/simulate_files/simulate_14_0.png b/examples/src/simulate_files/simulate_14_0.png deleted file mode 100644 index 59876b6e..00000000 Binary files a/examples/src/simulate_files/simulate_14_0.png and /dev/null differ diff --git a/examples/src/simulate_files/simulate_14_0.svg b/examples/src/simulate_files/simulate_14_0.svg deleted file mode 100644 index d5e1c938..00000000 --- a/examples/src/simulate_files/simulate_14_0.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/src/simulate_files/simulate_15_0.png b/examples/src/simulate_files/simulate_15_0.png deleted file mode 100644 index 94ea6948..00000000 Binary files a/examples/src/simulate_files/simulate_15_0.png and /dev/null differ diff --git a/examples/src/simulate_files/simulate_15_0.svg b/examples/src/simulate_files/simulate_15_0.svg deleted file mode 100644 index dd4654b5..00000000 --- a/examples/src/simulate_files/simulate_15_0.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -