Skip to content
Prev 333600 / 398506 Next

Problems dealing with matrices

I think the following is a pretty literal translation from your 
description. Looks like a linear difference equation with a ramp forcing 
function.

wt <- matrix( c(1,0,0,0,0 ), nrow=5 )
vol <- matrix( NA, nrow=5, ncol=length( volinp ) )
vol[ , 1 ] <- dcmat %*% ( volmat + wt )

for ( idx in volinp[ -1 ] ) {
   vol[ , idx ] <- dcmat %*% ( vol[ , idx-1 ] + idx * wt )
}
On Sun, 24 Nov 2013, halim10-fes wrote:

            
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                       Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------