1 Introduction

Developing optimal production control policies that control production to match supply and demand in an uncertain environment has received considerable attention in the manufacturing systems control literature. The objective of this study is to extend the one-part-type, one-machine production flow rate control problem to incorporate uncertain sales price, production cost, and demand. The original production flow rate control problem considers the problem of deciding how to control the production rate of an unreliable machine to satisfy a constant demand for a single item to minimize costs associated with holding inventory and having backlog (Bielecki and Kumar 1988). The variations of the optimal flow-rate control problem for an unreliable machine subject to a constant demand source were analyzed in severals studies (Olsder and Suri 1980; Kimemia and Gershwin 1983; Akella and Kumar 1986; Bielecki and Kumar 1988; Malhamé 1993; Hu 1995). The optimal production policy in these cases is shown to be a hedging-type policy: the machine produces with the maximum rate until the surplus reaches a hedging level, and it does not produce if the surplus is above this level.

The flow rate control problem has been extended to study production systems under different uncertain environments. The flow rate control problems for systems where machine failures are modeled in a more detailed way by considering machines with multiple failure states and production rate-dependent failure rates have been analyzed (Sharifnia 1988; Liberopoulos and Caramanis 1994; Martinelli 2010; Francie et al. 2014). In addition to the expected cost criterion used for unreliable machine flow rate problems, an extension that considered Conditional Value-at-Risk criterion as the objective of the control problem was also studied (Ahmadi-Javid and Malhamé 2015).

Following the work on production control problems for failure-prone production systems, a production control problem where the uncertainty is due to demand variation has also been studied, (Fleming et al. 1987; Ghosh et al. 1993; Sethi et al. 1997; Perkins and Srikant 2001; Feng and Xiao 2002). This problem has been extended to study the problem of controlling production as well as deciding on purchasing extra capacity to meet fluctuating demand (Tan 2002b; Hu et al. 2004; Gershwin et al. 2009).

The initial motivation for the production flow rate control problem came from a factory setting where the flow rate of a machine is adjusted based on the state of the system in an uncertain factory environment. In recent years, the production flow rate control problem has also been used to analyze different settings in a supply chain where optimal production decisions are investigated in an uncertain environment. For example, the production flow rate control problems have been used to analyze cases where an additional source of production capacity, such as a subcontractor, can be utilized to meet uncertain demand (Tan 2002a; Tan and Gershwin 2004; Rivera-Gómez et al. 2016). The production flow rate problems have also been formulated for joint production and pricing decisions when uncertainty is due to machine failures (Shi et al. 2014).

In this study, we consider a setting where the demand rate changes depending on the market conditions, the sales price fluctuates due to competitive market conditions and/or changes in the exchange rates and the production cost fluctuates due to a variety of reasons including changes in raw material and component prices, changes in exchange rates, changes in energy prices, among other factors and a producer controls the production rate in order to respond these fluctuations in the most effective way. Using a continuous flow control model, we show that the optimal policy that maximizes the expected profit is a state-dependent hedging policy and evaluate the performance of the system under the henging policy.

We first analyze the performance of a special case where the production cost fluctuates between a high and a low level and the demand rate is constant. Then, the performance of the system when both the production cost and the demand rate fluctuate between high and low levels is analyzed. According to the state-dependent hedging policy, the producer produces only when the cost is low and the surplus is between the two hedging levels. However when the backlog is below the lower hedging level, the producer produces with the maximum capacity regardless of the cost level in order to bring the surplus level above the lower hedging level.

Through analytical and numerical results, we show the effects of the production capacity, average cost rate, and the cost variability on the optimal cost and on the optimal hedging levels for both the alternating cost-constant demand and the alternating cost-alternating demand models. For the alternating cost-alternating demand model, the effects of the demand variability and the dependency between the demand and cost have also been analyzed.

The main contribution of this study is extending the original flow rate control problem setting to study problems where uncertainty is due to sales price and production cost together with the demand uncertainty and showing the effects of production capacity, production cost, demand variability, and the dependency between the demand and cost on the production policy and on the optimal profit.

The organization of the remaining part of the paper is as follows. In Section 2, the model assumptions are given and the optimal production policy that maximizes the expected profit is shown to be a state-dependent hedging policy. The general methodology to analyze the performance of the system when the optimal production policy is used is given in Section 3. In Section 4, the performance of a specific model where the production cost changes between a high and a low level and the demand stays constant is analyzed. In Section 5, the performance of a model where both the production cost and also the demand change between high and low levels is analyzed. The effects of the production cost, production capacity, and demand on the performance of the system are analyzed numerically in Section 6. Finally, the conclusions are given in Section 7.

2 Model

A make-to-stock producer that produces a single product in a continuous material flow setting to meet random demand is studied.

At time t, the amount of surplus that is the difference between the cumulative production and cumulative demand is x(t). The finished goods inventory is \(x^+(t)= \max \{x(t),0\}\) and the backlog is \(x^-(t)=\max \{-x(t),0\}\). The inventory holding cost is h and the backlog cost is b.

The demand rate at time t is \(\delta (t)\) and the average demand is \(\overline{\delta }\). The production cost at time t is c(t) and the average cost is m. The sales price per amount of product sold at time t is p(t) that is assumed to be determined by the market conditions and the firm is a price taker. The average sales price is \({\overline{p}}\). Since all the demand is satisfied immediately, if \(x(t)>0\), or after a delay, if \(x(t) \le 0\), the revenue from sales is obtained immediately at the current market price but the production cost is incurred depending on the production policy. Therefore, the uncertainty in the sales price does not affect the production control policy. When an average profit rate criterion is used, the expected revenue per unit time will be \(E[p(t)\delta (t)]\) for all production policies. When p(t) and \(\delta (t)\) are independent, \(E[p(t)\delta (t)]={\overline{p}} \overline{\delta }\). In general, p(t) and \(\delta (t)\) can be dependent, \(E[p(t)\delta (t)]\) is denoted with \(\overline{p\delta }\) and the fluctuations in sales price are not considered explicitly without any loss of generality.

The state of the system at time t is \(s(t) = (x(t), \alpha (t))\) where x(t) is the surplus and \(\alpha (t)=(c(t),\delta (t))\), \(\alpha (t) \in S\), is the state of the random environment that changes its state according to a time-homogenous irreducible Markov chain on a finite set. We assume that there are k different environmental states. In state i, the production cost is \(c(t) = c_i\) and the demand rate is \(\delta (t) = \delta _i\), \(i=1,\dots ,k\). The transition times between the environmental states are exponential and given in the state-transition rate matrix \(\varLambda = \{\lambda _{ij}\}\).

The production rate of the manufacturing facility at time t is denoted by u(t), \(0 \le u (t) \le \mu \) where \(\mu \) is the maximum production rate of the manufacturing facility. We assume that the production capacity is sufficient to meet the demand in the long run, \(\mu >\overline{\delta }\). Note that if \(\mu \le \overline{\delta }\), the manufacturing facility must run at the maximum rate all the time.

2.1 Production Control Problem

The profit rate is the difference between the revenue generated through sales and the production, inventory carrying and backlog costs, which are assumed to be linear:

$$\begin{aligned} g(x(t),\alpha (t)) = p(t)\delta (t) - c(t) u(t) - hx^+(t) - bx^-(t). \end{aligned}$$
(1)

The objective is finding a feedback rule that determines the rate at which the goods are produced at the plant at time t, u(t) depending on the state of the system \((x(t),\alpha (t))\) to maximize the expected profit rate.

The profit of policy u(t) in the interval [0, T], \(J^{u}(x,\alpha ,T)\), is defined as

$$\begin{aligned} J^{u}(x,\alpha ,T)=E \left[ \int _{0}^{T} g(x(t),\alpha (t)) dt\right] \end{aligned}$$

where the expectation is taken with respect to the stochastic process \(\alpha (t)\) starting from the initial state \(x(0)=x\) and \(\alpha (0)=\alpha _0\). Similarly, the long-run average profit of policy u is defined as

$$\begin{aligned} \overline{J}^{u}=\lim \sup _{T\rightarrow \infty }\frac{1}{T}J^{u}(x,\alpha ,T). \end{aligned}$$

The production control problem is

$$\begin{aligned} \overline{J}^{*}=\max _{u}\overline{J}^{u} \end{aligned}$$
(2)

subject to

$$\begin{aligned}&\frac{dx}{dt} = u(t) - \delta (t) \end{aligned}$$
(3)
$$\begin{aligned}&0 \le u(t) \le \mu \end{aligned}$$
(4)
$$\begin{aligned}&c(t) = c _i \;\; \mathrm{when } \;\; \alpha (t) = i, \;\; i=1,2,\dots ,k \end{aligned}$$
(5)
$$\begin{aligned}&\delta (t) = \delta _i \;\; \mathrm{when } \;\; \alpha (t) = i, \;\; i=1,2,\dots ,k \end{aligned}$$
(6)
$$\begin{aligned}&\textit{Markov dynamics for }\alpha (t) \textit{ with rate matrix } \varLambda =\{\lambda _{ij}\}. \end{aligned}$$
(7)

2.2 Characterization of the Policy

In the previous studies where the uncertainty is due to production capacity and/or demand, the main objective of the production strategy is determining how to build an inventory to protect the system for the periods when the production capacity is not sufficient to satisfy the demand. However, in the problem considered in this study, the uncertainty is due to the changes in sales price, production cost, and demand. Accordingly, the objective is determining the right strategy of building an inventory to benefit from lower production costs while meeting supply and demand in the most effective way. When a producer has sufficient capacity to meet the demand and also build an inventory, the producer can increase its profits by producing in advance when the production cost is low and balancing the production cost benefit with the costs of carrying inventory and backlog.

