func (m *Model) ConcurrencyAtLatency(r float64) float64 {
	return (m.Kappa - m.Sigma +
		math.Sqrt(math.Pow(m.Sigma, 2)+
			math.Pow(m.Kappa, 2)+
			2*m.Kappa*((2*m.Lambda*r)+m.Sigma-2))) / (2 * m.Kappa)
}
ConcurrencyAtLatency returns the expected number of concurrent events at a particular mean
latency, N(R).

See "Practical Scalability Analysis with the Universal Scalability Law, Equation 10".
package usl
import (
	"fmt"
	"math"
	"github.com/maorshutman/lm"
	"gonum.org/v1/gonum/floats"
)
type Model struct {
	Sigma  float64  
	Kappa  float64  
	Lambda float64  
}
func (m *Model) String() string {
	return fmt.Sprintf("Model{σ=%v,κ=%v,λ=%v}", m.Sigma, m.Kappa, m.Lambda)
}
func (m *Model) ThroughputAtConcurrency(n float64) float64 {
	return (m.Lambda * n) / (1 + (m.Sigma * (n - 1)) + (m.Kappa * n * (n - 1)))
}
func (m *Model) LatencyAtConcurrency(n float64) float64 {
	return (1 + (m.Sigma * (n - 1)) + (m.Kappa * n * (n - 1))) / m.Lambda
}
func (m *Model) MaxConcurrency() float64 {
	return math.Floor(math.Sqrt((1 - m.Sigma) / m.Kappa))
}
func (m Model) MaxThroughput() float64 {
	return m.ThroughputAtConcurrency(m.MaxConcurrency())
}
func (m *Model) LatencyAtThroughput(x float64) float64 {
	return (m.Sigma - 1) / (m.Sigma*x - m.Lambda)
}
func (m *Model) ThroughputAtLatency(r float64) float64 {
	return (math.Sqrt(math.Pow(m.Sigma, 2)+math.Pow(m.Kappa, 2)+
		2*m.Kappa*(2*m.Lambda*r+m.Sigma-2)) - m.Kappa + m.Sigma) / (2.0 * m.Kappa * r)
}