- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 233
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using DifferentialEquations
using Test
for sign in [-1.0, +1.0]
    @variables x(t)
    sys = ODESystem(
        [D(D(x)) ~ 0], t;
        initialization_eqs = [D(x)^2 ~ 1, x ~ 0], guesses = [D(x) => sign], name = :sys
    ) |> structural_simplify
    prob = ODEProblem(sys, [], (0.0, 1.0), [])
    sol = solve(prob, Tsit5())
    @test sol(1.0, idxs=sys.x) ≈ sign # system with D(x(0)) = ±1 should solve to x(1) = ±1
endBut it always chooses the negative branch:
Test Failed at C:\Users\herma\.julia\dev\SymBoltz\bug.jl:14
  Expression: sol(1.0, idxs = sys.x) ≈ sign
   Evaluated: -0.9999999999999956 ≈ 1.0
So it looks like the guess for D(x) is not respected. Is there a missing dummy derivative substitution somewhere, similar to #3029?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working