Giter Club home page Giter Club logo

Comments (2)

baggepinnen avatar baggepinnen commented on July 30, 2024

I wouldn't consider this a bug, it's not expected to work. To make this work, an explicit overload would be required that breaks the problem up into N individual problems and then recombine the result in the end.

from modelingtoolkit.jl.

baggepinnen avatar baggepinnen commented on July 30, 2024

This is a temporary workaround

using ModelingToolkit
using MonteCarloMeasurements

pars = @parameters a, b
vars = @variables x, y

eqs = [
    x ~ a
    y ~ x + b
]

@mtkbuild model = NonlinearSystem(eqs, vars, pars) #split=false

u0 = Dict(
    x => 1, 
    y => 2
)


function solve_wrapper(a0, b0)
    p = Dict(
        model.a => a0,
        model.b => b0
        )

    prob = NonlinearProblem(model, u0, p)
    sol = solve(prob)
    [sol[model.x], sol[model.y]]
end


a0 = 1
b0 = 1
solve_wrapper(a0, b0)

a = 1 ± 0.1
b = 1 ± 0.1
xy = @bymap solve_wrapper(a, b)
julia> xy = @bymap solve_wrapper(a, b)
2-element Vector{Particles{Float64, 2000}}:
 1.0 ± 0.1
 2.0 ± 0.14

from modelingtoolkit.jl.

Related Issues (20)

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.