xcyborg

15 Reputation

One Badge

11 years, 90 days

MaplePrimes Activity


These are questions asked by xcyborg


restart; printf("Factory Simulation: %s\n\n", Ghana*Chocolates); printf("Chocolate Factory Simulation Project .\n\n"); printf("%5a  %10a  %10a  %10a  %10a  %10a   \n", W, O(t, t+1), B(t), T(t), F(t), R(t)); printf(" ---------------------------------------------------------------------------\n"); _local(T, R, F, B, O, Q); initialise := proc (n) local i, t, a; T := proc (t) options operator, arrow; 250 end proc; R := proc (t) options operator, arrow; 150 end proc; F := proc (t) options operator, arrow; 250 end proc; B := proc (t) options operator, arrow; 50 end proc; for i to n do t := i; if B(t) < F(t) then Ds(t, t+1) := B(t) else Ds(t, t+1) := F(t) end if; M(t, t+1) := 50; O(t, t+1) := 50; P(t, t+1) := 50; if t = 2 then O(t, t+1) := 100 elif t = 3 then O(t, t+1) := 0 end if; P(t, t+1) := T(t)-F(t)+Ds(t, t+1); if R(t) < P(t, t+1) then P(t, t+1) := R(t) elif R(t) < 0 then P(t, t+1) := 0 end if; R(t+1) := R(t)+M(t, t+1)-P(t, t+1); F(t+1) := F(t)+P(t, t+1)-Ds(t, t+1); B(t+1) := B(t)+O(t, t+1)-Ds(t, t+1); R(t) := R(t+1); F(t) := F(t+1); B(t) := B(t+1); for a to t do Q(t, t+1) := O(t, t+1)+O(t-t+a, t-t+a+1) end do; T(t+1) := (t+1)*Q(t, t+1)/t; printf("%5a  %10a  %10a  %10a  %10a  %10a   \n", i, evalf[3](O(t, t+1)), evalf[3](B(t)), evalf[3](T(t)), evalf[3](F(t)), evalf[3](R(t))) end do; printf(" ---------------------------------------------------------------------------\n\n\n"); Restart; printf("%5a  %10a  %10a  %10a     \n", W, M(t, t+1), P(t, t+1), Ds(t, t+1)); printf(" ---------------------------------------------------------------------------\n") end proc; initialise(10)

    1         50.         50.        250.        250.        150.   
    2        100.        100.        200.        200.        200.   
    3          0.          0.        300.        300.         50.   
    4         50.         50.          0.          0.        400.   
    5         50.        100.        125.        125.        325.   
    6         50.         50.        120.        120.        280.   
    7         50.         50.        117.        117.        283.   
    8         50.         50.        114.        114.        286.   
    9         50.         50.        112.        112.        288.   
   10         50.         50.        111.        111.        289.   
 ---------------------------------------------------------------------------


    W          50      875/18          50     
 ---------------------------------------------------------------------------

 

NULL

NULL


Download suppress_warnins.mw

Hi All,

 

I need to suppress the warning messages when i try to pring my Table. Any help will be much apreciated.

 

Regards,

Xcyborg

  1. How can I represent the following in Maple?

 

(1) B(t+1) = B(t)+X (t,t+1)–D(t,t+1)

(2) T(t+1) =(m +1)/m(X(t,t+1)+X(t–1,t)+…+X (t–m+1,t–m+2))

Hi , i need to write some maple functions for the equations below and i am not sure if this should be arrays or not. please see the question below;

Consider a factory which manufactures only one product. Raw material is bought from external supplier and stored until required.

Finished items are held in a warehouse. The operation of factory and its warehouse

can be modelled as a set of equations as folllows.

 Let us define at time t :

R(t) = Raw material stored (units)

F(t) = finished goods stock (units)

B(t) = order backlog (units)

T(t) = target stock level for finished goods (units)

 

All variables defined above give quantities at the start of week t.

 

X( t, t+1 )= weekly orders received from customers

M( t, t+1 )= raw material supplied per week.

P( t, t+1 )= production per week.

D(t, t+1 )= amount dispatched to customers per week.

 

All variables defined above give quantities over week t to t+1

(i.e over the week t). The operation of the factory and its warehouse can be expressed

as a set of equations given as follows:

 

Backlog and Stock Position

(1) B(t+1) = B(t)+X (t,t+1)–D(t,t+1)

(2) T(t+1) =(m +1)/m(X(t,t+1)+X(t–1,t)+…+X (t–m+1,t–m+2))

 

(assuming that the company wishes to maintain m (suppose m=5)) weeks stock of

finish items and hence the target level is m times the average of the last m–1 weeks)

(3) R (t+1)=R(t)+M(t,t+1)–P(t,t+1)

(4) F (t+1)=F (t) +P(t,t+1)–D(t,t+1)

Rates

(5) D (t,t+1) = B(t) if B(t)<F(t)

F (t) otherwise

(6) M (t,t+1) = P(t–1,t)

(7) P (t,t+1) = T(t) – F(t) + D(t,t+1)

= R(t) if result exceeds R(t)

= 0 if the result is negative

 

Given the initial values for the variables, it is possible to simulate this system to study

how the system will respond to the order rate. Suppose that all is calm, and the factory

has operated as follows for the last five weeks.

Target warehouse stock = 250

Finished goods stock = 250

Raw material stock = 150

Production rate = 50/week

Material supply rate = 50/week

Order rate = 50/week

Order backlog = 50

 

Suppose the behaviour continues for the first week of the simulation but that during

next week orders double due to the sales promotion. During the third week orders

drops to zero as all demand returns of the previous week was satisfied. For the fourth

week and the succeeding weeks, demand returns to an order rate of 50/week. What

happens elsewhere in the system? A deterministic simulation will provide the answer

to the above mentioned question.

 

 For this compute the following.

i) The values of the equations (1)–(4) at the start of week t.

ii) The values of the equations (5)–(7) i.e. the new values of the rates during

the following week.

iii) Move simulation time to the start of the next week.

Next simulation should be presented in tabular form and plot production and demand

rate to examine the performance of the system.

 

All help will be much appreciated.

Best Regards,

 

Page 1 of 1