/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/ /* [ Created with wxMaxima version 22.04.0 ] */ /* [wxMaxima: input start ] */ fpprintprec:4; /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ T(t)=t/m; /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ L(l,v):=l/(m*v); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ R0(ppd, l,q,L,cpd,cpm,n):=n*(ppd*l*q/(2*L)-cpd*l/L*dstCoeff-cpm); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ Pr0(ppd, l,q,L,n):=n*ppd*l*q/(2*L); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ R1(ppd, l,demand,L,cpd,cpm,n):=ppd*l*demand-n*(cpd*l/L*dstCoeff+cpm); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ Pr1(ppd,l,demand):=ppd*l*demand; /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ numer:true$ /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] l km, demand goods/month, ppd money/good/km [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ l:109.9/2$ demand:20.3$ ppd:0.22$ m:6.4$ dstCoeff:sqrt(2)$ /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] v km/h, cp capacity, tu minutes for loading unloading, cpd cost/km, cpm cost/month [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ /*v:[6,3,5,4,6]$ cp:[1,4,4,6,2]$ tu:[5,5,5,5.5,5]$ cpd:[.09,0.12,0.14, 0.17,.09]$ cpm:[0.24,0.24,0.48, 0.52,.24]$ names:[Irish1,Irish1,pair1Irish,pair1Irish,Irish1]$ /*piece goods 1,4,4,6,2*/ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ /*v:[5,4,6,4,3,5,6]$ cp:[6,2,2,6,7,7,7]$ tu:[5.5,5,5, 5.5, 5, 5, 5]$ cpd:[0.17,0.09, 0.11, 0.17, 0.12, 0.14, 0.19]$ cpm:[0.52,0.12,0.22, 0.58, 0.24, 0.48, 0.94]$ names:[Irish2. pony1,pony2, Friesian2, Irish1, Irish2, Irish2x2]$ /*foods*/ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ /*v:[4, 5,4,7]$ cp:[1, 4, 6, 6]$ tu:[3.5, 5, 5.5, 5.5]$ cpd:[0.09, 0.14, 0.17, 0.22]$ cpm:[0.12, 0.48, 0.52, 0.98]$ names:[pony1, Irish2, Irish2, Irish2x2]$ /*piece goods*/ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ v:[5]$ cp:[21]$ tu:[3.5]$ cpd:[0.00]$ cpm:[0.86]$ names:[livestock]$ /*livestock*/ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ /*v:[7]$ cp:[10]$ tu:[7.5]$ cpd:[0.05]$ cpm:[12.48]$ names:[Irish2]$ /*passengers*/ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ /*v:[4/*7*/]$ cp:[50]$ tu:[60]$ cpd:[0.09]$ cpm:[0.12]$ names:[Irish2]$ /*mail*/ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ /*v:[12,10,12,12]$ cp:[75,25,50,8]$ tu:[67.5,52.5,52.5, 90]$ cpd:[.01,0.00,0.00, 0.00]$ cpm:[213.02,40.14,40.30, 40.40]$ names:[brig, Norfolk,Humber, ??, Dogger]$ /*all 75, pax5 mail 250, fishfood, fishfood, live fish*/ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ v1:2*l/(2*l/v*dstCoeff+tu/60)$ print("average velocity is",v1)$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ q:2*demand*L(l,v1)$ n:floor(q/cp)+1$ print("We need",q, "cargo to satisfy the demand and", n, "convoys to just overpass it.")$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ L1:n*cp/(2*demand)$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ print("Revenue",R0(ppd, l,cp,L(l,v1),cpd,cpm,n-1), "from", n-1, "convoys, unscheduled. Profit", Pr0(ppd, l,cp,L(l,v1),n-1)," cost",-R0(ppd, l,cp,L(l,v1),cpd,cpm,n-1)+Pr0(ppd, l,cp,L(l,v1),n-1))$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ print("Revenue",R1(ppd, l,demand,L(l,v1),cpd,cpm,n), "from", n, "convoys unscheduled. Profit", Pr1(ppd,l,demand), "cost", -R1(ppd, l,demand,L(l,v1),cpd,cpm,n)+Pr1(ppd,l,demand))$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ print("Revenue",maxRevenue:R1(ppd, l,demand,L1,cpd,cpm,n), "from", n, "convoys scheduled. Profit",Pr1(ppd,l,demand), "cost", -R1(ppd, l,demand,L1,cpd,cpm,n)+Pr1(ppd,l,demand))$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ print("A convoy, unscheduled, needs", floor(2*L(l,v1)*m), "hours and", 60*mod(2*L(l,v1)*m,1),"minutes or",2*L(l,v1),"months between departures")$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ print("Every one carried good covers", 1/2/L(l,v1), "of the demand per month")$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ print("Short service.", 60*m*cp/2/tu, " Maximum cover of the demand per month. Pick minimum cost/month if short service is enough")$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ print("Scheduled departures every",floor(2*L1/n*m), "hours and", 60*mod(2*L1/n*m,1),"minutes, for", n, "convoys")$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ print("Scheduled departures every",floor(2*L1/(n-1)*m), "hours and", 60*mod(2*L1/(n-1)*m,1),"minutes, for", n-1, "convoys")$ /* [wxMaxima: input end ] */ /* Old versions of Maxima abort on loading files that end in a comment. */ "Created with wxMaxima 22.04.0"$