ode

Matlab: Is it possible to numerically solve a system of ode's with a mixture of initial and terminal conditions?

陌路散爱 提交于 2021-02-18 11:26:29
问题 I'm trying to use ode45 to solve a system of ODE's: [X,Y]= ode45(@sys,[0, T],y0); where, function dy = sys(t,y) dy(1) = f_1(y) dy(2) = f_2(y) dy(3) = f_3(y) end The problem is that the function ode45 requires that y0 be initial values [y_1(0), y_2(0), y_3(0)] , while in my system, I only have the values [y_2(0), y_3(0), y_3(T)] available. Mathematically, this set of initial/terminal conditions should be enough to pin down the system, but is there any way I can work with that by ode45 or any

Simulation with RK4, update ODE variable as the simulation goes

守給你的承諾、 提交于 2021-02-11 13:40:56
问题 Problem : I’m currently making a python app that simulates a set of coupled ordinary differentials equations that depends on a variable, let’s call it « X ». As for now, I’m basically simulating this set of ODE with RK4 for given time then I’m plotting the graph on an animated plot with « matplotlib animation » embedded in tkinter. The fact is that I would like to be able to modify « X » as the equations are resolved so that the simulation can change as we modify this variable. Context : The

R- ode function (deSolve package): change the value of a parameter as a function of time

泪湿孤枕 提交于 2021-02-11 05:07:57
问题 I am trying to solve a first-order differential equation using the function ode from the deSolve package. The problem is as follows: a drug is administered by a constant infusion rate at some times (infusion times) and eliminated in a first-order rate. Thus, the process can be described by: if(t %in% Infusion_times){Infusion <- Infusion_rate} else{Infusion <- 0} dC <- -Ke*C + Infusion where t is the time, Infusion_times is a vector containing at what times the drug is administered, C is the

R- ode function (deSolve package): change the value of a parameter as a function of time

妖精的绣舞 提交于 2021-02-11 05:04:42
问题 I am trying to solve a first-order differential equation using the function ode from the deSolve package. The problem is as follows: a drug is administered by a constant infusion rate at some times (infusion times) and eliminated in a first-order rate. Thus, the process can be described by: if(t %in% Infusion_times){Infusion <- Infusion_rate} else{Infusion <- 0} dC <- -Ke*C + Infusion where t is the time, Infusion_times is a vector containing at what times the drug is administered, C is the

R- ode function (deSolve package): change the value of a parameter as a function of time

坚强是说给别人听的谎言 提交于 2021-02-11 05:04:07
问题 I am trying to solve a first-order differential equation using the function ode from the deSolve package. The problem is as follows: a drug is administered by a constant infusion rate at some times (infusion times) and eliminated in a first-order rate. Thus, the process can be described by: if(t %in% Infusion_times){Infusion <- Infusion_rate} else{Infusion <- 0} dC <- -Ke*C + Infusion where t is the time, Infusion_times is a vector containing at what times the drug is administered, C is the

Solving a system of 2nd order differential equations from sympy

。_饼干妹妹 提交于 2021-02-10 14:50:39
问题 I am doing a multiple DOF dynamics problem, using 2nd order Lagrangian equations. I used sympy to get to the equations of motion. Now these equations after calculating the derivatives got quite long, seems though that sympy simplify cant simplify it further. My problem actually is how to solve this system of three 2nd order ode from here. I don't know how to get these equations converted so they can be used with scipy.odeint(). Substitution came to mind, but there are a lot of symbols. So Im

fitting first order equation with nlme and lsoda

試著忘記壹切 提交于 2021-02-08 14:27:08
问题 I a trying to fit a first order differential model using nlme and lsoda . Here is the basic idea: I first define the function allowing to generate the solution of the differential equation: library(deSolve) ODE1 <- function(time, x, parms) {with(as.list(c(parms, x)), { import <- excfunc(time) dS <- import*k/tau - (S-yo)/tau res <- c(dS) list(res)})} solution_ODE1 = function(tau1,k1,yo1,excitation,time){ excfunc <- approxfun(time, excitation, rule = 2) parms <- c(tau = tau1, k = k1, yo = yo1,

Lyapunov Spectrum for known ODEs - Python 3 [closed]

只谈情不闲聊 提交于 2021-02-08 11:38:54
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 12 months ago . Improve this question I want to numerically compute the Lyapunov Spectrum of the Lorenz System by using the standard method which is described in this Paper, p.81. One basically need integrate the Lorenz system and the tangential vectors (i used the Runge-Kutta method for this). The evolution

Lyapunov Spectrum for known ODEs - Python 3 [closed]

試著忘記壹切 提交于 2021-02-08 11:36:59
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 12 months ago . Improve this question I want to numerically compute the Lyapunov Spectrum of the Lorenz System by using the standard method which is described in this Paper, p.81. One basically need integrate the Lorenz system and the tangential vectors (i used the Runge-Kutta method for this). The evolution

What is the theory behind the odeintw package for complex matrix differential equations?

帅比萌擦擦* 提交于 2021-02-08 09:53:38
问题 In most of the below answers for complex matrix differential equations, the odeintw package has been suggested. https://stackoverflow.com/a/45970853/7952027 https://stackoverflow.com/a/26320130/7952027 https://stackoverflow.com/a/26747232/7952027 https://stackoverflow.com/a/26582411/7952027 I want to know the theory behind the manipulations done in the code of odeintw. Like why one has to build that banded jacobian, the idea behind the functions _complex_to_real_jac, _transform_banded_jac,