Learn R Programming

TDD (version 0.4)

ConvDiffCoef: Convert Differential to Difference Eq. Coefficients

Description

Returns difference equation coefficients corresponding to input differential equation coefficients and sample interval.

Usage

ConvDiffCoef(db, dt)

Arguments

db
Vector of differential equation coefficients
dt
Time interval (s)

Value

Coefficients of difference equation.

Details

Input differential equation is of the form db[1] * f(t) + db[2] * f'(t) + db[3] * f''(t)...

Output difference equation is of the form b[1] * x_i + b[2] * x_(i-1) + b[3] * x_(i-2)...

Examples

Run this code
db = c(0, 0, 1) # represents f''(t)
dt = 0.1

ConvDiffCoef(db, dt)

Run the code above in your browser using DataLab