+# 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