We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using DifferentialEquations using Plots using BenchmarkTools
function f1(du,u,p,t) du[1] = u[2] du[2] = -u[1]-0.15u[2] du[3] = u[2]+2u[3] du[4] = -u[3]+0.8u[4] du[5] = 0.3u[4]+u[5] du[6] = u[5]+0.8u[6] du[7] = -u[6]+u[7] du[8] = u[7]-u[8] du[9] = 3u[8]-u[9] du[10] = u[9]-u[10] end
function j!(J, x) for i=1:10 for j=1:10 J[i,j]=0 end end J[1,2] = 1 J[2,1] = -1 J[2,2] =-0.15 J[3,2] = 1 J[3,3] = 2 J[4,3] =-1 J[4,4] =0.8 J[5,4] =0.3 J[5,5] =1 J[6,5]=1 J[6,6]=0.8 J[7,6]=-1 J[7,7]=1 J[8,7]=1 J[8,8]=-1 J[9,8]=3 J[9,9]=-1 J[10,9]=1 J[10,10]=-1 end
u0 = [1.0;0.0;0.0;1.0;0.5;-0.3;1.0;0.5;-0.3;-0.1] tspan = (0.0,10000.0)
f=ODEFunction(f1;jac_prototype=j!) prob=ODEProblem(f,u0,tspan)
sol= solve(prob,ImplicitEuler(autodiff=false,diff_type=Val{:central}))
print("end solve!!!!")
I use Implicit Euler to solve the ODEs, but it shows that
Warning: Instability detected. Aborting └ @ SciMLBase C:\Users\PC.julia\packages\SciMLBase\QqtZA\src\integrator_interface.jl:525
Interpolation: 3rd order Hermite
when I use @Btime, not the implicit euler.
The text was updated successfully, but these errors were encountered:
Yes, the solution blows up to infinity in finite time. It has an analytical solution:
A = zeros(10,10) j!(A, nothing) t = 50 exp(A*t)*u0
so it's clearly just a property of the solution (can also just be checked by the unstable eigenvalues).
Sorry, something went wrong.
No branches or pull requests
using DifferentialEquations
using Plots
using BenchmarkTools
function f1(du,u,p,t)
du[1] = u[2]
du[2] = -u[1]-0.15u[2]
du[3] = u[2]+2u[3]
du[4] = -u[3]+0.8u[4]
du[5] = 0.3u[4]+u[5]
du[6] = u[5]+0.8u[6]
du[7] = -u[6]+u[7]
du[8] = u[7]-u[8]
du[9] = 3u[8]-u[9]
du[10] = u[9]-u[10]
end
function j!(J, x)
for i=1:10
for j=1:10
J[i,j]=0
end
end
J[1,2] = 1
J[2,1] = -1
J[2,2] =-0.15
J[3,2] = 1
J[3,3] = 2
J[4,3] =-1
J[4,4] =0.8
J[5,4] =0.3
J[5,5] =1
J[6,5]=1
J[6,6]=0.8
J[7,6]=-1
J[7,7]=1
J[8,7]=1
J[8,8]=-1
J[9,8]=3
J[9,9]=-1
J[10,9]=1
J[10,10]=-1
end
u0 = [1.0;0.0;0.0;1.0;0.5;-0.3;1.0;0.5;-0.3;-0.1]
tspan = (0.0,10000.0)
f=ODEFunction(f1;jac_prototype=j!)
prob=ODEProblem(f,u0,tspan)
sol= solve(prob,ImplicitEuler(autodiff=false,diff_type=Val{:central}))
print("end solve!!!!")
I use Implicit Euler to solve the ODEs, but it shows that
Warning: Instability detected. Aborting
└ @ SciMLBase C:\Users\PC.julia\packages\SciMLBase\QqtZA\src\integrator_interface.jl:525
Interpolation: 3rd order Hermite
when I use @Btime, not the implicit euler.
The text was updated successfully, but these errors were encountered: