Skip to content

Commit 0ecdfa5

Browse files
committed
import fewer solvers
1 parent f40ea06 commit 0ecdfa5

30 files changed

+135
-187
lines changed

Project.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1717
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1818

1919
[weakdeps]
20-
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
20+
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
2121
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
2222
LightXML = "9c8b4983-aa76-5018-a973-4c85ecc9e179"
23-
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
23+
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
2424
MetaGraphsNext = "fa8bd995-216d-47f1-8a91-f3b68fbeb377"
2525

26-
2726
[extensions]
2827
Render = ["Makie"]
2928
URDF = ["LightXML", "Graphs", "MetaGraphsNext", "JuliaFormatter"]
@@ -47,12 +46,14 @@ StaticArrays = "1"
4746
julia = "1"
4847

4948
[extras]
50-
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
51-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
49+
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
5250
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
5351
LightXML = "9c8b4983-aa76-5018-a973-4c85ecc9e179"
54-
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
5552
MetaGraphsNext = "fa8bd995-216d-47f1-8a91-f3b68fbeb377"
53+
OrdinaryDiffEqBDF = "6ad6398a-0878-4a85-9266-38940aa047c8"
54+
OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce"
55+
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
56+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5657

5758
[targets]
58-
test = ["OrdinaryDiffEq", "Test", "JuliaFormatter", "LightXML", "Graphs", "MetaGraphsNext"]
59+
test = ["OrdinaryDiffEqBDF", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqTsit5", "Test", "JuliaFormatter", "LightXML", "Graphs", "MetaGraphsNext"]

docs/Manifest.toml

Lines changed: 1 addition & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.10.5"
44
manifest_format = "2.0"
5-
project_hash = "08003e42b5c1441ed313cb0f744985213930fbba"
5+
project_hash = "08a78d2a0b8f7c13d94e84d1e87233ac1adf1ff0"
66

77
[[deps.ADTypes]]
88
git-tree-sha1 = "eea5d80188827b35333801ef97a40c2ed653b081"
@@ -742,12 +742,6 @@ git-tree-sha1 = "1c6317308b9dc757616f0b5cb379db10494443a7"
742742
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
743743
version = "2.6.2+0"
744744

745-
[[deps.ExponentialUtilities]]
746-
deps = ["Adapt", "ArrayInterface", "GPUArraysCore", "GenericSchur", "LinearAlgebra", "PrecompileTools", "Printf", "SparseArrays", "libblastrampoline_jll"]
747-
git-tree-sha1 = "8e18940a5ba7f4ddb41fe2b79b6acaac50880a86"
748-
uuid = "d4d017d3-3776-5f7e-afef-a10c40355c18"
749-
version = "1.26.1"
750-
751745
[[deps.ExprTools]]
752746
git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec"
753747
uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
@@ -1923,18 +1917,6 @@ git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5"
19231917
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
19241918
version = "1.6.3"
19251919

1926-
[[deps.OrdinaryDiffEq]]
1927-
deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "ExponentialUtilities", "FastBroadcast", "FastClosures", "FillArrays", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "InteractiveUtils", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "MacroTools", "MuladdMacro", "NonlinearSolve", "OrdinaryDiffEqAdamsBashforthMoulton", "OrdinaryDiffEqBDF", "OrdinaryDiffEqCore", "OrdinaryDiffEqDefault", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqExplicitRK", "OrdinaryDiffEqExponentialRK", "OrdinaryDiffEqExtrapolation", "OrdinaryDiffEqFIRK", "OrdinaryDiffEqFeagin", "OrdinaryDiffEqFunctionMap", "OrdinaryDiffEqHighOrderRK", "OrdinaryDiffEqIMEXMultistep", "OrdinaryDiffEqLinear", "OrdinaryDiffEqLowOrderRK", "OrdinaryDiffEqLowStorageRK", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqNordsieck", "OrdinaryDiffEqPDIRK", "OrdinaryDiffEqPRK", "OrdinaryDiffEqQPRK", "OrdinaryDiffEqRKN", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqSDIRK", "OrdinaryDiffEqSSPRK", "OrdinaryDiffEqStabilizedIRK", "OrdinaryDiffEqStabilizedRK", "OrdinaryDiffEqSymplecticRK", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "Polyester", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleNonlinearSolve", "SimpleUnPack", "SparseArrays", "SparseDiffTools", "Static", "StaticArrayInterface", "StaticArrays", "TruncatedStacktraces"]
1928-
git-tree-sha1 = "cd892f12371c287dc50d6ad3af075b088b6f2d48"
1929-
uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
1930-
version = "6.89.0"
1931-
1932-
[[deps.OrdinaryDiffEqAdamsBashforthMoulton]]
1933-
deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqLowOrderRK", "Polyester", "RecursiveArrayTools", "Reexport", "Static"]
1934-
git-tree-sha1 = "8e3c5978d0531a961f70d2f2730d1d16ed3bbd12"
1935-
uuid = "89bda076-bce5-4f1c-845f-551c83cdda9a"
1936-
version = "1.1.0"
1937-
19381920
[[deps.OrdinaryDiffEqBDF]]
19391921
deps = ["ArrayInterface", "DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqSDIRK", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "StaticArrays", "TruncatedStacktraces"]
19401922
git-tree-sha1 = "b4498d40bf35da0b6d22652ff2e9d8820590b3c6"
@@ -1963,108 +1945,12 @@ git-tree-sha1 = "e63ec633b1efa99e3caa2e26a01faaa88ba6cef9"
19631945
uuid = "4302a76b-040a-498a-8c04-15b101fed76b"
19641946
version = "1.1.0"
19651947

