Page 1 of 1

Error when using subscripts.

Posted: Thu Jul 06, 2006 9:18 am
by nikvyas
Hello again.

I have a problem when using subscripts - it doesn't work!

I've defined a subscript [training platform] which contains a range of 5. I then have the following equation:

test[training platform] = DS TRAINING PATTERN[Training Platform], FTD TRAINING PATTERN[Training Platform],PTT TRAINING PATTERN[Training Platform],RCT TRAINING PATTERN[Training Platform],SFET TRAINING PATTERN[Training Platform]

Where each of the five patterns are a series of pulses (obviously defined elsewhere in the model) - eg:

DS TRAINING PATTERN[Training Platform]= PULSE TRAIN( 176 , 5, 168, 8400 )+PULSE TRAIN( 183 , 5,168,8400 )+PULSE TRAIN(200 ,5 ,168, 8400)+PULSE TRAIN(208,3,168,8400)+PULSE TRAIN( 224 , 5, 168, 8400 )+PULSE TRAIN( 231 , 5,168,8400 )+PULSE TRAIN(248 ,5 ,168, 8400)+PULSE TRAIN(256,3,168,8400)+PULSE TRAIN( 272 , 5, 168, 8400 )+PULSE TRAIN( 279 , 5,168,8400 )


However, I get an error message saying Incorrect/Incomplete equation - but I don't see what is incomplete.

Thanks

Nik

[Edited on 7-6-2006 by nikvyas]

Posted: Thu Jul 06, 2006 10:36 am
by Administrator
You have your syntax wrong.

What are you trying to do here?

test[training platform] = DS TRAINING PATTERN[Training Platform], FTD TRAINING PATTERN[Training Platform],PTT TRAINING PATTERN[Training Platform],RCTTRAINING PATTERN[Training Platform],SFET TRAINING PATTERN[Training Platform]

Tony.

Posted: Thu Jul 06, 2006 10:47 am
by bob@vensim.com
At a guess you intend

TrainingPlatform: DS,FTP,PTT,RCT,SFET ~~|

test[DS] = DS TRAINING PATTERN ~~|
test[FTP] = FTP TRAINING PATTERN ~~|
....
test[SFET] = SFET TRAININT PATTERN ~ Widget/Week ~|

That is, one equation for each subscript element and no subscripts on the test inputs. Use the Add Eq button to add multiple equations in the equation editor.

Posted: Fri Jul 07, 2006 9:15 am
by nikvyas
Thanks Bob - but I still get error messages. I did what you suggested as follows:

TrainingPlatform: DS, FTP, PTT, RCT, SFET

and then added the following to the "test" box variable:

test[TrainingPlatform]=DS TRAINING PATTERN

Then using the add eq button:

test[TrainingPlatform]=FTP TRAINING PLATFORM

and so on, for PTT, RCT and SFET. So now I have 5 equations within test[TrainingPlatform].

However, when I run it I get the message:

Incorrect number of subscripts for - DS TRAINING PATTERN
Incorrect number of subscripts for - FTP TRAINING PATTERN
Incorrect number of subscripts for - PTT TRAINING PATTERN
Incorrect number of subscripts for - RCT TRAINING PATTERN
Incorrect number of subscripts for - SFET TRAINING PATTERN


As usual, help greatly appreciated.

Posted: Fri Jul 07, 2006 10:47 am
by bob@vensim.com
You obviously need to remove the subscripts from the equations for DS TRAINING PATTERN etc and use the equations I specified, not the ones you used.

Chapter 17 of the User's Guide covers subscripts - this is a must read!