## Main.MilkPasteurization History

May 02, 2021, at 07:05 PM by 10.35.117.248 -
Changed line 48 from:
1. Inlet temperature (degC)
to:
1. Inlet temperature (degC)
Changed line 51 from:
1. Outlet temperature (degC)
to:
1. Outlet temperature (degC)
Changed line 54 from:
1. Pasteurization Temperature (degC), target temperature
to:
1. Pasteurization Temperature (degC), target temperature
Changed lines 57-59 from:
1. Variables
2. compressor work (kW)
to:
1. Variables
2. compressor work (kW)
Changed line 61 from:
1. heat exchanger areas (m^2)
to:
1. heat exchanger areas (m^2)
Changed lines 67-71 from:

t1 = m.Var(value = ti) #Temperature 1 (degC) t2 = m.Var(value = ti) #Temperature 2 (degC) te = m.Var(value = ti) #Evaporator Temperature (degC) tc = m.Var(value = ti) #Condenser Temperature (degC) Ctot = m.Var(value = 100000) #Total Cost

to:

t1 = m.Var(value = ti) # Temperature 1 (degC) t2 = m.Var(value = ti) # Temperature 2 (degC) te = m.Var(value = ti) # Evaporator Temperature (degC) tc = m.Var(value = ti) # Condenser Temperature (degC) Ctot = m.Var(value = 100000) # Total Cost

May 02, 2021, at 07:04 PM by 10.35.117.248 -
Changed lines 36-37 from:
1. exchanger), size of the compressor, and temperatures t1, t2, te and tc
2. that result in the minimum total cost
to:
1. exchanger), size of the compressor, and temperatures t1, t2, te and tc
2. that result in the minimum total cost
May 02, 2021, at 07:04 PM by 10.35.117.248 -
Changed lines 35-37 from:
1. areas of the heat exchangers (evaporator, condensers, and regenerative exchanger),
2. size of the compressor, and temperatures t1, t2, te and tc that result in the
3. minimum total costOptimize
to:
1. areas of the heat exchangers (evaporator, condensers, and regenerative
2. exchanger), size of the compressor, and temperatures t1, t2, te and tc
3. that result in the minimum total cost
May 02, 2021, at 07:03 PM by 10.35.117.248 -

Solution Help

See GEKKO documentation and additional example problems.

(:source lang=python:) from gekko import GEKKO

1. Initialize Gekko model

m = GEKKO()

1. Optimal heat pump and regenerative exchanger that minimizes the total present
2. worth of costs (capital cost and operating cost). Specifically, determine the
3. areas of the heat exchangers (evaporator, condensers, and regenerative exchanger),
4. size of the compressor, and temperatures t1, t2, te and tc that result in the
5. minimum total costOptimize
6. Parameters

U = 0.6 Ureg = 0.5 mdotm = 4 cpm = 3.75 cpw = 1.00 intrate = 0.09 nper = 6

1. Inlet temperature (degC)

ti = 7

1. Outlet temperature (degC)

to = 4

1. Pasteurization Temperature (degC), target temperature

tp = 73

1. Variables
2. compressor work (kW)

W = m.Var()

1. heat exchanger areas (m^2)

Ae = m.Var(value = 10, lb = 1.0, ub = 1000) Areg = m.Var(value = 10, lb = 1.0, ub = 1000) Afc = m.Var(value = 10, lb = 1.0, ub = 1000) Aac = m.Var(value = 10, lb = 1.0, ub = 1000)

t1 = m.Var(value = ti) #Temperature 1 (degC) t2 = m.Var(value = ti) #Temperature 2 (degC) te = m.Var(value = ti) #Evaporator Temperature (degC) tc = m.Var(value = ti) #Condenser Temperature (degC) Ctot = m.Var(value = 100000) #Total Cost

1. evaporator

Qe = m.Var(value = 1) dapp1e = m.Var(value = 1) dapp2e = m.Var(value = 1)

1. regenerative heat exchanger

Qreg = m.Var(value = 1) dapp1reg = m.Var(value = 1) dapp2reg = m.Var(value = 1)

1. fore condenser

Qfc = m.Var(value = 1) dapp1fc = m.Var(value = 1) dapp2fc = m.Var(value = 1)

1. after condenser

Qac = m.Var(value = 1) dapp1ac = m.Var(value = 1) dapp2ac = m.Var(value = 1)

1. temps of approach

dappe = m.Var(lb = 0.1) # >= 10 dappc = m.Var(lb = 0.1) # >= 10 dappreg1 = m.Var(lb = 0.1) # >= 10 dappreg2 = m.Var(lb = 0.1) # >= 10

1. ratios

ratio_e = m.Var(value = .05, lb = 0.001, ub = 0.999) ratio_reg = m.Var(value = .05, lb = 0.000, ub = 1.0) ratio_fc = m.Var(value = .05, lb = 0.001, ub = 0.999) ratio_ac = m.Var(value = .05, lb = 0.001, ub = 0.999)

1. Log-mean temperature differences

delte = m.Var(value = 1) deltreg = m.Var(value = 1) deltfc = m.Var(value = 1) deltac = m.Var(value = 1)

1. Coefficient Of Performance

COP = m.Var(value = 1)

1. Intermediates
2. Cost elec year at 4 hours per day

Celyear= m.Intermediate(W * 4.0 * 365.0 * 0.07)

1. Cost total over time
3. interest rate on unspent capital

mult = m.Intermediate((((1.0+intrate)**nper)-1.0) / (intrate*(1.0+intrate)**nper)) Celtot = m.Intermediate(Celyear * mult)

1. Cost equipment

Cequip = m.Intermediate(Ae*200.0 + Afc*200.0 + Aac*200.0 + Areg*200 + W*240.0)

1. temperatures in Kelvin

TeK = m.Intermediate(te + 273) TcK = m.Intermediate(tc + 273)

1. Equations

m.Equations([

    # Total cost
Ctot == Celtot + Cequip,

# overall energy balance on regen heat exchanger
# mdotm and cpm cancel from each term
t1 + t2 == tp + ti,

# log-mean temperature difference
#   lmtd(thi,tco,tho,tci)

# evaporator
Qe == mdotm * cpm *(t2 - to),
dapp1e == to - te,
dapp2e == t2 - te,

# regenerative heat exchanger
Qreg == mdotm * cpm * (tp-t2),
dapp1reg == t2 - ti,
dapp2reg == tp - t1,

# fore condenser
Qfc == mdotm * cpm * (tp - t1),
dapp1fc == tc - tp,
dapp2fc == tc - t1,

# after condenser
Qac == W + mdotm * cpm * (ti - to),
dapp1ac == tc - 35.0,
dapp2ac == tc - 30.0,

# approach temperatures
dappe == to - te,         # Temp app evap
dappc == tc - tp,         # Temp app fore cond
dappreg1 == t2 - ti,      # Temp app reg1
dappreg2 == tp - t1,      # Temp app reg2

# ratios
ratio_e   * dapp2e   == dapp1e,
ratio_reg * dapp2reg == dapp1reg,
ratio_fc  * dapp2fc  == dapp1fc,
ratio_ac  * dapp2ac  == dapp1ac,

# Log-mean Temperature Difference
delte   * m.log(ratio_e)   == (dapp1e - dapp2e),
#deltreg * m.log(ratio_reg) = (dapp1reg - dapp2reg)
deltfc  * m.log(ratio_fc)  == (dapp1fc - dapp2fc),
deltac  * m.log(ratio_ac)  == (dapp1ac - dapp2ac),

# Average temperature difference
#delte    = (dapp1e   + dapp2e)   / 2
deltreg  == (dapp1reg + dapp2reg) / 2,
#deltfc   = (dapp1fc  + dapp2fc)  / 2
#deltac   = (dapp1ac  + dapp2ac)  / 2

# coefficient of performance
# 75% of Carnot Efficiency
COP * (TcK-TeK) == 0.75 * TeK,

# Work to compressor
W * COP == Qe,

# heat transferred for each exchanger
Ae   * U    * delte   == Qe,
Areg * Ureg * deltreg == Qreg,
Afc  * U    * deltfc  == Qfc,
Aac  * U    * deltac  == Qac
])

1. objective function

m.Obj(Ctot)

1. minimize ctot

m.options.SOLVER = 1 m.options.IMODE = 3

m.solve()

print('Minimum cost: ' + str(Ctot[0])) (:sourceend:)

June 21, 2020, at 04:43 AM by 136.36.211.159 -
Deleted lines 16-34:

(:html:)

 <div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'apmonitor'; // required: replace example with your forum shortname

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
})();
</script>


(:htmlend:)

January 11, 2013, at 02:20 PM by 69.169.188.188 -
Changed lines 16-35 from:
This assignment can be completed in groups of two. Additional guidelines on individual, collaborative, and group assignments are provided under the Expectations link.
to:
This assignment can be completed in groups of two. Additional guidelines on individual, collaborative, and group assignments are provided under the Expectations link.

(:html:)

 <div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'apmonitor'; // required: replace example with your forum shortname

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
})();
</script>


(:htmlend:)

December 31, 2012, at 08:57 PM by 128.187.97.21 -
Deleted line 9:
Deleted line 10:
December 31, 2012, at 08:42 PM by 128.187.97.21 -

(:title Heat Pump Optimization Problem:) (:keywords heat pump, nonlinear, optimization, engineering optimization, two-bar optimization, engineering design, interior point, active set, differential, algebraic, modeling language, university course:) (:description Engineering design and optimization of a heat pump system for pasteurization of milk. Optimization principles are used to design the system.:)

In the pasteurization of milk the temperature is raised to 73°C, held for 20 sec., and then cooled. The milk arrives at a temperature of 7°C and is delivered from the pasteurizing process for packaging at a temperature of 4°C.

We will consider using a heat pump with a regenerative heat exchanger to do this. One possible cycle is shown in the figure below. The incoming milk is preheated in a regenerative heat exchanger and then heated further in the fore-condenser of the heat pump. As it exits the fore-condenser, the temperature of the milk is 73°C. Thereafter the milk is cooled as it flows through the other side of the regenerative heat exchanger and then through the evaporator of the heat pump.

Find the optimal heat pump and regenerative exchanger that minimizes the total present worth of costs (capital cost and operating cost). Specifically, determine the areas of the heat exchangers (evaporator, condensers, and regenerative exchanger), size of the compressor, and temperatures t1, t2, te and tc that result in the minimum total cost. Run the problem with no constraints on temperatures of approach (Case 1); then rerun with constraints that all temperatures of approach (evaporator, condensers, regenerative heat exchanger) are at least 10 °C (Case 2).

This problem is based on a problem from W. Stoecker, Design of Thermal Systems, 3rd ed.

This assignment can be completed in groups of two. Additional guidelines on individual, collaborative, and group assignments are provided under the Expectations link.