1966-
[[deps.OrdinaryDiffEqExplicitRK]]
1967-
deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "TruncatedStacktraces"]
1968-
git-tree-sha1 = "4dbce3f9e6974567082ce5176e21aab0224a69e9"
1969-
uuid = "9286f039-9fbf-40e8-bf65-aa933bdc4db0"
1970-
version = "1.1.0"
1971-
1972-
[[deps.OrdinaryDiffEqExponentialRK]]
1973-
deps = ["DiffEqBase", "ExponentialUtilities", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqSDIRK", "OrdinaryDiffEqVerner", "RecursiveArrayTools", "Reexport", "SciMLBase"]
1974-
git-tree-sha1 = "f63938b8e9e5d3a05815defb3ebdbdcf61ec0a74"
1975-
uuid = "e0540318-69ee-4070-8777-9e2de6de23de"
1976-
version = "1.1.0"
1977-
1978-
[[deps.OrdinaryDiffEqExtrapolation]]
1979-
deps = ["DiffEqBase", "FastBroadcast", "LinearSolve", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "Polyester", "RecursiveArrayTools", "Reexport"]
1980-
git-tree-sha1 = "fea595528a160ed5cade9eee217a9691b1d97714"
1981-
uuid = "becaefa8-8ca2-5cf9-886d-c06f3d2bd2c4"
1982-
version = "1.1.0"
1983-
1984-
[[deps.OrdinaryDiffEqFIRK]]
1985-
deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "LinearSolve", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "RecursiveArrayTools", "Reexport", "SciMLOperators"]
1986-
git-tree-sha1 = "795221c662698851328cb7787965ab4a180d9468"
1987-
uuid = "5960d6e9-dd7a-4743-88e7-cf307b64f125"
1988-
version = "1.1.1"
1989-
1990-
[[deps.OrdinaryDiffEqFeagin]]
1991-
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "RecursiveArrayTools", "Reexport", "Static"]
1992-
git-tree-sha1 = "a7cc74d3433db98e59dc3d58bc28174c6c290adf"
1993-
uuid = "101fe9f7-ebb6-4678-b671-3a81e7194747"
1994-
version = "1.1.0"
1995-
1996-
[[deps.OrdinaryDiffEqFunctionMap]]
1997-
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "SciMLBase", "Static"]
1998-
git-tree-sha1 = "925a91583d1ab84f1f0fea121be1abf1179c5926"
1999-
uuid = "d3585ca7-f5d3-4ba6-8057-292ed1abd90f"
2000-
version = "1.1.1"
2001-
2002-
[[deps.OrdinaryDiffEqHighOrderRK]]
2003-
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "Static"]
2004-
git-tree-sha1 = "103e017ff186ac39d731904045781c9bacfca2b0"
2005-
uuid = "d28bc4f8-55e1-4f49-af69-84c1a99f0f58"
2006-
version = "1.1.0"
2007-
2008-
[[deps.OrdinaryDiffEqIMEXMultistep]]
2009-
deps = ["DiffEqBase", "FastBroadcast", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "Reexport"]
2010-
git-tree-sha1 = "9f8f52aad2399d7714b400ff9d203254b0a89c4a"
2011-
uuid = "9f002381-b378-40b7-97a6-27a27c83f129"
2012-
version = "1.1.0"
2013-
2014-
[[deps.OrdinaryDiffEqLinear]]
2015-
deps = ["DiffEqBase", "ExponentialUtilities", "LinearAlgebra", "OrdinaryDiffEqCore", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators"]
2016-
git-tree-sha1 = "0f81a77ede3da0dc714ea61e81c76b25db4ab87a"
2017-
uuid = "521117fe-8c41-49f8-b3b6-30780b3f0fb5"
2018-
version = "1.1.0"
2019-
2020-
[[deps.OrdinaryDiffEqLowOrderRK]]
2021-
deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "SciMLBase", "Static"]
2022-
git-tree-sha1 = "d4bb32e09d6b68ce2eb45fb81001eab46f60717a"
2023-
uuid = "1344f307-1e59-4825-a18e-ace9aa3fa4c6"
2024-
version = "1.2.0"
2025-
2026-
[[deps.OrdinaryDiffEqLowStorageRK]]
2027-
deps = ["Adapt", "DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static", "StaticArrays"]
2028-
git-tree-sha1 = "590561f3af623d5485d070b4d7044f8854535f5a"
2029-
uuid = "b0944070-b475-4768-8dec-fb6eb410534d"
2030-
version = "1.2.1"
2031-
20321948
[[deps.OrdinaryDiffEqNonlinearSolve]]
20331949
deps = ["ADTypes", "ArrayInterface", "DiffEqBase", "FastBroadcast", "FastClosures", "ForwardDiff", "LinearAlgebra", "LinearSolve", "MuladdMacro", "NonlinearSolve", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "PreallocationTools", "RecursiveArrayTools", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleNonlinearSolve", "StaticArrays"]
20341950
git-tree-sha1 = "a2a4119f3e35f7982f78e17beea7b12485d179e9"
20351951
uuid = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8"
20361952
version = "1.2.1"
20371953

2038-
[[deps.OrdinaryDiffEqNordsieck]]
2039-
deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqTsit5", "Polyester", "RecursiveArrayTools", "Reexport", "Static"]
2040-
git-tree-sha1 = "ef44754f10e0dfb9bb55ded382afed44cd94ab57"
2041-
uuid = "c9986a66-5c92-4813-8696-a7ec84c806c8"
2042-
version = "1.1.0"
2043-
2044-
[[deps.OrdinaryDiffEqPDIRK]]
2045-
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "Polyester", "Reexport", "StaticArrays"]
2046-
git-tree-sha1 = "a8b7f8107c477e07c6a6c00d1d66cac68b801bbc"
2047-
uuid = "5dd0a6cf-3d4b-4314-aa06-06d4e299bc89"
2048-
version = "1.1.0"
2049-
2050-
[[deps.OrdinaryDiffEqPRK]]
2051-
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "Reexport"]
2052-
git-tree-sha1 = "da525d277962a1b76102c79f30cb0c31e13fe5b9"
2053-
uuid = "5b33eab2-c0f1-4480-b2c3-94bc1e80bda1"
2054-
version = "1.1.0"
2055-
2056-
[[deps.OrdinaryDiffEqQPRK]]
2057-
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "Static"]
2058-
git-tree-sha1 = "332f9d17d0229218f66a73492162267359ba85e9"
2059-
uuid = "04162be5-8125-4266-98ed-640baecc6514"
2060-
version = "1.1.0"
2061-
2062-
[[deps.OrdinaryDiffEqRKN]]
2063-
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "RecursiveArrayTools", "Reexport"]
2064-
git-tree-sha1 = "41c09d9c20877546490f907d8dffdd52690dd65f"
2065-
uuid = "af6ede74-add8-4cfd-b1df-9a4dbb109d7a"
2066-
version = "1.1.0"
2067-
20681954
[[deps.OrdinaryDiffEqRosenbrock]]
20691955
deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static"]
20701956
git-tree-sha1 = "96b47cdd12cb4ce8f70d701b49f855271a462bd4"
@@ -2077,30 +1963,6 @@ git-tree-sha1 = "f6683803a58de600ab7a26d2f49411c9923e9721"
20771963
uuid = "2d112036-d095-4a1e-ab9a-08536f3ecdbf"
20781964
version = "1.1.0"
20791965

2080-
[[deps.OrdinaryDiffEqSSPRK]]
2081-
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static", "StaticArrays"]
2082-
git-tree-sha1 = "7dbe4ac56f930df5e9abd003cedb54e25cbbea86"
2083-
uuid = "669c94d9-1f4b-4b64-b377-1aa079aa2388"
2084-
version = "1.2.0"
2085-
2086-
[[deps.OrdinaryDiffEqStabilizedIRK]]
2087-
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "RecursiveArrayTools", "Reexport", "StaticArrays"]
2088-
git-tree-sha1 = "348fd6def9a88518715425025eadd58517017325"
2089-
uuid = "e3e12d00-db14-5390-b879-ac3dd2ef6296"
2090-
version = "1.1.0"
2091-
2092-
[[deps.OrdinaryDiffEqStabilizedRK]]
2093-
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "StaticArrays"]
2094-
git-tree-sha1 = "1b0d894c880e25f7d0b022d7257638cf8ce5b311"
2095-
uuid = "358294b1-0aab-51c3-aafe-ad5ab194a2ad"
2096-
version = "1.1.0"
2097-
2098-
[[deps.OrdinaryDiffEqSymplecticRK]]
2099-
deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "RecursiveArrayTools", "Reexport"]
2100-
git-tree-sha1 = "4e8b8c8b81df3df17e2eb4603115db3b30a88235"
2101-
uuid = "fa646aed-7ef9-47eb-84c4-9443fc8cbfa8"
2102-
version = "1.1.0"
2103-
21041966
[[deps.OrdinaryDiffEqTsit5]]
21051967
deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static", "TruncatedStacktraces"]
21061968
git-tree-sha1 = "96552f7d4619fabab4038a29ed37dd55e9eb513a"

docs/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
88
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
99
ModelingToolkitStandardLibrary = "16a59e39-deab-5bd0-87e4-056b12336739"
1010
Multibody = "e1cad5d1-98ef-44f9-a79a-9ca4547f95b9"
11-
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
11+
OrdinaryDiffEqBDF = "6ad6398a-0878-4a85-9266-38940aa047c8"
12+
OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce"
13+
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
1214
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1315
RobustAndOptimalControl = "21fd56a4-db03-40ee-82ee-a87907bee541"

docs/src/examples/free_motion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using Multibody
66
using ModelingToolkit
77
using Plots
88
using JuliaSimCompiler
9-
using OrdinaryDiffEq
9+
using OrdinaryDiffEqRosenbrock
1010
1111
t = Multibody.t
1212
D = Differential(t)

docs/src/examples/gearbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using Multibody
1111
using ModelingToolkit
1212
using Plots
1313
using JuliaSimCompiler
14-
using OrdinaryDiffEq
14+
using OrdinaryDiffEqRosenbrock
1515
1616
t = Multibody.t
1717
D = Differential(t)

docs/src/examples/gyroscopic_effects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using Multibody
1212
using ModelingToolkit
1313
using Plots
1414
using JuliaSimCompiler
15-
using OrdinaryDiffEq
15+
using OrdinaryDiffEqBDF
1616
1717
t = Multibody.t
1818
D = Differential(t)

