Help in vector multiplication!!

Use this forum to post Vensim related questions.
Post Reply
luisangelguzmang
Member
Posts: 42
Joined: Wed Apr 06, 2011 8:20 am

Help in vector multiplication!!

Post 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 3911 times
tomfid
Administrator
Posts: 3994
Joined: Wed May 24, 2006 4:54 am

Re: Help in vector multiplication!!

Post 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]
luisangelguzmang
Member
Posts: 42
Joined: Wed Apr 06, 2011 8:20 am

Re: Help in vector multiplication!!

Post by luisangelguzmang »

Thanks, but I can't understand completely. It is possible to get a small model with this?
tomfid
Administrator
Posts: 3994
Joined: Wed May 24, 2006 4:54 am

Re: Help in vector multiplication!!

Post by tomfid »

Try this:
vecmult2.mdl
(1.65 KiB) Downloaded 456 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
Post Reply