AndrewG

195 Reputation

7 Badges

11 years, 319 days

MaplePrimes Activity


These are replies submitted by AndrewG

Ok, thanks Carl Love.

Thank you Kitonum.

Thanks!  Does this way only offer one solution?  What I'm saying is, suppose another set of equations offers 3 solutions, would LPSolve just pick one at random for display?

Also if I wanted to list all of my possibilities of selections for $200 with their respective capacities, would the seq command be the way to go? 

 

Ok, Best Buy has/had 3 types of usb sticks on sale a 32Gb for $15, 64Gb for $20 and 128Gb for $30.  So say I was allowed $200 to buy any I wanted. 
The equation then is 15*x+20*y+30*z=200

Not all of the choices I make will give me the largest storage option.  I want to maximize the storage space I buy. 

32*x+64*y+128*z=s. 

What solutions of 15*x+20*y+30*z=200 put into 32*x+64*y+128*z=s will maximize s?  

 

@Christian Wolinski isolve, thanks.  That should do the trick.

Another year and I'm tracking again, this time right from the beginning.  Oct 14 is when we first turned on our furnace and we started with 78%. If the winter is similar to last year and we use roughly the same thermostat settings same house and we get to 73.5% by Nov 27 (from last years data) we should be ok.  For interest the size of the house ~ 1000 sq ft. in a fairly protected area ie. not in an open field. 

From my first post where the data ended Feb 4th the forcasted line was L1 := 74.7923770273075-.344160464909419*x and we ended up being just 3 days off on the prediction.  However, the change in the guage on the propane tank over 3 days isn't really noticeable and it's measured on a scale with 5% graduation markings so lots of room for error we are well within a good prediction range.

Unless this winter is particularly cold, I don't expect to have to worry about running out of propane.  And as long as the wife doesn't think it's too cold in the house we're good for the winter.   

Here's an update on my data collection.  We seem to have forecasted quite well. 

FYI, we keep the thermostat at 64 deg F during the day and 63 deg F at night.  A few times we've bumped it up to 65 and maybe 66 but rarely.  I realize this is probably much colder than most people keep their houses at but that's what we have to do if we want to stretch out the use of our 1500L (1800L size tank) for the whole winter. 


 

Do I have enough propane for the winter?

``

I've taken some measurements from my propane tank throughout the winter.  Now we can use Maple to see if we have enough to last the rest of the winter.

NULL

a := [["nov 27, 2017", 73.5], ["dec 9, 2017", 72], ["dec 16, 2017", 69], ["dec 31, 2017", 62], ["jan 12, 2018", 60], ["jan 19, 2018", 56], ["jan 26, 2018", 54], ["feb 4,2018", 51], ["feb 11, 2018", 47], ["feb 13, 2018", 45], ["feb 26, 2018", 42.5], ["mar 1, 2018", 42], ["mar 9, 2018", 40], ["mar 17, 2018", 37], ["mar 24, 2018", 35], ["apr 1, 2018", 32], ["apr 4, 2018", 31], ["apr 9, 2018", 30]]

[["nov 27, 2017", 73.5], ["dec 9, 2017", 72], ["dec 16, 2017", 69], ["dec 31, 2017", 62], ["jan 12, 2018", 60], ["jan 19, 2018", 56], ["jan 26, 2018", 54], ["feb 4,2018", 51], ["feb 11, 2018", 47], ["feb 13, 2018", 45], ["feb 26, 2018", 42.5], ["mar 1, 2018", 42], ["mar 9, 2018", 40], ["mar 17, 2018", 37], ["mar 24, 2018", 35], ["apr 1, 2018", 32], ["apr 4, 2018", 31], ["apr 9, 2018", 30]]

(1)

with(Finance)  NULL

pts := [seq([DayCount(a[1, 1], a[i, 1]), a[i, 2]], i = 1 .. nops(a))]

[[0, 73.5], [12, 72], [19, 69], [34, 62], [46, 60], [53, 56], [60, 54], [69, 51], [76, 47], [78, 45], [91, 42.5], [94, 42], [102, 40], [110, 37], [117, 35], [125, 32], [128, 31], [133, 30]]

(2)

with(plots)

listplot(pts)

 

Adding a 30% and 20% level to the graph.  We probably shouldn't be too worried about the cold in June so DayCount("Nov 27, 2017", "Jun 1, 2018") = 186 we'll extend these reference lines out to 186.