docs/src/examples/kinematic_loops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using Multibody
2727
using ModelingToolkit
2828
import ModelingToolkitStandardLibrary.Mechanical.Rotational
2929
using Plots
30-
using OrdinaryDiffEq
30+
using OrdinaryDiffEqBDF
3131
using LinearAlgebra
3232
using JuliaSimCompiler
3333

docs/src/examples/pendulum.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ To start, we load the required packages
55
```@example pendulum
66
using ModelingToolkit
77
using Multibody, JuliaSimCompiler
8-
using OrdinaryDiffEq # Contains the ODE solver we will use
8+
using OrdinaryDiffEqRosenbrock # Contains the ODE solver we will use
99
using Plots
1010
```
1111
We then access the world frame and time variable from the Multibody module
@@ -57,7 +57,7 @@ This results in a simplified model with the minimum required variables and equat
5757
multibody
5858
```
5959

60-
We are now ready to create an `ODEProblem` and simulate it. We use the `Rodas4` solver from OrdinaryDiffEq.jl, and pass a dictionary for the initial conditions. We specify only initial condition for some variables, for those variables where no initial condition is specified, the default initial condition defined the model will be used.
60+
We are now ready to create an `ODEProblem` and simulate it. We use the `Rodas4` solver from OrdinaryDiffEqRosenbrock.jl, and pass a dictionary for the initial conditions. We specify only initial condition for some variables, for those variables where no initial condition is specified, the default initial condition defined the model will be used.
6161
```@example pendulum
6262
D = Differential(t)
6363
defs = Dict() # We may specify the initial condition here
@@ -187,7 +187,7 @@ The systems we have modeled so far have all been _planar_ mechanisms. We now ext
187187
This pendulum, sometimes referred to as a _rotary pendulum_, has two joints, one in the "shoulder", which is typically configured to rotate around the gravitational axis, and one in the "elbow", which is typically configured to rotate around the axis of the upper arm. The upper arm is attached to the shoulder joint, and the lower arm is attached to the elbow joint. The tip of the pendulum is attached to the lower arm.
188188

189189
```@example pendulum
190-
using ModelingToolkit, Multibody, JuliaSimCompiler, OrdinaryDiffEq, Plots
190+
using ModelingToolkit, Multibody, JuliaSimCompiler, OrdinaryDiffEqRosenbrock, Plots
191191
import ModelingToolkitStandardLibrary.Mechanical.Rotational.Damper as RDamper
192192
import Multibody.Rotations
193193
@@ -326,6 +326,7 @@ We will continue the pendulum theme and design an inverted pendulum on cart. The
326326
We start by putting the model together and control it in open loop using a simple periodic input signal:
327327

328328
```@example pendulum
329+
using OrdinaryDiffEqTsit5
329330
import ModelingToolkitStandardLibrary.Mechanical.TranslationalModelica
330331
import ModelingToolkitStandardLibrary.Blocks
331332
using Plots

docs/src/examples/prescribed_pose.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ using Multibody
2323
using Multibody.Rotations # To specify orientations using Euler angles
2424
using ModelingToolkit
2525
using Plots
26-
using OrdinaryDiffEq
26+
using OrdinaryDiffEqRosenbrock
2727
using LinearAlgebra
2828
using JuliaSimCompiler
2929
using Test

docs/src/examples/quad.md

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using ModelingToolkitStandardLibrary.Blocks
1313
using LinearAlgebra
1414
using Plots
1515
using JuliaSimCompiler
16-
using OrdinaryDiffEq
16+
using OrdinaryDiffEqBDF
1717
using Test
1818
t = Multibody.t
1919
D = Differential(t)
@@ -336,3 +336,79 @@ nothing
336336
While gain and phase margins appear to be reasonable, we have a large high-frequency gain in the transfer functions from measurement noise to control signal, ``C(s)S(s)``. For a rotor craft where the control signal manipulates the current through motor windings, this may lead to excessive heat generation in the motors if the sensor measurements are noisy.
337337

