Hilsa fishery
A hilsa fishery, the life cycle of a migratory fish.
- Class:
HilsaFisherySystem - Import:
from skcomplex.systems.economics.resources import HilsaFisherySystem - Field:
economics/resources - Topics:
fishery,life cycle,stocks and flows,system dynamics,ode - References:
- Bala et al. 2017
Use this system
The block imports the class and simulates the system with its default parameters and its tuned run settings.
from skcomplex.systems.economics.resources import HilsaFisherySystem
trajectory = HilsaFisherySystem().prepare().simulate()
Parameters
The model parameters take these defaults, and set_params changes them.
| Parameter | Default |
|---|---|
spawners |
375.0 |
eggs_per_nest |
200000.0 |
juvenile_harvest |
0.48 |
adult_harvest |
0.8 |
migration_loss |
0.25 |
solver |
'auto' |
backend |
'auto' |
Tags
The system with its default parameters has these capability tags, which solvers and analyses check.
| Tag | Values |
|---|---|
| Time | continuous |
| Space | none |
| Laws | rate |
| Randomness | unknown |
| Domains | real |
| Structure | fixed |
Class
The source of the class shows how it builds its components from its model parameters.
class HilsaFisherySystem(BaseSystem):
"""A hilsa fishery, the life cycle of a migratory fish.
The catch of juveniles and spawners depletes it. Spawning adults lay eggs in nests in the rivers, and the number of
nests is limited by the spawning grounds. The eggs hatch into larvae within a month, the larvae become juveniles
within two months, and the juveniles stay in the rivers for eight months before they enter the ocean. The fish
mature in the ocean over two years, migrate back to the rivers, and spawn. Every stage drains over its duration, and
a fixed fraction of its outflow is lost to natural mortality, to the catch of juveniles, or to the catch of spawning
adults, while the rest enters the next stage. Fish are conserved, every change of a stage is a flow, and the
population settles where the spawning grounds fill, unless the catch keeps the reproduction below replacement. The
stages, the durations, and the loss fractions follow the hilsa system of Bala, Arshad and Noh (2017, Chapter 9),
with the stocks in millions of fish and time in months.
The system has the stages `hilsa.eggs`, `hilsa.larvae`, `hilsa.juveniles`, `hilsa.yearlings`, `hilsa.adults`,
`hilsa.migrants`, and `hilsa.spawners`, and the flows between the stages, among them `hilsa.egg_deposition`,
`hilsa.young_entering_ocean_catch`, and `hilsa.adult_catch`, per month, over months. The observables of the system
are the nests `hilsa.nests`, and the weights `hilsa.adult_weight` and `hilsa.juvenile_weight` in tonnes.
Args:
spawners:
The initial number of adults about to spawn.
eggs_per_nest:
The number of eggs per nest.
juvenile_harvest:
The fraction of the juveniles leaving the rivers that the fishery catches.
adult_harvest:
The fraction of the adults about to spawn that the fishery catches.
migration_loss:
The fraction of the adults lost during their migration to the rivers.
label:
The label of the system, which names it when it is nested in another one.
solver:
The solver of the problem, or `'auto'` for the one the system chooses.
backend:
The backend that evaluates the compiled functions, or `'auto'` for the one the system chooses.
Examples:
>>> from skcomplex.systems.economics.resources import HilsaFisherySystem
>>> HilsaFisherySystem(adult_harvest=0.5).prepare().system_.elements[0].adult_harvest
0.5
"""
field = 'economics/resources'
topics = ('fishery', 'life cycle', 'stocks and flows', 'system dynamics', 'ode')
references = ('Bala et al. 2017',)
until = 120.0
dt = 0.5
observables = (
Observable('nests', _nests, element='hilsa'),
Observable('adult_weight', _get_adult_weight, element='hilsa'),
Observable('juvenile_weight', _get_juvenile_weight, element='hilsa'),
)
@staticmethod
def _get_stage(
label: str,
stock: str,
following: str,
time: str,
losses: tuple[tuple[str, str], ...],
) -> Interaction:
"""Return the flows that drain a stage over its duration.
A share goes to each loss and the rest to the next stage. The stage reads the duration `time` and the share of
every loss by name, and reports the flow to the next stage as `hilsa.<label>` and the flow to every loss as
`hilsa.<label>_<loss>`.
"""
shares = [share for share, _ in losses]
def drain(s: SimpleNamespace) -> list[BaseLaw]:
"""Return the flow into the next stage and the flow to every loss."""
held = getattr(s.target, stock)
flows: list[BaseLaw] = [
RateLaw(
{held: -1, getattr(s.target, following): +1},
HilsaFisherySystem._get_survival(s, stock, time, shares),
label=label,
),
]
flows += [
RateLaw({held: -1}, HilsaFisherySystem._get_loss(s, stock, time, share), label=f'{label}_{sink}')
for share, sink in losses
]
return flows
return Interaction(label, roles={'target': 'hilsa'}, laws=drain)
@staticmethod
def _get_outflow(s: SimpleNamespace, stock: str, time: str) -> Expression:
"""Return the outflow of a stage over its duration."""
return getattr(s.target, stock) / getattr(s.target, time)
@staticmethod
def _get_survival(s: SimpleNamespace, stock: str, time: str, shares: list[str]) -> Expression:
"""Return the outflow of a stage that survives its losses into the next stage."""
return (1 - sum((getattr(s.target, share) for share in shares), start=0)) * HilsaFisherySystem._get_outflow(
s,
stock,
time,
)
@staticmethod
def _get_loss(s: SimpleNamespace, stock: str, time: str, share: str) -> Expression:
"""Return the outflow of a stage to one loss."""
return getattr(s.target, share) * HilsaFisherySystem._get_outflow(s, stock, time)
def __init__(
self,
spawners: float = 375.0,
*,
eggs_per_nest: float = 2e5,
juvenile_harvest: float = 0.48,
adult_harvest: float = 0.8,
migration_loss: float = 0.25,
label: str = 'system',
solver: BaseSolver | str = 'auto',
backend: BaseBackend | str = 'auto',
) -> None:
super().__init__(label, solver=solver, backend=backend)
self.spawners = spawners
self.eggs_per_nest = eggs_per_nest
self.juvenile_harvest = juvenile_harvest
self.adult_harvest = adult_harvest
self.migration_loss = migration_loss
@staticmethod
def _get_birth_death() -> list[Interaction]:
"""Return the life cycle flows of the stages of the hilsa.
They are the spawning, hatching, growth, migration, losses, and catch.
"""
mortality = 'mortality'
return [
Interaction(
'egg_deposition',
roles={'target': 'hilsa'},
laws=lambda s: [
RateLaw({s.target.eggs: +1}, s.target.eggs_per_nest * _nests(s.target), label='egg_deposition'),
],
),
HilsaFisherySystem._get_stage('hatching', 'eggs', 'larvae', 'hatching_time', (('egg_loss', mortality),)),
HilsaFisherySystem._get_stage(
'juvenile_entering',
'larvae',
'juveniles',
'larval_time',
(('larval_loss', mortality),),
),
HilsaFisherySystem._get_stage(
'young_entering_ocean',
'juveniles',
'yearlings',
'river_time',
(('juvenile_loss', mortality), ('juvenile_harvest', 'catch')),
),
HilsaFisherySystem._get_stage(
'maturation',
'yearlings',
'adults',
'ocean_time',
(('first_year_loss', mortality),),
),
HilsaFisherySystem._get_stage(
'adults_entering',
'adults',
'migrants',
'adult_ocean_time',
(('second_year_loss', mortality),),
),
HilsaFisherySystem._get_stage(
'adults_leaving',
'migrants',
'spawners',
'migration_time',
(('migration_loss', mortality),),
),
Interaction(
'spawning',
roles={'target': 'hilsa'},
laws=lambda s: [
RateLaw({s.target.spawners: -1}, _get_spawning(s.target), label='spawning'),
RateLaw(
{s.target.spawners: -1},
s.target.adult_harvest * s.target.spawners / s.target.spawning_time,
label='adult_catch',
),
],
),
]
@staticmethod
def _get_filled_stages(
spawners: float,
eggs_per_nest: float,
juvenile_harvest: float,
adult_harvest: float,
migration_loss: float,
) -> dict[str, float]:
"""Return the stages filled by the egg deposition of the initial spawners.
The deposition fills them through the life cycle.
"""
spawning = FEMALE_FRACTION * (1 - adult_harvest) * spawners / SPAWNING_TIME
inflow = eggs_per_nest * min(spawning, MAX_NESTS)
losses = {'juveniles': STAGES[2][4] + juvenile_harvest, 'migrants': migration_loss}
stages = {}
for name, _, duration, _, fraction in STAGES:
stages[name] = inflow * duration
inflow *= 1 - losses.get(name, fraction)
return {**stages, 'spawners': spawners}
def _prepare(self, context: Sequence[Observable] | None = None) -> None:
"""Set the system of the components built from the model parameters."""
super()._prepare(context)
hilsa = HilsaElement(
'hilsa',
eggs_per_nest=self.eggs_per_nest,
juvenile_harvest=self.juvenile_harvest,
adult_harvest=self.adult_harvest,
migration_loss=self.migration_loss,
)
hilsa.set_params(
**self._get_filled_stages(
self.spawners,
self.eggs_per_nest,
self.juvenile_harvest,
self.adult_harvest,
self.migration_loss,
),
)
self.system_ = System(self.label, elements=[hilsa], interactions=self._get_birth_death())
Components
The system uses these element and interaction classes, each with its nearest class of the core.
Elements:
HilsaElement, fromElement
Interactions:
Interaction
class HilsaElement(Element):
"""Life cycle of the hilsa, with one stock of fish per stage.
It holds the parameters of the stages and the catch.
Args:
label:
The label of the element.
eggs:
The eggs in the nests, in millions of fish.
larvae:
The larvae in the rivers, in millions of fish.
juveniles:
The juveniles in the rivers, in millions of fish.
yearlings:
The fish in their first year in the ocean, in millions of fish.
adults:
The fish in their second year in the ocean, in millions of fish.
migrants:
The adults migrating back to the rivers, in millions of fish.
spawners:
The adults about to spawn, in millions of fish.
female_fraction:
The fraction of the spawners that are female and build a nest.
eggs_per_nest:
The number of eggs per nest.
max_nests:
The most nests the spawning grounds hold.
spawning_time:
The duration of the spawning, in months.
hatching_time:
The time the eggs take to hatch, in months.
larval_time:
The time the larvae take to become juveniles, in months.
river_time:
The time the juveniles stay in the rivers, in months.
ocean_time:
The time the fish spend in their first year in the ocean, in months.
adult_ocean_time:
The time the fish spend in their second year in the ocean, in months.
migration_time:
The time the migration back to the rivers takes, in months.
egg_loss:
The fraction of the eggs lost to natural mortality.
larval_loss:
The fraction of the larvae lost to natural mortality.
juvenile_loss:
The fraction of the juveniles lost to natural mortality.
first_year_loss:
The fraction of the fish lost to natural mortality in their first year in the ocean.
second_year_loss:
The fraction of the fish lost to natural mortality in their second year in the ocean.
migration_loss:
The fraction of the adults lost during their migration to the rivers.
juvenile_harvest:
The fraction of the juveniles leaving the rivers that the fishery catches.
adult_harvest:
The fraction of the adults about to spawn that the fishery catches.
weight_per_adult:
The weight of an adult, in kilograms.
weight_per_juvenile:
The weight of a juvenile, in kilograms.
"""
def __init__(
self,
label: str,
*,
eggs: Annotated[float, RealSet.closed_open(0, oo), Quantity('fish')] = 0.0,
larvae: Annotated[float, RealSet.closed_open(0, oo), Quantity('fish')] = 0.0,
juveniles: Annotated[float, RealSet.closed_open(0, oo), Quantity('fish')] = 0.0,
yearlings: Annotated[float, RealSet.closed_open(0, oo), Quantity('fish')] = 0.0,
adults: Annotated[float, RealSet.closed_open(0, oo), Quantity('fish')] = 0.0,
migrants: Annotated[float, RealSet.closed_open(0, oo), Quantity('fish')] = 0.0,
spawners: Annotated[float, RealSet.closed_open(0, oo), Quantity('fish')] = 375.0,
female_fraction: Annotated[float, RealSet.closed_open(0, oo)] = FEMALE_FRACTION,
eggs_per_nest: Annotated[float, RealSet.closed_open(0, oo)] = 2e5,
max_nests: Annotated[float, RealSet.closed_open(0, oo)] = MAX_NESTS,
spawning_time: Annotated[float, RealSet.open(0, oo)] = SPAWNING_TIME,
hatching_time: Annotated[float, RealSet.open(0, oo)] = 1.0,
larval_time: Annotated[float, RealSet.open(0, oo)] = 2.0,
river_time: Annotated[float, RealSet.open(0, oo)] = 8.0,
ocean_time: Annotated[float, RealSet.open(0, oo)] = 12.0,
adult_ocean_time: Annotated[float, RealSet.open(0, oo)] = 12.0,
migration_time: Annotated[float, RealSet.open(0, oo)] = 2.0,
egg_loss: Annotated[float, RealSet.closed_open(0, oo)] = 0.99,
larval_loss: Annotated[float, RealSet.closed_open(0, oo)] = 0.8,
juvenile_loss: Annotated[float, RealSet.closed_open(0, oo)] = 0.4,
first_year_loss: Annotated[float, RealSet.closed_open(0, oo)] = 0.3,
second_year_loss: Annotated[float, RealSet.closed_open(0, oo)] = 0.5,
migration_loss: Annotated[float, RealSet.closed_open(0, oo)] = 0.25,
juvenile_harvest: Annotated[float, RealSet.closed_open(0, oo)] = 0.48,
adult_harvest: Annotated[float, RealSet.closed_open(0, oo)] = 0.8,
weight_per_adult: Annotated[float, RealSet.closed_open(0, oo)] = 0.82,
weight_per_juvenile: Annotated[float, RealSet.closed_open(0, oo)] = 0.09,
) -> None:
super().__init__(label)
self.eggs = eggs
self.larvae = larvae
self.juveniles = juveniles
self.yearlings = yearlings
self.adults = adults
self.migrants = migrants
self.spawners = spawners
self.female_fraction = female_fraction
self.eggs_per_nest = eggs_per_nest
self.max_nests = max_nests
self.spawning_time = spawning_time
self.hatching_time = hatching_time
self.larval_time = larval_time
self.river_time = river_time
self.ocean_time = ocean_time
self.adult_ocean_time = adult_ocean_time
self.migration_time = migration_time
self.egg_loss = egg_loss
self.larval_loss = larval_loss
self.juvenile_loss = juvenile_loss
self.first_year_loss = first_year_loss
self.second_year_loss = second_year_loss
self.migration_loss = migration_loss
self.juvenile_harvest = juvenile_harvest
self.adult_harvest = adult_harvest
self.weight_per_adult = weight_per_adult
self.weight_per_juvenile = weight_per_juvenile
class Interaction(BaseInteraction):
"""An interaction whose laws run once for the elements its roles bind.
It states the laws that change the values of the elements its roles bind, such as gravity on a ball in
`Interaction('gravity', roles={'target': 'ball'}, laws=lambda s: [RateLaw(s.target.x.diff(s.t, 2), -9.81)])`. When a
role binds a group, the laws run once for every member, as arrays. With `among` and `along`, they run once for every
edge of a network and read `s.source` and `s.target`, the members at its two ends, or once for every hyperedge or
random small group and read `s.member`, `s.others`, and `s.members`. With `within`, they run once for every pair of
members closer than a radius and read `s.first` and `s.second`. A subclass takes its roles, typed `Role`, and its
parameters as arguments of its `__init__` and sets `laws_` in its `_prepare`. It states predation between two
populations, a reaction between two chemicals, and an infection along the contacts of a network.
Read more in the user guide, under Interactions.
Args:
label:
The name of the interaction, unique among the components of its system, such as `'predation'`.
roles:
The element each role binds, by the name of the role, such as `{'target': 'ball'}`, for a rule written
without a class, or `None`.
laws:
The function of the namespace that returns the laws of a rule written without a class, such as
`lambda s: [RateLaw(s.target.n.diff(s.t), s.target.n)]`, the laws themselves when they read no element, or
`None`.
among:
The group whose members sit at the ends of the edges, such as `'people'`, or `None` to bind elements by
their roles only. A subclass annotates it as a role, and a rule written without a class binds it as one.
along:
`True` for the edges of the network the group lives on, the name of a layer of a network with several, such
as `'contacts'`, `'hyperedges'` for its hyperedges, `('hyperedges', k)` for its hyperedges of `k` members,
`RandomPartition(k)` for random groups of `k` members drawn at every step, `'neighborhoods'` for every
member with the members around it, or `None` for no edges. On the edges, the laws read the member of an
element that sits on them as `s.edge`, and on the hyperedges as `s.hyperedge`.
within:
A `RadiusNeighborhood(r)` for laws that run once for every pair of members of the roles `first` and `second`
closer than `r`, which read `s.first` and `s.second` and give the laws of both, such as the repulsion of
walkers of two crowds, or `None` for no pairs. With `among`, both members come from that group. The laws may
give the energy of the pair as `ObjectiveLaw(V)` in place of its forces, and each member then feels the
force `-dV/dx` on its position `x`.
See Also:
BaseInteraction: The base of every interaction.
RandomPartition: Groups the members of a group at random at every step.
TrainingInteraction: Trains the parameters of a nested system.
Examples:
>>> from skcomplex.core.components.interactions import Interaction
>>> from skcomplex.core.components.laws import RateLaw
>>> birth = Interaction('birth', roles={'target': 'fish'}, laws=lambda s: [RateLaw(s.target.n.diff(s.t), 1)])
>>> birth.roles
{'target': 'fish'}
"""
def __init__(
self,
label: str,
*,
roles: Mapping[str, object] | None = None,
laws: Callable[[SimpleNamespace], Sequence[BaseLaw]] | Sequence[BaseLaw] | None = None,
among: str | None = None,
along: bool | str | tuple[str, int] | RandomPartition | None = None,
within: RadiusNeighborhood | None = None,
) -> None:
super().__init__(label)
self.roles = roles
self.laws = laws
self.among = among
self.along = along
self.within = within
def _get_declared(self) -> Mapping[str, _DeclaredVariableSpec]:
"""Return the numeric arguments as parameters, and `roles` and `among` as roles.
With `within`, `among` binds both members of a pair, `first` and `second`.
"""
declared = dict(super()._get_declared())
for name, binding in (self.roles or {}).items():
declared[name] = _DeclaredVariableSpec(binding, RoleSpec())
if self.among is not None and self.within is not None:
for name in PAIR_ROLES:
declared.setdefault(name, _DeclaredVariableSpec(self.among, RoleSpec()))
elif self.among is not None and 'among' not in declared and 'among' not in self._get_specs():
declared['among'] = _DeclaredVariableSpec(self.among, RoleSpec())
return declared
@classmethod
def _get_state_arguments(cls, role: RoleSpec) -> tuple[str, ...]:
"""Return the arguments that name the states a role reads.
The mapping `roles` of bindings names none.
"""
return tuple(name for name in super()._get_state_arguments(role) if name != 'roles')
def _get_binding(self, role: str) -> object:
"""Return what a role binds, from `roles` or from the argument of its name.
Args:
role:
The name of the role.
Returns:
binding:
The label, labels, or entries the role binds, or `None` when it binds nothing.
"""
if self.roles is not None and role in self.roles:
return self.roles[role]
if self.among is not None and self.within is not None and role in PAIR_ROLES:
return self.among
return super()._get_binding(role)
def _check_arguments(self) -> None:
"""Raise an error for roles, laws, or groups the interaction cannot take.
Raises:
ValidationError:
A role of `roles` takes the name of an argument, `laws` is neither a function nor a list of laws, or
`along` names hyperedges of fewer than two members.
"""
clashes = sorted(set(self.roles or {}) & {'label', 'roles', 'laws', 'among', 'along'})
if clashes:
error_msg = f'The role {clashes[0]!r} of {self.label!r} takes the name of an argument. Rename the role.'
raise ValidationError(error_msg)
if self.laws is not None and not callable(self.laws) and not isinstance(self.laws, list | tuple):
error_msg = (
f'The laws of {self.label!r} are {self.laws!r}. Give a function that takes the bound elements as '
'`s` and returns the laws, such as `laws=lambda s: [RateLaw(s.target.n.diff(s.t), s.target.n)]`.'
)
raise ValidationError(error_msg)
if isinstance(self.along, tuple) and not self._is_sized(self.along):
error_msg = (
f'{self.label!r} runs along {self.along!r}. Give the hyperedges of one size as a whole number of 2 or '
"more, such as `along=('hyperedges', 3)`."
)
raise ValidationError(error_msg)
if isinstance(self.along, RandomPartition):
self.along._check()
grouped = isinstance(self.along, RandomPartition) or self.along == NEIGHBORHOODS
if grouped and self.among is None:
error_msg = f'{self.label!r} runs along groups of members. Name their group with `among`.'
raise ValidationError(error_msg)
super()._check_arguments()
def _prepare(self, context: SimpleNamespace) -> None:
"""Set the laws of `laws` for a binding.
Args:
context:
The namespace of the elements a binding of the roles names.
"""
super()._prepare(context)
if self.laws is not None:
self.laws_ = list(self.laws(context) if callable(self.laws) else self.laws)
@staticmethod
def _is_sized(along: tuple[object, ...]) -> bool:
"""Return whether `along` names hyperedges of a whole size of at least two."""
if len(along) != MIN_SIZE or along[0] != HYPEREDGES:
return False
size = along[1]
return isinstance(size, int) and not isinstance(size, bool) and size >= MIN_SIZE
def _get_draws(self) -> bool:
"""Return whether the interaction draws, as it does along random groups."""
return super()._get_draws() or isinstance(self.along, RandomPartition)
def _runs_on_edges(self) -> bool:
"""Return whether the interaction runs along edges."""
grouped = self._runs_on_hyperedges() or self._get_grouping() is not None
return self.along is not None and self.along is not False and not grouped
def _runs_on_hyperedges(self) -> bool:
"""Return whether the interaction runs along the hyperedges of a network."""
return self.along == HYPEREDGES or (isinstance(self.along, tuple) and self.along[0] == HYPEREDGES)
def _get_hyperedge_size(self) -> int | None:
"""Return the size `along` gives the hyperedges, or `None` for every size."""
return int(self.along[-1]) if isinstance(self.along, tuple) and self._runs_on_hyperedges() else None
def _get_within(self) -> RadiusNeighborhood | None:
"""Return the neighbourhood of the pairs the laws run for, or `None` for no pairs."""
return self.within
def _get_layer(self) -> str | None:
"""Return the layer `along` names, or `None` for no layer."""
if not isinstance(self.along, str) or self.along == NEIGHBORHOODS or self._runs_on_hyperedges():
return None
return self.along
def _get_grouping(self) -> tuple[str, int, str] | None:
"""Return the kind, size, and reduction of the groups `along` names, or `None`."""
if isinstance(self.along, RandomPartition):
return ('partition', self.along.size, 'sum')
if self.along == NEIGHBORHOODS:
return ('neighborhood', 0, 'sum')
return None
Equations
The equations are those that symbolic returns for the system with its default parameters.
hilsa.eggs: diff(eggs_hilsa(t), t) == eggs_per_nest_hilsa*where(max_nests_hilsa < -(adult_harvest_hilsa - 1)*female_fraction_hilsa*spawners_hilsa(t)/spawning_time_hilsa, max_nests_hilsa, -(adult_harvest_hilsa - 1)*female_fraction_hilsa*spawners_hilsa(t)/spawning_time_hilsa) + (egg_loss_hilsa - 1)*eggs_hilsa(t)/hatching_time_hilsa - egg_loss_hilsa*eggs_hilsa(t)/hatching_time_hilsa
hilsa.larvae: diff(larvae_hilsa(t), t) == -(egg_loss_hilsa - 1)*eggs_hilsa(t)/hatching_time_hilsa + (larval_loss_hilsa - 1)*larvae_hilsa(t)/larval_time_hilsa - larval_loss_hilsa*larvae_hilsa(t)/larval_time_hilsa
hilsa.juveniles: diff(juveniles_hilsa(t), t) == (juvenile_harvest_hilsa + juvenile_loss_hilsa - 1)*juveniles_hilsa(t)/river_time_hilsa - juvenile_harvest_hilsa*juveniles_hilsa(t)/river_time_hilsa - juvenile_loss_hilsa*juveniles_hilsa(t)/river_time_hilsa - (larval_loss_hilsa - 1)*larvae_hilsa(t)/larval_time_hilsa
hilsa.yearlings: diff(yearlings_hilsa(t), t) == -(juvenile_harvest_hilsa + juvenile_loss_hilsa - 1)*juveniles_hilsa(t)/river_time_hilsa + (first_year_loss_hilsa - 1)*yearlings_hilsa(t)/ocean_time_hilsa - first_year_loss_hilsa*yearlings_hilsa(t)/ocean_time_hilsa
hilsa.adults: diff(adults_hilsa(t), t) == (second_year_loss_hilsa - 1)*adults_hilsa(t)/adult_ocean_time_hilsa - second_year_loss_hilsa*adults_hilsa(t)/adult_ocean_time_hilsa - (first_year_loss_hilsa - 1)*yearlings_hilsa(t)/ocean_time_hilsa
hilsa.migrants: diff(migrants_hilsa(t), t) == -(second_year_loss_hilsa - 1)*adults_hilsa(t)/adult_ocean_time_hilsa + (migration_loss_hilsa - 1)*migrants_hilsa(t)/migration_time_hilsa - migration_loss_hilsa*migrants_hilsa(t)/migration_time_hilsa
hilsa.spawners: diff(spawners_hilsa(t), t) == -(migration_loss_hilsa - 1)*migrants_hilsa(t)/migration_time_hilsa + (adult_harvest_hilsa - 1)*spawners_hilsa(t)/spawning_time_hilsa - adult_harvest_hilsa*spawners_hilsa(t)/spawning_time_hilsa