Pasting a short script into the REPL, it slowly accepts line after line but when it gets to the last line it just freezes there indefinitely.
No errors. No cpu activity. no idication anything is wrong or failing iany detected way just stops and does nothing?
The entire session/program in case it helps diagonse the issue:
julia> using Plots, Interact
julia>
julia> function linear_partition(x, N, r)
return [x * (i / (N-1))^r for i in 0:N-1]
end
linear_partition (generic function with 1 method)
julia>
julia> function geometric_partition(x, N, r)
ratio = r^(1/(N-1))
first_segment = x * (1 - ratio) / (1 - ratio^N)
return [first_segment * ratio^i for i in 0:N-1]
end
geometric_partition (generic function with 1 method)
julia>
julia> function logarithmic_partition(x, N, r)
return [x * log(i + r) / log(N + r) for i in 1:N]
end
logarithmic_partition (generic function with 1 method)
julia>
julia> function exponential_partition(x, N, r)
return [x * (exp(i * r / (N-1)) - 1) / (exp(r) - 1) for i in 0:N-1]
end
exponential_partition (generic function with 1 method)
julia>
julia> function plot_partitions(N, r)
x = 10 # Arbitrary total length
partitions = [
("Linear Scaling", linear_partition(x, N, r)),
("Geometric Progression", geometric_partition(x, N, r)),
("Logarithmic Scaling", logarithmic_partition(x, N, r)),
("Exponential Scaling", exponential_partition(x, N, r))
]
p = []
for (title, part) in partitions
push!(p, plot(title=title, legend=false, size=(600, 200)))
for d in part
plot!(p[end], [d, d], [0, 50], linewidth=2, color=:black)
end
end
plot(p...)
end
plot_partitions (generic function with 1 method)
julia>
julia> @manipulate for N in 5:50, r in 0.1:0.1:5
plot_partitions(N, r)