Questions tagged [differential-equations]

An equation that relates some unknown function itself and its derivatives of various orders.

An equation that relates some unknown function itself and its derivatives of various orders, for instance x'' = g (free fall) or x' = v (movement under constant speed). Developers solve differential equations numerically or write symbolic engines to solve analytically.

1488 questions
6
votes
3 answers

Change parameter values at time step in deSolve

I am trying to solve an ODE in R using deSolve. With the following code, I expected the parameter gamma0 takes the values 5 at time step 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10, and 0 otherwise. However, the print(gamma0) shows that gamma0 stays at 0.…
Marine
  • 521
  • 1
  • 4
  • 23
6
votes
1 answer

Solve Differential equation using Python PyDDE solver

I am trying to solve following differential equation using python package PyDDE: dy[i]/dt = w[i] + K/N * \sum{j=1toN} sin(y[j] -y[i]), where i = 1,2,3,4...N=50 Below is the python code to solve this equation from numpy import random, sin, arange,…
ADK
  • 259
  • 2
  • 17
6
votes
1 answer

High frequency noise at solving differential equation

I'm trying to simulate a simple diffusion based on Fick's 2nd law. from pylab import * import numpy as np gridpoints = 128 def profile(x): range = 2. straggle = .1576 dose = 1 return…
6
votes
1 answer

SymPy/SciPy: solving a system of ordinary differential equations with different variables

I am new to SymPy and Python in general, and I am currently working with Python 2.7 and SymPy 0.7.5 with the objective to: a) read a system of differential equations from a text file b) solve the system I already read this question and this other…
Alberto
  • 352
  • 1
  • 4
  • 16
6
votes
1 answer

Solving a differential equation in parallel, python

I am numerically solving a differential equation that depends on parameters. I am not really interested on the solutions but on their behaviour depending on the value of the parameters. Since I want a very precise description I must use a very fine…
6
votes
1 answer

How to use dorpi5 or dop853 in Python

I have looked through scipy.integrate.ode but I am unable to find out how to actually use these integration methods, dorpi5 and dop853. I would like to try integrating ode integration python versus mathematica my python code with these two methods…
dustin
  • 4,309
  • 12
  • 57
  • 79
6
votes
1 answer

Errors while solving ODE's python

I have a university project in which we are asked to simulate a satellite approach to Mars using ODE's and SciPy's odeint function. I manage to simulate it in 2D by making a second-order ODE into two first-order ODE's. However I am stuck in the…
6
votes
1 answer

Animate the movement of a point along the plot of a specific solution obtained using ParametricPlot3D

We have the system: x'[t] == x[t] - 5 y[t] + z[t] y'[t] == 3 x[t] - 3 y[t] - 3 z[t] z'[t] == -2 x[t] + 10 y[t] + 4 z[t] and the initial conditions: x[0] == .01 y[0] == 3 z[0] == 0 I produced the specific plot: eqn = {x'[t] == x[t] - 5 y[t] +…
Sektor
  • 177
  • 1
  • 6
  • 9
6
votes
1 answer

Matlab - solving a third order differential equation

y''' + 41y'' + 360y' + 900y = 600x' + 1200x; y(0)= 2 ; y'(0)= 1 ; y''(0) = -0.05 How can I solve this equation using the ODE45 function? I tried this: ==> function dydt=f(t,y) dydt = [y(2) ; y(3) ; -41*y(3)-360*y(2)- 900*y(1)] ==> clear…
ag.alessandro
  • 63
  • 1
  • 1
  • 6
6
votes
2 answers

Using the solution of a differential equation in two separate plot commands in Mathematica

I've encountered a problem while trying to use the answer from a NDSolve in two separate plot commands. To illustrate the problem, I'll use a simple differential equation and only one plot command. If I write something like this: {Plot[x[t], {t, 0,…
6
votes
2 answers

How do you input piecewise functions into wolfram alpha?

I've tried several approaches, such as defining a function f(t) at certain values, and then using f(t) in my equation, but nothing has worked for me thus far. I love using wolfram alpha, it is an invaluable resource for helping me to better…
Nate G
  • 63
  • 1
  • 1
  • 4
5
votes
0 answers

Plotting FiPy equation on a map

I would like to model the biodiffusion of stork through migration. I have an equation that gives me that kind of results, and I would like to plot it on a map to represent the movements. My code equation : D = Variable(value=(0)) ux =…
Jouline
  • 90
  • 7
5
votes
2 answers

How to solve a system of ODE with time dependent parameters in R?

I am trying to solve this system of ODEs through deSolve, dX/dt = -X*a + (Y-X)b + c and dY/dt = -Ya + (X-Y)*b for time [0,200], a=0.30, b=0.2 but c is 1 for time [50,70] and 0 otherwise. The code I have been using is, time <- seq(0, 200,…
5
votes
1 answer

Second order differential equation in Julia

I'm new to Julia programming I managed to solve some 1st order ODE, but when I thought to move to the second order I don't know how to use the solver to implement to the required equation. I want to solve this equation y" + y = 0 with initial…
5
votes
1 answer

Unexpected solution using JiTCDDE

I'm trying to investigate the behavior of the following Delayed Differential Equation using Python: y''(t) = -y(t)/τ^2 - 2y'(t)/τ - Nd*f(y(t-T))/τ^2, where f is a cut-off function which is essentially equal to the identity when the absolute value…