]> permondes.de Git - Analog_Engine.git/blame - scripts/TP2 10.28 Potential of a charged sphere.LACE
Throwing a stone on earth, starting a rocket from earth
[Analog_Engine.git] / scripts / TP2 10.28 Potential of a charged sphere.LACE
CommitLineData
6d26a6bd
P
1# Determine the potential (inside and outside) of a charged sphere (radius R) with a constant internal charge density rho0.
2#
3# phi(r)'' = -rho0/epsilon0 - 2/r * phi(r)'
4# with rho0 = 0 outside of sphere
5# using t as variable for r
6#
7# compound functions used:
8# Open Amplifier
9define openamp (weight*: variable-1, weight*: variable-2) -> output
10 isum (weight*: variable-1, weight*: variable-2) -> output
11 connect (FB:) -> GND
12
13# Division
14define idivide (numerator, denominator) -> -quotient
15 openamp (numerator, product) -> -quotient
16 multiply (-quotient, denominator) -> product
17
18# coefficients
19coefficient.1 -> factor0,2 # shall be set to 0.2
20coefficient.2 (-1) -> -rho0/epsilon0
21coefficient.3 (-1) -> -phi0
22coefficinet.4 (-1) -> -R # -radius of sphere
23
24# generate a ramp of t
25iintegrate (-1) -> t
26
27# distinguish in sphere or outside
28compare (t, -R) -> -rho/epsilon0_l
29 LT0: -rho/epsilon0 # in sphere,
30 GT0: GND # outside sphere
31
32# calculate phi
33iintegrate (1*: -rho0/epsilon0_l, 10*: -0.2/r*phi') -> -phi' # need 2/r*phi' thus 10* input
34iintegrate (-phi') -> phi
35 IC: -phi0
36invert(-phi') -> phi'
37
38# doing this division by t first because phi' is low when also t is, thus there is the chance of less overload
39idivide (phi', t) -> -phi'/t
40cmultiply (-phi'/t, factor0.2) -> -0.2/r*phi'
41
42output(t) -> out.x
43output(phi') -> out.y
44output(phi) -> out.z