Hi
I am new in Julia. I intend to produce two vectors u and v via a for loop as below. Unfortunately, the vectors are not recognizable outside of the loop, why?
λ = −0.45 # The bifurcation Parameter
function ST(u, v)
[v; u-u^2+λ*v+0.5*u*v]
end
#function count()
a = 0.001; b = 0.0008 # Initial Condition
Τ=12 # Final Time
Δ = 0.01 # The Time Discretization
for n in 1:Τ/Δ
K1 = ST(a, b)
K2 = ST(a+Δ*K1[1]/2, b+Δ*K1[2]/2)
K3 = ST(a+Δ*K2[1]/2, b+Δ*K2[2]/2)
K4 = ST(a+Δ*K3[1] , b+Δ*K3[2])
global (a, b) = [a; b]+Δ*(K1+2*K2+2*K3+K4)/6
global (u(n), v(n)) = (a, b)
println("n=", n, "--a=", u(n), "-- b=", v(n))
end
And at the program I am going to plot the points of u versus v. How is sort out?