COSC 071
Project 1 Design
Algorithm
Variables
There will be three types of variables
-
User Input
-
Temperature - this will have to be a decimal number
-
Salinity - this will also be a decimal number
-
Nitrates - this again is a decimal number
-
Lumens - this could be decimal, or it could be an integer since the
range is large.
-
Constants
-
The maximum observed amount of pseudo-nitzschia australis.
- Others will be the cut points for each of temperature, salinity,
lumens, and nutrients, to mark where they are max or min. This will
allow easy adjustment in the program should experiments determine
different values.
-
Computed Values
- The total amount of pseudo-nitzschia australis.
-
Four variables to indicate the contribution of each factor. These will
be the percentage of maximum of each of temperature, salinity, light,
and nutrients. Range will be from 0 to 1 (0 to 100%). The total amount
of PNA will be determined by multiplying these four percentages with
the known maximum value.
Algorithm
Please note that the algorithm presented is less detailed than I
would expect from your submissions. This is to ensure that
programming of the solution remains reasonable challenging.
- Output message describing program operation
- Prompt user for variables and read in values
- Determine the percentage of maximum for temperature by mapping
the peak to a function such as a parabola, sin, or exponential. It
should be 1 at both minimum and maximum, and 1 at the peak.
- Determine the percentage of maximum for lumens by making it 0
if less than the minimum, 1 if more than the maximum, and scale it
linearly between 0 and 1 in between the minimum and maximum.
- Determine the percentage of maximum for salinity by making it 0 if it
is greater than max, 1 if less than minimum, and scale it lineraly
between 1 and 0 in beween min and max.
- Determine the percentage of maximum for nutrients by making it 0
if less than the minimum, 1 if more than the maximum, and scale it
linearly between 0 and 1 in between the minimum and maximum.
- Determine an estimate of organism density by multiplying each of
the percentages determined above by the known maximum density.
-
Output the estimated amount of pseudo-nitzschia australis.
Testing
The only values that we know for sure are the given maximum, minimum,
and peaks. To test it, the program should be run repeatedly to make
sure that maximums occur where they should, minimums occur where they
should, and that the shape of the output function for each input
(tested independantly while others are at max) is correct.