The problem considered in this study is similar to the flow rate control problem studied in the literature. In Equation (1), the effect of random production cost is captured in the term c(t)u(t) where c(t) follows a Markov process and the capacity of u(t) is constant. In the models where the uncertainty is due to random changes in production capacity due to machine failures, c(t) is constant but the capacity of u(t) is random.

The problem of minimizing the long-run average cost of holding inventory and/or purchasing extra capacity for a reliable single facility producing a single part-type to meet fluctuating demand has been analyzed in the literature (Hu et al. 2004). Hu et al. (2004) study a problem where a Markov chain modulates the capacity bound, the demand rate, and the production cost. By using the general results for optimal production planning in a stochastic manufacturing system with long-run average cost (Sethi et al. 1998), they show that the optimal policy is a hedging type policy where there is a hedging level for each state. In a discrete state space and continuous time model, Karabağ and Tan (2018) analyze the purchasing, production, and sales policies for a continuous-review discrete material flow production/inventory system with fluctuating and correlated purchasing and sales prices, exponentially distributed raw material and demand inter-arrival times, and processing time and prove that the optimal purchasing, production, and sales strategies are state-dependent threshold policies for the infinite-horizon Markov decision process under the average reward criterion.

The structure of the optimal control problem (2)-(7) is similar to the model for a single reliable producer meeting fluctuating demand by controlling its production rate and purchasing extra capacity when there are k demand states where the demand rate is \(\delta _i\) is state i, the rate matrix for transitions among demand states is \(\varLambda \), and the cost of production in state i is \(c_i\) (Hu et al. 2004). The main difference is that the production capacity of the system analyzed in this study is not always sufficient to meet the demand rate, as opposed to the case with the option of purchasing extra capacity to meet the demand when it is necessary. The possibility of not meeting the demand in certain states was addressed by Sethi et al. (1998).

As a result, the proofs of the convexity of the differential cost function, uniqueness of the optimal cost, and the optimality of the hedging policy given in the literature, (Sethi et al. 1998) and (Hu et al. 2004), allow us to state the the optimal control policy for our model as a state-dependent hedging policy.

The optimal policy states that there is a hedging level for each state i, denoted with \(Z_i\). When the surplus level is above the hedging level for the current state, the production stops. When it is below this level, the production facility operates with the maximum rate \(\mu \). In order to avoid switching between 0 and \(\mu \) back and forth just above and just below \(Z_i\), it is reasonable to set \(u=\delta _i\) when \(x=Z_i\) (Gershwin 1994).

As a result, the optimal production control policy for the production control problem with price, cost, and demand uncertainty is described as

