Giter Club home page Giter Club logo

geometricequations.jl's Introduction

GeometricEquations

Stable Docs Latest Docs License Build Status Coverage

GeometricEquations.jl define different types of ordinary differential equations, differential algebraic and stochastic equations, that hold a number of functions determining the vector field, constraints, initial conditions, and possibly additional information like parameters, periodicity, invariants and the Hamiltonian or Lagrangian.

Development

We are using git hooks, e.g., to enforce that all tests pass before pushing. In order to activate these hooks, the following command must be executed once:

git config core.hooksPath .githooks

geometricequations.jl's People

Contributors

github-actions[bot] avatar michakraus avatar vchuravy avatar

Watchers

 avatar  avatar  avatar

Forkers

vchuravy

geometricequations.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Missing constructor for multiple parameters and a single set of ics for `HODEEnsemble`.

There is a missing constructor for HODEEnsemble:

function HODEEnsemble(v, f, hamiltonian, tspan, tstep, ics::AbstractVector{<:NamedTuple};
invariants = NullInvariants(),
parameters = NullParameters(),
periodicity = NullPeriodicity())
equ = HODE(v, f, hamiltonian, invariants, parameter_types(parameters), periodicity)
EnsembleProblem(equ, tspan, tstep, ics, parameters)
end
function HODEEnsemble(v, f, hamiltonian, tspan, tstep, q₀::AbstractVector{<:StateVariable}, p₀::AbstractVector{<:StateVariable}; kwargs...)
_ics = [(q = q, p = p) for (q,p) in zip(q₀,p₀)]
HODEEnsemble(v, f, hamiltonian, tspan, tstep, _ics; kwargs...)
end
function HODEEnsemble(v, f, hamiltonian, tspan, tstep, q₀::AbstractVector{<:AbstractArray}, p₀::AbstractVector{<:AbstractArray}; kwargs...)
_q₀ = [StateVariable(q) for q in q₀]
_p₀ = [StateVariable(p) for p in p₀]
HODEEnsemble(v, f, hamiltonian, tspan, tstep, _q₀, _p₀; kwargs...)
end

I should take two vectors (Vector{<:Number}) or StateVariables as input and the parameters should be a vector of NamedTuples. JuliaGNI/GeometricProblems.jl#66 can only be merged once this constructor is implemented.

Problem in connection with parameter-dependent `EnsembleProblem` and generated Code with `EulerLagrange`.

So I'm not 100% sure if this belongs to GeometricEquations or GeometricProblems, but I have the following problem:

I used to be able to do:

using GeometricIntegrators: integrate, ImplicitMidpoint
using GeometricEquations: EnsembleProblem
using GeometricProblems.CoupledHarmonicOscillator: hodeproblem, default_parameters, tspan, tstep, hamiltonian, p₀, q₀
const m₁ = default_parameters.m₁
const m₂ = default_parameters.m₂
const k₁ = default_parameters.k₁
const k₂ = default_parameters.k₂
const k = Float64.(0.0:0.1:4)

params_collection = [(m₁ = m₁, m₂ = m₂, k₁ = k₁, k₂ = k₂, k = k_val) for k_val in k]
ensemble_problem = EnsembleProblem(hodeproblem().equation, tspan, tstep, (q = q₀, p = p₀), params_collection)
ensemble_solution = integrate(ensemble_problem, ImplicitMidpoint())

But now I get the following error:

julia> ensemble_solution = integrate(ensemble_problem, ImplicitMidpoint())
ERROR: MethodError: no method matching vectorfield(::Vector{Float64})

Closest candidates are:
  vectorfield(::GeometricBase.AbstractStateVariable)
   @ GeometricBase ~/.julia/packages/GeometricBase/d27AC/src/data/state_variables.jl:131

Stacktrace:
  [1] (::GeometricIntegrators.Integrators.var"#15#21")(::Int64)
    @ GeometricIntegrators.Integrators ./none:0
  [2] iterate
    @ ./generator.jl:47 [inlined]
  [3] collect(itr::Base.Generator{UnitRange{Int64}, GeometricIntegrators.Integrators.var"#15#21"})
    @ Base ./array.jl:834
  [4] GeometricIntegrators.Integrators.SolutionStepPODE(t::Float64, q::Vector{…}, p::Vector{…}, parameters::@NamedTuple{…}; nhistory::Int64, internal::@NamedTuple{…})
    @ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/solutions/solution_step_pode.jl:67
  [5] SolutionStepPODE
    @ ~/.julia/packages/GeometricIntegrators/yNYjW/src/solutions/solution_step_pode.jl:63 [inlined]
  [6] GeometricIntegrators.Integrators.SolutionStep(problem::HODEProblem{…}, extrap::GeometricIntegrators.Extrapolators.MidpointExtrapolation; kwargs::@Kwargs{…})
    @ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/solutions/solution_step_constructors.jl:17
  [7] GeometricIntegrators.Integrators.SolutionStep(problem::HODEProblem{…}, method::GeometricIntegrators.Integrators.IPRK{…}, extrap::GeometricIntegrators.Extrapolators.MidpointExtrapolation)
    @ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/solutions/solution_step_constructors.jl:52
  [8] SolutionStep
    @ ~/.julia/packages/GeometricIntegrators/yNYjW/src/solutions/solution_step_constructors.jl:52 [inlined]
  [9] GeometricIntegrators.Integrators.GeometricIntegrator(problem::HODEProblem{…}, integratormethod::GeometricIntegrators.Integrators.IPRK{…}, solvermethod::SimpleSolvers.Newton, iguess::GeometricIntegrators.Extrapolators.HermiteExtrapolation)
    @ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/integrator.jl:165
 [10] #GeometricIntegrator#82
    @ ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/integrator.jl:185 [inlined]
 [11] GeometricIntegrators.Integrators.GeometricIntegrator(problem::HODEProblem{Float64, Float64, Vector{…}, HODE{…}, @NamedTuple{…}, @NamedTuple{}, @NamedTuple{…}, @NamedTuple{…}}, method::GeometricIntegrators.Integrators.IPRK{RungeKutta.PartitionedTableau{…}})
    @ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/integrator.jl:178
 [12] GeometricIntegrators.Integrators.GeometricIntegrator(::HODEProblem{Float64, Float64, Vector{…}, HODE{…}, @NamedTuple{…}, @NamedTuple{}, @NamedTuple{…}, @NamedTuple{…}}, ::ImplicitMidpoint; kwargs::@Kwargs{})
    @ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/rk/abstract.jl:58
 [13] integrate(problems::HODEEnsemble{Float64, Float64, Vector{…}, HODE{…}, @NamedTuple{…}, @NamedTuple{}, Vector{…}, Vector{…}}, method::ImplicitMidpoint; kwargs::@Kwargs{})
    @ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/integrator.jl:37
 [14] integrate(problems::HODEEnsemble{Float64, Float64, Vector{…}, HODE{…}, @NamedTuple{…}, @NamedTuple{}, Vector{…}, Vector{…}}, method::ImplicitMidpoint)
    @ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/integrator.jl:33
 [15] top-level scope
    @ REPL[14]:1
Some type information was truncated. Use `show(err)` to see complete types.

I get the same error when supplying a vector of initial conditions instead of a vector of parameters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.