Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
107 views

Any idea why dsolve in sympy 1.14 when given this ode Eq(x**a * y(x) + Derivative(y(x), (x, 2)),0) gives error TypeError: 'Symbol' object cannot be interpreted as an integer code from sympy import * x ...
Nasser's user avatar
  • 13.2k
2 votes
2 answers
179 views

I am trying to model a fatigue crack growth in Python using Paris’ law : da / dN = C ( DeltaK ) ^ m where : a = crack length N = load cycles C, m = material constants ( DeltaK ) = Y.( DeltaSigma ).( ...
sina torabizadeh's user avatar
0 votes
0 answers
119 views

I am trying to solve a convection-diffusion-reaction problem for a tubular reactor. The reaction governing the process is as follows: The method I chose to solve it is the line method, which consists ...
Renato's user avatar
  • 11
2 votes
2 answers
118 views

I would like to compute the residual of the numerical solution to an ordinary differential equation. Here is the code import numpy as np from scipy.integrate import solve_ivp def f(t, x): return ...
Artem's user avatar
  • 123
2 votes
0 answers
65 views

I’ve written a MATLAB implementation of an implicit Runge–Kutta method (Radau IIA). It behaves well on most test problems, but it refuses to converge on the following very stiff equation like y' = y^2 ...
Matteo Cozzolino's user avatar
1 vote
2 answers
62 views

I am trying to add a legend to each plot output of the ccl4model(ODE model) in the deSolve package using plot.deSolve and the legend method but it only appears on the last plot output of the model. I ...
Idowu Mariam's user avatar
0 votes
1 answer
89 views

I ended up trying to build a for-loop to achieve my end goal (running an ODE function modeling disease transmission through different scenarios/parameter sets in the most transparent way possible) but ...
Kit McLean's user avatar
0 votes
0 answers
29 views

I'm trying to simulate a satellite tracker. With ode45 I have de state of the satellite for each time and then convert position to Azimuth-Elevation local coordinates. If the object enters in the ...
David Torralbo's user avatar
1 vote
2 answers
123 views

the model Im trying to graph this model however I am just not sure whether my code is leading me to a reasonable solution: import numpy as np import matplotlib.pyplot as plt from scipy.integrate ...
big_d's user avatar
  • 11
0 votes
1 answer
56 views

I am using the following code. How can I plot time (x-axis) vs C_WT (y-axis) line plots for different C_WT values as in vectorC_WT in a single graph in R ? kon_WT = 1 koff_WT = 10 R_WT = 20 ...
Khushhi's user avatar
  • 63
3 votes
2 answers
101 views

I'm modeling the spread of an infectious disease in R, and I need to loop the model through multiple sets of parameters. I have a working model so far (a dummy version is below), but only for a single ...
Kit McLean's user avatar
1 vote
1 answer
85 views

I am trying to solve two coupled differential equations in python using the solve:ivp() function from scipy.integrate but I get an unexplained gain on one of my terms that breaks the equation. It is ...
Lucas Leal Abadi's user avatar
0 votes
1 answer
37 views

I composed the following ODE file: function [dndt,dmdt,dhdt,dVdt]=hh(n,m,h,V) C=1; GK=36; GNa=120; GL=0.3; EK=-72; ENa=55; EL=-49.4; dndt=(1-n)*alphan(V)-n*betan(V); dmdt=(1-m)*alpham(V)-m*...
צבי's user avatar
  • 31
0 votes
1 answer
63 views

Let us consider the following code: import sympy as sy import scipy as sc from sympy.physics.units.quantities import Quantity from sympy.solvers.ode.systems import dsolve_system from IPython.display ...
user2751530's user avatar
0 votes
0 answers
49 views

I am now struggling with a shooting method using python. The original question is ODE, with m=0 Here's my code, and I wonder why the graph would become flatter if the tolerence gets smaller. import ...
user104804's user avatar
0 votes
0 answers
30 views

I am experimenting with an N-Body-Simulation with the goal to be efficient with a large number of particles. That means, the most costly thing will be calls to the ODE-function. Adams-Bashforth only ...
Paul Aner's user avatar
  • 543
0 votes
1 answer
79 views

I'm using solve_ivp but I'm getting strange results depending on the settings of the problem, though i think it's more an issue with the implementation of the solver than a coding issue, but I'd love ...
mmonti's user avatar
  • 316
0 votes
1 answer
51 views

I am trying to solve coupled ODEs, but I present a small part of the problem here. I have tried to solve for R along the entire grid. The grid size is too big to run conventional methods, hence I am ...
Rahul Rai's user avatar
0 votes
0 answers
80 views

So I am trying to solve a project from MIT Numerical Methods course, basically need to solve a now uncoupled equation for supersonic flow over an airfoil which is just a parabolic shape.but for some ...
Ricardo's user avatar
1 vote
2 answers
120 views

I am new to coding and trying to solve a simple 1D dispersion equation. The equation and boundary conditions: adC/dx = bd^2C/dx^2 x = hj, C = C0; x = - inf, C =0 The analytical solution is C = C0 * ...
user28866182's user avatar
1 vote
1 answer
75 views

I am trying to find multiple parameters for the optimized system which is governed by a system of equations. In my code, I need to be able to use 4 or 5 equations and determine the parameters for the ...
AndyDufresne's user avatar
1 vote
1 answer
89 views

I am using this Optimisation script: using DifferentialEquations, Optimization, OptimizationPolyalgorithms, OptimizationOptimJL, Plots, SciMLSensitivity, Zygote parameters = [] function ...
AndyDufresne's user avatar
1 vote
0 answers
38 views

I have an ODE function ode(y,t,theta, influent) where influent is an array of values at different times (experimental data for input to system). I have this in my main ode function (not as important): ...
Rvdb's user avatar
  • 11
2 votes
1 answer
56 views

I'm trying to simulate the level of a tank that has two inlet flows and one outlet. The idea is that after this will be used in a control problem. However, I can't get it to work with gekko but it did ...
iarima's user avatar
  • 45
0 votes
1 answer
55 views

I am trying to solve an ode within the pyomo framework, using the forward euler method. I wrote down the discretization scheme explicitly but the result is not as expected. From the pyomo model the ...
dnma's user avatar
  • 1
1 vote
0 answers
60 views

I'm trying to plot the dynamics of a particle moving through several cylindrical magnetic elements. I'm using solve_ivp to integrate the ODE, but I'm having trouble obtaining the expected behavior ...
Banjo's user avatar
  • 13
0 votes
1 answer
69 views

I am trying to obtain the steady state points of the following ODE system for a SIR model (steady state points are the solutions when the equations of the system equal zero): import sympy as sp S, I, ...
YoshiroVilchez's user avatar
-1 votes
1 answer
104 views

I am trying to reproduce 4.1.3 Emission from Solid Materials as per this PDF. https://www.rivm.nl/bibliotheek/rapporten/2017-0197.pdf Produced this version of the model and this is the best I have ...
Nick's user avatar
  • 927
1 vote
1 answer
155 views

I am trying to write a python code to solve the ODE representing a coupled Chua oscillators. The set of ODEs can be found here. The non-linear term is defined as f(x) And the possible solution is ...
Faruque's user avatar
  • 27
0 votes
1 answer
67 views

I am stuck in an attempt to pass an interpolating function that was generated from a PDE solved using NDSolveValue to a second call to NDSolveValue for a solution to a simple ODE. Here is my code for ...
Leapfrog's user avatar
2 votes
1 answer
86 views

I am trying to fit the parameters of an ODE to data with two dimensions, which should generally be possible, according to the example Fitting multidimensional datasets. This is my failed attempt so ...
soupinacanoe's user avatar
2 votes
1 answer
187 views

I want to solve (1-x^2)y'=x^2-xy-1 with Sympy, but I cannot solve it as expected. I expect to get the following solution. -1<x<1:y(x)=-sqrt(1-x**2)*asin(x)+C1*sqrt(1-x**2) x<-1,x>1:y(x)=-...
Ryo's user avatar
  • 21
0 votes
0 answers
131 views

I would be really thankful for some suggestions how to introduce a delay in one of my ODE in the system and solve it with solve_ivp scipy. So, I have a system of equations with some analytical ...
Yehor K.'s user avatar
0 votes
0 answers
46 views

I'm working on a model that simulates pesticide dynamics in a rice field using a system of differential equations. One of the compartments in my model is the mass of pesticide in the water (mw). ...
Pablo's user avatar
  • 39
0 votes
1 answer
35 views

Code for getting the data: import pandas as pd import torch dataset = pd.read_csv('/kaggle/input/fish-bear/population_data.csv') years = torch.tensor(dataset['year'], dtype = torch.float64) fish_pop =...
GreatRSingh's user avatar
-1 votes
2 answers
174 views

I need help to build Fortran 95 code that solves 3rd order ODE using Runge-Kutta-Fehlberg method. I am trying to solve y''' = -2y''+y'+2y with y(0)=3, y'(0)=-2, and y''(0)=6. The exact solution should ...
Takashi Katayama's user avatar
0 votes
1 answer
179 views

I'm trying to solve a problem involving a fixed-bed reactor that uses a system of ordinary differential equations, but for some reason it gets stuck in an infinite loop. Here's the code: import numpy ...
Renato's user avatar
  • 11
0 votes
1 answer
132 views

I'm trying to solve the 2D heat equation using the finite difference method as a filtering technique for an image using the solve_ivp method. My code is shown which gives an error message "y0 ...
User123's user avatar
  • 29
2 votes
1 answer
72 views

I'm reasonably new to R and have this system of ODEs \frac{dS}{dT} = -\beta(1-\mu)S(t)\frac{I(t))}{1-D(t))} \frac{dI}{dT} = -\beta(1-\mu)S(t)\frac{I(t))}{1-D(t))}-\delta I(t))-\phi I(t)) \frac{dR}{dT}=...
Tom FitzGerald-Jones's user avatar
0 votes
0 answers
89 views

Hello I want to plot the Hopf bifurcation diagram for the 3D system. I have this code but I'm getting nothing other than straight lines. How would I fix this? Any help is appreciated. The parameter ...
sjk05's user avatar
  • 141
1 vote
0 answers
43 views

I am currently working on a simulation project involving a two-degree-of-freedom (2DOF) airfoil. The motion of this airfoil is governed by the following equations of motion: To numerically solve ...
Amir Khan's user avatar
-1 votes
1 answer
58 views

There is a basic ODE - Differential Equation. y' = 2x , solution is f(x) = x² Code: def deriv (y,x) : return 2 * x # time points x = np.linspace ( 0 , 10) # initial condition y0 = 1 # solve ...
estellec's user avatar
1 vote
1 answer
168 views

I have a questions very similar to this post. Unfortunately there is no answer for the question and I have additional questions. I am trying to generate a solve for the current in an RLC circuit and ...
Noahwar97's user avatar
2 votes
1 answer
99 views

I want to perform parameter inference for an ODE model (m.options.IMODE = 5). I have 2 models in Gekko. First, I generate model data from each model, and perform parameter inference directly on the ...
Aleksejs Fomins's user avatar
2 votes
1 answer
90 views

I am trying to edit the Gray-Scott 1D equation example (last example on the page) in the odeint documentation. I have the code below and it works for the Neumann boundary conditions but I want a ...
Zack Fair's user avatar
  • 239
2 votes
1 answer
91 views

In this minimal example I want to solve the basic integrator ODE dT/dt = k[F(t) - T(t)] where F(t) is a forcing vector, which is selected to be a square wave. I have implemented two procedures to ...
Aleksejs Fomins's user avatar
0 votes
1 answer
224 views

I have a system of differential equations containing 62500 simultaneous equations. The system dynamics are linear and of the form: [dU/dt] = [Jacobian]x[U]. The jacobian is sparse (non-zero vals ~ 0.6%...
balaji sriram's user avatar
1 vote
1 answer
43 views

I need to plot the function f(k) which is defined as a square root of the time integral of the square of the Euclidean norm of the system state vector x(t) during the first 10 seconds after the start ...
Snork Maiden's user avatar
3 votes
1 answer
106 views

I have the following nonlinear system and accompanying ODE: My solution in MATLAB: % Solving with ODE45 dt = 10^-1; % [s] T = 100; % [s] N = 2; % number of masses X_0 = zeros(2*N,1); t_span = [0:dt:T];...
Jonathan Frutschy's user avatar
0 votes
0 answers
127 views

I am a biology student and I am recently learning how to fit ode with observed data in R. I cultivate a microbe under a given condition but with two different initial densities (N0=5 and N0=100), I ...
Myosotis_Li's user avatar

1
2 3 4 5
40