$$\begin{aligned} u^{*}(x,i)=\left\{ \begin{array} [c]{l} 0, \;\;x>Z_i\\ \delta _i, \;\;x=Z_i\\ \mu , \;\;x<Z_i \end{array}, \;\;i=1,2,\dots ,k. \right. \end{aligned}$$
(8)

3 Analysis of the General Model

Let the hedging levels ordered from the smallest one, \(Z_{(1)}\) to the largest one, \(Z_{(k)}\): \(Z_{(1)} \le Z_{(2)} \le \dots \le Z_{(k)}\). The states in S are then indexed according to this order, i.e., \(Z_{1} \le Z_{2} \le \dots \le Z_{k}\).

The internal equations are analyzed in k+1 regions defined by the hedging levels \(Z_j\), \(j \in \{1,\dots ,k\}\). The region where \(x>Z_k\) will be transient since the surplus level will decrease to \(Z_k\) in all states. Therefore there will be \(k-1\) internal regions to be analyzed in the steady-state.

The time-dependent probability density when the surplus is in region j where \(Z_{j-1}< x < Z_j\) is defined as

$$\begin{aligned} f_j(x,i,t) = \frac{\partial }{\partial x} \text{ prob }[x(t) \le x, \alpha (t)=i],\;\; Z_{j-1}< x < Z_j,\;\;j=1,\dots ,k-1. \end{aligned}$$

It is assumed that the process is ergodic and the steady-state probabilities exist. The steady-state density functions are defined as

$$\begin{aligned} f_j(x,i) = \lim _{t \rightarrow \infty } f_j(x,i,t),\;\;j=1,\dots ,k-1. \end{aligned}$$
(9)

The steady-state distribution is determined by analyzing the continuous time, continuous and discrete state space Markov process. First, the differential equations that describe the dynamics of the system when the buffer is in an interior region are derived and then the probability masses at the hedging levels are determined.

Relating the probability density of the state at time \(t+\delta t\) to the probability density of the state at time t yields the following equations for all \(i \in S\) and \(j=1,\dots ,k-1\):

$$\begin{aligned} f_j(x,i,t+\delta t)= & {} f_j(x-(u(x,i)-\delta _i)\delta t,i,t)\left( 1 -\mathop {\sum }\limits _{{\begin{array}{c}i^\prime =1\\ i^\prime \ne i\end{array}}}^{k} \lambda _{ii^\prime } \delta t \right) \nonumber \\&+ \sum _{\begin{array}{c}i^\prime =1\\ i^\prime \ne i\end{array}}^{k} f_j(x-(u(i^\prime ,x)-\delta _{i^\prime })\delta t,i^\prime ,t)\lambda _{i^\prime i}\delta t. \end{aligned}$$
(10)

The above equation can also be written in differential form by setting \(\delta t \rightarrow 0\) as

$$\begin{aligned}&\frac{\partial {f_j(x,i,t)}}{\partial t} + (u(x,i)-\delta _i)\frac{\partial {f_j(x,i,t)}}{\partial x} \nonumber \\&\quad = -f_j(x,i,t)\left( \mathop {\sum }\limits _{{\begin{array}{c}i^\prime =1\\ i^\prime \ne i\end{array}}}^{k} \lambda _{ii^\prime } \right) + \sum _{\begin{array}{c}i^\prime =1\\ i^\prime \ne i\end{array}}^{k} f_j(x,i^\prime ,t)\lambda _{i^\prime i}. \end{aligned}$$
(11)

In the steady state, the above equation yields \(k(k-1)\) equations given below:

$$\begin{aligned} (u(x,i)-\delta _i)\frac{\partial {f_j(x,i)}}{\partial x}= & {} -f_j(x,i)\left( \mathop {\sum }\limits _{{\begin{array}{c}i^\prime =1\\ i^\prime \ne i\end{array}}}^{k} \lambda _{ii^\prime } \right) \nonumber \\&+ \sum _{\begin{array}{c}i^\prime =1\\ i^\prime \ne i\end{array}}^{k} f_j(x,i^\prime )\lambda _{i^\prime i}, \;\;i\in S, \;\;j=1,\dots ,k-1.\nonumber \\ \end{aligned}$$
(12)

When the producer uses the optimal production policy, the production rate u(xi) is set to either 0 if \(x>Z_i\), to \(\delta _i\) if \(x=Z_i\), or to \(\mu \) if \(x<Z_i\) as given in Equation (8). Accordingly, the coefficient of \(\frac{\partial {f_j(x,i)}}{\partial x} \) in Equation (12) will be \(-\delta _i\) if \(x>Z_i\), and 0 if \(x=Z_i\), and \(\mu - \delta _i\) if \(x<Z_i\).

Let the steady-state probabilities in Region j be arranged in column vectors as

$$\begin{aligned} \mathbf f _j(x) = \{ f_j(x,i)\}, \;\; {\mathrm{for}} \;\; i \in S, \;\; Z_{j-1}< x < Z_j, \;\; j=1,\dots ,k-1 \end{aligned}$$
(13)

where \(Z_0\) is set to \(-\infty \).

Then the internal equations given in Equation (12) can be written in a matrix form for each region as

$$\begin{aligned} {\frac{{\partial \mathbf f _j (x)}}{{\partial x}}}= \varOmega _j \mathbf f _j, \quad j=1,\dots ,k-1. \end{aligned}$$
(14)

The solution of this first-order matrix differential equation is

$$\begin{aligned} \mathbf f _j = e^{\varOmega _j x}{} \mathbf w _j, \quad j=1,\dots ,k-1 \end{aligned}$$
(15)

where \(e^{\varOmega _j x}\) is the matrix exponential determined by matrix \(\varLambda _j\) and \(\mathbf w _j\) is a column vector of length k. Since the length of \(\mathbf w _j\) is k, \(k(k-1)\) equations are needed to determine the weights uniquely.

The necessary boundary equations are derived with a level crossing analysis (Tan and Gershwin 2009). Let L(xiT) denote the number of level crossings in state (xi). The expected number of level crossings per unit time in the long run is determined by the densities and the flow rates as

$$\begin{aligned} \mathop {\lim }\limits _{T \rightarrow \infty } \frac{{L(x,i,j,T)}}{T} = |u(x,i)-\delta _i|f(x,i). \end{aligned}$$
(16)

In state i and region j, if \(u(x,i)>\delta _i\), \((u(x,i)-\delta _i)f_j(x,i)\) is the expected number of upward crossings at buffer level x per unit time and if \(u(x,i)<\delta _i\), \((\delta _i-u(x,i))f_j(x,i)\) is the expected number of downward crossings per unit time.

The probability of state \((Z_j,i)\) at time t is denoted by \(\mathbf {prob} (Z_j,i,t)\) and the corresponding steady-state probability is denoted by

$$\begin{aligned} \mathbf {prob} (Z_j,i) = \mathop {\lim }\limits _{t \rightarrow \infty } \mathbf {prob} (Z_j,i,t). \end{aligned}$$
(17)

The probability masses at the hedging levels are determined by the probability densities in the neighbor regions and the expected time spent at the hedging level each time the surplus reaches that level.

4 Analysis of the Alternating Cost and Constant Demand Model

In this part, a special case of the model described in Section 2 is analyzed when the production cost alternates between a high and a low level and the demand is constant and equal to \(\overline{\delta }<\mu \).

4.1 Model Description

In this case, the state of the environment is determined by the state of the cost at time t which is either high (H) or low (L), i.e., \(S = \{\mathrm{H},\mathrm{L}\}\). When the cost is high, the cost rate is \(c(t) = c _{\mathrm{H}}\) and when the cost is low, the cost rate is \(c(t) = c _{\mathrm{L}}\), \(c _{\mathrm{H}}>c _{\mathrm{L}}\).

Following the optimal policy given for the general model in Equation (8), the optimal policy for the alternating cost model is described by two hedging levels \(Z_{\mathrm{H}}\) and \(Z_{\mathrm{L}}\) for the cost states H(igh) and L(ow) respectively. Figure 1 depicts the sample path of the system when the production rate is set according to the optimal policy.

Fig. 1
figure 1

Sample Path of the System with the Double Hedging Policy (\(\mu = 1\), \(\overline{\delta }= 0.8\), \(c _{\mathrm{H}}=1.5\), \(c _{\mathrm{L}}=0.5\), \(Z _{\mathrm{L}} = 3\), \(Z_{\mathrm{H}} = -2\), \(\lambda _{\mathrm{{HL}}} = 0.08\), \(\lambda _{\mathrm{{LH}}} = 0.02\)

The times to switch from a high cost state to a low cost state and from a low cost state to a high cost state are exponentially distributed random variables with rates \(\lambda _{\mathrm{{HL}}}\) and \(\lambda _{\mathrm{{LH}}}\).

With the high and low levels of cost and the switching rates, the average cost rate, m is

$$\begin{aligned} m = c_{\mathrm{L}} + (c_{\mathrm{H}}-c_{\mathrm{L}}) \frac{\lambda _{\mathrm{LH}}}{\lambda _{\mathrm{LH}}+\lambda _{\mathrm{HL}}}. \end{aligned}$$
(18)

The asymptotic variance of the cost per time \(V_c\), (Tan 1997), is given as:

$$\begin{aligned} V_c = {\mathop {\lim } \limits _{t \rightarrow \infty } } \frac{Var[\int _0^t c(\tau )d\tau ]}{t} = 2(c_{\mathrm{H}}-c_{\mathrm{L}})^2 \frac{\lambda _{\mathrm{LH}}\lambda _{\mathrm{HL}}}{(\lambda _{\mathrm{LH}}+\lambda _{\mathrm{HL}})^3}. \end{aligned}$$
(19)

As a measure of cost variability, the squared coefficient of variation of cost \(cv^2\) is used. It is defined as

$$\begin{aligned} cv_m^2 = {\mathop {\lim } \limits _{t \rightarrow \infty } } \frac{Var[\int _0^t c(\tau )d\tau ]t}{E^2[\int _0^t c(\tau )d\tau ]} = \frac{V_c}{m^2}. \end{aligned}$$
(20)

The alternating renewal process for the cost with exponential switching times describes a stationary cost process with temporary mean shift due to market conditions. Although there are two discrete levels in this model, the accumulated production cost in a given time interval is asymptotically normal (Tan 1997). Accordingly, the first and the second moments of the cost can be used to analyze the effects of cost variability on the performance of the system.

4.2 Hedging Levels for the Optimal Policy

In the long run, the system operates with two hedging levels \(Z_{\mathrm{H}} \le 0 \le Z_{\mathrm{L}}\). Since \(c_{\mathrm{H}} > c_{\mathrm{L}}\), \(Z_{\mathrm{L}}\) must greater than or equal to \(Z_{\mathrm{H}}\). Otherwise, when \(Z_{\mathrm{L}}<Z_{\mathrm{H}}\), the manufacturer produces when the production cost is high. This in turn decreases the profit. When \(Z_{\mathrm{L}} \ge Z_{\mathrm{H}}\) and the optimal policy is followed, x stays between the lower hedging level \(Z_{\mathrm{H}}\) and the upper hedging level \(Z_{\mathrm{L}}\). Since \(Z_{\mathrm{H}} \le x \le Z_{\mathrm{L}}\), the profit cannot be optimal if \(Z_{\mathrm{L}} < 0\). Because when \(Z_{\mathrm{L}} < 0\), it is possible to increase \(Z_{\mathrm{L}}\) to 0 and decrease the average backlog. Similarly, the profit cannot be optimal if \(Z_{\mathrm{H}} > 0\). Because when \(Z_{\mathrm{H}} > 0\), it is possible to decrease \(Z_{\mathrm{H}}\) to 0 and lower the average inventory.

The process when \(x<Z_{\mathrm{H}}\) and \(x>Z_{\mathrm{L}}\) will be transient and the buffer level stays between these two hedging levels: \(Z_{\mathrm{H}} \le x \le Z_{\mathrm{L}}\).

4.3 Analysis of the Model

The analysis of the model when \(Z_{\mathrm{{L}}}=Z_{\mathrm{{H}}}=0\) is straight forward. When \(Z_{\mathrm{{L}}}=0\), the producer cannot build an inventory by producing in advance during the periods where the production cost is low. If there is no benefit of setting \(Z_{\mathrm{{H}}}<0\), when \(Z_{\mathrm{{L}}}=Z_{\mathrm{{H}}}=0\), the producer produces all the time regardless of the instantaneous level of the production cost; the average inventory is 0, and the average backlog is 0. As a result, for the case \(Z_{\mathrm{{L}}}=Z_{\mathrm{{H}}}=0\), the average profit per unit time in Equation (2) is

$$\begin{aligned} {\overline{J}} = ({\overline{p}}-m){\overline{\delta }}. \end{aligned}$$
(21)

When \(Z_{\mathrm{{H}}} \ne Z_{\mathrm{{L}}}\) and \(Z_{\mathrm{{H}}} \le 0 \le Z_{\mathrm{{L}}}\), the probability distribution of x(t) is necessary to determine the average profit rate. The probability distribution is given in the next section.

4.3.1 Probability distribution

In the alternating cost and constant demand model, there are two states and two hedging levels. Since \(\mu >{\overline{\delta }}\), the dynamics in the regions where \(x>Z_{\mathrm{{L}}}\) and \(x<Z_{\mathrm{{H}}}\) will be transient. As a result, there will be one region, \(Z_{\mathrm{{H}}}<x<Z_{\mathrm{{L}}}\) to be analyzed.

When the cost is low (state L), the producer will produce with the maximum rate and the surplus will increase with rate \(\mu - \overline{\delta }\). When the cost is high (state H), the producer will stop production and the surplus will decrease with rate \(\overline{\delta }\). Accordingly, the matrix \(\varOmega _1\) that defines the differential equations for the probability densities

$$\begin{aligned} \mathbf f _1(x) = [f_1(x,{\mathrm{H}}), f_1(x,{\mathrm{L}})]^T, \end{aligned}$$

for the interior region is given as

$$\begin{aligned} \varOmega _1 = \left[ {\begin{array}{cc} \frac{\lambda _{\mathrm{{HL}}}}{\overline{\delta }}&{} -\frac{\lambda _{\mathrm{{LH}}}}{\overline{\delta }}\\ \frac{\lambda _{\mathrm{{HL}}}}{\mu -\overline{\delta }}&{} -\frac{\lambda _{\mathrm{{LH}}}}{\mu -\overline{\delta }} \end{array}} \right] . \end{aligned}$$
(22)

Once the steady-state densities are determined, the probability masses at the hedging levels \(Z_{\mathrm{{H}}}\) and \(Z_{\mathrm{{L}}}\) can be determined. Since the surplus level increases when the cost is low and the producer produces with the maximum rate, \(Z_{\mathrm{{L}}}\) can be reached only in state L and the process stays there until the cost becomes high and the producer stops producing. Therefore, the steady-state probability that the process stays at \(Z_{\mathrm{{L}}}\), denoted with \(P^{Z_{\mathrm{L}}}\), is equal to the average number of times the process reaches \(Z_{\mathrm{{L}}}\) in state L times the average time it stays there. By using Equation (16), we can write

$$\begin{aligned} P^{Z_{\mathrm{L}}}= & {} {\mathop {\lim } \limits _{t \rightarrow \infty } } \mathbf {prob} [x(t) = Z_{\mathrm{L}} ] = \frac{\mu -{\overline{\delta }} }{\lambda _{\mathrm{LH}}} f_1(Z_{\mathrm{L}},{\mathrm{L}}). \end{aligned}$$
(23)

Similarly, the surplus decreases and reaches the lower hedging level \({Z_{\mathrm{H}}}\) only when the cost is high and the producer stops producing. Accordingly, the steady-state probability that the surplus is equal to \({Z_{\mathrm{H}}}\), \(P^{Z_{\mathrm{H}}}\) can be written as

$$\begin{aligned} P^{Z_{\mathrm{H}}}= & {} {\mathop {\lim } \limits _{t \rightarrow \infty } } \mathbf {prob} [x(t) = Z_{\mathrm{H}} ] = \frac{{\overline{\delta }} }{\lambda _{\mathrm{HL}}} f_1(Z_{\mathrm{H}},{\mathrm{H}}). \end{aligned}$$
(24)

Two boundary conditions are necessary to determine the weight vector \(\mathbf w _1\) that yields the solution for the steady-state density functions given in Equation (15). In the long run, the number of upward crossings at a surplus level x must be equal to the number of downward crossings. By using Equation (16) that gives the number of level crossings based on the steady-state probability density functions, the first boundary equation is given as

$$\begin{aligned} {\overline{\delta }}f_1(x,{\mathrm{H}}) = ({\mu - \overline{\delta }})f_1(x,{\mathrm{L}}). \end{aligned}$$
(25)

The second boundary condition is the normalization:

$$\begin{aligned} \int _{Z_{\mathrm{H}}}^{Z_{\mathrm{H}}} \left( f_1(x,{\mathrm{H}}) + f_1(x,{\mathrm{L}})\right) dx + P^{Z_{\mathrm{H}}} + P^{Z_{\mathrm{L}}} = 1. \end{aligned}$$
(26)

The solution for the probability density functions is given as

$$\begin{aligned} f_1(x,{\mathrm{H}}) =&{\left\{ {\begin{array}{ll} {k{e^{\eta x}}}&{}{\eta \ne 0}\\ k&{}{\eta = 0} \end{array}} \right. },&{Z_{\mathrm{{H}}}}< x < {Z_{\mathrm{{L}}}}, \end{aligned}$$
(27)
$$\begin{aligned} f_1(x,{\mathrm{L}}) =&{\left\{ {\begin{array}{*{20}{l}} {k{\frac{{\overline{\delta }} }{{\mu }-{\overline{\delta }} }}{e^{\eta x}}}&{}{\eta \ne 0}\\ k{\frac{{\overline{\delta }} }{{\mu }-{\overline{\delta }} }}&{}{\eta = 0} \end{array}} \right. },&\quad {Z_{\mathrm{{H}}}}< x < {Z_{\mathrm{{L}}}} \end{aligned}$$
(28)

where

$$\begin{aligned} \eta = {\frac{{\lambda _{\mathrm{HL}}}}{{\overline{\delta }} }} - {\frac{{\lambda _{\mathrm{LH}}}}{{{\mu }-{\overline{\delta }} } }} \end{aligned}$$
(29)

and k is given as

$$\begin{aligned} k =\left\{ {\begin{array}{ll} \left( {\left( {\frac{ {\overline{\delta }} }{\lambda _{\mathrm{{HL}}}} - \frac{\mu }{\eta ({\mu } - {\overline{\delta }}) } } \right) {e^{\eta {Z_{\mathrm{{H}}}}}} + \left( {\frac{{\overline{\delta }} }{\lambda _{\mathrm{{LH}}}} + \frac{\mu }{\eta ({\mu } - {\overline{\delta }}) } } \right) {e^{\eta {Z_{\mathrm{{L}}}}}}} \right) ^{ - 1},&{}{\eta \ne 0} \\ \left( \frac{ {\overline{\delta }}}{\lambda _{\mathrm{{LH}}}} + \frac{ {\overline{\delta }}}{\lambda _{\mathrm{{HL}}}} - \frac{\mu }{{\mu }-{\overline{\delta }}}(Z_{\mathrm{H}} - Z_{\mathrm{L}})\right) ^{-1},&{}{\eta = 0} \end{array}}. \right. \end{aligned}$$

4.3.2 Evaluation of the Objective Function

In order to determine the optimal values of the hedging levels, the average profit rate is determined by using the probability distribution derived in the preceding section.

The probabilities that the process is in the interior region in the long run when the cost is high, \(P^{\mathrm{H}}\), and when it is low, \(P^{\mathrm{L}}\), are defined as

$$\begin{aligned} P^{\mathrm{H}}= & {} {\mathop {\lim } \limits _{t \rightarrow \infty } } \mathbf {prob} [Z_{\mathrm{H}}< x(t) < Z_{\mathrm{L}}, c(t)=\mathrm{H} ] = {\int _{Z_{\mathrm{H}}}^{Z_{\mathrm{L}}} f_1(x,{\mathrm{H}})dx}, \end{aligned}$$
(30)
$$\begin{aligned} P^{\mathrm{L}}= & {} {\mathop {\lim } \limits _{t \rightarrow \infty } } \mathbf {prob} [Z_{\mathrm{H}}< x(t) < Z_{\mathrm{L}}, c(t)=\mathrm{L} ] = {\int _{Z_{\mathrm{H}}} ^{Z_{\mathrm{L}}} f_1(x,{\mathrm{L}})dx}. \end{aligned}$$
(31)

The average profit rate excluding the inventory and backlog costs, \(\varPi \) is evaluated from Equation (1) as

$$\begin{aligned} \varPi = {{\overline{p}}}{\overline{\delta }} - \left( {{\mu } P^{\mathrm{L}}} + {\overline{\delta }} P^{Z_{\mathrm{L}}}\right) c_{\mathrm{L}} - {\overline{\delta }} P^{Z_{\mathrm{H}}} c_{\mathrm{H}}. \end{aligned}$$
(32)

In the above equation, the first term is the revenue obtained from sales. Since backlog is allowed, all the demand is satisfied either instantly from the available inventory or after a delay if the inventory is not available. As a result, in the long run, the revenue rate generated from demand is \({{\overline{p}}}{\overline{\delta }}\). The second term is the cost rate due to production when the cost is low. In this case, the producer produces with the maximum rate in the interior region and with the demand rate at the upper hedging level. Finally, the last term is the cost rate due to production when the cost is high and the backlog is at the lower hedging level.

Since the production rate is equal to the demand rate in the long term,

$$\begin{aligned} {\mu } P^{\mathrm{L}} + {\overline{\delta }} P^{Z_{\mathrm{L}}} + {\overline{\delta }} P^{Z_{\mathrm{H}}} = {\overline{\delta }}. \end{aligned}$$

With this equality, \(\varPi \) can be written as

$$\begin{aligned} \varPi = {\overline{\delta }}\left( {\overline{p}} - {\overline{c}} \right) \end{aligned}$$
(33)

where the average production cost incurred under the policy \({\overline{c}}\) is

$$\begin{aligned} {\overline{c}} = (1-P^{Z_{\mathrm{H}}})c_{\mathrm{L}} + P^{Z_{\mathrm{H}}} c_{\mathrm{H}}. \end{aligned}$$
(34)

Note that when \(Z_{\mathrm{H}}\) is set to \(-\infty \), \(P^{Z_{\mathrm{H}}}\) approaches to 0, and the average production cost incurred turns out to be \(c_{\mathrm{L}}\) since the producer produces only when the cost is low. Since producing only when the production cost is low causes a high backlog cost, the optimal policy determines the optimal hedging levels based on the sales price, production, holding, and backlog costs so that the average production cost is balanced with the other costs and the revenue.

The average inventory level \(E[x^+]\) and the average backlog level \(E[x^-]\) are given as

$$\begin{aligned} E[x^+]= & {} {\int _{0}^{Z_{\mathrm{L}}} {xf_1(x,{\mathrm{H}}) + f_1(x,{\mathrm{L}}))}dx} + Z_{\mathrm{L}}P^{Z_{\mathrm{L}}}, \end{aligned}$$
(35)
$$\begin{aligned} E[x^-]= & {} -{\int _{Z_{\mathrm{H}}}^{0} {xf_1(x,{\mathrm{H}}) + f_1(x,{\mathrm{L}}))}dx}- Z_{\mathrm{H}}P^{Z_{\mathrm{H}}} . \end{aligned}$$
(36)

Finally, the average profit per unit time defined in Equation (2) is

$$\begin{aligned} {\overline{J}} = {\varPi } - h E[x^+] - b E[x^-]. \end{aligned}$$
(37)

Since the probability distribution of x is given in Equations (27)-(31), a closed-form expression for \({\overline{J}}\) is available. The optimal values of \(Z_{\mathrm{L}}\) and \(Z_{\mathrm{H}}\) are determined by solving the following maximization problem:

$$\begin{aligned}&\max \limits _{Z_{\mathrm{L}}, Z_{\mathrm{H}}} {\overline{J}} \nonumber \\ \text{ subject } \text{ to }&\nonumber \\&Z_{\mathrm{H}} \le 0 \le Z_{\mathrm{L}} . \end{aligned}$$
(38)

4.4 Analytical Solution of a Special Case

In order to examine the effects of variability, the average cost rate and the asymptotic squared coefficient of variation of the cost, m and \(cv^2_m\) given in Equations (18) and (20) respectively, are used to set \(\lambda _{\mathrm{LH}}\) and \(\lambda _{\mathrm{HL}}\). In order to simplify the discussion, the number of system parameters is decreased by defining new units for normalization without loss of generalization. The average sales price \({\overline{p}}\) is set to 1 by normalizing the unit of money. The demand rate \({\overline{\delta }}\) is set to 1 by normalizing the unit for volume of material. For the given average cost per time m, expressed with the new unit of money, and the given coefficient of variation of the cost, \(cv^2\), \(c_{\mathrm{H}}\) is set to 1 and \(c_{\mathrm{L}}\) is set to 0 by normalizing the unit of time.

In this setting, the switching rates are determined by the average and coefficient of variation of cost through Equations (18), (19), and (20) as:

$$\begin{aligned} \lambda _{\mathrm{LH}} = \frac{2(1-m)}{cv^2},\\ \lambda _{\mathrm{HL}} = \frac{2(1-m)^2}{cv^2m}. \end{aligned}$$

First, the analysis of a special case where the lower hedging level, \(Z_{\mathrm{H}}\), is 0 and \(\eta =0\) is given. This special case yields a compact closed-form expression for the hedging levels in terms of the system parameters. This expression is then used to gain insights about the overall effects of system parameters.

When the backlog cost is high compared to the sales price, production, and inventory holding costs or when the firm wants to meet all the demand without a backlog, the lower hedging level is set as \(Z_{\mathrm{H}}=0\). Since the producer produces with the demand rate when \(Z_{\mathrm{H}}=0\) and the cost is high, all the demand is satisfied without a backlog and \(\mathbf {prob} [x(t)< 0]=0\). Furthermore, \(\eta \) defined in Equation (29) is assumed to be 0. Under this setting, \(\mu = \frac{1}{1-m}\) and \({\overline{J}}\) can be written in closed-form as a function of \(Z_{\mathrm{L}}\) as

$$\begin{aligned} {\overline{J}} = (1-m)\frac{-h(m-1)Z_{\mathrm{L}}^2 + \left( 2(1-m) -cv^2hm\right) Z_{\mathrm{L}}-cv^2m}{2(1-m)^2Z_{\mathrm{L}}+mcv^2}. \end{aligned}$$
(39)

Since \(Z_{\mathrm{L}} \ge 0\), the optimal hedging level is derived in terms of the system parameters as

$$\begin{aligned} Z_{\mathrm{L}}^* = \max \left\{ 0,m cv \frac{\sqrt{(4(m-1)^2 + cv^2 h (2m-1))}- cv\sqrt{h}}{2 \sqrt{h}(m - 1)^2} \right\} . \end{aligned}$$
(40)

By using Equations (39) and (40), we can show that the optimal upper hedging level is positive if \(h < \frac{2(1-m)}{cv^2}\) and 0 if \(h \ge \frac{2(1-m)}{cv^2}\). In words, in order to benefit from producing in advance and holding inventory when the cost is low, the holding cost should be lower than a threshold that depends on the average cost and the squared coefficient of the cost. Furthermore, when \(Z_{\mathrm{L}}>0\), as the holding cost increases the upper hedging level decreases. For this case, as the cost variability increases, the behavior of the upper hedging level depends on the other parameters.

The performance of the alternating cost-constant demand model is analyzed for a range of system parameters in Section 6.

5 Analysis of the Double-Hedging Policy for the Alternating Cost and Alternating Demand Model

We now consider the case where both the production cost and also the demand fluctuates between two levels. We will analyze the case where the production capacity is sufficient to meet the average demand but not sufficient to meet the demand when it is high. Note that the dynamics of the system when \(\mu \) is greater than the high demand rate is similar to the model analyzed in Section 4.

The state of the cost at time t is either high (H) or low (L) and the state of the demand at time t is also either high (H) or low (L). When the cost is high, the cost rate is \(c(t) = c _{\mathrm{H}}\) and when the cost is low, the cost rate is \(c(t) = c _{\mathrm{L}}\), \(c _{\mathrm{H}}>c _{\mathrm{L}}\).

When the demand is high, the demand rate is \(\delta (t) = \delta _{\mathrm{H}}>\mu \) and when the demand is low, the demand rate is \(\delta _{\mathrm{L}}<\mu \). The average demand rate \(\overline{\delta }\) and the coefficient of variation of demand \(cv^2_d\) are determined based on \(\delta _{\mathrm{L}}\), \(\delta _{\mathrm{H}}\), and the transition rates between the low and high demand rates by using Equation (18) and (20) after substituting the demand parameters for the corresponding cost parameters.

In this case, there are four states in the environment \(S = \{(c(t),d(t))\} \in \{\mathrm{LH}, \mathrm{LL}, \mathrm{HL}, \mathrm{HH} \}\). The state-transition rates are given in matrix \(\varLambda = \{\lambda _{ij}\}\) where \(j\in \{1,2,3,4\}\) according to the ordering of states in S. This model allows capturing possible dependency between the demand rates and production costs in different states.

Since there are four states in the environment, the optimal policy will use four hedging levels. Based on the dynamics of the system, the hedging levels will be ordered as \(Z_{\mathrm{{LH}}}>Z_{\mathrm{{LL}}}>0>Z_{\mathrm{{HL}}}>Z_{\mathrm{{HH}}}\). Since \(\mu >\delta _{\mathrm{L}}\), the region above \(Z_{\mathrm{{LL}}}\) will be transient. In the steady-state, the optimal policy will operate with three hedging levels and there will be probability masses at only two of the hedging levels \(Z_{\mathrm{{LL}}}\) and \(Z_{\mathrm{{HL}}}\).

In order to compare the performance of the alternating cost-alternating demand model with the alternating cost-constant demand model, the performance of the system is analyzed under the double-hedging policy that is based on the cost state: an upper hedging level at \(Z_{\mathrm{{L}}} = Z_{\mathrm{{LL}}}\) and a lower level at \(Z_{\mathrm{{H}}}=Z_{\mathrm{{HH}}}=Z_{\mathrm{{LH}}}\).

Since \(\mu <\delta _{\mathrm{H}}\), in the region \(Z_{\mathrm{{HL}}}>x>Z_{\mathrm{{HH}}}\), not producing when the demand is high decreases the surplus with rate \(\delta _{\mathrm{H}}\) and producing decreases the surplus with rate \(\delta _{\mathrm{H}}-\mu \). Since the surplus decreases in both cases, setting the hedging levels \(Z_{\mathrm{{HH}}}\) and \(Z_{\mathrm{{LH}}}\) to the same level will have limited effect on the performance of the system.

Since the demand fluctuates, the dynamics in the interior regions need to be analyzed in two regions \(Z_{\mathrm{{L}}}>x>Z_{\mathrm{{H}}}\) and \(Z_{\mathrm{{H}}}>x\). Figure 2 depicts the sample path of the system when the double hedging policy is used for the alternating cost-alternating demand case.

Fig. 2
figure 2

Sample Path of the System with the Double Hedging Policy (\(\mu = 1\), \(\delta _{\mathrm{H}} = 1.2\), \(\delta _{\mathrm{L}} = 0.4\), \(c _{\mathrm{H}}=1.5\), \(c _{\mathrm{L}}=0.5\), \(Z _{\mathrm{L}} = 3\), \(Z_{\mathrm{H}} = -2\), \(\lambda _{\mathrm{{HL}}} = 0.08\), \(\lambda _{\mathrm{{LH}}} = 0.02\), \(\lambda ^\prime _{\mathrm{{HL}}} = 0.1\), \(\lambda ^\prime _{\mathrm{{LH}}} = 0.1\))

5.1 The Steady-State Probability Distribution

Since there are four states in the environment state space and two regions, there will be four differential equation for each region resulting in a total eight differential equations to be solved.

In the first region, \(Z_{\mathrm{{L}}}>x>Z_{\mathrm{{H}}}\), the surplus will be increasing with rate \(\mu -\delta _{\mathrm{L}}\) in the state \(\mathrm {LL}\) where the cost is low and the demand is low and the producer produces with the full capacity. In all other states, the surplus will be decreasing with rates \(\delta _{\mathrm{H}}-\mu \), \(\delta _{\mathrm{L}}\), and \(\delta _{\mathrm{H}}\) for states \(\mathrm{LH}\), \(\mathrm{HL}\), and \(\mathrm{HH}\) respectively.

In the second region, \(Z_{\mathrm{{H}}}>x\), the producer will produce with the maximum capacity in all states. Therefore the surplus will be increasing with rate \((\mu -\delta _{\mathrm{L}})\) in the states \(\mathrm {LL}\) and \(\mathrm {HL}\) where the demand is low. When the demand is high, the surplus will be decreasing with rate \((\delta _{\mathrm{H}}-\mu )\), in states \(\mathrm{LH}\), \(\mathrm{HH}\) respectively.

Then the matrices \(\varOmega _1\) and \(\varOmega _2\) that define the differential equations for the probability densities

$$\begin{aligned} \mathbf f _j(x) = [f_j(x,{\mathrm{LH}}), f_j(x,{\mathrm{LL}}), f_j(x,{\mathrm{HL}}), f_j(x,{\mathrm{HH}})]^T, \quad j\in \{1,2\} \end{aligned}$$

for the first and the second region are given as

$$\begin{aligned} \varOmega _1 = \left[ {\begin{array}{cccc} -\frac{\lambda _{12} + \lambda _{14}}{\mu -\delta _{\mathrm{H}}}&{} \frac{\lambda _{21}}{\mu -\delta _{\mathrm{H}}}&{} 0 &{} \frac{\lambda _{41}}{\mu -\delta _{\mathrm{H}}}\\ \\ \frac{\lambda _{12}}{\mu -\delta _{\mathrm{L}}} &{} -\frac{\lambda _{21} + \lambda _{23}}{\mu -\delta _{\mathrm{L}}} &{} \frac{\lambda _{32}}{\mu -\delta _{\mathrm{L}}} &{} 0 \\ \\ 0 &{} -\frac{\lambda _{23}}{\delta _{\mathrm{L}}} &{} \frac{\lambda _{32} + \lambda _{34}}{\delta _{\mathrm{L}}} &{} -\frac{\lambda _{43}}{\delta _{\mathrm{L}}} \\ \\ -\frac{\lambda _{14}}{\delta _{\mathrm{H}}} &{} 0 &{} -\frac{\lambda _{34}}{\delta _{\mathrm{H}}} &{} \frac{\lambda _{41} + \lambda _{43}}{\delta _{\mathrm{H}}} \end{array}} \right] \end{aligned}$$
(41)

and

$$\begin{aligned} \varOmega _2 = \left[ {\begin{array}{cccc} -\frac{\lambda _{12} + \lambda _{14}}{\mu -\delta _{\mathrm{H}}}&{} \frac{\lambda _{21}}{\mu -\delta _{\mathrm{H}}}&{} 0 &{} \frac{\lambda _{41}}{\mu -\delta _{\mathrm{H}}}\\ \\ \frac{\lambda _{12}}{\mu -\delta _{\mathrm{L}}} &{} -\frac{\lambda _{21} + \lambda _{23}}{\mu -\delta _{\mathrm{L}}} &{} \frac{\lambda _{32}}{\mu -\delta _{\mathrm{L}}} &{} 0 \\ \\ 0 &{} \frac{\lambda _{23}}{\mu -\delta _{\mathrm{L}}} &{} -\frac{\lambda _{32} + \lambda _{34}}{\mu -\delta _{\mathrm{L}}} &{} \frac{\lambda _{43}}{\mu -\delta _{\mathrm{L}}} \\ \\ \frac{\lambda _{14}}{\mu -\delta _{\mathrm{H}}} &{} 0 &{} \frac{\lambda _{34}}{\mu -\delta _{\mathrm{H}}} &{} -\frac{\lambda _{41} + \lambda _{43}}{\mu -\delta _{\mathrm{H}}} \end{array}} \right] . \end{aligned}$$
(42)

5.2 Boundary Conditions

Eight boundary conditions are required to determine the steady-state probability density functions. The first two boundary conditions are determined by the equivalence of the upward and downward level crossings in each region. Since at any given buffer level, the expected number of upward and downward crossings are equal in the long run, we can write

$$\begin{aligned} (\mu -\delta _{\mathrm{L}})f_1(x,{\mathrm{LL}}) = (\delta _{\mathrm{H}}-\mu )f_1(x,{\mathrm{LH}})+\delta _{\mathrm{L}} f_1(x,{\mathrm{HL}})+ \delta _{\mathrm{H}} f_1(x,{\mathrm{HH}}) \end{aligned}$$
(43)

and

$$\begin{aligned} (\mu -\delta _{\mathrm{L}})\left( f_2(x,{\mathrm{LL}}) + f_2(x,{\mathrm{HL}})\right) = (\delta _{\mathrm{H}}-\mu )\left( f_2(x,{\mathrm{LH}})+ f_2(x,{\mathrm{HH}})\right) . \end{aligned}$$
(44)

In the first region, since the surplus only increases in state LL, it reaches the upper hedging level \(Z_{\mathrm{L}}\) in this state and leaves immediately when the cost switches to the high state that leads to stopping production or when the demand switches to the high state where although the producer produces with the full capacity, the surplus decreases since it is not sufficient to meet the high demand.

Accordingly, the ratio of the times the surplus leaves the upper boundary in state HL or LH is equal to the ratio of the downward level crossings in these states. Therefore,

$$\begin{aligned} \frac{\delta _{\mathrm{L}}f_1(Z_{\mathrm{L}},{\mathrm{HL}})}{\delta _{\mathrm{L}}f_1(Z_{\mathrm{L}},{\mathrm{HL}})+(\delta _{\mathrm{H}}-\mu )f_1(Z_{\mathrm{L}},{\mathrm{LH}})} = \frac{\lambda _{23}}{\lambda _{21}+\lambda _{23}}. \end{aligned}$$
(45)

In addition, the number of times the surplus reaches the upper hedging level in state LL must be equal to the number of times the surplus leaves the upper hedging level is states HL and LH. So,

$$\begin{aligned} (\mu -\delta _{\mathrm{L}})f_1(Z_{\mathrm{L}},{\mathrm{LL}}) = \delta _{\mathrm{L}}f_1(Z_{\mathrm{L}},{\mathrm{HL}})+(\delta _{\mathrm{H}}-\mu )f_1(Z_{\mathrm{L}},{\mathrm{LH}}). \end{aligned}$$
(46)

In other words, it is not possible for the process to leave the upper hedging level in state HH. Therefore, the number of level crossings at \(Z_{\mathrm{L}}\) in state HH is 0:

$$\begin{aligned} f_1(Z_{\mathrm{L}},{\mathrm{HH}})=0. \end{aligned}$$
(47)

The surplus reaches the lower hedging level \(Z_{\mathrm{H}}\) either from the first region in state HL, where the surplus decreases with rate \(\delta _{\mathrm{L}}\) since the producer does not produce when the cost is high, or from the second region in state HL, where the producer produces with the maximum capacity although the cost is high to increase the surplus with rate \(\mu - \delta _{\mathrm{L}}\). At the lower hedging level, the producer produces with the rate \(\delta _{\mathrm{L}}\) that keeps the surplus at this level. In this state, if the cost switches to the low state, the producer starts producing with the full capacity and the surplus increases into the first region. On the other hand, again in the same state HL, if the demand switches to the high state, although the producer switches to full capacity production, the surplus decreases with rate \(\delta _{\mathrm{H}}-\mu \) since the production capacity is not sufficient to meet the demand.

The next boundary equation is related to the level crossings at the lower hedging level in state LH. When the cost is low and the demand is high, the producer produces with the maximum capacity in both regions but the surplus decreases. As a result, the number of crossing from region 1 at \(Z_{\mathrm{L}}\) in state LH must be equal to the number of level crossing to region 2 in the same state:

$$\begin{aligned} f_1(Z_{\mathrm{H}},{\mathrm{LH}}) = f_2(Z_{\mathrm{H}},{\mathrm{LH}}) \end{aligned}$$
(48)

The probability masses at the upper and lower hedging levels are calculated from the average number of times per unit time the surplus reaches these levels and the expected time the surplus stays there:

$$\begin{aligned} P^{Z_{\mathrm{L}}}= & {} \frac{\mu -\delta _{\mathrm{L}}}{\lambda _{21}+\lambda _{23}} f_1(Z_{\mathrm{L}},{\mathrm{LL}}), \end{aligned}$$
(49)
$$\begin{aligned} P^{Z_{\mathrm{H}}}= & {} \frac{\delta _{\mathrm{L}}f_1(Z_{\mathrm{H}},{\mathrm{HL}})+(\mu -\delta _{\mathrm{L}})f_2(Z_{\mathrm{H}},{\mathrm{HL}})}{{\lambda _{32}+\lambda _{34}}}. \end{aligned}$$
(50)

Since backlog is allowed, in the long run, the production rate must be equal to the demand rate. This equality given in Equation (54) is used as the next boundary condition. Furthermore, since there is sufficient capacity to meet the demand, if there is a negative eigenvalue of \(\varOmega _2\) that describes the dynamics in the region \(x<Z_{\mathrm{H}}\), its weight should be zero.

The last equation is the normalization equation. The sum of all the probabilities must be equal to 1.

$$\begin{aligned}&\int \limits _{Z_{\mathrm{H}}}^{Z_{\mathrm{L}}} \mathbf u \;\mathbf f _1(x) dx + \int \limits _{-\infty }^{Z_{\mathrm{H}}} \mathbf u \;\mathbf f _2(x) dx + P^{Z_{\mathrm{L}}} + P^{Z_{\mathrm{LH}}} = 1 \end{aligned}$$
(51)

where \(\mathbf u \) is the row vector of ones.

Solving the above equations for \(\mathbf w _1\) and \(\mathbf w _2\) given in Equation (15) yields the solution for the density functions. Once the density functions are obtained, the probability masses at \(Z_{\mathrm{L}}\) and \(Z_{\mathrm{H}}\) are determined by using Equations (49) and (50).

5.3 Performance Measures

In order to determine the profit rate, the average production cost incurred through implementing the optimal production policy needs to be determined. According to the production policy, when the production cost is low, the producer produces with the full capacity until the upper hedging level is reached. At the upper hedging level, it produces with the low demand rate in order to keep the surplus level at this level. Accordingly, the production rate when the cost is low, denoted with \(\rho _{\mathrm{L}}\) is

$$\begin{aligned} \rho _{\mathrm{L}}= & {} \delta _{\mathrm{L}}P^{Z_{\mathrm{L}}} + \mu \left( \int \limits _{Z_{\mathrm{H}}}^{Z_{\mathrm{L}}} (f_1(x,{\mathrm{LL}}) + f_1(x,{\mathrm{LH}}))dx \right. \nonumber \\&\left. \quad + \int \limits _{-\infty }^{Z_{\mathrm{H}}} (f_2(x,{\mathrm{LL}}) + f_2(x,{\mathrm{LH}}))dx \right) . \end{aligned}$$
(52)

When the production cost is high, the producer only produces when the backlog reaches the lower hedging level. When the surplus level is lower than \(Z_{\mathrm{H}}\), it produces with the maximum rate. When the surplus increases to \(Z_{\mathrm{H}}\) with the maximum rate, the producer decreases its production rate to the low demand rate in order to keep the backlog at that level. Accordingly, the production rate when the cost is high \(\rho _{\mathrm{H}}\) is

$$\begin{aligned} \rho _{\mathrm{H}} = \delta _{\mathrm{L}}P^{Z_{\mathrm{H}}}+\mu \left( \int \limits _{-\infty }^{Z_{\mathrm{H}}} (f_2(x,{\mathrm{HL}})+ f_2(x,{\mathrm{HH}}))dx \right) . \end{aligned}$$
(53)

Since the producer has sufficient capacity to meet the demand in the long run, \(\mu >\overline{\delta }\), all the demand is satisfied either immediately from the inventory or later after being backlogged. Therefore, the production rate when the cost is high and low must be equal to the demand rate:

$$\begin{aligned} \overline{\delta } = \rho _{\mathrm{H}} + \rho _{\mathrm{L}} \end{aligned}$$
(54)

Accordingly, the average production cost, \({\overline{c}}\) incurred through using the optimal production policy is

$$\begin{aligned} {\overline{c}} = c_{\mathrm{L}}\frac{\rho _{\mathrm{L}}}{\overline{\delta }} + c_{\mathrm{H}}\frac{\rho _{\mathrm{H}}}{\overline{\delta }} \end{aligned}$$
(55)

The average profit rate excluding the inventory and backlog costs, \(\varPi \) is evaluated from Equation (1) as

$$\begin{aligned} \varPi= & {} \overline{\delta p}- \overline{\delta }{\overline{c}} \end{aligned}$$
(56)

The average inventory level \(E[x^+]\) and the average backlog level \(E[x^-]\) are given as

$$\begin{aligned} E[x^+]= & {} \int \limits _0^{Z_{\mathrm{L}}} x\mathbf u \cdot \mathbf f _1(x)dx + Z_{\mathrm{L}}P^{Z_{\mathrm{L}}}, \end{aligned}$$
(57)
$$\begin{aligned} E[x^-]= & {} -\int _{Z_{\mathrm{H}}}^{0} x\mathbf u \cdot \mathbf f _1(x)dx -\int _{-\infty }^{Z_{\mathrm{H}}} x\mathbf u \cdot \mathbf f _2(x)dx- Z_H P^{Z_{\mathrm{H}}} . \end{aligned}$$
(58)

Finally, the average profit per unit time defined in Equation (2) is

$$\begin{aligned} {\overline{J}} = {\varPi } - h E[x^+] - b E[x^-]. \end{aligned}$$
(59)

The optimal hedging levels are determined by solving the optimization problem given in Equation (38).

6 Numerical Results

In this section, we analyze the effects of system parameters on the performance of the system. We focus on the effects of average production cost, production cost variability and production capacity for the alternating production cost-constant demand and for the alternating production cost-alternating demand models. The effects of the demand variability and the dependence between the demand and production cost are analyzed for the model with alternating cost and alternating demand.

The optimal profit and the optimal hedging levels are determined for different values of the system parameters being analyzed. In order to capture the effects of a wider range of all the system parameters, the holding cost and backlog parameters are varied in different cases.

6.1 Effect of the Production Capacity

The level of production capacity with respect to the demand rate determines how much a producer can benefit from the optimal production policy. When the production capacity is high with respect to the demand, the producer can produce more when the cost is low and keep the inventory if this is more profitable. However, if the production capacity is low compared to the demand, the producer cannot produce a sufficient level of inventory when the production cost is low. If the demand is also uncertain, the production capacity is used to respond to the changes in the demand as well as to produce in advance to benefit from the low cost periods.

Figure 3 depicts the effect of the production capacity on the optimal profit and on the upper and lower hedging levels for the alternating cost-constant demand model. When the maximum production rate is equal to the demand rate of \(\overline{\delta }=1\), the producer does not have the capacity to benefit from producing in advance and runs all the time. Accordingly, the upper and the lower hedging levels are set to 0. As a result, the producer produces all the time and makes a profit of \({\overline{J}} = ({{\overline{p}}}-m){\overline{\delta }}=0.2\). As the maximum production rate increases, the producer can produce more in advance when the production cost is low and build an inventory. In order to benefit from this flexibility, the upper and lower hedging levels are set accordingly. Consequently, the optimal profit increases with the maximum production rate.

Fig. 3
figure 3

Optimal Profit and Upper and Lower Hedging Levels vs. Production Capacity for the Alternating Cost and Constant Demand Model (\({\overline{\delta }}=1\), \({{\overline{p}}}=1\), \(m=0.8\), \(cv^2=1.5\), \(c_{\mathrm{H}}=1\), \(c_{\mathrm{L}}=0\), \(h=0.03\), \(b=0.06\))

Figure 4 depicts the effect of production capacity on the optimal profit (\({\overline{J}}^v\)) and on the upper and lower hedging levels (\(Z_{\mathrm{U}}^v\) and \(Z_{\mathrm{D}}^v\)) for the alternating cost-alternating demand model. The figure also gives the profit (\({\overline{J}}^c\)) and the hedging levels (\(Z_{\mathrm{U}}^c\) and \(Z_{\mathrm{D}}^c\)) resulting from the alternating cost-constant demand model that has the same average demand rate. When the demand alternates between the high and low levels, the production policy allows using the production capacity to build more inventory when the demand is low compared to using the production capacity to meet the constant demand that has the same average demand rate. This alternative is more profitable when the inventory holding cost is lower compared to the production cost. In order to benefit from this opportunity, the lower hedging level is set to a lower level and the production is used more when the cost is low. Accordingly, the production policy yields a higher average profit for the case with the alternating demand.

Fig. 4
figure 4

Optimal Profit and Upper and Lower Hedging Levels vs. Production Capacity for the Alternating Cost-Alternating Demand and Alternating Cost-Constant Demand Models (\({\overline{\delta }}=1\), \(cv^2_d= 0.5\), \(\delta _{\mathrm{H}}=1.5\), \(\delta _{\mathrm{L}}=0.5\), \({{\overline{p}}}=1\), \(m=0.8\), \(c_{\mathrm{H}}=1\), \(c_{\mathrm{L}}=0\), \(cv_m^2=2\), \(h=0.05\), \(b=0.01\))

6.2 Effect of the Production, Holding, and Backlog Cost

We now focus on the effect of the production cost. Figure 5 shows the effect of average cost on the optimal profit and on the upper and lower hedging levels, \(Z_{\mathrm{U}}=Z_{\mathrm{L}}\) and \(Z_{\mathrm{D}}=Z_{\mathrm{H}}\), for the alternating production cost-constant demand model. Since the average sales price is set at 1, as the average cost increases, the profit from sales decreases. When the average cost is low, the profit from sales is high. In this case, the producer does not produce in advance and produces without holding inventory. When the average production cost increases above a certain level, the production policy is used to balance the inventory and production costs. When the average production cost increases, the production policy sets the lower hedging level at a higher level to limit the production when the production cost is high. In order to balance the supply and demand, it increases the upper hedging level to keep more inventory for the production when the cost is low.

For the same alternating production cost-constant demand model, Figure 6 shows the effect of the backlog cost on the optimal profit and on the upper and lower hedging levels, \(Z_{\mathrm{L}}\) and \(Z_{\mathrm{H}}\) while the holding cost is kept constant. When the backlog cost is much smaller than the holding cost, \(Z_{\mathrm{L}}\) is set to a low level and thus it does not affect the production decisions. However, as b increases, the lower hedging level approaches 0 level where no backlog is allowed. The average profit decreases with the increasing backlog cost and reaches a limit since no backlog is allowed when the backlog cost is sufficiently large.

Fig. 5
figure 5

Optimal Profit and Upper and Lower Hedging Levels vs. Average Production Cost for the Alternating Cost and Constant Demand Model (\({\overline{\delta }}=1\), \({{\overline{p}}}=1\), \(\mu =2.8\), \(cv^2=2\), \(c_{\mathrm{H}}=1\), \(c_{\mathrm{L}}=0\), \(h=0.05\), \(b=0.01\))

Fig. 6
figure 6

Optimal Profit and Upper and Lower Hedging Levels vs. Backlog Cost for the Alternating Cost and Constant Demand Model (\({\overline{\delta }}=1\), \({{\overline{p}}}=1\), \(\mu =2.8\), \(cv^2=2\), \(c_{\mathrm{H}}=1\), \(c_{\mathrm{L}}=0\), \(m=0.6\), \(h=0.05\))

When the demand also alternates between high and low demand levels, the production capacity is used to balance the inventory and backlog costs and to benefit from the low production cost simultaneously by determining the hedging levels optimally. Figure 7 depicts the effect of average cost on the optimal profit and on the upper and lower hedging levels for the alternating production cost-alternating demand model. As opposed to the case shown in Figure 5 where there is sufficient capacity (\(\mu =2.8\) for \(\overline{\delta }= 1\)), in the case depicted in Figure 7, the production capacity is limited (\(\mu =1.3\) for \(\overline{\delta }= 0.7\)). In this case, the upper hedging level increases while the lower hedging level decreases with the increasing average cost. However, the change is limited since the production policy is used mainly to respond to the demand fluctuations.

Fig. 7
figure 7

Optimal Profit and Upper and Lower Hedging Levels vs. Average Production Cost for the Alternating Cost and Alternating Demand Model (\(\mu =1.3\), \({\overline{\delta }}=0.7\), \(cv^2_d= 2\), \(\delta _{\mathrm{H}}=1.1\), \(\delta _{\mathrm{L}}=0.3\), \({{\overline{p}}}=1\), \(c_{\mathrm{H}}=1\), \(c_{\mathrm{L}}=0\), \(cv_m^2=2\), \(h=0.01\), \(b=0.09\))

In addition to the average production cost, the variability of the production cost also affects the performance of the system. Namely, Equation (20) shows that as the squared coefficient of variation of the demand increases the average time spent in low and high cost states also increases. The production policy sets the hedging levels accordingly.

Figure 8 shows the effects of the squared coefficient of variation of the production cost on the optimal profit and on the optimal hedging levels for the alternating cost-constant demand model. Figure 8 shows that the optimal profit decreases with the increasing cost variability. In this particular case, the producer would make a profit of \(({\overline{p}}-m){\overline{\delta }} = 0.2\) (as given in Equation (21)) by producing at the demand rate and incurring the instantaneous production cost. Therefore, the producer makes a significantly higher profit by adjusting its flow rate depending on the production cost. However, its profit decreases with the increasing cost variability. As the figure shows, the lower hedging level decreases and the upper hedging level increases with the increasing cost variability. This means that as the cost variability increases, the producer produces more when the cost is low and keeps in the inventory according to the optimal production policy. When the cost is high, it stops production and allows the arriving demand to be backlogged. The increasing backlog cost is negated with the production cost benefit.

Fig. 8
figure 8

Optimal Profit and Upper and Lower Hedging Levels vs. Cost Variability for the Alternating Cost and Constant Demand Model (\(\mu =2\), \({\overline{\delta }}=1\), \({{\overline{p}}}=1\), \(m=0.6\), \(c_{\mathrm{H}}=1\), \(c_{\mathrm{L}}=0\), \(h=0.03\), \(b=0.03\))

When the demand also alternates between high and the low levels, the effect of the production cost variability is similar. Figure 9 depicts the effect of cost variability on the optimal profit and on the upper and lower hedging levels and on the optimal profit for the alternating demand case respectively. As the production cost coefficient of variation increases, the upper hedging level increases and the lower hedging level decreases to produce more when the cost is low and keep the inventory for the periods where the cost is high.

Fig. 9
figure 9

Optimal Profit and Upper and Lower Hedging Levels vs. Cost Variability for the Alternating Cost and Alternating Demand Model (\(\mu =1.3\), \({\overline{\delta }}=0.7\), \(cv^2_d= 2\), \(\delta _{\mathrm{H}}=1.1\), \(\delta _{\mathrm{L}}=0.3\), \({{\overline{p}}}=1\), \(m=0.4\), \(c_{\mathrm{H}}=1\), \(c_{\mathrm{L}}=0\), \(h=0.01\), \(b=0.09\))

6.3 Effect of the Demand Variability

As the demand squared coefficient of variation (\(cv^2_d\)) increases, the average time spent in high and low demand states increases for the same average demand rate. Accordingly, the available production capacity can be used more effectively to build an inventory when the demand is low. Similarly, the need to produce when the demand is high also decreases.

Figure 10 shows the effect of demand variability on the optimal profit and on the upper and lower hedging levels for the alternating demand case respectively. As the demand variability increases, the lower hedging level decreases since the producer can build more inventory when the demand is low. Accordingly, the optimal production policy is more effective and the the average profit rate increases with the increasing demand variability.

Fig. 10
figure 10

Optimal Profit and Upper and Lower Hedging Levels vs. Demand Variability for the Alternating Cost and Alternating Demand Model (\(\mu =1.3\), \({\overline{\delta }}=0.8\), \(\delta _{\mathrm{H}}=1.2\), \(\delta _{\mathrm{L}}=0.4\), \({{\overline{p}}}=1\), \(m=0.8\), \(c_{\mathrm{H}}=1\), \(c_{\mathrm{L}}=0\), \(cv_m^2=2\), \(h=0.01\), \(b=0.09\))

6.4 Effect of the Dependency between Demand and Cost

In our model, the random environment tracks the state changes in demand and production cost jointly. This model can be used to analyze the effects of possible dependency between the demand and cost states. Namely, if the time period where the production cost is low and also the demand rate is low is longer, the producer can benefit from the optimal policy more by building an inventory during these periods. However, if the time period where the demand is high and the production cost is low is longer, the producer cannot build an inventory since its capacity is not sufficient to meet the demand.

In order to analyze the possible correlation between demand and cost, we study the effect of the fraction of the time spent in the low demand-low cost state (state LL) on the optimal cost when the double hedging policy is used. As the fraction of the time in the low demand-low cost state increases, the optimal production policy can benefit from producing in advance and building an inventory that will be used for the periods where the production cost is high.

We design an experiment where the average demand and the average cost stay the same but the fraction of time spent in state LL, denoted with \(\pi _{\mathrm{{LL}}}\), changes. Once \(\pi _{\mathrm{{LL}}}\) is given, the fraction of times in other states can be determined accordingly in a way to keep the average demand \(\overline{\delta }\) and average cost m the same:

$$\begin{aligned} \pi _{\mathrm{{LH}}}= & {} 1- m -\pi _{\mathrm{{LL}}} \end{aligned}$$
(60)
$$\begin{aligned} \pi _{\mathrm{{HL}}}= & {} 1- \overline{\delta }-\pi _{\mathrm{{LL}}} \end{aligned}$$
(61)
$$\begin{aligned} \pi _{\mathrm{{HH}}}= & {} 1- \pi _{\mathrm{{LL}}} - \pi _{\mathrm{{LH}}} - \pi _{\mathrm{{HL}}}. \end{aligned}$$
(62)

After determining the fractions of time spent in each state, we change three transition rates in order to get the steady-state probabilities that are equal to the fractions of time spend in each state. When \(\lambda _{41}\), \(\lambda _{43}\), \(\lambda _{32}\), \(\lambda _{34}\), \(\lambda _{12}\), \(\lambda _{14}\) are given, we determine \(\lambda _{14}\), \(\lambda _{23}\), and \(\lambda _{21}\) through the following equations:

$$\begin{aligned} \lambda _{14}= & {} \frac{1}{\pi _{\mathrm{{LH}}}}(\pi _{\mathrm{{HH}}}(\lambda _{14} + \lambda _{43})-\pi _{\mathrm{{HL}}}\lambda _{34}) \end{aligned}$$
(63)
$$\begin{aligned} \lambda _{23}= & {} \frac{1}{\pi _{\mathrm{{LL}}}}(\pi _{\mathrm{{HL}}}(\lambda _{32} + \lambda _{34})-\pi _{\mathrm{{HH}}}\lambda _{43}) \end{aligned}$$
(64)
$$\begin{aligned} \lambda _{21}= & {} \frac{1}{\pi _{\mathrm{{LL}}}}(\pi _{\mathrm{{LH}}}(\lambda _{312} + \lambda _{14})-\pi _{\mathrm{{HH}}}\lambda _{41}) \end{aligned}$$
(65)
Fig. 11
figure 11

Optimal Profit vs. Fraction of Time Spent in Low Cost Low Demand State for the Alternating Cost and Alternating Demand Model (\(\mu =1.3\), \({\overline{\delta }}=0.8\), \(cv^2_d= 2\), \(\delta _{\mathrm{H}}=1.5\), \(\delta _{\mathrm{L}}=0.5\), \({\overline{p}}=1\), \(m=0.4\), \(c_{\mathrm{H}}=1\), \(c_{\mathrm{L}}=0\), \(h=0.01\), \(b=0.09\), \(\lambda _{12}=0.8\),\(\lambda _{12}=0.1\), \(\lambda _{34}=0.024\), \(\lambda _{41}=0.443\), \(\lambda _{43}=0.263\))

Finally, since all the steady-state probabilities and the transition rates should be greater than zero, we determine the range we can change \(\pi _{\mathrm{{LL}}}\) from the above equations in order to get non-negative results for all parameters.

Figure 11 illustrates the effect of the fraction of the time spent in low cost low demand state on the optimal profit for the alternating demand case. As expected, as the fraction of the time spent in low demand low cost state increases, the optimal profit also increases. In other words, the producer can benefit from positive correlation between demand and cost.

7 Conclusion

In this study, we consider the optimal production flow control policy of a manufacturing firm that builds a product to stock to meet demand when the sales price, the production cost, and the demand rate are uncertain. We show that the optimal policy that maximizes the expected profit is a state-dependent hedging policy and analyze the performance of the system under the optimal production policy.

First, the performance of a special case where the production cost fluctuates between a high and a low level and the demand rate is constant is analyzed. When the cost is low, the manufacturer produces with the maximum production rate until an upper hedging level is reached. The manufacturer produces with the demand rate at the hedging level. When the cost is high, the manufacturer stops producing until the backlog level reaches a lower hedging level. At the lower hedging level, the manufacturer produces with the demand rate even if the cost is high to keep the backlog at that level.

Next, the performance of the system when both the production cost and the demand rate fluctuate between high and low levels is analyzed. When the production capacity is sufficient to meet the low demand rate but not sufficient to meet the high demand rate, the optimal policy is also a state-dependent hedging policy. The performance of the system under a double-hedging policy is evaluated. According to the double-hedging policy, the producer produces only when the cost is low and the surplus is between the two hedging levels. However when the backlog is below the lower hedging level, the producer produces with full capacity regardless of the cost level in order to bring the surplus level above the lower hedging level.

The effects of the production capacity, average cost rate, and the cost variability on the optimal cost and on the optimal hedging levels are analyzed for both the alternating cost-constant demand and for the alternating cost-alternating demand models. For the alternating cost-alternating demand model, the effects of the demand variability and the dependency between the demand and cost have also been analyzed.

This model can be extended in a number of ways. For example, it is possible to include uncertainty not only in sales price, production cost, and demand but also uncertainty in machine reliability. In addition, procurement and sales decisions can be separated from production flow decisions. In the model presented in this note, there is no input inventory for the producer and the sales decision is not considered. In a system with an input inventory and possibility of deciding on the timing of sales, a control problem where a producer sets the procurement rate, the sales rate as well as the production rate can also be discussed. With this model, the inter-dependency between price and cost, price and demand can be incorporated in the rate matrices.

This study shows that the results from the rich literature of optimal flow rate control problems can be used to analyze settings where the source of uncertainty is not only machine reliability or demand fluctuations but also sales price and production cost variability.

This model shows that the production rate can be controlled optimally to benefit from producing in advance when the production cost is low while meeting the supply and the demand in the best way. The benefit of the policy depends on the interaction between the production, inventory holding, and backlog costs and the availability of excess production capacity in comparison to the demand rate.