Skip to content

Commit 0db82e4

Browse files
committed
solve sort of works
1 parent 9984624 commit 0db82e4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/src/lecture_13/ode.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ function solve_res(f,x0::AbstractVector,sqΣ0, θ,dt,N,Nr)
8282
X,S
8383
end
8484

85+
QXr,QSr=solve_res(f,[1.0,1.0,0.1],diagm([0.1,0.1,0.01]),θ0,0.1,1000,100)
86+
plot(QXr[1,1:30:end],label="x",color=:blue,errorbar=QSr[1,1:30:end])
87+
plot!(QXr[2,1:30:end],label="y",color=:red,errorbar=QSr[2,1:30:end])
88+
89+
8590
function solve(f,x0::AbstractVector,Σ0, θ,dt,N)
8691
n = length(x0)
8792
n2 = 2*length(x0)
@@ -112,16 +117,12 @@ end
112117

113118
## Extension to arbitrary
114119

115-
QX,QS=solve(f,[1.0,1.0,0.1],diagm([0.1,0.1,0.01]),θ0,0.1,1000)
120+
QX,QS=solve(f,[1.0,1.0,0.1],diagm([0.1,0.1,0.01].^2),θ0,0.1,1000)
116121
plot(QX[1,1:30:end],label="x",color=:blue,errorbar=QS[1,1:30:end])
117122
plot!(QX[2,1:30:end],label="y",color=:red,errorbar=QS[2,1:30:end])
118123

119124
savefig("LV_Quadrics.svg")
120125

121-
QXr,QSr=solve_res(f,[1.0,1.0,0.1],diagm([0.1,0.1,0.01]),θ0,0.1,1000,100)
122-
plot(QXr[1,1:30:end],label="x",color=:blue,errorbar=QSr[1,1:30:end])
123-
plot!(QXr[2,1:30:end],label="y",color=:red,errorbar=QSr[2,1:30:end])
124-
125126
function filter(f,x0::AbstractVector,Σ0, θ,dt,Ne,Y,σy)
126127
XX=[]
127128
SS=[]

0 commit comments

Comments
 (0)