3. Transport 2: One-Time Truck Shipments¶

ISE 754, Fall 2024

Package Used: No new packages used.

Examples¶

Ex: Truck Shipment Example¶

  • Product shipped in cartons from Raleigh, NC (27606) to Gainesville, FL (32606)
  • Each identical carton weighs 40 lb and occupies 9 ft3 (its cube)
  • Don’t know linear dimensions of each unit for TL and LTL
  • Cartons can be stacked on top of each other in a trailer
  • Additional info/data is presented only when it is needed to determine answer

1. Assuming that the product is to be shipped P2P TL, what is the maximum payload for each trailer used for the shipment?

image.png

In [1]:
using Printf

# The `prt` function formats a numerical result with commas, prints it between
# a label and units strings, and returns the original value.
function prt(value, label, units="", digits=2)
    fmtval = split(Printf.format(Printf.Format("%."*string(digits)*"f"),value),".")
    fmtval[1] = reverse(join(Iterators.partition(reverse(fmtval[1]), 3), ","))
    println("$label\t= $(join(fmtval, ".")) $units")
    return value
end

uwt = 40                                                     # lb
ucu = 9                                                      # ft3
s = prt( uwt/ucu, "s", "(lb/ft3)", 4)
Kwt = 25                                                     # ton
Kcu = 2750                                                   # ft3
qmax = prt( min(Kwt, s*Kcu/2000), "qmax", "(ton)");
s	= 4.4444 (lb/ft3)
qmax	= 6.11 (ton)

2. On Jan 10, 2018, 300 cartons of the product were shipped. How many truckloads were required for this shipment?

In [2]:
udTL = 300                                                   # cartons
qTL = prt( udTL*(uwt/2000), "qTL", "(ton)")
prt( ceil(Int, qTL/qmax), "No. TL", "", 0);
qTL	= 6.00 (ton)
No. TL	= 1 

3. Before contacting the carrier to negotiate (and using Jan 2018 PPI), what would have been the estimated TL transport charge for this shipment?

image.png

In [3]:
d = 532                                                      # Google Maps road distance
ppiTL = 131.0                                                # TL PPI for Jan 2018
rTL = prt( 2.00ppiTL/102.7, "rTL", "(\$/mi)")
cTL = prt( ceil(qTL/qmax) * rTL * d, "cTL", "(\$)");
rTL	= 2.55 ($/mi)
cTL	= 1,357.20 ($)

4. Using the Jan 2018 PPI LTL rate estimate, what was the transport charge to ship 15 cartons LTL?

image.png

In [4]:
udLTL = 15                                                   # cartons
qLTL = prt( udLTL*(uwt/2000), "qLTL", "(ton)")
ppiLTL = 177.4                                               # LTL PPI for Jan 2018

rateLTL(q,s,d,ppi) = ppi*(s^2/8 + 14)/((q^(1/7) * d^(15/29) - 7/2) * (s^2 + 2*s + 14))

rLTL = prt( rateLTL(qLTL,s,d,ppiLTL), "rLTL", "(\$/ton-mi)")
cLTL = prt( rLTL * qLTL * d, "cLTL", "(\$)");
qLTL	= 0.30 (ton)
rLTL	= 3.78 ($/ton-mi)
cLTL	= 602.81 ($)

5. What would the shipment size have to be so that the TL and LTL charges are equal?

image.png

In [5]:
using Optim

cTLh(q) = ceil(q/qmax) * rTL * d
cLTLh(q) = rateLTL(q,s,d,ppiLTL) * q * d
qI = optimize(q -> abs(cTLh(q) - cLTLh(q)), 0, qmax).minimizer
Out[5]:
0.795952965018524
In [6]:
# Using LB = 0, UB = qmax for 1-D bounded interval search instead of Nelder-Mead
optimize(q -> abs(cTLh(q) - cLTLh(q)), 0, qmax)
Out[6]:
Results of Optimization Algorithm
 * Algorithm: Brent's Method
 * Search Interval: [0.000000, 6.111111]
 * Minimizer: 7.959530e-01
 * Minimum: 7.309245e-06
 * Iterations: 33
 * Convergence: max(|x - x_upper|, |x - x_lower|) <= 2*(1.5e-08*|x|+2.2e-16): true
 * Objective Function Calls: 34

Brent's method (1973) is the default method used for univariate optimization in many software packages including Optim (Nelder-Mead is the default for multivariate optimization). It uses parabolic interpolation whenever possible because it can converge to the optimum solution much faster than interval search.

Univariate Optimization¶

$ \begin{eqnarray} x^* &=& \mathrm{arg}\underset{x}{\operatorname{min}} \bigl\{ \, f(x) : L\!B \leq x \leq U\!B \bigr\} \\ T\!C^* &=& f(x^*) \end{eqnarray}$

image.png

6. What are the TL and LTL minimum charges?

image.png image.png

In [7]:
MC_TL =  prt( 45rTL/2, "MC_TL", "(\$)")
MC_LTL = prt( (ppiLTL/104.2) * (45 + d^(28/19)/1625), "MC_LTL", "(\$)");
MC_TL	= 57.40 ($)
MC_LTL	= 87.51 ($)

Independent Transport Charge¶

In [8]:
using CairoMakie
dcf() = display(current_figure())

c0h(q) = min(max(cTLh(q), MC_TL), max(cLTLh(q), MC_LTL))

q = 1/2000:0.01:8                                 # Plot charge from 1 lb to 8 tons
h = lines(q, [c0h(i) for i in q])
h.axis.xlabel = "Shipment Size (ton)"
h.axis.ylabel = "Transport Charge (\$)"
h.axis.title = "Independent shipment charge: Class 200 from 27606 to 32606"
dcf();
No description has been provided for this image

8. Using the same LTL shipment, what is the transport cost found using the undiscounted CzarLite tariff?

image.png

In [9]:
q = qLTL
i = 2
disc = 0
MC = 95.23
ODi = 127.69
ci = prt( ODi*20*q, "ci")
ODip1 = 99.92
qBi = 0.5
cip1 = prt( ODip1*20*qBi, "cip1")
c_tar = prt( (1 - disc)*max(MC, min(ci, cip1)), "c_tar");
ci	= 766.14 
cip1	= 999.20 
c_tar	= 766.14 

Ex 2: Spot Quotes¶

Continuing with previous Ex:

(a) Before getting a TL spot quote, what is the current estimate assuming we will be shipping the same 300 cartons next Tuesday (the previous Ex was for 2018)?

In [10]:
uwt = 40                                               # lb
ucu = 9                                                # ft3
s = uwt/ucu                                            # lb/ft3
Kwt = 25                                               # ton
Kcu = 2750                                             # ft3
qmax = min(Kwt, s*Kcu/2000)                            # ton
udTL = 300                                             # cartons
qTL = udTL*(uwt/2000)                                  # ton
qTLlb = prt( 2000qTL, "qTLlb", "(lb)")
d = 532                                                # Google Maps for road distance
ppiTL = 189.015                                        # TL PPI Aug 2024 (P), provisional
rTL = prt( 2.00ppiTL/102.7, "rTL", "(\$/mi)")
cTL = prt( ceil(qTL/qmax) * rTL * d, "cTL", "(\$)");
qTLlb	= 12,000.00 (lb)
rTL	= 3.68 ($/mi)
cTL	= 1,958.25 ($)

(b) TL spot quote from Coyote (to get quote, said shipping 12,000 lb of hinges):

image.png

(c) What is the spot quote for the reverse trip from Gainesville (32606) to Raleigh (27606)?

image.png

(d) Before getting a LTL spot quote, what is the current estimate assuming we will be shipping the same 15 cartons next Tuesday?

In [11]:
udLTL = 15                                             # cartons
qLTL = udLTL*(uwt/2000)                                # ton
qLTLlb = prt( 2000qLTL, "qLTLlb", "(lb)")
ppiLTL = 243.762                                       # LTL PPI Aug 2024 (P)

rateLTL(q,s,d,ppi) = ppi*(s^2/8 + 14)/((q^(1/7) * d^(15/29) - 7/2)*(s^2 + 2*s + 14))

rLTL = prt( rateLTL(qLTL,s,d,ppiLTL), "rLTL", "(\$/ton-mi)")
cLTL = prt( rLTL * qLTL * d, "cLTL", "(\$)");
qLTLlb	= 600.00 (lb)
rLTL	= 5.19 ($/ton-mi)
cLTL	= 828.31 ($)

(e) LTL spot quote from FedEx LTL website (qLTL = 0.3 ton = 2000(0.3) = 600 lb):

image.png

image.png

(f) LTL spot quote from Coyote (Can only ship as pallets, so using two 48 in. x 48 in. pallets with total height of 59 in.):

image.png

image.png

image.png

In [ ]: