heat {cmna}R Documentation

Heat Equation via Forward-Time Central-Space

Description

solve heat equation via forward-time central-space method

Usage

heat(u, alpha, xdelta, tdelta, n)

Arguments

u

the initial values of u

alpha

the thermal diffusivity coefficient

xdelta

the change in x at each step in u

tdelta

the time step

n

the number of steps to take

Details

The heat solves the heat equation using the forward-time central-space method in one-dimension.

Value

a matrix of u values at each time step

Examples

alpha <- 1
x0 <- 0
xdelta <- .05
x <- seq(x0, 1, xdelta)
u <- sin(x^4 * pi)
tdelta <- .001
n <- 25
z <- heat(u, alpha, xdelta, tdelta, n)


[Package cmna version 1.0.5 Index]