# NOT RUN {
m278hlcha()
#
## Naive way to find out technical state (factors k1 and k2) for pipe
## segments constructed in 1980:
optim(
par = c(1.5, 1.5),
fn = function(x) {
# functional to optimize
abs(
m278hlcha(k1 = x[1], k2 = x[2]) -
m325nhl(year = 1980, laying = "channel", d = 250, temperature = 110)
)
},
method = "L-BFGS-B",
lower = 1.01, upper = 4.4
)$par
# [1] 4.285442 4.323628
# }
Run the code above in your browser using DataLab