Commit fd2c21bc authored by lindnemi's avatar lindnemi
Browse files

this is how to save less data points

parent 04d44c23
...@@ -15,7 +15,7 @@ using BenchmarkTools ...@@ -15,7 +15,7 @@ using BenchmarkTools
G = readdlm(joinpath(@__DIR__, "weights.txt"), '\t', Float64, '\n') G = readdlm(joinpath(@__DIR__, "weights.txt"), '\t', Float64, '\n')
g = SimpleDiGraph(G) g = SimpleDiGraph(G)
N = nv(g) N = nv(g)
synaptic_weights = G synaptic_weights = G
synaptic_weights ./= max(synaptic_weights...) synaptic_weights ./= max(synaptic_weights...)
...@@ -46,7 +46,7 @@ const τᶠinv = 1. / τᶠ ...@@ -46,7 +46,7 @@ const τᶠinv = 1. / τᶠ
const y₀τᶠinv = y₀ * τᶠinv const y₀τᶠinv = y₀ * τᶠinv
#we only need random x0 for the first step #we only need random x0 for the first step
x0 = Vector(vec([rand(N) .* 4 .- 2 rand(N) .* 4 .- 2 rand(N) .* 0.1 rand(N) .* 0.1 .+ 1]')) x0 = Vector(vec([rand(N) .* 4 .- 2 rand(N) .* 4 .- 2 rand(N) .* 0.1 rand(N) .* 0.1 .+ 1]'))
#println(x0) #println(x0)
for sig in [10,5,2,1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1,0.05,0] for sig in [10,5,2,1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1,0.05,0]
global x0 global x0
...@@ -67,7 +67,7 @@ for sig in [10,5,2,1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1,0.05,0] ...@@ -67,7 +67,7 @@ for sig in [10,5,2,1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1,0.05,0]
# STP model # STP model
[3] = τᴰinv - τᴰinv * ξ[3] + ξ[3] * ξ[4] * (u₀ - ξ[1]) [3] = τᴰinv - τᴰinv * ξ[3] + ξ[3] * ξ[4] * (u₀ - ξ[1])
[4] = y₀τᶠinv - ξ[4] * τᶠinv - y₀ * (ξ[4] - 1.) * (ξ[1] - u₀) [4] = y₀τᶠinv - ξ[4] * τᶠinv - y₀ * (ξ[4] - 1.) * (ξ[1] - u₀)
# coupling # coupling
@inbounds for e in e_s # edges for which vertex is source @inbounds for e in e_s # edges for which vertex is source
[1] += e[1] [1] += e[1]
end end
...@@ -95,7 +95,7 @@ for sig in [10,5,2,1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1,0.05,0] ...@@ -95,7 +95,7 @@ for sig in [10,5,2,1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1,0.05,0]
prob = ODEProblem(fhn_network!, x0, tspan, p) prob = ODEProblem(fhn_network!, x0, tspan, p)
@time sol = solve(prob, Tsit5(),reltol=1e-6, saveat=tspan[1]:.2:tspan[end]); @time sol = solve(prob, Tsit5(),reltol=1e-6, saveat=90000:.2:100000);
#we only need the values for u from the sol #we only need the values for u from the sol
#u values are saved in indices 1,5,9,13,... #u values are saved in indices 1,5,9,13,...
#sol is of the size 1508(377*4)*5001 #sol is of the size 1508(377*4)*5001
...@@ -136,5 +136,5 @@ for sig in [10,5,2,1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1,0.05,0] ...@@ -136,5 +136,5 @@ for sig in [10,5,2,1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1,0.05,0]
# savefig(plspec,"spect_$σ.png") # savefig(plspec,"spect_$σ.png")
#println(x0) #println(x0)
end end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment