one.d.heat.eq: The Heat Equation Solver This function takes in all the...

Description Usage Arguments Value

View source: R/one.d.heat.eq.R

Description

The Heat Equation Solver This function takes in all the options possible in order to choose how to solve the heat equation, and the boundary conditions.

Usage

1
2
3
one.d.heat.eq(init.dat, n = 50000, boundary = c("Neumann",
  "Dirichlet"), alpha = 1, dt = 0.1, dx = 0.1, eps = 0,
  save.intermediates = F)

Arguments

init.dat

A vector representing the evenly spaced points describing the initial state of the system.

n

The number of time steps to run the simulation for.

boundary

A string, either "Neumann" or "Dirichlet" (any capitalization allowed).

alpha

The rate constant for the heat equation, 'a' in du/dt = a d^2u/(dx^2).

dt

The length of each time step.

eps

If abs(eps) > 0, then if the value of the data at some point is less than eps, it will be truncated to zero.

save.intermediates

Recording the data at each time step is quite memory-intensive, but if one is interested in the evolution of the system rather than just the outcome, it may be desirable to record them. For large values MALLOC in C++ might complain and shut down RStudio, in order to address this I hope to develop a rule of thumb for an average operating system (= my operating system) for how large of an array should generate an error.

Value

finalresults The state of the data on the final time step.

full If save.intermediates = T, this will be a matrix containing the data at every time step. Time along the rows, spatial dimension along the columns.

initial.data The data at the start.

n.steps The number of time steps chosen.

time.passed The amount of time passed, i.e. n*dt.

intermediates.saved Whether values other than the initial and final data were saved, necessary Boolean for the plot.heat method.


TWilliamBell/heateq documentation built on Aug. 10, 2019, 3:32 p.m.