ex_twobit: The Two Bit Adding Unit, Index 1 DAE

twobitR Documentation

The Two Bit Adding Unit, Index 1 DAE

Description

Computes the sum of two base-2 numbers, each two digits long, and a carry bit. These numbers are fed into the circuit in the form of input signals.

Index 1 DAE of dimension 350

Usage

twobit (times = seq(0, 320, by = 0.5), yini = NULL, dyini = NULL, 
        printmescd = TRUE, method = radau,  
        atol = 1e-4, rtol = 1e-4, maxsteps = 1e5, hmax = 0.1, ...) 

Arguments

yini

the initial (state) values for the DE system. If y has a name attribute, the names will be used to label the output matrix.

dyini

the initial derivatives of the state variables of the DE system.

times

time sequence for which output is wanted; the first value of times must be the initial time.

method

the solver to use

atol

absolute error tolerance, either a scalar or a vector, one value for each y.

rtol

relative error tolerance, either a scalar or a vector, one value for each y,

maxsteps

maximal number of steps per output interval taken by the solver

hmax

maximal size of step; if too large: will fail.

printmescd

if TRUE the mixed error significant digits computed using the reference solution at time 1e13 are printed

...

additional arguments passed to the solver .

Details

This model has no parameters

Value

A matrix of class deSolve with up to as many rows as elements in times and as many columns as elements in yini, plus an additional column (the first) for the time value.

There will be one row for each element in times unless the solver returns with an unrecoverable error. If yini has a names attribute, it will be used to label the columns of the output value.

Note

This model is implemented in FORTRAN

Author(s)

Karline Soetaert <karline.soetaert@nioz.nl>

Francesca Mazzia

References

http://archimede.dm.uniba.it/~testset

Examples


out <- twobit(times = seq(0, 100, by = 0.5))
plot(out, lwd = 2, which = c("x49", "x130", "x148"), mfrow = c(3, 1))

## Not run: 
  out <- twobit()
# compare with reference solution
  max(abs(out[nrow(out),-1] - reference("twobit")))    

## End(Not run)

deTestSet documentation built on Dec. 10, 2023, 3:04 a.m.