Hello
I want to combine subscript to new one .
I tryed Vector ELM MAP , but I cant.
Please tell me how to .
-----------------------
subscript1:
(n1-n2)
subscript3:
(K1-K6)
Array1[subscript1]=1,2,3
Array2[subscript1]=5,6,7
newVector[subscript3]=Array1[subscript1]+Array2[subscript1]
-----------------------
I want to set newVector contents like
newVector[k1]--->1
newVector[k2]--->2
newVector[k3]--->3
newVector[k4]--->5
newVector[k5]--->6
newVector[k6]--->7
-----------------------
Yusuke
subscript combine
subscript combine
- Attachments
-
- subscriptcombine.mdl
- (1.52 KiB) Downloaded 174 times
Re: subscript combine
There are probably several ways to accomplish this. Not knowing anything about the meaning of the variables, it's hard to suggest the best option.
One would be:
sub1 : (n1-n3)
subK : kLower, kUpper
kLower : (k1-k3)
kUpper : (k4-k6)
Then you can write:
newvec[kLower] = array1[sub1]
newvec[kUpper] = array2[sub1]
or directly
newvec[kLower] = 1,2,3
newvec[kUpper] = 5,6,7
One would be:
sub1 : (n1-n3)
subK : kLower, kUpper
kLower : (k1-k3)
kUpper : (k4-k6)
Then you can write:
newvec[kLower] = array1[sub1]
newvec[kUpper] = array2[sub1]
or directly
newvec[kLower] = 1,2,3
newvec[kUpper] = 5,6,7
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: subscript combine
Dear Tomfid
Thank you for a answer.
I try attached model using your comment.
But I can not finish it .
1)after make subscript
subK:Klower, KUpper
I can not set the subscript
kLower : (k1-k3)
kUpper : (k4-k6)
with error *KLower is already a model variable*
How can I set model?
Thank you for a answer.
I try attached model using your comment.
But I can not finish it .
1)after make subscript
subK:Klower, KUpper
I can not set the subscript
kLower : (k1-k3)
kUpper : (k4-k6)
with error *KLower is already a model variable*
How can I set model?
- Attachments
-
- subscriptcombine2.mdl
- (1.59 KiB) Downloaded 183 times
Re: subscript combine
Create Klower, Kupper first, then create subK.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: subscript combine
Dear TomFid
Thank you comment.
I can add subscript
But `model check error `show,
in
newvec[kLower] = array1[sub1]
newvec[kUpper] = array2[sub1]
"Subscript Range -sub1 appears on the right,but not left"
I attached this model.
Please give me hint about this.
Yusuke
Thank you comment.
I can add subscript
But `model check error `show,
in
newvec[kLower] = array1[sub1]
newvec[kUpper] = array2[sub1]
"Subscript Range -sub1 appears on the right,but not left"
I attached this model.
Please give me hint about this.
Yusuke
- Attachments
-
- subscriptcombine3.mdl
- (1.64 KiB) Downloaded 157 times
Re: subscript combine
Sorry my attached file have a mistake of number of data .
So I attached new one .
I still not get the solution .
So I attached new one .
I still not get the solution .
- Attachments
-
- subscriptcombine4.mdl
- (1.64 KiB) Downloaded 171 times
Re: subscript combine
I forgot one thing - you need to map sub1 to the k ranges:
sub1 : (n1-n3) -> klower,kupper
sub1 : (n1-n3) -> klower,kupper
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: subscript combine
Dear Tom
Thank you .
I can do it.
Thank you .
I can do it.