This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deep_access(sol, names...) | |
return map(sol.u) do u | |
reduce(Base.maybeview, names; init=u) | |
end | |
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### A Pluto.jl notebook ### | |
# v0.16.4 | |
using Markdown | |
using InteractiveUtils | |
# ╔═╡ 15da0afe-3e5b-11ec-031f-d9903463dce1 | |
begin | |
using ControlSystems | |
using IntervalArithmetic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### A Pluto.jl notebook ### | |
# v0.16.1 | |
using Markdown | |
using InteractiveUtils | |
# ╔═╡ b2663d22-8605-11eb-17fa-e90e625ac922 | |
using ComponentArrays | |
# ╔═╡ 932b2cb6-8609-11eb-27d7-a393d81f6d8a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ComponentArrays, DifferentialEquations, Plots, UnPack | |
## Functions | |
function lotka!(D, x, p, t) | |
@unpack NB, NR = x | |
@unpack ϵ₁, ϵ₂, γ₁, γ₂ = p | |
D.NB = ϵ₁*NB - γ₁*NR*NB | |
D.NR = -ϵ₂*NR + γ₂*NR*NB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DifferentialEquations | |
using ModelingToolkit | |
# Time and time derivative | |
@parameters t | |
D = Differential(t) | |
# Forced Duffing oscillator | |
function Duffing(; name) | |
@parameters α β |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## This example comes from https://diffeqflux.sciml.ai/dev/Flux/ | |
using ComponentArrays | |
using OrdinaryDiffEq | |
using Plots | |
using UnPack | |
using DiffEqFlux: sciml_train | |
using Flux: glorot_uniform, ADAM, σ, relu | |
using Optim: LBFGS |