338338
The diskmargin at the plant output is small, luckily, the gain variation appears at the plant input where the diskmargin is significantly larger. The diskmargins are visualized in the figure titled "Stable region for combined gain and phase variation". See [Diskmargin example](https://juliacontrol.github.io/RobustAndOptimalControl.jl/dev/#Diskmargin-example) to learn more about diskmargins.
339+
340+
```@example QUAD
341+
using LowLevelParticleFilters, SeeToDee, StaticArrays
342+
343+
Ts = 0.02
344+
tv = range(0, 7, step=Ts)
345+
Y = [SVector(i...) .+ 0.01 .* randn.() for i in sol(tv, idxs=outputs)]
346+
Y0 = [SVector(i...) for i in sol(tv, idxs=outputs)]
347+
U = [SVector(i...) .+ 0.2 .* randn.() for i in sol(tv, idxs=inputs)]
348+
X = Matrix(sol(tv, idxs=x_sym))
349+
##
350+
351+
state_parameters = [quad.body.m]
352+
353+
function dyn_with_state_parameters(mmodel, inputs, state_parameters)
354+
fdyn, x_sym, p_sym, io_sys = ModelingToolkit.generate_control_function(mmodel, inputs)
355+
356+
p_inds = [findfirst(x -> string(x) == string(p), p_sym) for p in state_parameters]
357+
# @info "found" p_sym[p_inds]
358+
359+
nx_orig = length(x_sym)
360+
nx_extended = nx_orig + length(state_parameters)
361+
362+
p1 = copy(p)
363+
dx = zeros(nx_orig)
364+
out = zeros(nx_extended)
365+
366+
f_ext = function (x, u, p, t)
367+
for (i, p_ind) in enumerate(p_inds)
368+
p1[p_ind] = max(x[nx_orig + i], 0.1) # NOTE: temp hack
369+
end
370+
dx .= 0
371+
fdyn(dx, x, u, p1, t)
372+
@views out[1:nx_orig] .= dx
373+
# [dx; x[nx_orig+1:end]]
374+
@views out[nx_orig+1:end] .= x[nx_orig+1:end]
375+
out
376+
end
377+
# f_ext, [x_sym; p_sym[p_inds]], p_sym[1:end-length(inputs)], io_sys
378+
f_ext, [x_sym; p_sym[p_inds]], p_sym, io_sys
379+
end
380+
381+
fdyn, x_sym, p_sym, io_sys = dyn_with_state_parameters(multibody(quad), inputs, state_parameters)
382+
383+
g = JuliaSimCompiler.build_explicit_observed_function(io_sys, outputs; inputs)
384+
nx = length(x_sym)
385+
nu = length(inputs)
386+
ny = length(outputs)
387+
x = randn(nx)
388+
u = randn(nu)
389+
390+
op = [
391+
quad.body.r_0[2] => 1e-32
392+
quad.v_alt => 1e-32 # To avoid singularity in linearization
393+
quad.world.g => 9.81
394+
inputs .=> 13;
395+
quad.body.m => 2 # We pretend that the body mass is close to cable+load+body mass for better altitude estimation
396+
] |> Dict
397+
##
398+
x0, p = JuliaSimCompiler.initial_conditions(io_sys, op, op)
399+
y0 = g(x0, u, p, 0)
400+
R1 = collect(0.001I(nx))
401+
R1[end] = 0.01
402+
R2 = 0.01^2 * I(ny)
403+
404+
d0 = LowLevelParticleFilters.MvNormal([x0; 2], R1)
405+
discrete_dynamics = SeeToDee.Rk4(fdyn, 0.01)
406+
407+
ukf = UnscentedKalmanFilter(discrete_dynamics, g, R1, R2, d0; p, nu, ny)
408+
409+
410+
@time filtersol = forward_trajectory(ukf, U, Y)
411+
plot(filtersol, size=(1200, 1000), ploty=false, plotu=false)
412+
X[end,:] .= 5.3
413+
plot!(X', sp=(1:nx)', label=false, l=(:black, :dash))
414+
```

0 commit comments

Comments
 (0)