From: Permondes Date: Tue, 10 Sep 2024 14:53:45 +0000 (+0200) Subject: Potential of charged sphere X-Git-Url: https://permondes.de/gitweb/Analog_Engine.git/commitdiff_plain/6d26a6bd8b30ad893da0315655d2f68aee787515?hp=b0b8ac6f98d48eb700cce1f18b401ccf1ea99d78 Potential of charged sphere Application: Potential of charged sphere LACE: major rework of the syntax --- diff --git a/Analog Engine Example Applications.odt b/Analog Engine Example Applications.odt index f0413c6..c59148e 100644 Binary files a/Analog Engine Example Applications.odt and b/Analog Engine Example Applications.odt differ diff --git a/Language for Analog Computing Engines.odt b/Language for Analog Computing Engines.odt new file mode 100644 index 0000000..4da5af0 Binary files /dev/null and b/Language for Analog Computing Engines.odt differ diff --git a/description Language for Analog Circuit Engines.odt b/description Language for Analog Circuit Engines.odt deleted file mode 100644 index 19deaef..0000000 Binary files a/description Language for Analog Circuit Engines.odt and /dev/null differ diff --git a/scripts/CompoundFunctions.LACE b/scripts/CompoundFunctions.LACE new file mode 100644 index 0000000..e2a7cef --- /dev/null +++ b/scripts/CompoundFunctions.LACE @@ -0,0 +1,30 @@ +# collection of compound functions which can be realized with THAT + +# Open Amplifier +define openamp (weight*: variable-1, …) -> output + isum (weight*: variable-1, …) -> output + connect (FB:) -> GND + +# Division +define idivide (numerator, denominator) -> -quotient + openamp (numerator, product) -> -quotient + multiply (-quotient, denominator) -> product + +# Integration extension +define iintegrate (weight*: variable-1, …, ic: variable-IC, limit: gt0) -> variable-n + iintegrate (weight*: variable-1, …) -> variable-n + diode (cat:variable-n) -> DA + connect (DA) -> sj +# diode and connect used to limit the result to values >0 + +# Building an additional integrator with the help of an openamp +define iintegrate.additional (variable) -> integral + openamp variable -> integral + connect SJ -> cp + capacitor.100nF (integral) -> cp +# NB: The 100 nF capacitor is available on a THAT. This capacitance corresponds to those of the SLOW settings. In order to use the standard time constant an external 1 nF capacitor has to be used. + +# Summing extension +define isum (weight*: variable-1, …, /divisor) -> -result + isum (weight*: variable-1, …) -> -result + connect (-result, …) -> IN diff --git a/scripts/TP1 03.08 Charge in em field.LACE b/scripts/TP1 03.08 Charge in em field.LACE new file mode 100644 index 0000000..955f475 --- /dev/null +++ b/scripts/TP1 03.08 Charge in em field.LACE @@ -0,0 +1,31 @@ +#PROGRAM-ID ChargeInEMfield +#VERSION 20240116 +# A mass m with charge q>0 is located in a static electro-magnetic field [0,0,E], [0,-B,0]. +# Find the trajetory +# Differential equation (Lorentz force): +# x'' = omega*z' +# z'' = a*omega^2 - omega*x' +# good start settings are omega=0,92, a*omega^2=0,05 + +# coefficient definition +alias coefficient.1 -> omega_x # -omega for x' +coefficient.2 (+1) -> a*omega^2 +alias coefficient(3) -> omega_z # omega for z' + +# solving the DE +iintegrate (x'') -> -x' +iintegrate (-x') -> x + +coefficient.omega_x (-x') -> -omega*x' +#cmultiply (-x', omega_x) -> omega*x' + +iintegrate (a*omega^2, -omega*x') -> -z' # input is z'' +iintegrate (-z') -> z +invert (-z') -> z' + +coefficient.omega_z (z') -> omega*z' +#cmultiply (z', omega_z) -> omega*z' +assign omega*z' -> x'' + +output(x) -> out.x +output(z) -> out.z diff --git a/scripts/TP1 09.27 Bead on Cycloid.LACE b/scripts/TP1 09.27 Bead on Cycloid.LACE index 3f28dd3..8931f63 100644 --- a/scripts/TP1 09.27 Bead on Cycloid.LACE +++ b/scripts/TP1 09.27 Bead on Cycloid.LACE @@ -4,32 +4,32 @@ # equation of motion: # mu'' = - g/4a * mu, with mu = sin(phi/2) and phi a parameter of the cycloid -coefficient(1): g/4a -coefficient(2): 1 -> mu0' -coefficient(3): -1 -> -mu0 -coefficient(4): 4ax -coefficient(5): 4ay # same as 4ax +alias coefficient.1 g/4a +coefficient.2 (+1) -> mu0' +coefficient.3 (-1) -> -mu0 +alias coefficient.4 4ax +alias coefficient.5 4ay # same as 4ax iintegrate mu'' -> -mu' IC: mu0' iintegrate -mu' -> mu IC: -mu0 invert mu -> -mu --mu * g/4a -> -g/4a*mu -mu'' = -g/4a*mu +coefficient.g/4a (-mu) -> -g/4a*mu +assign -g/4a*mu -> mu'' # the following is for displaying the cycloid in x-y space # calculating x (NB: this includes some unacceptable approximations) -mu * 4ax -> 4a*mu -output(x): 4a*mu +coefficient.4ax (mu) -> 4a*mu +output(4a*mu) -> out.x # calculating y multiply mu, mu -> mu^2 -mu^2 * 4ay -> 4ay*mu^2 +coefficient.4ay (mu^2) -> 4ay*mu^2 isum 4a*mu^2 -> -2a*mu^2 # just serves to devide by 2 because we need 2a instead of 4a /2 invert -2a*mu^2 -> 2a*mu^2 -output(y): 2a*mu^2 +output(2a*mu^2) -> out.y # display mu, so the sinus -output(z): mu +output(mu) -> out.z diff --git a/scripts/TP1 10.30 Linear Molecule.LACE b/scripts/TP1 10.30 Linear Molecule.LACE index fd9806e..810dcc8 100644 --- a/scripts/TP1 10.30 Linear Molecule.LACE +++ b/scripts/TP1 10.30 Linear Molecule.LACE @@ -7,35 +7,45 @@ # NB: all integrators have to run with 100 nF capacitance, i.e. SLOW mode -coefficient(1): omega0^2_1 # omega0^2 for s1 -coefficient(2): omega0^2_2 # omega0^2 for s2 # same as omega0^2_1 -coefficient(3): omega0^2_3 # omega0^2 for s3 # same as omega0^2_1 -coefficient(4): my -coefficient(5): -1 -> -s1_0 # initial position of s1 -coefficient(6): -1 -> -s3_0 # initial position of s3 +# the following integrator has to be built up manually as THAT only has 5 integrators and we need 6 +# iintegrate -s2' -> s2 +define openamp (variable) -> result + isum (variable) -> result + connect (FB) -> GND + +define iintegrate6 (variable) -> integral + openamp variable -> integral + connect SJ -> cp + capacitor.100nF (integral) -> cp +# this capacitance requires SLOW settings on all other capacitors. Better use an external 1 nF capacitor. + +alias coefficient.1 -> coefficient.omega0^2_1 # omega0^2 for s1 +alias coefficient.2 -> coefficient.omega0^2_2 # omega0^2 for s2 # same as omega0^2_1 +alias coefficient.3 -> coefficient.omega0^2_3 # omega0^2 for s3 # same as omega0^2_1 +alias coefficient.4 -> coefficient.my +coefficient.5 (-1) -> -s1_0 # initial position of s1 +coefficient.6 (-1) -> -s3_0 # initial position of s3 # initial positon of s2, the central mass, is set to 0 iintegrate -omega0^2_1*s1, omega0^2_2*s2 -> -s1' # input is s1'' iintegrate -s1' -> s1 IC: -s1_0 invert s1 -> -s1 --s1 * omega0^2_1 -> -omega0^2_1*s1 +coefficient.omega0^2_1 (-s1) -> -omega0^2_1*s1 iintegrate -my*bracket -> -s2' # input is s2'' -# the following integrator has to be built up manually as THAT only has 5 integrators and we need 6 -# iintegrate -s2' -> s2 -openamp -s2' -> s2 - loopback: capacitor(100nF) -s2 * omega0^2_2 -> omega0^2_2*s2 +iintegrate6 -s2' -> s2 +coefficient.omega0^2_2 (s2) -> omega0^2_2*s2 isum -omega0^2_1*s1, omega0^2_2*s2, omega0^2_2*s2, -omega0^2_3*s3 -> -bracket --bracket * my -> -my*bracket +coefficient.my (-bracket) -> -my*bracket iintegrate omega0^2_2*s2, -omega0^2_3*s3 -> -s3' # input is s3'' iintegrate -s3' -> s3 IC: -s3_0 invert s3 -> -s3 --s3 * omega0^2_3 -> -omega0^2_3*s3 +coefficient.omega0^2_3 (-s3) -> -omega0^2_3*s3 + +output s1 -> out.x +output s2 -> out.y +output s3 -> out.z - output(x): s1 - output(y): s2 - output(z): s3 diff --git a/scripts/TP2 10.28 Potential of a charged sphere.LACE b/scripts/TP2 10.28 Potential of a charged sphere.LACE new file mode 100644 index 0000000..1284191 --- /dev/null +++ b/scripts/TP2 10.28 Potential of a charged sphere.LACE @@ -0,0 +1,44 @@ +# Determine the potential (inside and outside) of a charged sphere (radius R) with a constant internal charge density rho0. +# +# phi(r)'' = -rho0/epsilon0 - 2/r * phi(r)' +# with rho0 = 0 outside of sphere +# using t as variable for r +# +# compound functions used: +# Open Amplifier +define openamp (weight*: variable-1, weight*: variable-2) -> output + isum (weight*: variable-1, weight*: variable-2) -> output + connect (FB:) -> GND + +# Division +define idivide (numerator, denominator) -> -quotient + openamp (numerator, product) -> -quotient + multiply (-quotient, denominator) -> product + +# coefficients +coefficient.1 -> factor0,2 # shall be set to 0.2 +coefficient.2 (-1) -> -rho0/epsilon0 +coefficient.3 (-1) -> -phi0 +coefficinet.4 (-1) -> -R # -radius of sphere + +# generate a ramp of t +iintegrate (-1) -> t + +# distinguish in sphere or outside +compare (t, -R) -> -rho/epsilon0_l + LT0: -rho/epsilon0 # in sphere, + GT0: GND # outside sphere + +# calculate phi +iintegrate (1*: -rho0/epsilon0_l, 10*: -0.2/r*phi') -> -phi' # need 2/r*phi' thus 10* input +iintegrate (-phi') -> phi + IC: -phi0 +invert(-phi') -> phi' + +# doing this division by t first because phi' is low when also t is, thus there is the chance of less overload +idivide (phi', t) -> -phi'/t +cmultiply (-phi'/t, factor0.2) -> -0.2/r*phi' + +output(t) -> out.x +output(phi') -> out.y +output(phi) -> out.z diff --git a/scripts/Template.AESL b/scripts/Template.AESL new file mode 100644 index 0000000..48143fb --- /dev/null +++ b/scripts/Template.AESL @@ -0,0 +1,26 @@ +IDENTIFICATION DIVISION +PROGRAM-ID ... +VERSION ... +COMMENT ... + +ENVIRONMENT DIVISION +ENGINE Anabrid-THAT +TIMEBASE 1ms +REQUIRES ... + +DATA DIVISION +INPUT ... +OUTPUT OUTPUT.X ... +OUTPUT OUTPUT.Y ... +OUTPUT OUTPUT.Z ... +OUTPUT OUTPUT.U ... +COEFFICIENT.n ... + +PROGRAM DIVISION +# INTEGRATOR is inverting! +# SUMMER is inverting! +... + +OPERATION DIVISION +MODE REPEAT +OP-TIME ...