differentialequations.jl

How can I run a simple parallel array assignment operation in Julia?

好久不见. 提交于 2021-02-10 14:03:34
问题 I have to solve a differential equations system many times, iterating over a parameter. For this, I run a loop over a list of the parameter, and store the solution (evaluated at an array of time values) for each parameter. So I have a 2D array in which I store solutions (each row is for a value of the parameter). Now, since any iteration has nothing to do with another one, I thought of doing this in parallel. Here is my code: using DifferentialEquations using SharedArrays using DelimitedFiles

How can I run a simple parallel array assignment operation in Julia?

蓝咒 提交于 2021-02-10 14:02:08
问题 I have to solve a differential equations system many times, iterating over a parameter. For this, I run a loop over a list of the parameter, and store the solution (evaluated at an array of time values) for each parameter. So I have a 2D array in which I store solutions (each row is for a value of the parameter). Now, since any iteration has nothing to do with another one, I thought of doing this in parallel. Here is my code: using DifferentialEquations using SharedArrays using DelimitedFiles

solve system of ODEs with read in external forcing

落爺英雄遲暮 提交于 2020-03-24 04:54:10
问题 In Julia, I want to solve a system of ODEs with external forcings g1(t), g2(t) like dx1(t) / dt = f1(x1, t) + g1(t) dx2(t) / dt = f2(x1, x2, t) + g2(t) with the forcings read in from a file. I am using this study to learn Julia and the package DifferentialEquations, but I am having difficulties finding the correct approach. I could imagine that using a callback could work, but that seems pretty cumbersome. Do you have an idea of how to implement such an external forcing? 回答1: You can use

solve system of ODEs with read in external forcing

大兔子大兔子 提交于 2020-03-24 04:53:54
问题 In Julia, I want to solve a system of ODEs with external forcings g1(t), g2(t) like dx1(t) / dt = f1(x1, t) + g1(t) dx2(t) / dt = f2(x1, x2, t) + g2(t) with the forcings read in from a file. I am using this study to learn Julia and the package DifferentialEquations, but I am having difficulties finding the correct approach. I could imagine that using a callback could work, but that seems pretty cumbersome. Do you have an idea of how to implement such an external forcing? 回答1: You can use

How to get Rosenbrock23 to work with ODE in ParameterizedFunctions.jl DSL?

*爱你&永不变心* 提交于 2019-12-11 02:28:04
问题 Further to this question, I have the same model implemented in ParameterizedFunctions.jl DSL. The following MWE works: using DifferentialEquations using Plots # Modeling a consecutive / parallel reaction in a CSTR # A --> 2B --> C, C --> 2B, B --> D # PETERSEN-Matrix # No. A B C D Rate # 1 -1 2 k1*A # 2 -2 1 k2*B*B # 3 2 -1 k3*C # 4 -1 1 k4*B fpr! = @ode_def ConsecutiveParallelReaction begin dA = -k_1*A + q_in/V_liq*(A_in - A) dB = 2*k_1*A - 2*k_2*B*B + 2*k_3*C - k_4*B + q_in/V_liq*(B_in - B)