Page 1 of 1

Help in vector multiplication!!

Posted: Tue Dec 04, 2012 8:40 pm
by luisangelguzmang
Hi, i try to make a multiplication bewtween a vector and a scalar. I need the result in another vector, but i can“t do that. I need some help.....
The multiplication is:
image
image
mult.jpg (16.63 KiB) Viewed 3915 times

Re: Help in vector multiplication!!

Posted: Wed Dec 05, 2012 12:05 am
by tomfid
So, it looks like you want

outvector[1] = scalar*invector[1]
for i > 1
outvector = scalar*outvector[i-1]

in Vensim, you'd do this as:

Code: Select all

vec : (v1-v10)
vecNext : (v2-v10) -> vecPrev
vecPrev : (v1-v9) -> vecNext

outvector[v1] = scalar * invector[v1]
outvector[vecNext] = scalar * invector[vecPrev]

Re: Help in vector multiplication!!

Posted: Wed Dec 05, 2012 4:25 pm
by luisangelguzmang
Thanks, but I can't understand completely. It is possible to get a small model with this?

Re: Help in vector multiplication!!

Posted: Wed Dec 05, 2012 5:10 pm
by tomfid
Try this:
vecmult2.mdl
(1.65 KiB) Downloaded 457 times
It doesn't exactly replicate your numbers - I think your table is wrong.

This kind of operation (essentially an iteration within a subscript range) requires subscript mapping and equations for individual elements:

http://www.vensim.com/documentation/ref ... apping.htm
http://www.vensim.com/documentation/22100.htm
http://www.vensim.com/documentation/21265.htm