The app()
function starts a GUI application that makes it easy to
run simple simulations and see the results in graphical form. Sliders
and buttons permit a fair degree of customization. The application
has some build-in documentation, which supplements what can be found
in the ‘Details’ section of the present documentation.
app(mode = "simple", options = list(height = 500))
character value specifying the style to use. Only
the value "simple"
is permitted at present. This yields a
3-panel plot, constructed by plot.strike
,
called with default arguments.
list containing options that are provided
to shinyApp
, which creates the GUI app.
When app()
is run, a window will appear within a few moments. At the top of that
is a textual introduction to the system, with a button to hide that information. Below is
a user-interaction area, with buttons and sliders that control the simulation
and the plotted output. Below that is a plotting area, the contents of which
depend on the configuration of the simulation as well as the user's selection
of items to display.
The default setup, which is shown before the user alters any of the sliders,
etc., is a simulation of a small fishing boat, of mass 45 tonnes, moving at
speed 10 knots towards a whale of length 13.7m. (The whale length is used to
compute its mass, using a formula that is described by the output of typing
help("whaleMassFromLength","whalestrike")
in an R console).
Sliders are provided for setting certain key properties of the ship and the
whale, with italic labels for those properties that are deemed most likely to
be adjusted during simulations. The details of these and the other parameters
are revealed by typing help("parameters","whalestrike")
and
help("strike","whalestrike")
in an R console.
To the right of the sliders is a column of checkboxes that control the plotted
output. At startup, three of these boxes are ticked, yielding a display with
three panels showing the time history of the simulation
(help("plot.strike","whalestrike")
provides details of the plots):
The left-hand plot panel shows whale and boat location, the former with an indication of the interfaces between skin, blubber, sublayer, and bone.
The middle panel shows the same information as the left one, but with a whale-centred coordinate system, and with labels for the components. This makes it easier to see the degree to which the layers are compressed during the impact.
The right panel is an indication of the estimated threat to the four layers of the whale, with curves that are filled with grey for time intervals when the impact stress (force/area) is less than the strength of the material in the layer, and black for times when that threshold is exceeded.
Much can be learned by adjusting the sliders and examining the plotted output. As an exercise, try setting to a particular ship mass of interest, and then to slide the ship speed to higher and lower values, whilst monitoring the "threat" panel for black regions. This will reveal a critical speed for conditions that threaten the whale. Next, try altering the sublayer thickness, which is a surrogate for location along the whale body, because e.g. the sublayer is thinner near the mandible.
Advanced users are likely to want to alter the values of impact width and height. The default setting are intended to mimic a small fishing boat, such as a Cape Islander. Try lowering the width, to simulate a strike by a daggerboard or keel of a sailing boat.
Note that the pulldown menu for setting the whale species affects only whale mass. It does not affect the thicknesses of blubber or sublayer, the values of which have been set up to represent a midsection strike on a North Atlantic Right Whale.
Other interactive apps:
app2()