Giter Club home page Giter Club logo

Comments (4)

ChrisRackauckas avatar ChrisRackauckas commented on June 5, 2024

Each MassActionJump can have either a rate parameter or an index. However, dispatching on Int sounds like a source of chaos, so maybe it can be an easy switch to flip.

from jumpprocesses.jl.

isaacsas avatar isaacsas commented on June 5, 2024
using Catalyst, DiffEqBase, DiffEqJump
 rn = @reaction_network begin
           α, S + I --> 2I
           β, I --> R
         end α β
p = [.1/1000, .01]
tspan = (0.0,250.0)
u0 = [999,1,0] 
dprob = DiscreteProblem(rn,u0,tspan,p)
jprob = JumpProblem(rs, dprob, Direct())
sol = solve(jprob, SSAStepper())

# change the rate of the first reaction
jprob.massaction_jump.scaled_rates[1] = .001
sol = solve(jprob, SSAStepper())

See discussion at https://discourse.julialang.org/t/simulating-mjps-many-times-with-different-parameters-as-inner-loop/49061/11 too.

from jumpprocesses.jl.

isaacsas avatar isaacsas commented on June 5, 2024

This probably needs some type of API accessor for easier updating, and which can work within callbacks too.

from jumpprocesses.jl.

isaacsas avatar isaacsas commented on June 5, 2024

This could be handled by having MassActionJump's take an optional extra parameter vector: rate_idxs_in_params or such. Then when the JumpProblem is constructed the corresponding parameter from prob.p could be used instead.

Only took three years for me to implement this, but should be fixed by #190.

from jumpprocesses.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.