DGS Studio

Surface Integrals

Surface Integrals

Scalar surface integrals use the area element. surface_flux uses the oriented normal r_u × r_v.

Solve Equation evaluates surface_integral(1,(u,v,0),u,0,1,v,0,1) on r(u, v) = (u, v, 0). The cross product r_u × r_v is (0, 0, 1), its length is 1, and the area is 1. surface_integral(u+v,(u,v,0),u,0,1,v,0,1) multiplies that area element by u+v and is also 1.

surface_flux((0,0,1),(u,v,0),u,0,1,v,0,1) uses the oriented normal rather than its length. The field (0, 0, 1) agrees with that normal, so the flux is 1. The word inward, or reversing one parameter bound, changes the sign. A scalar surface integral ignores an orientation word. Parallel partial derivatives make the surface degenerate, and the result says so instead of returning 0.

Equation

surface_integral(1,(u,v,0),u,0,1,v,0,1)

Graph preview

Graph preview of surface_integral(1,(u,v,0),u,0,1,v,0,1)
A static sample of this expression. The studio draws the full interactive result.

How a surface integral is formed

A scalar surface integral adds f times the area element on a parametric surface r(u, v). The tangent vectors are the partial derivatives r_u and r_v, and dS is the length of their cross product. Reversing a parameter bound does not change that positive area. Flux instead uses the vector r_u × r_v without taking its length, so the order of the parameters chooses the orientation. Reversing one parameter reverses the normal and changes the sign of the flux. surface_flux((P, Q, R), (x, y, z), ...) is that oriented integral. The word inward reverses one parameter bound. Any other orientation word is rejected.

The same engine still accepts the flat surface_integral and surface_integral_flux commands. A surface whose partial derivatives are parallel is degenerate: the area element is zero and the normal is undefined, so no value is returned. An exact double integral is preferred. A numerical value is shown only when the quadrature error is within tolerance, and a divergent integral is not given a finite answer. The surface is the existing parametric surface in the 3D viewer, with normal arrows. Flux can also draw the vector field. Orbit, zoom, pan, and the existing GLB export stay with that viewer.

Reading the input

Other versions of this example

These stay on this page so each version keeps the same explanation. Choose Try example to run a version in its Studio workflow, or copy it into the editable field below.

Unit square area

Expected value 1.

surface_integral(1,(u,v,0),u,0,1,v,0,1)

Scalar height

Expected value 1.

surface_integral(u+v,(u,v,0),u,0,1,v,0,1)

Upward flux

Expected value 1.

surface_flux((0,0,1),(u,v,0),u,0,1,v,0,1)

Try a change

Solve Equation shows the tangent vectors, their cross product, and either the area element or the flux integrand. The boxed value is exact when the double integral closes. An orientation word is accepted only for flux.

Edit and generate

Solve Equation opens the studio homepage and runs this field. Open in DGS Studio loads the same text and waits for you to generate it. The equation is sent once, as a query parameter.

Related examples