Capacity Planning---Need Help

Almost done---Need Help....Please

Page 1 of 1

4 Replies - 431 Views - Last Post: 18 October 2009 - 07:06 PM Rate Topic: -----

#1 Wiredlouis  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 01-March 09

Capacity Planning---Need Help

Post icon  Posted 18 October 2009 - 05:51 PM

Hi,

I already have started a topic on this, however, i'm not having having any luck getting some help. I have a working program that is giving me some of the proper output, but i really need some help on the functions that are not working.....namely R2,R3,V2,V3,V4.

Again, I apologize for starting the same topic again, but any help at all would greatly be appreciated.


Capacity Planning

Decision Parameters

DP1 Length of time interval = 1
DP2 Maximum planned inventory factor = 5
DP3 Receiving rate factor = 20
DP4 Receiving capacity = 50
DP5 Productivity factor = 10
DP6 Shipping capacity =35
DP7 Number of simulated periods = 31

Rates of Flow

R1 Order rate = 20
R2 Receiving Rate = 20
R3 Production Rate = 20
R4 Shipping Rate = 20


Volume

V1 Order Backlog = 20
V2 Desired Inventory = 100
V3 Raw materials inventory = 80
V4 Finished Goods Inventory = 100


Formulae

Delta T = DP1

V1(t) = V1 (t-1) + (R1(t) R4(t)) delta T

V2(t) = DP2 * delta T * [(sumR1(t-j)) /10].from j=0 to 9

V3(t) = V3 (t-1) + (R2(t) R3(t)) *delta T

V4(t) = V4 (t-1) + (R3(t) R4(t)) * delta T


R2(t) = { A = DP3 * V2 (t-1) / V4 (t-1), if A <= DP4

{ DP4, IF A > DP4


R3(t) = { B = V3(t-1) / (DP5 * delta T), IF B<= DP8

{ DP8, IF B> DP8


Output


Time Interval R1 R2 R3 R4 V1 V2 V3 V4


1 20 20 20 20 20 100 80 100

2 18 20 8 20 18 99 92 88

3 16 22.5 9.2 18 16 97 105.3 79.2

4 14 24.4 10.5 16 14 94 119 73

5 12 25.5 11.9 14 12 90 132.8 71.6

6 10 25.1 13.2 12 10 85 144.6 72.9

etc


#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main ()
{

	double R1[12],R2[12],R3[12],R4[12],V1[12],V2[12],V3[12],V4[12],DP1,DP2,DP3,DP4,DP5,DP6,DP7,DP8,A,B,sum;
	R1[0]=20,R2[0]=20,R3[0]=20,R4[0]=20, V1[0]=20, V2[0]=100, V3[0]=80, V4[0]=100, DP1=1, DP2=5, DP3=20, DP4=50, DP5=10, DP6=35, DP7=50, DP8=500;
	int t,j;
	sum=0;
	

	
		for (j=0;j<10; ++j)

		for (t=1;t<12; ++t)
	
	{
		V1[t] = ((R1[t] - R4[t])*DP1) + V1[t-1];

		V2[t] = ((sum+=R1[j])/10)*DP1*DP2;

		V3[t] = ((R2[t] - R3[t])*DP1) - V3[t-1];

		V4[t] = ((R3[t] - R4[t])*DP1) + V4[t-1];

		if (t<=1)
			R1[t]=20;
		else
			R1[t]=R1[t-1]-2;

		
				
			A = (DP3*V2[t-1])/V4[t-1];
			{

			if (A<= DP4)
				R2[t]=A;

			else
				R2[t]=DP4;
			}
		
			
		

		
			B= ((V3[t-1])/(DP5*DP1));

			if (B<=DP8)
				R3[t]=B;
			else
				R3[t]=DP8;
			
		
		

		

			if ( V1[t-1]<=min(V4[t-1],DP6*DP1))

				R4[t] = V1[t-1]/DP1;
				
			
			if (V4[t-1]<=min(V1[t-1],DP6*DP1))

				R4[t] = V4[t-1]/DP1;

			
			if ((DP6*DP1)<=min(V1[t-1],V4[t-1]))
		
				R4[t] = DP6;
		

	}
		
	cout.precision  (3);

	cout<< "Results for the Simulation\n";
	cout<<"\n";

 
	cout<<"Time	R1	R2	R3	R4	V1	V2	V3	V4\n";
	cout<<"---------------------------------------------------------------------------\n";

	for (t=1; t<12; ++t)

	{
		cout<<setw(2)<<t<<setw(8)<<R1[t]<<setw(8)<<R2[t]<<setw(8)<<R3[t]<<setw(8)<<R4[t]<<setw(8)<<V1[t]<<setw(8)<<V2[t]<<setw(8)<<V3[t]<<setw(8)<<V4[t]<<endl;
	}

	return 0;

}



Is This A Good Question/Topic? 0
  • +

Replies To: Capacity Planning---Need Help

#2 CommanderFett  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 9
  • Joined: 16-September 09

Re: Capacity Planning---Need Help

Posted 18 October 2009 - 06:06 PM

can you give me a copy of what you want the output to be? Which outputs would you say are correct and which do you think shoud be different?
Was This Post Helpful? 0
  • +
  • -

#3 Wiredlouis  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 01-March 09

Re: Capacity Planning---Need Help

Posted 18 October 2009 - 06:26 PM

View PostCommanderFett, on 18 Oct, 2009 - 05:06 PM, said:

can you give me a copy of what you want the output to be? Which outputs would you say are correct and which do you think shoud be different?


Here is what the output should look like:

Time, R1, R2, R3,R4,V1,V2,V3,V4 are the columns.......


Time R1 R2 R3 R4 V1 V2 V3 V4



1 20.00 20.00 20.00 20.00 20.00 100.00 80.00 100.00
2 18.00 20.00 8.00 20.00 18.00 99.00 92.00 88.00
3 16.00 22.50 9.20 18.00 16.00 97.00 105.30 79.20
4 14.00 24.49 10.53 16.00 14.00 94.00 119.26 73.73
5 12.00 25.50 11.93 14.00 12.00 90.00 132.84 71.66
6 10.00 25.12 13.28 12.00 10.00 85.00 144.67 72.94
7 8.00 23.31 14.47 10.00 8.00 79.00 153.51 77.41
8 6.00 20.41 15.35 8.00 6.00 72.00 158.57 84.76
9 4.00 16.99 15.86 6.00 4.00 64.00 159.70 94.62
10 2.00 13.53 15.97 4.00 2.00 55.00 157.26 106.59
11 0.00 10.32 15.73 2.00 0.00 45.00 151.86 120.31


In my program, R2, R3, V2, V3,V4 are not correct.......
Was This Post Helpful? 0
  • +
  • -

#4 CommanderFett  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 9
  • Joined: 16-September 09

Re: Capacity Planning---Need Help

Posted 18 October 2009 - 06:40 PM

I'll do my best to find the problem and get back to you before the end of tomorrow.
Was This Post Helpful? 0
  • +
  • -

#5 Wiredlouis  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 01-March 09

Re: Capacity Planning---Need Help

Posted 18 October 2009 - 07:06 PM

Thank you
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1