differential-equations

Need help solving a second order non-linear ODE in python

二次信任 提交于 2019-11-27 15:03:13
问题 I don't really know where to start with this problem, as I haven't had much experience with this but it is required to solve this part of the project using a computer. I have a 2nd order ODE which is: m = 1220 k = 35600 g = 17.5 a = 450000 and b is between 1000 and 10000 with increments of 500. x(0)= 0 x'(0)= 5 m*x''(t) + b*x'(t) + k*x(t)+a*(x(t))^3 = -m*g I need to find the smallest b such that the solution is never positive. I know what the graph should look like, but I just don't know how

Differential Equations in Python [closed]

蹲街弑〆低调 提交于 2019-11-27 10:48:58
问题 I'm working with a DE system, and I wanted to know which is the most commonly used python library to solve Differential Equations if any. My Equations are non Linear First Order equations. 回答1: If you need to solve large nonlinear systems (especially stiff ones), the scipy tools will be slow and awkward. The PyDSTool package is now quite commonly used in this situation. It lets your equations be automatically converted into C code and integrates them with good solvers. It's especially good if

Absolute error of ODE45 and Runge-Kutta methods compared with analytical solution

梦想与她 提交于 2019-11-27 08:29:25
I would appreciate if someone can help with the following issue. I have the following ODE: dr/dt = 4*exp(0.8*t) - 0.5*r ,r(0)=2, t[0,1] (1) I have solved (1) in two different ways. By means of the Runge-Kutta method (4th order) and by means of ode45 in Matlab. I have compared the both results with the analytic solution, which is given by: r(t) = 4/1.3 (exp(0.8*t) - exp(-0.5*t)) + 2*exp(-0.5*t) When I plot the absolute error of each method with respect to the exact solution, I get the following: For RK-method, my code is: h=1/50; x = 0:h:1; y = zeros(1,length(x)); y(1) = 2; F_xy = @(t,r) 4.*exp

Finding solution to Cauchy prob. in Matlab

穿精又带淫゛_ 提交于 2019-11-27 08:27:55
问题 I need some help with finding solution to Cauchy problem in Matlab. The problem: y''+10xy = 0, y(0) = 7, y '(0) = 3 Also I need to plot the graph. I wrote some code but, I'm not sure whether it's correct or not. Particularly in function section. Can somebody check it? If it's not correct, where I made a mistake? Here is separate function in other .m file: function dydx = funpr12(x,y) dydx = y(2)+10*x*y end Main: %% Cauchy problem clear all, clc xint = [0,5]; % interval y0 = [7;3]; % initial