The harmonic mean,
harmonic_mean(x)
An '>Expression representing the harmonic mean of the input.
# NOT RUN {
x <- Variable()
prob <- Problem(Maximize(harmonic_mean(x)), list(x >= 0, x <= 5))
result <- solve(prob)
result$value
result$getValue(x)
# }
Run the code above in your browser using DataLab