"""Supplementary comparison for Model 5 (audit brief, Section 2).
Model 5  (original):  E' = gU + eta A - (b2+mu)E,  A' = b2 E - (eps+alpha+mu)A          [word-of-mouth GAIN, N' = Lam - mu N + eta A]
Model 5c (variant)  :  E' = gU + eta A - (b2+mu)E,  A' = b2 E - (eps+alpha+eta+mu)A      [word-of-mouth TRANSFER A -> E, N' = Lam - mu N]
The original model is NOT replaced; 5c is a separate comparison model."""
import mpmath as mp
from models import *

def system_5c(p=None):
    p = p or params(5); J, b = system(5, p); iA = NAMES[5].index('A'); J[iA, iA] -= p['eta']; return J, b

def loop_gain(p):
    """Theta_w = eta b2 /((b2+mu)(eps+alpha+mu)):  mean number of secondary exposures produced by one exposure through E -> A -> E"""
    return p['eta'] * p['b2'] / ((p['b2'] + p['mu']) * (p['eps'] + p['al'] + p['mu']))
