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

Python - Strange plot points on ode

I'm currently developing a dynamic model for a vehicle as part of my master thesis. I'm using the ode solver that comes with python, and I get results that seem good. But I notice a problem with some of the plots. Part of my code is as follows: f =…
Nate
  • 3
  • 3
0
votes
1 answer

solving system of coupled odes with odeint

I'm using a system of ode's to model coffee bean roasting for a class assignment. The equations are below. The parameters (other than X_b and T_b) are all constants. When I try to use odeint to solve this system, it gives a constant T_b and X_b…
L Buck
  • 3
  • 1
  • 2
0
votes
0 answers

Matlab Error 'Dimensions of matrices being concatenated are not consistent.'

I know this problem comes up a lot on here and I've read through many threads but am still stuck on my specific problem. I'm using a mass matrix with ode function to solve 4 equations simultaneously, 2 algebraic and 2 differential: function ade %…
0
votes
1 answer

Combining two ode45 function answers into one plot

I am trying to use Matlab to solve a problem which has two separate differential equations that I want to return the values for over time in one giant plot. For Example the first portion I want to do is: ainitial = 0; arange=[0 2]; [a,A] =…
obizues
  • 1,473
  • 5
  • 16
  • 30
0
votes
0 answers

Easy MatLab Q - ODE 15S

I'm trying to solve a differential algebraic equation and keep getting the following error: Function definitions in a script must appear at the end of the file. Move all statements after the "pscalc" function definition to before the first local…
mo farah
  • 23
  • 5
0
votes
1 answer

Octave ODE solver: issues with state & derivative vectors

I have the code to solve a problem of non-stationary heat transfer (no, this is not homework, but the code is taken from a textbook), which requires solving a set of ODEs with the Method of Lines, and goes as follows: %Problem P6_08A clear, clc,…
Fabio Capezzuoli
  • 599
  • 7
  • 23
0
votes
0 answers

3D diffusion equation in cylinder in matlab

I want know if there is a way to solve the PDE for diffusion in a cylinder with 0.3 metre radius and 1.6 metre height. I am trying to create a cylindrical coordinate with this code. %cylinder % n = linspace(-pi,pi,30); % m = linspace(0,1.6,20); %…
Kappa
  • 1
0
votes
1 answer

Solving an ODE System in Python with Runge Kutta 4th Order , unexpected ERROR

I have a problem while solving a physical Problem in Python. It is an ODE System. ODE System At certain time points some dosis has to be injected to raise the value A. I have to solve this with the Runge Kutta Method of 4th Order. I thought i got it…
RyZ
  • 1
  • 1
0
votes
1 answer

Solve Newtons Cooling Method with ODE23 Matlab

I'm new to Matlab and trying to solve the Newton cooling DEQ with ODE23, actually a simplified version of it. I am not sure how to input the function into the ODE function. I have T_s = 19, T_c = 84, and r = 0.025 elapsing from [0, 300] seconds. The…
user3440639
  • 185
  • 2
  • 12
0
votes
1 answer

Is it possible to trigger event by non-continuous function?

Can someone please point me in the right direction with specifying an event for a function that is not continuous? For example, suppose that I have Object1 that moves along the x axis and I also have another Object2 that moves vertically at x=100. I…
Razvan
  • 151
  • 4
  • 14
0
votes
1 answer

How to solve a coupled nonlinear first order differential equation?

I have a problem in the form of 2 equations and known initial conditions. The equations are: dx/dt = (-a1*sin(y) + a2 + a3*sin(y-x)) / ((dy/dt)*a4*cos(y-x)) dy/dt = (a1*sin(x) -a5 + a6*x + a7*sin(y-x)) / ((dx/dt)*a8*cos(y-x)) where a1 to a8 are…
Bob Smith
  • 1
  • 3
0
votes
1 answer

Setting up two events with ode45

Could someone please explain what am I doing wrong when setting up an ode45 event this way? When I tried running the code it would reach line 6, however it would not stop computing the ode regardless that I set isTerminal=[1,1] on line 7, instead it…
Razvan
  • 151
  • 4
  • 14
0
votes
1 answer

Integrating a set of second order differential equations with Scipy

I have a set of second order differential equations: and I would like to solve for using odeint in python. Is this possible? I have attempted to do it, but my code does not give me the expected result. import numpy as np, matplotlib.pyplot as…
PiccolMan
  • 4,854
  • 12
  • 35
  • 53
0
votes
0 answers

How to implement a Heaviside function in an ODE in R

What's the proper way to implement a Heaviside step function that's part of an deSolve ODE? My first guess would be to use ifelse s.t. ode <- function(t, y, p) { dy = numeric(1) H = ifelse((y[1] - 1) >= 0, 1, 0) dy[1] = -p*y[1] + (y[1] -…
Pascal
  • 563
  • 1
  • 3
  • 15
0
votes
1 answer

Matlab, slope field, euler ODE system and 2nd order Runge-Kutta

I have system of differential equations x' = ax - by y' = bx + ay I need to find approximate solution using explicit Euler method and second order Runge-Kutta, Conditions a = 0, b=1, x(0) = 0, y(0) = 1, and accualy for more than that, Using…
macck
  • 15
  • 2
1 2 3
99
100