This model simulates the beginning of an idealized salmon smolt migration. In the Spring of each year, salmon egss hatch in the streams and hatcheries of tributaries of rivers leading to the ocean. These very large populations of salmon grow into a juvenile stage in which they are known as smolts, but any further development will need to occur in the oceans themselves. Thus, nearly simultaneously they begin a migration to the ocean.
Mortality is very high -- even independent of human involvement -- but the migration occurs relatively rapidly. This model simulates the movement of the smolts through zone 1 from the streams and hatcheries where they were spawned, which is represented by zone 0.
powered by NetLogo
view/download model file: Zone0IntoZone1.nlogo
The Setup command initializes the system and the plots by creating "Initial-Population" numbers of smolts in zone 0. In this simulation, the initial population consists of thousands of smolts, whereas actual populations often involve millions of them. The Go command starts the random migration out of zone 0, and each smolt randomly moves about zone 0 until it encounters the channel exiting the zone. Once in the channel, it is highly unlikely that the smolt will backtrack into zone0 itself. The degree to which each smolt in zone 0 is controled by the flow of the zone toward the channel can be adjusted using the "Relative-flow-in-lake" slider.
Adjust the Initial-Population, ticks-per-unit-time, and Relative-Flow-In-Lake sliders to desired settings. Press Setup and then Go (press Step for one tick of the model at a time). Press setup and then go. To "smooth out" the measurements of Emigration and the percentage migration rate, the number of ticks per unit time can be varied up to 20 ticks per unit time. There is also an additional "Smoothing" option that can be turned on or off. There is also a flow in each of the lakes (i.e., the large "boxes" ) toward the channels leading away from the lakes, and the "Relative-Flow-In-Lake" slider adjusts this from no influence at 0 to flow-controlled at 1.
The simulation is designed to test the efficacy of the model
dN1/dt = m0 N0(t) - m1 N1(t)
where N0(t) and N1(t) are the populations of zones 0 and 1, respectively, at time t and where m0 and m1 are the relative (i.e., percentage) rates of emigration from zones 0 and 1, respectively. This model only applies when both m0 and m1 can be assumed to be relatively constant. Also, it is important to asses whether or not m0 and m1 are approximately the same or should be treated as completely independent parameters.
However, as the Relative-Flow-In-Lake parameter is increased, the accuracy of this model decreases as m is not nearly as close to being constant during the migration.
Try varying the Initial-Population. Also, try changing the relative rate of flow of the smolts (relative to the flow of the lake, that is). Changing this slider during the migration also may lead to some interesting results, especially if the initial population is quite large.
This model created by Dr. Jeff Knisley as part of the Symbiosis project module on migratory models in differential calculus. It is one of the simulations located at http://math.etsu.edu/symbiosis/migrations.
globals [ from0to1 MaxDist Current-Time Previous-Time AllTime N0P N1P zonewidth m0 m1 Departures-per-tick
m1raw ]
patches-own [ iswater? inlake? pzone flow-heading flow-strength ] ; flow-strength is 0 to 1, percentage of main-channel flow speed
turtles-own [ zone ]
to setup
clear-all
set from0to1 0
set Previous-Time 0
set Current-Time 0
set zonewidth 28
setup-patches
set m1raw [ ]
set Departures-per-tick 0
CreateSmolts
set AllTime [ 0 ]
set N0P [ ]
set N0P lput Initial-Population N0P
set N1P [ 0 ]
set-current-plot "N0 (black) and N1 (blue)"
set-plot-y-range 0 Initial-Population
set-current-plot-pen "N0(t)"
plotxy 0 Initial-Population
set-current-plot-pen "N1(t)"
plotxy 0 0
end
to CreateSmolts
set-default-shape turtles "fish"
create-turtles Initial-Population
[
set color green
move-to one-of patches with [ pzone = 0 ]
set heading random 360
set zone 0
]
end
to setup-patches
;set source info and zone transition points
ask patches
[
ifelse ( pxcor > min-pxcor and pycor > -4 and pycor < 4 )
[ set pcolor blue
set iswater? true
set inlake? false
set pzone -1
set flow-heading 90
set flow-strength 1
]
[ set pzone -1
set iswater? false
set inlake? false
]
]
make-compartment min-pxcor ( min-pxcor + zonewidth ) 0 ;from0to1
make-compartment ( min-pxcor + zonewidth ) ( min-pxcor + 2 * zonewidth ) 1 ; from0to1 max-pxcor 1
end
to make-compartment [ L R zn ]
let U max-pycor
let B min-pycor
set MaxDist sqrt ( ( R - 4 - L ) ^ 2 + U ^ 2 )
ask patches [
if ( pxcor > min-pxcor and pxcor > L and pxcor < ( R - 4 ) and pycor < U and pycor > B )
[ set pcolor blue
set iswater? true
set inlake? true
set pzone zn
set flow-heading towardsxy ( R - 4 ) 0
set flow-strength 1 - sqrt ( ( pxcor - R ) ^ 2 + pycor ^ 2) / MaxDist ]
if ( pxcor <= R and pxcor >= ( R - 4 ) and pxcor <= max-pxcor and pycor > -4 and pycor < 4 )
[ set pcolor blue
set iswater? true
set inlake? false
set pzone -1
set flow-heading 90
set flow-strength 1 ]
]
end
to go
if( not any? turtles ) [ stop ]
ask turtles [
if ( random-float 1 < 1 / ticks-per-unit-time )
[ smoltMove
smoltLearn
]
]
smoltCount
end
to smoltMove
rt random 90
lt random 90
let p [ flow-strength ] of patch-here
if( [ pzone ] of patch-here >= 0 ) [ set p p * Relative-Flow-In-Lake ]
ifelse ( heading < 270 )
[ set heading ( ( 1 - p ) * heading + p * ( [ flow-heading ] of patch-here ) ) ]
[ set heading ( ( 1 - p ) * heading + p * ( [ flow-heading ] of patch-here + 360 ) ) ]
if not ( member? patch-ahead 1 neighbors with [ iswater? ] )
[ set heading towards one-of neighbors with [ iswater? ] ]
fd 1
set zone [pzone] of patch-here
if ( xcor >= max-pxcor )
[ die ]
end
to smoltCount
tick
set Current-time ticks / ticks-per-unit-time
set N0P lput count turtles with [ zone = 0 ] N0P
set N1P lput count turtles with [ zone = 1 ] N1P
if( Current-Time < Previous-Time )
[ clear-all-plots
reset-ticks
set Current-Time 0
]
set-current-plot "N0 (black) and N1 (blue)"
set-current-plot-pen "N0(t)"
plotxy Current-Time last N0P
set-current-plot-pen "N1(t)"
plotxy Current-Time last N1P
set-current-plot "m0 (black) and m1 (blue)"
set-current-plot-pen "m0"
if( last N0P > 0 and last N1P > 0 and Current-Time > 0 )
[ set m0 ln ( first N0P / last N0P ) / ( Current-Time )
plotxy Current-Time m0
]
let tmp count turtles with [ xcor > ( max-pxcor - 5 ) ]
if( last N1P > 5 and tmp > 0 )
[ ifelse( Smooth-m1 )
[ set m1raw lput ( ( 2 * m1 + 8 * tmp / ( last N1P ) ) / 10 ) m1raw ]
[ set m1raw lput ( tmp / ( last N1P ) ) m1raw ]
set-current-plot-pen "m1"
set m1 ( ( sum m1raw ) / ( length m1raw ) / 4 ) ;]
plotxy Current-Time m1
]
if( length m1raw > ticks-per-unit-time )
[ set m1raw remove-item 1 m1raw ]
set Previous-Time Current-Time
end
to smoltLearn
; Zone number, simple flow concept means no going to earlier zone
end