Description Usage Arguments Details Value Author(s) Examples
View source: R/temp_analytic_harmonic.R
Provides a template for bbuilding nicely documented R functions
1 | TempAnalyticHarmonic(Tmean, As, z, t, P, kappa)
|
Tmean |
Mean temperature [C] at the surface. Must be a scalar. |
As |
Amplitude [C] of surface temperature oscillation. Must be larger than zero and a scalar. |
z |
Depth [m] below the surface, positive downwards. Must be positive number, can be a vector or a scalar. |
t |
Time [s] after start of period for which output is desired. Can be a vector or a scalar |
P |
Period [s] of surface temperature oscillation. Must be larger than zero and a scalar. |
kappa |
Thermal difussivity [m2/s] of material. |
Feel free to leave out things that are not needed.
Returns an array of temperatures [C] with one column for each z specified and one row for each t specified.
Stephan Gruber <stephan.gruber@carleton.ca>
1 2 3 4 5 6 7 8 9 10 11 12 | #temperature for only one depth and time
temp <- TempAnalyticHarmonic(0, 10, 1, 3600000, 24*365*3600, 5e-07)
#temperature for three depths and one instant in time
temp <- TempAnalyticHarmonic(0, 10, c(1,2,3), 3600000, 24*365*3600, 5e-07)
#temperature for three depths and many time steps, plot
time <- seq(from = 0, to = 24*365*3600, length.out = 200)
temp <- TempAnalyticHarmonic(0, 10, c(1,2,3), time, 24*365*3600, 5e-07)
plot( temp[,1], type="l")
lines(temp[,2], col=2)
lines(temp[,3], col=3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.