plot({pts, [[0, 20], [186, 20]], [[0, 30], [186, 30]]}, view = [default, 0 .. 80])

 

 

30% is the recommended level your propane company wants you to fill up at.  The technician who installed the tank said 20% is all right.  It's up to you if you want to go to 10% but if you run out of propane the company has to come in and do a leak test on your system which is an added cost you don't want.  So let's predict at what point we need to start worrying about filling up our propane tank.  To do that, of course, all we need is a forecast line.  For that we'll just calculate a best fit.

 

a1 := [seq(DayCount(a[1, 1], a[i, 1]), i = 1 .. nops(a))]

[0, 12, 19, 34, 46, 53, 60, 69, 76, 78, 91, 94, 102, 110, 117, 125, 128, 133]

(3)

a2 := a[() .. (), 2]

[73.5, 72, 69, 62, 60, 56, 54, 51, 47, 45, 42.5, 42, 40, 37, 35, 32, 31, 30]

(4)

X := convert(a1, Vector)

Y := convert(a2, Vector)

with(Statistics)

L1 := LinearFit([1, x], X, Y, x, weights = [1, `$`(1, nops(a2)-1)])

HFloat(74.38775152653564)-HFloat(0.34148443019869407)*x

(5)

Plotting it all together

plot({L1, pts, [[0, 20], [186, 20]], [[0, 30], [186, 30]]}, x = 0 .. 200, y = 0 .. 80, labels = ["Days", ""], tickmarks = [default, [seq(10*i = cat(10*i, "%"), i = 1 .. 8)]])

 

Projecting the line to 30% we get

solve(L1 = 30)

129.9847009

(6)

This 30% prediction is based on the forecasted line.  Obviously we reached 30% at 133 days April 9.

AdvanceDate(a[1, 1], trunc(solve(L1 = 30)))

Record(monthDay = 5, month = 4, year = 2018, format = "%B %e, %Y", ModulePrint = proc (m) Finance:-FormatDate(m) end proc)

(7)

April is still a bit chilly so maybe if we wait until 20%, of course it's getting warmer all this time so our usage should go down.  

AdvanceDate(a[1, 1], trunc(solve(L1 = 20)))

Record(monthDay = 5, month = (), year = 2018, format = "%B %e, %Y", ModulePrint = proc (m) Finance:-FormatDate(m) end proc)

(8)

It isn't warm enough to turn off the furnace yet but it looks like we'll have enough to get us into the warm months

AdvanceDate(a[1, 1], trunc(solve(L1 = 10)))

Record(monthDay = 3, month = 6, year = 2018, format = "%B %e, %Y", ModulePrint = proc (m) Finance:-FormatDate(m) end proc)

(9)

We'll hit 10% well into late spring and almost right into summer of course it's a rough estimate however it looks like we won't have to fill up during the high price winter season.  I can tell my wife to relax, we should have enough propane for the winter.

 

Conclusion

This gives a fairly decent forecast provided you don't change the thermostat too much during the winter months or the weather doesn't get too extremely cold.   


 

Download Propane_usage-2.mw

@Rouben Rostamian  I was just doing it by eye and they looked the same.  Thanks for proving otherwise. 

@tomleslie & @Rouben Rostamian

It looks like to me all that happened was the best fit line, that was calculated originally, is just moved without changing orientation to pass through the point (ie slope remains unchanged).  That would suggest that a line passing through any of the points in the data would retaine the same slope.  Strange how it works that way.  Am I correct in saying that?

@Preben Alsholm yes that's what I meant

@Preben Alsholm so it essentially does what you've done without using the weights option.

@Rouben Rostamian  Thanks for that.  Works good. 

I think the best I can do is use the weights option. 

L := LinearFit(b*x+a, pts1, pts2, x, weights = [1, 1, 200, 1, 1, 1])
                                                   L := 12.6067534055780+4.15810034989978*x

Setting the weights high gets it fairly close
solve(L=2)
    20.9229541053776

plot({L, pts}, x = 0 .. 20)

 

 

@Rouben Rostamian  Hi, that particular surface was one I picked at random.  I chose that one for interest, but for calculations sake another bumpy surface would be okay. 

@nm I would like it better without the E.  I found a command Scale10 but it doesn't work like I thought.  Funny though as I mentioned to Markiyan that Maple doesn't have a convert to scientific notation command.

1 2 3 4 5 Page 1 of 5