SciML / LabelledArrays.jl

Arrays which also have a label for each element for easy scientific machine learning (SciML)
https://docs.sciml.ai/LabelledArrays/stable/
Other
120 stars 21 forks source link

SLVector does not work with stiff solvers. Again? #103

Closed AndreyPikunov closed 3 years ago

AndreyPikunov commented 3 years ago

Hello all!

I know the issues like this appeared before but have a problem today anyways.

I have just installed LabelledArrays.jl and updated all my packages. I run the example given in the README of this repo with the only difference: Tsit5() -> Rodas5()

I see the error: ERROR: type SArray has no field y

This is my code:

using LabelledArrays
using DifferentialEquations

LorenzVector = @SLVector (:x,:y,:z)
LorenzParameterVector = @SLVector (:σ,:ρ,:β)

function f(u,p,t)
  x = p.σ*(u.y-u.x)
  y = u.x*(p.ρ-u.z) - u.y
  z = u.x*u.y - p.β*u.z
  LorenzVector(x,y,z)
end

u0 = LorenzVector(1.0,0.0,0.0)
p = LorenzParameterVector(10.0,28.0,8/3)
tspan = (0.0,10.0)
prob = ODEProblem(f,u0,tspan,p)
sol = solve(prob, Rodas5())  # <- this very guy

This is my packages:

(@v1.6) pkg> st
      Status `~/.julia/environments/v1.6/Project.toml`
  [c52e3926] Atom v0.12.35
  [6e4b80f9] BenchmarkTools v0.7.0
  [a134a8b2] BlackBoxOptim v0.6.0
  [8d3b24bd] CMAEvolutionStrategy v0.2.2
  [336ed68f] CSV v0.8.5
  [03cb29e0] CellMLToolkit v2.4.6
  [593b3428] CmdStan v6.3.1
  [8f4d0f93] Conda v1.5.2
  [a93c6f00] DataFrames v1.2.2
  [2b5f629d] DiffEqBase v6.70.0
  [ebbdde9d] DiffEqBayes v2.26.0
  [0c46a032] DifferentialEquations v6.18.0
  [31c24e10] Distributions v0.24.18
  [bbc10e6e] DynamicHMC v3.1.0
  [86b6b26d] Evolutionary v0.10.0
  [587475ba] Flux v0.12.6
  [28b8d3ca] GR v0.59.0
  [a75be94c] GalacticOptim v2.0.3
  [7073ff75] IJulia v1.23.2
  [d0351b0e] InspectDR v0.4.3
  [e5e0dc1b] Juno v0.8.4
  [7f56f5a3] LSODA v0.7.0
  [2ee39098] LabelledArrays v1.6.4
  [23fbe1c1] Latexify v0.15.6
  [961ee093] ModelingToolkit v5.26.0
  [89824b7a] NaturalES v1.0.0
  [429524aa] Optim v1.4.1
  [1dea7af3] OrdinaryDiffEq v5.61.1
  [d96e819e] Parameters v0.12.2
  [a03496cd] PlotlyBase v0.8.17
  [f0f68f2c] PlotlyJS v0.18.7
  [91a5bcdd] Plots v1.22.1
  [92933f4c] ProgressMeter v1.7.1
  [438e738f] PyCall v1.92.3
  [d330b81b] PyPlot v2.10.0
  [731186ca] RecursiveArrayTools v2.17.2
  [295af30f] Revise v3.1.19
  [efcf1570] Setfield v0.7.1
  [684fba80] SparsityDetection v0.3.4
  [90137ffa] StaticArrays v1.2.12
  [f3b207a7] StatsPlots v0.14.27
  [c3572dad] Sundials v4.5.3
  [84d833dd] TransformVariables v0.4.1
  [0f1e0344] WebIO v0.8.16
ChrisRackauckas commented 3 years ago

Thanks, fixed.

AndreyPikunov commented 3 years ago

Yes, It does work now. Thank you very much!