Skip to content
DeepForgeby svx
All problems
EasyCalculusca-143

Flux Through Cube Face

Problem

The field F(x, y, z) = [a*x + b, c*y, d*z] is integrated over the face x = 1 of the unit cube [0, 1]^3 with outward normal (1, 0, 0).

On that face F_x = a + b is constant and the face area is 1, so the flux is simply a + b. Return that value.

Hint

Only the component along the outward normal contributes to the flux.

Test cases

case 1
in: [2,3,4,5]
expected: 5
case 2
in: [0,0,1,1]
expected: 0
case 3
in: [1,-2,0,0]
expected: -1
case 4
in: [10,0,0,0]
expected: 10
Starter codePython
def flux_cube_face(a, b, c, d):
    # Your code here
    pass

4 test cases · run your code against them in the editor