Last active
December 25, 2020 03:41
-
-
Save tieubinhco/4f75c6f64e31215941666058061ecac2 to your computer and use it in GitHub Desktop.
MATLAB script to calculate Economic Order Quantity Model (EOQ)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear | |
clc | |
%syms Q H S P D | |
D=40*10^6; | |
S=10000; | |
H=0.1; | |
P=5; | |
Working_days=250; %(days) | |
Lag_time=7; %(days) | |
%syms Q | |
%Q=linspace(0,10^9,10000); | |
EOQ=sqrt(2*S*D/H); | |
Q=EOQ; | |
Total_Order_Cost=(D/Q)*S; | |
Total_Holding_Cost=(Q/2)*H; | |
Capital_Cost=P*D; | |
TC=Total_Order_Cost+Total_Holding_Cost+Capital_Cost; | |
d=D/Working_days; %Demand on 1 day | |
R=d*Lag_time; %Reordering point | |
T=Q/d; %Ordering Cycle | |
%fplot(TC,[0,1000]) | |
%% Display values | |
EOQ | |
Total_Holding_Cost | |
TC | |
d | |
R | |
T |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment