Questions tagged [ode]

An ODE (ordinary differential equation, in contrast to partial differential equation) is a differential equation containing a function or functions of exactly one independent variable.

An ODE (ordinary differential equation, in contrast to partial differential equation) is a differential equation containing a function or functions of exactly one independent variable. Equations of this type can be solved numerically or analytically.

1902 questions
0
votes
1 answer

Julia and system of ordinary differential equations

I want to try to solve a system of ordinary differential equations, perhaps parallelized and came across Julia and DifferentialEquations.jl. the system looks like x'(t) = f(t)*z(t) y'(t) = g(t)*z(t) z'(t) = f(t)*(1-2*x(t))/(2) -g(t)*y(t) over 10^2…
MKF
  • 105
  • 7
0
votes
1 answer

find numerical derivative of function inside System of differential equations?

I want to solve this system of DE : function ydot= DRV(y) B=[1 0.5 4;7.2 0.6 5;3.3 8 0.2]; R1=[2 5 3;11 3 6;1.2 2 4]; Q1=eye(3,3); qv=[y(1);y(2);y(3)]; p=[y(4) y(5) y(6);y(7) y(8) y(9);y(10) y(11)…
user9552185
0
votes
1 answer

stopping ODE solver with condition

I would like to terminate ODE solver when the dependent variable exceeded certain value. Consider a simple ODE model library("deSolve") dModel<- function(t, y, parms) {list(c(y))} out<-ode(c(1),seq(0,100,1),dModel, parms=NULL) I want to stop solver…
bell
  • 191
  • 1
  • 1
  • 11
0
votes
0 answers

SciLab how to solve a differential equation with different time parameters

I am a newbie to Scilab and I just typed these following equations from a paper for my thesis. It describes a certain ordinary differential equation with association of lac enzyme genes. We do want to plot the time against each enzyme product…
0
votes
0 answers

non-numeric argument error using ode23s in R

To understand and learn how ode23s method work in R, I used a simple system from a numerical analysis book and implemented. I encountered an error Error in t + y[1]^2 : non-numeric argument to binary operator Here is my code…
bell
  • 191
  • 1
  • 1
  • 11
0
votes
0 answers

Extrapolating value from function to a for loop and passing it back to the function

function Test() a = 2; b = 1; c = 0.5; q = 0.001; r = 10; function F = Useful(x) %calculates existing values for x with size 11 eq1 = (1*(0.903*x(2))^(-1))-(0.903*x(1)); eq2 = (1*(0.665*x(3))*(0.903*x(2))^(-1))-0.903*x(4); eq3 =…
0
votes
1 answer

Avoiding divergent solutions with odeint? shooting method

I am trying to solve an equation in Python. Basically what I want to do is to solve the equation: (1/x^2)*d(Gam*dL/dx)/dx)+(a^2*x^2/Gam-(m^2))*L=0 This is the Klein-Gordon equation for a massive scalar field in a Schwarzschild spacetime. It suppose…
0
votes
1 answer

How is the ODE being solved in MATLAB?

My prof. made two codes while doing an ODE function xdot= code(t,x); A=[-.5 0; 1 0]; B=[1 ; 0]; K=[1.5 1]; U=-K*x; xdot=A*x+B*U; ` and the second one was [t,x]=ode23('code',[0 10],[1 1 ]'); figure(1); plot(t,x); grid I am not sure why he is doing…
Caithmac
  • 1
  • 1
0
votes
2 answers

Error using *- inner dimension matrix must agree

I got a problem with a task where I have to compare methods for solving ODEs: ode45, Euler and Gauss-Legendre methods. Here, I have to calculate errors for different steps. h=[0.01 0.05 0.1 0.5]; func = @(t, y) -2*y+t*sin(t); opts =…
Marta
  • 37
  • 10
0
votes
0 answers

Solving Non Autonomous System of ODEs

I am working on a project and need to solve a system of non autonomous ODEs (nonlinear). How can I do this in the programming language R? Is there a specific package I could use? Can someone help me out with any instructions or references? I tried…
Zen'z
  • 1
0
votes
0 answers

Solving ODE with time dependent parameter in R using deSolve

I have parameter values that are specific to each time. I want to feed this parameter values to solve the following ODE: dN/dt = mu*N where mu = b*(X-12.2)^2. The Xvalue changes with time. Please see the code below that I came up…
KBH
  • 1
  • 2
0
votes
1 answer

Finding execution time in solving ODEs using odeint

I wanted to print out the execution time of a solution to the system of equations for every t+dt where dt is .01 sec import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt import time from datetime import timedelta #…
user3397
  • 113
  • 1
  • 1
  • 5
0
votes
0 answers

Scipy - solving ODE system of the form: A*dy/dt = f(t, y)

What are my options to solve in scipy the ODE system: Obviously if A is invertibile then i can solve equivalently: using standard methods from scipy.integrate. But still remain the following questions: what about efficiency and what if A is…
mrkwjc
  • 1,080
  • 8
  • 17
0
votes
2 answers

How to write an Ordinary Differential Equation in MATLAB?

I tried writing an Ordinary Differential Equation in MATLAB. I wrote this code: function [y] = odefun(t,y) t = [0:0.01:10]; y = [0 0]'; y(1) = y(2); y(2) = sin(2*t)-2*y(2)-2*y(1); % I get an error here end I get an error in the last line in this…
james
  • 23
  • 7
0
votes
1 answer

Having some troubles with my chemical reactions ODE code

So I'm writing my masters thesis and I have to model the BR (Briggs-Rauscher iodine-iodide oscillation) reaction and I have some problems with this code. Everytime I run(the same code) it, I get a different plot and an error. I tried different…
user9280977