hi renger

thanks a lot for your help.

On Monday, May 26, 2014 12:46:50 PM UTC+4:30, Renger van Nieuwkoop wrote:

Hi

You multiply v with set t (t is not a number but a set element). Use ord(t).

Cheers

Renger

Modelworks

Gewerbestrasse 16

3600 Thun â€“ Switzerland

+41 79 818 53 73

## Info@modelworks.ch

From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of Vahid reza Mohammadi

Sent: Monday, May 26, 2014 8:40 AM

To: gams...@googlegroups.com

Subject: error $148

hi,everyone

i was often dismayed by the error $148,because i really cannot found

why i was wrong.

my code is following:

1 sets

2 j activity / a1*a7 /*

3 k resource type / k1k3 /

4 t time period / 1*20 /*

5 m mode /m1m2 / ;

6 alias(i,j) ;

7 alias(u,t);

8 variables

9 x(j,m,t) activity j in mode m in time t

10 sr(k) recruitment date of resource type k

11 fr(k) release date of resource type k

12 z1 total present value

13 z2 total cost of resource ;

14 binary variables x ;

15 integer variables sr, fr ;

16 parameters

17 c(k) unit cost of resource types per unit time

18 / k1 14

19 k2 23

20 k3 17 /

21 d(j,m) duration of activity j in mode m

22 / a2. m1 = 4

23 a2. m2 = 7

24 a3. m1 = 3

25 a3. m2 = 7

26 a4. m1 = 2

27 a4. m2 = 4

28 a5. m1 = 6

29 a5. m2 = 8

30 a6. m1 = 3

31 a6. m2 = 5 /

32 cf(j,m) cashflow of activity j in mode m

33 / a2. m1 = 100

34 a2. m2 = 200

35 a3. m1 = 300

36 a3. m2 = 400

37 a4. m1 = 500

38 a4. m2 = 600

39 a5. m1 = 700

40 a5. m2 = 800

41 a6. m1 = 900

42 a6. m2 = 1000 /

43 r(j,k,m) resource requirement of activity j in mode m for resource type k

44 / a2. k1. m1 = 9

45 a2. k1. m2 = 6

46 a3. k1. m1 = 12

47 a3. k1. m2 = 6

48 a3. k3. m1 = 11

49 a3. k3. m2 = 6

50 a4. k1. m1 = 3

51 a4. k1. m2 = 1

52 a4. k2. m1 = 4

53 a4. k2. m2 = 1

54 a4. k3. m1 = 3

55 a4. k3. m2 = 2

56 a5. k2. m1 = 3

57 a5. k2. m2 = 2

58 a5. k3. m1 = 4

59 a5. k3. m2 = 3

60 a6. k1. m1 = 9

61 a6. k1. m2 = 6

62 a6. k2. m1 = 4

63 a6. k2. m2 = 2 /

64 a(k) constant availability of renewable resource type k

65 / k1 30

66 k2 40

67 k3 50 /

68 ES(j) earliest start time of activity j

69 /a2 1

70 a3 1

71 a4 5

72 a5 5

73 a6 4

74 a7 20/

75 LS(j)

76 /a2 7

77 a3 7

78 a4 17

79 a5 13

80 a6 16

81 a7 20/ ;

82 scalar w deadline of the project /20/ ;

83 scalar v discount rate /0.05/ ;

84 equations

85 value define objective function 1

86 cost define objective function 2

87 precedence(i,j) precedence constraint

88 execution start time in one execution mode

89 resources renewable resources limitations

90 recruitment recruitment dates for resources

91 release release dates for resources

92 deadline project deadline is not violated ;

93 value… z1 =e= sum((j,m,t)$(ord(t)>= ES(j)and ord(t)<= LS(j)),cf(j,m)*exp(*

-vt)*x(j,m,t)) ;

**** $148

GAMS 24.1.2 r40979 Released Jun 16, 2013 WEX-WEI x86_64/MS Windows 05/26/14 11:02:55 Page 2

G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m

Error Messages

148 Dimension different - The symbol is referenced with more/less

indices as declared

## **** 1 ERROR(S) 0 WARNING(S)

## could anyone tell me why there has such error?

thank

\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.

To post to this group, send email to gams...@googlegroups.com.

Visit this group at http://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/d/optout.

–

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.

To post to this group, send email to gamsworld@googlegroups.com.

Visit this group at http://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/d/optout.