我有一個朱莉婭代碼: using DifferentialEquations
using Plots
using ParameterizedFunctions
plotly()
lorenz = @ode_def Lorenz begin
dx = σ*(y-x)
dy = ρ*x-y-x*z
dz = x*y-β*z
end σ = 10. β = 8./
假設我們有以下功能: function f=lorenz(t,x,a,b,c)
% solve differential equation like this
%dx/dt=a*(y-x)
%dy/dt=-x*z+b*x-y
%dz/dt=xy-c*z/3
f=zeros(3,1);% preallocate result
f(1)=a*
的實際代碼發佈前,讓我告訴你,我的電腦的處理器和內存信息是好的: 昨天我已經張貼了關於Lorenz方程(從古典式混沌理論),其中的大好人一個幫助我和展示的解決方案,那就是: function f=lorenz(t,x,a,b,c)
% solve differential equation like this
%dx/dt=a*(y-x)
%dy/dt=-x*z
我試圖解決任意n(多變量索引)值的Lane-Emden方程。爲了使用SciPy,我將二階ODE表示爲一組兩個一階耦合一階ODE。我有以下代碼: import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
def poly(y,xi,n):
theta, phi = y