From 83e52241909dd50436b0c0c929b820e11f2516c0 Mon Sep 17 00:00:00 2001 From: Helge Gehring <42973196+HelgeGehring@users.noreply.github.com> Date: Wed, 11 Oct 2023 16:11:28 -0700 Subject: [PATCH] add average potential calculation --- docs/julia/thermal_simple.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/julia/thermal_simple.jl b/docs/julia/thermal_simple.jl index a9ea7164..7a3aec88 100644 --- a/docs/julia/thermal_simple.jl +++ b/docs/julia/thermal_simple.jl @@ -48,12 +48,14 @@ constant = tag -> 1 # For this we solve the electrostatic equation $Δϕ = 0$ and define the voltage at two oppositing boundaries to 0V at $x=0$ and 1V at $x=1$. # The theoretical solution of this function is a linear function. # $$ ϕ(x)=x $$ +# This would mean the average of the potential over the domain should be +# $$ \int ϕ dA = 0.5 $$ # %% tags=["hide-input"] p0 = compute_potential(constant ∘ τ, Dict("left" => 0.0, "right" => 1.0)) average_potential = ∑(∫(potential(p0))dΩ) / ∑(∫(1)dΩ) -println(average_potential) +println("The computed value for the average potential is $average_potential") # %% tags=["hide-input"] T0 = calculate_temperature(constant ∘ τ, power_density(p0), Dict("boundary" => 0.0))