https://hrubos.tech/blogy/content/images/20260310084647-GaussOstrogradsky2026-03-08-20-56-59.png

https://hrubos.tech/blogy/content/images/20260310084709-GaussOstrogradsky2026-03-08-20-56-07.png
Už vidíme, kde sa zhromadil rovnomerne náboj? Je to na špicoch a rovnomerne sa odpudzuje. A čo je toto? Gauss-Ostrogradského veta, ktorá hovorí jednoducho, že náboj sa hromadí na špicoch. Otázka potom je: Videli ste smerom na Žilinu na Strečno červené gule na vysokom napätí? Na toto sú tam ;)

Áno rozkladajú náboj, aby špicaté tvory nezabilo vysoké napätie. Predstavte si vtáčika so špicatou nôžkou, ktorý sa priblíži k vysokému napätiu. Okrem toho sme ich dali oranžové, aby ich videl aj vrtuľník a z diaľky.
https://hrubos.tech/blogy/2025/08/gauss-ostrogradsky-po-enty-raz
A čo tu? Obrázok:


############################################################
# Install packages (first run only)
############################################################
using Pkg
Pkg.add([
"GLMakie",
"StaticArrays"
])
using GLMakie, StaticArrays, LinearAlgebra, Random
# Parameters
N = 40
R = 4.0
dt = 0.02
gridN = 5
# Random points in sphere
function random_point_in_sphere(R)
while true
p = rand(SVector{3,Float64}) .* (2R) .- R
if norm(p) <= R
return p
end
end
end
positions = [random_point_in_sphere(R) for _ in 1:N]
velocities = [SVector(0.0,0.0,0.0) for _ in 1:N]
# Coulomb force
function force(i)
f = SVector(0.0,0.0,0.0)
for j in 1:N
if i != j
r = positions[i] - positions[j]
d = norm(r) + 1e-3
f += r / d^3
end
end
return f
end
# Electric field
function electric_field(p)
E = SVector(0.0,0.0,0.0)
for q in positions
r = p - q
d = norm(r) + 1e-3
E += r / d^3
end
return E
end
# Simulation step
function step!()
for i in 1:N
f = force(i)
velocities[i] += dt*f
velocities[i] *= 0.98
positions[i] += velocities[i]*dt
if norm(positions[i]) > R
n = normalize(positions[i])
velocities[i] -= 2dot(velocities[i], n)*n
positions[i] = n*R
end
end
end
# Grid for vector field (statické pole!)
grid = range(-R,R,length=gridN)
field_points = [SVector(x,y,z) for x in grid, y in grid, z in grid]
field_points = vec(field_points)
function compute_vectors()
[electric_field(p)*0.3 for p in field_points]
end
# Observables pre častice
pos_obs = Observable(copy(positions))
vec_obs = compute_vectors() # statické pole pre 3D šípky
# Setup figure
fig = Figure(resolution=(900,900))
ax = Axis3(fig[1,1])
scatter!(ax, pos_obs, color=:red, markersize=18)
arrows!(ax, field_points, vec_obs, color=:blue, arrowsize=0.08)
# Animation
@async begin
while isopen(fig.scene)
step!()
pos_obs[] = copy(positions)
vec_obs = compute_vectors() # prepíš statické pole pre arrows!
arrows!(ax, field_points, vec_obs, color=:blue, arrowsize=0.08)
sleep(0.02)
end
end
display(fig)
readline()

Comments “Čo sa stane, ak potrieme Jelenicu plsťou a nabijeme hviezdicové prúžky papiera rovnakým nábojom?”