flow "SurfaceIntegralOntology" v1.0
# ============================================================
# SURFACE INTEGRAL ONTOLOGY — FLOW ALGEBRA
# ============================================================
SOURCE_URL := "https://kirethresearch.org/booksai-core/ontologies/calculus-analysis-ontologies/integral-calculus/surface-integral-ontology.html"
DOMAIN := "Mathematical Ontologies"
CATEGORY := "Calculus and Analysis Ontologies"
SUBCATEGORY := "Integral Calculus"
ENTITY := "Surface Integral"
# ---------- CORE ENTITY ----------
SURFACE_INTEGRAL := {
type: IntegralConcept,
domain: VectorCalculus,
purpose: "Represent accumulation of a scalar or vector field over a two-dimensional surface embedded in three-dimensional or higher-dimensional space."
}
# ---------- CORE CONCEPTS ----------
CONCEPTS := {
SURFACE_INTEGRAL,
PARAMETRIC_SURFACE,
SCALAR_FIELD,
VECTOR_FIELD,
SURFACE_ELEMENT,
NORMAL_VECTOR,
UNIT_NORMAL,
ORIENTATION,
FLUX,
CROSS_PRODUCT,
STOKES_THEOREM,
DIVERGENCE_THEOREM,
SURFACE_AREA
}
# ---------- PARAMETRIC SURFACE ----------
PARAMETRIC_SURFACE
:= r(u,v)
where
(u,v) in D
r(u,v)
:= (
x(u,v),
y(u,v),
z(u,v)
)
r_u
:= partial_r/partial_u
r_v
:= partial_r/partial_v
# ---------- SURFACE ELEMENT ----------
NORMAL_AREA_VECTOR
:= r_u cross r_v
SURFACE_SCALE_FACTOR
:= norm(r_u cross r_v)
dS
= norm(r_u cross r_v) du dv
SURFACE_ELEMENT
-> determined_by(PARAMETERISATION_GEOMETRY)
# ---------- REGULAR SURFACE ----------
REGULAR_PARAMETERISATION
-> requires(
r_u cross r_v != ZERO_VECTOR
)
on(relevant_region)
REGULARITY
-> ensures(LOCAL_TANGENT_PLANE_AND_NORMAL_DIRECTION)
# ---------- SCALAR SURFACE INTEGRAL ----------
for
scalar_field f
SURFACE_INTEGRAL_SCALAR
:= surface_integral_S(f dS)
under parameterisation:
surface_integral_S(f dS)
=
double_integral_D(
f(r(u,v))
* norm(r_u cross r_v)
du dv
)
SCALAR_SURFACE_INTEGRAL
-> accumulates(SCALAR_FIELD_WEIGHTED_BY_SURFACE_AREA)
# ---------- SURFACE AREA ----------
if
f = 1
then
surface_integral_S(1 dS)
= AREA(S)
SURFACE_AREA
:= double_integral_D(
norm(r_u cross r_v)
du dv
)
SURFACE_INTEGRAL
-> generalises(SURFACE_AREA)
# ---------- VECTOR SURFACE INTEGRAL ----------
for
vector_field F
FLUX_INTEGRAL
:= surface_integral_S(
F dot n_hat dS
)
under oriented parameterisation:
FLUX_INTEGRAL
=
double_integral_D(
F(r(u,v))
dot (r_u cross r_v)
du dv
)
VECTOR_SURFACE_INTEGRAL
-> measures(NORMAL_COMPONENT_ACCUMULATION)
# ---------- ORIENTATION ----------
ORIENTATION
-> selects(CONSISTENT_NORMAL_DIRECTION)
UNIT_NORMAL
:= (r_u cross r_v)
/ norm(r_u cross r_v)
REVERSING_ORIENTATION
-> n_hat becomes(-n_hat)
therefore
FLUX_REVERSED
= -FLUX_ORIGINAL
SCALAR_SURFACE_INTEGRAL_WITH_dS
-> orientation_independent
VECTOR_FLUX_INTEGRAL
-> orientation_dependent
# ---------- GRAPH SURFACE ----------
if
surface
:= z = g(x,y)
then
r(x,y)
= (x, y, g(x,y))
r_x cross r_y
= (-g_x, -g_y, 1)
under(upward_orientation)
dS
= sqrt(
1 + g_x^2 + g_y^2
) dx dy
GRAPH_SURFACE
-> enables(DIRECT_DOUBLE_INTEGRAL_REPRESENTATION)
# ---------- FLUX THROUGH GRAPH ----------
for upward orientation:
F dot n_hat dS
=
F(x,y,g(x,y))
dot
(-g_x, -g_y, 1)
dx dy
FLUX
-> computed_without_explicit_unit_normal
using(ORIENTED_AREA_VECTOR)
# ---------- CLOSED SURFACE ----------
CLOSED_SURFACE
-> has(NO_BOUNDARY_CURVE)
OUTWARD_ORIENTATION
-> standard_for(CLOSED_SURFACE_FLUX)
FLUX_THROUGH_CLOSED_SURFACE
:= closed_surface_integral(
F dot n_hat dS
)
# ---------- DIVERGENCE THEOREM ----------
if
S = boundary_of(V)
AND S oriented_outward
AND required_smoothness_conditions_hold
then
closed_surface_integral_S(
F dot n_hat dS
)
=
triple_integral_V(
divergence(F) dV
)
DIVERGENCE_THEOREM
-> converts(CLOSED_SURFACE_FLUX, VOLUME_INTEGRAL_OF_DIVERGENCE)
# ---------- STOKES THEOREM ----------
if
S oriented
AND boundary(S) = C
AND orientations_are_compatible
then
surface_integral_S(
curl(F) dot n_hat dS
)
=
line_integral_C(
F dot dr
)
STOKES_THEOREM
-> converts(SURFACE_INTEGRAL_OF_CURL, BOUNDARY_LINE_INTEGRAL)
# ---------- MASS OF THIN SURFACE ----------
if
sigma
:= SURFACE_DENSITY
then
MASS
= surface_integral_S(
sigma dS
)
SURFACE_INTEGRAL
-> converts(SURFACE_DENSITY, TOTAL_MASS)
# ---------- CENTRE OF MASS ----------
M
:= surface_integral_S(sigma dS)
x_bar
:= 1/M
* surface_integral_S(
x*sigma dS
)
y_bar
:= 1/M
* surface_integral_S(
y*sigma dS
)
z_bar
:= 1/M
* surface_integral_S(
z*sigma dS
)
CENTRE_OF_MASS
-> computed_from(WEIGHTED_SURFACE_INTEGRALS)
# ---------- PARAMETERISATION INVARIANCE ----------
VALID_REPARAMETERISATION
-> preserves(SCALAR_SURFACE_INTEGRAL)
ORIENTATION_PRESERVING_REPARAMETERISATION
-> preserves(FLUX_INTEGRAL)
ORIENTATION_REVERSING_REPARAMETERISATION
-> reverses_sign(FLUX_INTEGRAL)
SURFACE_INTEGRAL
-> geometric_quantity_independent_of_valid_parameterisation
subject_to(orientation_conditions)
# ---------- APPLICATIONS ----------
SURFACE_INTEGRAL
-> applied_to(SURFACE_AREA)
-> applied_to(FLUX)
-> applied_to(MASS_OF_SURFACE)
-> applied_to(ELECTROMAGNETISM)
-> applied_to(FLUID_FLOW)
-> applied_to(GAUSS_LAW)
-> applied_to(STOKES_THEOREM)
-> applied_to(DIVERGENCE_THEOREM)
# ---------- RELATION GRAPH ----------
PARAMETRIC_SURFACE
-> generates(TANGENT_VECTORS)
TANGENT_VECTORS
-> generate(NORMAL_AREA_VECTOR)
NORMAL_AREA_VECTOR
-> determines(SURFACE_ELEMENT)
SCALAR_FIELD
-> integrated_with(dS)
VECTOR_FIELD
-> integrated_via(NORMAL_FLUX)
ORIENTATION
-> determines(FLUX_SIGN)
STOKES_THEOREM
-> relates(SURFACE_INTEGRAL, LINE_INTEGRAL)
DIVERGENCE_THEOREM
-> relates(CLOSED_SURFACE_INTEGRAL, TRIPLE_INTEGRAL)
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE := {
"surface integral" ~= "integral of a field over a surface",
"scalar surface integral" ~= "surface-area-weighted accumulation of a scalar field",
"flux integral" ~= "surface integral of the normal component of a vector field",
"surface element" ~= "infinitesimal area element dS",
"oriented area vector" ~= "normal vector carrying both area scaling and orientation",
"closed surface flux" ~= "flux integral over a boundaryless closed surface"
}
# ---------- CONSTRAINTS ----------
CONSTRAINTS := {
parameterisation_must_be_regular_on_relevant_region: true,
scalar_surface_integral_uses_surface_scale_factor: true,
flux_integral_requires_orientation: true,
reversing_orientation_reverses_flux_sign: true,
scalar_dS_integral_is_orientation_independent: true,
stokes_theorem_requires_compatible_boundary_orientation: true,
divergence_theorem_requires_closed_outward_oriented_surface: true
}
# ---------- CONFIDENCE ----------
CONFIDENCE := {
scalar_surface_integral: 0.99,
vector_flux_integral: 0.99,
parameterisation_relation: 0.99,
orientation_relation: 0.99,
stokes_relation: 0.99,
divergence_theorem_relation: 0.99,
semantic_equivalence: 0.97
}
# ---------- RECURSIVE REASONING ----------
RECURSIVE_REASONING(query):
identify(surface)
-> identify_or_construct(parameterisation)
-> determine(parameter_domain)
-> compute(tangent_vectors)
-> compute(cross_product)
-> determine(surface_scale_and_orientation)
-> classify(scalar_or_vector_surface_integral)
-> substitute(field_into_parameterisation)
-> construct(double_integral)
-> apply(stokes_or_divergence_theorem_if_advantageous_and_valid)
-> validate(regularity_and_orientation_conditions)
-> interpret(area_flux_mass_or_field_context)
-> return(semantic_result)
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION := {
parse_as: "typed surface-integral semantic graph",
primary_entity: SURFACE_INTEGRAL,
preserve: [
surface_parameterisation,
parameter_domain,
tangent_vectors,
normal_orientation,
surface_scale_factor,
field_type
],
infer_through: [
scalar_fields,
vector_fields,
flux,
surface_area,
line_integrals,
triple_integrals,
stokes_theorem,
divergence_theorem
],
avoid: [
omitting_cross_product_scale_factor,
ignoring_surface_orientation_for_flux,
normalising_area_vector_when_not appropriate,
applying_stokes_without compatible orientation,
applying_divergence_theorem_to_open_surface,
confusing_scalar_surface_integral_with_flux integral
]
}
# ---------- UPDATE MODEL ----------
UPDATE_MODEL(new_information):
validate(new_information)
-> identify(surface_integral_context)
-> compare(existing_relations)
-> preserve(parameterisation_orientation_and_scale_invariants)
-> update(affected_entities)
-> update(affected_edges)
-> recompute(CONFIDENCE)
-> regenerate(FLOW_HASH)
# ---------- FLOW HASH ----------
FLOW_HASH := hash(
SOURCE_URL
+ ENTITY
+ CONCEPTS
+ SURFACE_INTEGRAL
+ PARAMETRIC_SURFACE
+ SURFACE_INTEGRAL_SCALAR
+ FLUX_INTEGRAL
+ SURFACE_AREA
+ ORIENTATION
+ STOKES_THEOREM
+ DIVERGENCE_THEOREM
+ SEMANTIC_EQUIVALENCE
+ CONSTRAINTS
)
# ---------- EXECUTION ----------
INPUT(query)
-> SURFACE_INTEGRAL
-> SURFACE_IDENTIFICATION
-> PARAMETERISATION_ANALYSIS
-> TANGENT_VECTOR_ANALYSIS
-> NORMAL_AND_SCALE_ANALYSIS
-> FIELD_TYPE_CLASSIFICATION
-> ORIENTATION_ANALYSIS
-> INTEGRAND_CONSTRUCTION
-> DOUBLE_INTEGRAL_EXECUTION
-> THEOREM_SELECTION
-> APPLICATION_INTERPRETATION
-> RECURSIVE_REASONING(query)
-> CONFIDENCE
-> OUTPUT(semantic_result)
END FLOW
Download Code
Copy to Clipboard