Skip to content

Autodiff jacobians sometimes don't work #7

@jonniedie

Description

@jonniedie
using ComponentArrays
using DifferentialEquations
using Parameters: @unpack

tspan = (0.0, 20.0);

function lorenz!(D, u, p, t; f=0.0)
    @unpack σ, ρ, β = p
    @unpack x, y, z = u
    
    D.x = σ*(y - x)
    D.y = x*- z) - y - f
    D.z = x*y - β*z
    return nothing
end

lorenz_p ==10.0, ρ=28.0, β=8/3)
lorenz_ic = CArray(x=1.0, y=0.0, z=0.0)

lorenz_prob = ODEProblem(lorenz!, lorenz_ic, tspan, lorenz_p)
lorenz_sol = solve(lorenz_prob, Rodas5())

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions