From fd2c21bc602e5d50b90fe394db3cf3df5c97210f Mon Sep 17 00:00:00 2001 From: lindnemi Date: Mon, 11 Jan 2021 17:47:44 +0100 Subject: [PATCH] this is how to save less data points --- jl_code_for_sigmaInvestigation.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jl_code_for_sigmaInvestigation.jl b/jl_code_for_sigmaInvestigation.jl index a123f44..ff6ef45 100644 --- a/jl_code_for_sigmaInvestigation.jl +++ b/jl_code_for_sigmaInvestigation.jl @@ -15,7 +15,7 @@ using BenchmarkTools G = readdlm(joinpath(@__DIR__, "weights.txt"), '\t', Float64, '\n') g = SimpleDiGraph(G) -N = nv(g) +N = nv(g) synaptic_weights = G synaptic_weights ./= max(synaptic_weights...) @@ -46,7 +46,7 @@ const τᶠinv = 1. / τᶠ const y₀τᶠinv = y₀ * τᶠinv #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) 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 @@ -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 dξ[3] = τᴰinv - τᴰinv * ξ[3] + ξ[3] * ξ[4] * (u₀ - ξ[1]) dξ[4] = y₀τᶠinv - ξ[4] * τᶠinv - y₀ * (ξ[4] - 1.) * (ξ[1] - u₀) - # coupling + # coupling @inbounds for e in e_s # edges for which vertex is source dξ[1] += e[1] 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] 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 #u values are saved in indices 1,5,9,13,... #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] # savefig(plspec,"spect_\$σ.png") #println(x0) - -end \ No newline at end of file + +end -- GitLab