Net Direction of Chemical Change

Example

A reactor is initially charged with of , of , and of . Nitrogen and hydrogen react to form ammonia according to the following equation:

with .

What will happen as the system moves towards equilibrium?

solution

Since , will decompose.

Needs heat to go forward: endothermic
Gives off heat when going forward: exothermic

def factory(t: Int) = {
    def closure(add: Int) = {
        param + add
    }

    closure
}

val five = factory(5)
val four = factory(4)

five(1) // 6
five(2) // 7