Interrupted. larger maxiters is needed.

我在用Julia 求解方程时,程序中间被杀掉,报错为
Interrupted. larger maxiters is needed.
@DiffEqBase
…Julia\packages\DiffEqBase\VoY3t\scr\integrator_interface.jl:329

dτ = 0.05
τmax = 1000000
τ = [0:dτ:τmax;]
corr = timecorrelations.correlation(τ, ρ₀, H, J, dagger(a), a)

timecorrelations.correlation(),是调用了DiffEqBase 去求a(t)在0:dτ:τmax中的演化方程。

请放一个能运行的代码。看情况是最大迭代次数达到了,但是并不满足收敛准则,所以需要你自己设置一个更大的最大迭代次数。

非常感谢能收到您的回复,我的代码调用了量子光学的包,如果您感兴趣的话,可以安装一下 Pkg.add(“QuantumOptics”)
我看了一下包中函数correlation()求解微分的关键命令:OrdinaryDiffEq.solve

下面是可执行的代码,我运行一段时间就会爆出我刚才所说的警告。

using QuantumOptics
using PyPlot

Nc = 10
κ = 1.0
n = 4
Δ = 5.0κ

basis = FockBasis(Nc)

a = destroy(basis)
H = -Δ*dagger(a)*a
J = [sqrt(2κ)*a]

ρ₀ = fockstate(basis, n) ⊗ dagger(fockstate(basis, n))

dτ = 0.05
τmax = 1000000
τ = [0:dτ:τmax;]
corr = timecorrelations.correlation(τ, ρ₀, H, J, dagger(a), a)

ω, spec = timecorrelations.correlation2spectrum(τ, corr; normalize_spec=true)

corr_an = n.*exp.(-1.0im*Δ.*τ).*exp.(-κ.*τ)
spec_an = 2n*κ./((Δ .+ ω).^2 .+ κ^2)
spec_an ./= maximum(spec_an)

figure(figsize=(9, 3))
subplot(121)
plot(ω, spec, label="numerical")
plot(ω, spec_an, ls="dashed", label="analytical")
xlabel("freq.")
ylabel("spectrum")
subplot(122)
plot(τ[1:200], real(corr[1:200]))
plot(τ[1:200], real(corr_an[1:200]), ls="dashed")
xlabel("time")
ylabel("correlation")

PyPlot.display_figs()

此为上述关键命令的补充的一个补充,谢谢
OrdinaryDiffEq.solve(
prob,
alg;
reltol = 1.0e-6,
abstol = 1.0e-8,
save_everystep = false, save_start = false,
save_end = false,
callback=full_cb, kwargs…)

函数中,
correlation([tspan, ]rho0, H, J, op1, op2; <keyword arguments>)
关于 解释是

  • kwargs...: Further arguments are passed on to the ode solver.
    [tspan, ] 是时间,rho0,初态,
    H, J, op1, op2是给出该动力学方程