Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

WIP: 2nd order pde #434

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

valentinsulzer
Copy link
Contributor

Trying to add functionality for 2nd order PDE such as the wave equation (inspired by #421 )
Not obvious why the test is failing, am I missing something obvious? Equations look sensible:

julia> equations(sys)
30-element Vector{Equation}:
 Differential(t)(Differential(t)(u₂(t))) ~ -(85.21111544320605u₁(t) + 85.21111544320605u₃(t) - (170.4222308864121u₂(t)))
 Differential(t)(Differential(t)(u₃(t))) ~ -(85.21111544320605u₂(t) + 85.21111544320603u₄(t) - (170.42223088641208u₃(t)))
 Differential(t)(Differential(t)(u₄(t))) ~ -(85.21111544320605u₃(t) + 85.21111544320608u₅(t) - (170.42223088641214u₄(t)))
 Differential(t)(Differential(t)(u₅(t))) ~ -(85.21111544320608u₄(t) + 85.2111154432061u₆(t) - (170.4222308864122u₅(t)))
 Differential(t)(Differential(t)(u₆(t))) ~ -(85.21111544320607u₅(t) + 85.21111544320603u₇(t) - (170.42223088641208u₆(t)))
 Differential(t)(Differential(t)(u₇(t))) ~ -(85.21111544320604u₆(t) + 85.21111544320613u₈(t) - (170.42223088641217u₇(t)))
 Differential(t)(Differential(t)(u₈(t))) ~ -(85.21111544320614u₇(t) + 85.21111544320604u₉(t) - (170.4222308864122u₈(t)))
 Differential(t)(Differential(t)(u₉(t))) ~ -(85.21111544320613u₁₀(t) + 85.21111544320604u₈(t) - (170.42223088641217u₉(t)))
 ⋮
 Differential(t)(Differential(t)(u₂₄(t))) ~ -(85.211115443206u₂₃(t) + 85.211115443206u₂₅(t) - (170.422230886412u₂₄(t)))
 Differential(t)(Differential(t)(u₂₅(t))) ~ -(85.21111544320617u₂₄(t) + 85.21111544320651u₂₆(t) - (170.42223088641268u₂₅(t)))
 Differential(t)(Differential(t)(u₂₆(t))) ~ -(85.21111544320652u₂₅(t) + 85.21111544320618u₂₇(t) - (170.4222308864127u₂₆(t)))
 Differential(t)(Differential(t)(u₂₇(t))) ~ -(85.211115443206u₂₆(t) + 85.211115443206u₂₈(t) - (170.422230886412u₂₇(t)))
 Differential(t)(Differential(t)(u₂₈(t))) ~ -(85.211115443206u₂₇(t) + 85.211115443206u₂₉(t) - (170.422230886412u₂₈(t)))
 Differential(t)(Differential(t)(u₂₉(t))) ~ -(85.211115443206u₂₈(t) + 85.211115443206u₃₀(t) - (170.422230886412u₂₉(t)))
 u₁(t) ~ exp(-t)
 u₃₀(t) ~ -exp(-t)
julia> equations(ode_order_lowering(sys))
58-element Vector{Equation}:
 Differential(t)(u₂ˍt(t)) ~ -(85.21111544320605u₁(t) + 85.21111544320605u₃(t) - (170.4222308864121u₂(t)))
 Differential(t)(u₃ˍt(t)) ~ -(85.21111544320605u₂(t) + 85.21111544320603u₄(t) - (170.42223088641208u₃(t)))
 Differential(t)(u₄ˍt(t)) ~ -(85.21111544320605u₃(t) + 85.21111544320608u₅(t) - (170.42223088641214u₄(t)))
 Differential(t)(u₅ˍt(t)) ~ -(85.21111544320608u₄(t) + 85.2111154432061u₆(t) - (170.4222308864122u₅(t)))
 Differential(t)(u₆ˍt(t)) ~ -(85.21111544320607u₅(t) + 85.21111544320603u₇(t) - (170.42223088641208u₆(t)))
 Differential(t)(u₇ˍt(t)) ~ -(85.21111544320604u₆(t) + 85.21111544320613u₈(t) - (170.42223088641217u₇(t)))
 Differential(t)(u₈ˍt(t)) ~ -(85.21111544320614u₇(t) + 85.21111544320604u₉(t) - (170.4222308864122u₈(t)))
 Differential(t)(u₉ˍt(t)) ~ -(85.21111544320613u₁₀(t) + 85.21111544320604u₈(t) - (170.42223088641217u₉(t)))
 ⋮
 Differential(t)(u₂₄(t)) ~ u₂₄ˍt(t)
 Differential(t)(u₂₅(t)) ~ u₂₅ˍt(t)
 Differential(t)(u₂₆(t)) ~ u₂₆ˍt(t)
 Differential(t)(u₂₇(t)) ~ u₂₇ˍt(t)
 Differential(t)(u₂₈(t)) ~ u₂₈ˍt(t)
 Differential(t)(u₂₉(t)) ~ u₂₉ˍt(t)
 u₁(t) ~ exp(-t)
 u₃₀(t) ~ -exp(-t)

@valentinsulzer
Copy link
Contributor Author

Initial conditions also look correct:

julia> sys.defaults
Dict{Term{Real, Nothing}, Float64} with 60 entries:
  Differential(t)(u₂₀(t)) => 0.468408
  u₈(t)                   => 0.725995
  Differential(t)(u₂(t))  => -0.994138
  Differential(t)(u₃₀(t)) => 1.0
  Differential(t)(u₉(t))  => -0.647386
  Differential(t)(u₂₅(t)) => 0.856857
  u₁₄(t)                  => 0.161782
  Differential(t)(u₁₄(t)) => -0.161782
  u₁₃(t)                  => 0.267528
  u₃(t)                   => 0.976621
  Differential(t)(u₁₁(t)) => -0.468408
  u₃₀(t)                  => -1.0
  ⋮                       => ⋮

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant