Espindola's bloghttps://blog.espindo.la/Espindola's blogenFri, 19 Oct 2018 06:08:43 GMTNikola (getnikola.com)http://blogs.law.harvard.edu/tech/rssIs LNQ friend or foe?https://blog.espindo.la/posts/is-lnq-friend-or-foe/Rafael Ávila de Espíndola<div><p>The BC government has recently reached an agreement to allow the
construction of a liquefied natural gas processing and export facility in
<a class="reference external" href="https://www.lngcanada.ca/">Kitmat</a>.</p>
<p>The discussion about the project has been a bit similar to the site C
discussion. Some mention the economic advantage, others mention local
environmental risks. As with the site C, I think that is missing the
point. I think we have to focus on the transition to renewable energy
sources and the climate change impact.</p>
<p>The <a class="reference external" href="https://www.bcgreens.ca/weaver_statement_on_lng_canada_fid">bc green party argument</a> is at
least focused on green house gasses emissions. But it doesn't look at
what LNG might be used for.</p>
<p>According to the lngcanada's website, a target market is Asia, where
the gas would be used as a replacement for coal. Since the gas
production would be in BC and the coal power plants are not, I think
it is important to look at the global balance, not just the BC
emissions.</p>
<p>It is clear that LNG is not a renewable energy source. But if it is
better than sources like coal, we should consider the possibility that
it is a useful tool for the transition. Is it better to burn gas
instead of coal while renewable sources come online?</p>
<p>Lets first look at the difference in emissions by burning gas instead
of coal. Natural gas is mostly methane, which is the simplest
hydrocarbon with a formula <span class="math">\(CH_4\)</span>. The first thing to notice is
that the atomic mass of carbon is 12, while that of hydrogen
is 1. That means that even the simplest hydrocarbon is <span class="math">\(12/16\)</span>
or <span class="math">\(75\%\)</span> carbon by mass.</p>
<p>As for <span class="math">\(CO_2\)</span>, the atomic mass of oxygen is <span class="math">\(16\)</span>, which
means that the the mass of <span class="math">\(CO_2\)</span> is <span class="math">\(2*16 + 12 =
44\)</span>. So <span class="math">\(CO_2\)</span> is <span class="math">\(12/44\)</span> or <span class="math">\(27\%\)</span> carbon by
mass.</p>
<p>The <a class="reference external" href="https://en.wikipedia.org/wiki/Heat_of_combustion">available energy</a> from burning
methane is <span class="math">\(50\)</span> MJ/kg. Since we are interested about the
produced CO2, the energy content is <span class="math">\(50/0.75\)</span> or <span class="math">\(66\)</span>
MJ/kg of carbon. For high grade coal it is <span class="math">\(32.50\)</span> MJ/kg. This
quick calculation matches the <a class="reference external" href="https://en.wikipedia.org/wiki/Natural_gas">claim</a> that per KWh natural gas
produces half as much CO2 as coal.</p>
<p>So we have that each Kg of carbon from LNG used in electricity
generation saves one Kg of carbon in the atmosphere. Given their
atomic masses, a Kg of carbon is present in <span class="math">\(16/12\)</span> Kg of
methane and <span class="math">\(44/12\)</span> Kg of <span class="math">\(CO_2\)</span>. So it looks like burning
1 Kg of methane produces (and saves) <span class="math">\(44/16 = 2.75\)</span> Kg of
<span class="math">\(CO_2\)</span>.</p>
<p>The proposed Kitmat project is expected to produce <span class="math">\(14\)</span> mega
tonnes (<span class="math">\(1.4*10^{10}\)</span> Kg) per year of LNG. The estimates on the
green house emissions per year range from <span class="math">\(3.4\)</span> to <span class="math">\(10\)</span>
mega tonnes of <span class="math">\(CO_2\)</span> equivalent. That is surprisingly
inefficient. The reason for the inefficiency seems to be that methane
is, over a <span class="math">\(100\)</span> years time frame, <span class="math">\(20\)</span> times worse than
<span class="math">\(CO_2\)</span> for global warming. So a small leak (<span class="math">\(5\%\)</span> say)
dwarfs other production problems.</p>
<p>Even taking the <span class="math">\(10\)</span> mega tonnes <span class="math">\(CO_2\)</span> equivalent number,
it would seem that if the LNG is used to replace coal than the project
would still save <span class="math">\(14*2.75 - 10 = 28.5\)</span> mega tonnes equivalent
per year.</p>
<p>The total emissions from the project are <span class="math">\(14*2.75 + 10\)</span> mega
tonnes of <span class="math">\(CO_2\)</span> equivalent. That is, <span class="math">\(4.85 * 10^{10}\)</span>
Kg. Given the <span class="math">\(50\)</span> MJ/Kg heat of combustion and a <span class="math">\(50\%\)</span>
efficient generator, the total electricity that can be generated per
year is <span class="math">\(1.4*10^{10} * 50*10^6/2 = 3.5*10^{17}J\)</span> or <span class="math">\(9.72
*10^{10}\)</span> KWh. So the emissions are about <span class="math">\(499\)</span> g/KWh according
to this estimate.</p>
<p>The above leaves out transportation inefficiency for gas, but coal
mining has its <a class="reference external" href="https://en.wikipedia.org/wiki/Environmental_impact_of_the_coal_industry#Greenhouse_gas_emissions">own problems</a>
too.</p>
<p>A much more <a class="reference external" href="https://pubs.acs.org/doi/abs/10.1021/es505617p">detailed paper</a> using data from
actual power plants when looking at whether the US should export LNG
arrived at <span class="math">\(655\)</span> g/KWh <span class="math">\(CO_2\)</span> equivalent. That would still
be saving <span class="math">\(550\)</span> g/KWh of electricity if replacing coal according
to the same paper.</p>
<p>LNG is a much more complicated case than site C, but it seems that LNG
can be an useful short/medium term tool for reducing emissions. It is
just important be careful on how much methane is leaked.</p>
<p>This also creates an interesting accounting problem on the carbon
market. BC should receive credit if it lowers emissions in Asia. The
same authors seem to have a <a class="reference external" href="https://cedmcenter.org/wp-content/uploads/2017/10/Effect-of-crude-oil-carbon-accounting-decisions-on-meeting-global-climate-budgets.pdf">paper on the subject</a>.</p>
<p>One last thing that I still agree with the greens is that the project
should not be subsidized. If the above analysis is correct, there
should be plenty of demand for LNG and a subsidy is just giving away
free money.</p></div>https://blog.espindo.la/posts/is-lnq-friend-or-foe/Thu, 18 Oct 2018 07:00:00 GMTSite C and the BC Greenshttps://blog.espindo.la/posts/site-c-and-the-bc-greens/Rafael Ávila de Espíndola<div><p>I was disappointed when I first learned that the BC Green Party was
against the constructions of the <a class="reference external" href="https://www.bchydro.com/energy-in-bc/projects/site_c.html">Site C hydroelectric dam</a>. The
only criticism of the project I saw at the time was about loss of
land and harm to local communities and environments.</p>
<p>Those are the arguments I would expect from a "tree hugger", not a
factual environmentalist. Looking into it I found out that the BC
Greens actually have a good reason for opposing the project and I would
like to share it.</p>
<p>I think the "tree hugger" arguments are weak because our fossil fuel
dependency and global warming are critical problems. If those are not
solved we risk far greater damage to our society and environment.</p>
<p>To solve these great problems we need renewable energy sources. Gains
in efficiency will not be sufficient. In Canada the <a class="reference external" href="https://en.wikipedia.org/wiki/List_of_countries_by_energy_consumption_per_capita">energy
consumption per capita</a>
is about 9.6 <span class="math">\(KW\)</span>. As we know from <a class="reference external" href="https://en.wikipedia.org/wiki/The_Matrix">The Matrix</a> (and from a 2 <span class="math">\(KCal\)</span> diet),
a human body consumes about 100 <span class="math">\(W\)</span>, so about 1% of what we
use. We had horses and firewood before industrialization, but it
should be clear that to depend on efficiency gains is suicidal.</p>
<p>Fortunately in BC most of the electricity is already renewable
(hydroelectric), but electricity is just a part of our energy
consumption. We have to replace <a class="reference external" href="http://www.statcan.gc.ca/tables-tableaux/sum-som/l01/cst01/trade37c-eng.htm">our use of gasoline and diesel</a>
and <a class="reference external" href="http://www.statcan.gc.ca/pub/11-526-s/2013002/t003-eng.htm">natural gas</a>. With
the current technology electrifying transportation and heating seems
the best alternative.</p>
<p>I first realized that the Greens must be thinking about this when I
found that their <a class="reference external" href="https://d3n8a8pro7vhmx.cloudfront.net/greenpartybc/pages/2300/attachments/original/1493054476/2017-platform-bcgreenparty-print.pdf">platform</a>
lists electrification.</p>
<p>Lets see how much electricity we need. I got the energy content of the
various fuels from Wikipedia and the efficiency is an educated guess.</p>
<p>5,770,067 cubic meters of gasoline with 32.18 <span class="math">\(GJ/m^3\)</span> thermal and an
engine <a class="reference external" href="https://en.wikipedia.org/wiki/Thermal_efficiency">thermal efficiency</a> of 30% gives
55.7 useful <span class="math">\(PJ\)</span> per year.</p>
<p>1,747,579 cubic meters of diesel with 35.86 <span class="math">\(GJ/m^3\)</span> thermal and an
engine thermal efficiency of 40% gives 25.1 useful <span class="math">\(PJ\)</span> per year.</p>
<p>The natural gas table is already in energy units: 98.1 <span class="math">\(PJ\)</span>. To
replace that with heat pumps with a <a class="reference external" href="https://en.wikipedia.org/wiki/Coefficient_of_performance">coefficient of performance</a> of 4 we
need 24.5 <span class="math">\(PJ\)</span> per year.</p>
<p>The total is 105 <span class="math">\(PJ\)</span> per year, which is 3.34 <span class="math">\(GW\)</span> or
29.25 <span class="math">\(TWh\)</span> per year.</p>
<p>Site C is 5.1 <span class="math">\(TWh\)</span> per year. We need 5.73 times what it would
produce to replace our fossil fuel use.</p>
<p>So we need a lot of electricity, but is Site C the best way to get a
part of it? In a reply to an email I sent about it to the Green Party
I was pointed to a <a class="reference external" href="http://www.andrewweavermla.ca/2015/11/24/seeking-leadership-bc-green-party/">speech</a>
where Andrew Weaver mentions Oregon and Washington. I got curious as to
what they are doing for electricity.</p>
<p>Oregon has a population a bit smaller than BC. In 7 years (2005-2012)
Oregon added 5.6 <span class="math">\(TWh\)</span> per year of <a class="reference external" href="https://en.wikipedia.org/wiki/Growth_of_wind_power_in_the_United_States">wind power</a>.</p>
<p>It seems possible then for BC to get the equivalent of the Site C
generation from wind in the time it would take to finish Site C. Wind
can also be built incrementally, and Site C will produce nothing in
the next 7 years.</p>
<p>Another advantage of wind is that there is a lot of it. According
to <a class="reference external" href="https://www.bchydro.com/content/dam/hydro/medialib/internet/documents/planning_regulatory/iep_ltap/ror/resource_options_update_session_presentation.pdf">BC Hydro</a>
itself there is a potential for 38.9 <span class="math">\(TWh\)</span> per year which is more than
sufficient for replacing current fossil fuel use.</p>
<p>Which brings us to the real reason to oppose Site C: there are other
ways to get our renewable energy and we should consider their
cost. And the cost of wind is <a class="reference external" href="https://blogs.scientificamerican.com/plugged-in/wind-energy-is-one-of-the-cheapest-sources-of-electricity-and-its-getting-cheaper/">very competitive</a>.</p>
<p>And since we are talking cost, why is BC Hydro the one that has to
decide what gets built? Electricity generation is an area that
allows for competition, now more than ever with wind going mainstream.</p>
<p>BC hydro could just buy renewable electricity and let the market
figure out what is the cheapest option. It looks like it would be
wind, but if in the end someone figures out a way to finish Site C at
a lower cost, that would be great.</p>
<p>I was very happy to find out (in the same speech) that that is exactly
the position Andrew is pushing for.</p>
<p>Long story short, my first impression of the party was wrong. I have
decided to join the party and so far I am very happy with that
decision.</p></div>https://blog.espindo.la/posts/site-c-and-the-bc-greens/Sun, 26 Nov 2017 17:00:00 GMTCanadians should not retire at 65https://blog.espindo.la/posts/canada-retire-65/Rafael Ávila de Espíndola<div><p>Or at least, they should not take the canadian pention plan (CPP)
at 65.</p>
<p>The age one should claim a pension depends on the life expectancy, but
also on objectives. In this post I look at a simple objective:
maximizing payments. The post ignores things like reinvesting the
payments or needing the money earlier for whatever reason.</p>
<p>The <a class="reference external" href="https://www.canada.ca/en/services/benefits/publicpensions/cpp/cpp-benefit/amount.html">CPP rules</a>
say that you can claim it any time from 60 to 70, but 65 is the
default, so why not?</p>
<p>To incentivize people to retire later, each month after 65 years
increases the monthly payment by 0.7% (1.4% for two month, 2.1% for
three, 42% at 70 years). In a similar way, each month before 65
reduces the monthly payment by 0.6% (1.2% for two months, 1.8% for
three, 36% at 60 years).</p>
<p>The asymmetry (0.6% versus 0.7%) has in interesting impact. Lets first
look at what would happent without the asymmetry.</p>
<p>Without it, given any retiment month <span class="math">\(T\)</span>, the monthly payment would be</p>
<div class="math">
\begin{equation*}
R(1 + K(T - 65*12))
\end{equation*}
</div>
<p>where <span class="math">\(R\)</span> is the monthly payment you would get at 65 years, and
<span class="math">\(K\)</span> is the relative gain or loss each month (the 0.7% or 0.6% in the
case of the CPP).</p>
<p>Now lets consider when it makes sense to delay retirement from
<span class="math">\(T\)</span> to <span class="math">\(T+1\)</span>. If one dies at <span class="math">\(D\)</span> months, each of the
remaining <span class="math">\(D - (T + 1)\)</span> payments will be <span class="math">\(R*K\)</span> bigger. On
the other hand, one would miss out on the original first payment. So
delaying retirement by one month from <span class="math">\(T\)</span> is worth it when</p>
<div class="math">
\begin{equation*}
(D - (T + 1))R*K > R(1 + K(T - 65*12))
\end{equation*}
</div>
<p>Which simplifies to</p>
<div class="math">
\begin{equation*}
T < \frac{D - \frac{1}{K} - 1 + 12*65}{2}
\end{equation*}
</div>
<p>Since <span class="math">\(T\)</span> is an integer, and it profitable to go from <span class="math">\(T\)</span>
to <span class="math">\(T+1\)</span> when <span class="math">\(T\)</span> is smaller than the right hand side, we
conclude that the best <span class="math">\(T\)</span> to retire is</p>
<div class="math">
\begin{equation*}
T = \left\lceil\frac{D - \frac{1}{K} - 1 + 12*65}{2}\right\rceil
\end{equation*}
</div>
<p>Note for every 2 months increase in the life expectancy <span class="math">\(D\)</span>,
<span class="math">\(T\)</span> goes up by 1. A change of <span class="math">\(K\)</span> is just an offset.
Lets see what a plot looks like for a <span class="math">\(K\)</span> of 0.6% or 0.7%.</p>
<object class="align-center" data="https://blog.espindo.la/canada-retire-65/death_to_retirement.svg" style="width: 800px;" type="image/svg+xml">
/canada-retire-65/death_to_retirement.svg</object>
<p>So if <span class="math">\(K\)</span> were always 0.6% or 0.7% (or any other value), it would
be easy. Make a guess about the life expectancy and read the best
retirement age in the graph.</p>
<p>Given that in the CPP <span class="math">\(K\)</span> changes at 65, what happens at the
transition? When the best retirement age is above 65, we are in the
0.7% rule. When it is below, we are in the 0.6% rule. Let's take a look
at just those data points</p>
<object class="align-center" data="https://blog.espindo.la/canada-retire-65/death_to_retirement_f.svg" style="width: 800px;" type="image/svg+xml">
/canada-retire-65/death_to_retirement_f.svg</object>
<p>There is still an overlap around a life expectancy of 78 years. If
<span class="math">\(T\)</span> were not required to be an integer, the difference in the
best retiment age between two values for K would be</p>
<div class="math">
\begin{equation*}
\Delta T = \frac{D - \frac{1}{K_1} - 1 + 12*65}{2} - \frac{D - \frac{1}{K_2} - 1 + 12*65}{2} = \frac{1}{2K_2} - \frac{1}{2K_1}
\end{equation*}
</div>
<p>For 0.6% and 0.7%, that is about 11.9 months. What we want to find is
when is it worth to transition from</p>
<div class="math">
\begin{equation*}
T_1 = \frac{D - \frac{1}{K_1} - 1 + 12*65}{2}
\end{equation*}
</div>
<p>to</p>
<div class="math">
\begin{equation*}
T_2 = \frac{D - \frac{1}{K_2} - 1 + 12*65}{2}
\end{equation*}
</div>
<p>The logic is the same that we used for retiring from <span class="math">\(T\)</span> to
<span class="math">\(T+1\)</span>: the extra amount earned on the months that are left has
to be larger than the lost payments</p>
<div class="math">
\begin{equation*}
(D - T_2)((65*12 - T_1)K_1 + (T_2 - 65*12)K_2) > (T_2 - T_1)(1 - K_1(65*12 - T_1))
\end{equation*}
</div>
<p>Doing the substitutions (I used <a class="reference external" href="https://www.ginac.de/">GiNaC</a>) we get</p>
<div class="math">
\begin{equation*}
\frac{D^2}{4000} - \frac{39D}{100} + \frac{12276379}{84000} > 0
\end{equation*}
</div>
<p>Which has a solution of a life expectancy just over 77 years and 10
months. For the discrete case we can just test the 0.6% and 0.7%
solutions and pick the best. The combined result is on the last graph:</p>
<object class="align-center" data="https://blog.espindo.la/canada-retire-65/death_to_retirement_c.svg" style="width: 800px;" type="image/svg+xml">
/canada-retire-65/death_to_retirement_c.svg</object>
<p>And indeed, with a life expectancy of 77 years and 10 months one
should retire at 64 years and 6 months. But with a life expectancy
just a month longer, the best retirement age is 65 years and 6 months.</p>
<p>When I first got curious about this I was lazy and just wrote a python
script to try all the possible retirement ages. I was surprised to see
the discontinuity in the graph and decided to do the math to see what
was going on.</p>
<p>The program is available at <a class="reference external" href="https://gitlab.com/rafael.espindola/best-cpp-age">gitlab</a> in case anyone
wants to try it.</p></div>https://blog.espindo.la/posts/canada-retire-65/Sat, 05 Aug 2017 17:00:00 GMTAirbnb crackdown in Victoriahttps://blog.espindo.la/posts/airbnb-victoria/Rafael Ávila de Espíndola<div><p>The Victoria city council <a class="reference external" href="http://www.timescolonist.com/business/victoria-council-may-target-short-term-vacation-rentals-in-housing-crackdown-1.20557393">is trying to restrict short term rentals</a>.</p>
<p>Ironically when we moved to Victoria airbnb made the move much easier
than moving to Toronto a few years before. With airbnb it was possible
to search for various options and find a convenient 1 month rent.</p>
<p>In my previous move there was no airbnb. Despite Toronto being much
bigger, there were fewer choices. There were no reviews on the choices
and paying for it from outside Canada was inconvenient.</p>
<p>The airbnb that we rented for the move is a small basement in a
house. Not the kind of space that would normally be used as a regular
rental or bnb. We had a similar experience in Stratford. The
convenience of airbnb does seem to create options that would simply
not exist otherwise.</p>
<p>Airbnb is criticized for increasing the cost of long term rentals, which
is likely true, but it also creates interesting subletting
possibilities. In trips to Montreal and Vancouver we stayed in units
that were clearly sublet. By crashing at a friend's place for a
weekend a tenant can offset a substantial part of their rent.</p>
<p>But yes, in another trip we have stayed in a pretty conventional
apartment that could have been otherwise rented long term. Even here
it is important to discount the fact that a higher return on
investment for landlords incentivizes the construction of more
units. In the current construction boom in Toronto some of the
buildings are bought mostly for investment. <a class="reference external" href="https://www.theglobeandmail.com/news/investigations/investigation-x2-condo-toronto/article34906278/">Not as many would have
been built otherwise</a>.</p>
<p>There is a fairness issue too. If when traveling to, for example,
Montreal we can stay in a airbnb, it feels wrong to deny the same to
Montrealers visiting Victoria.</p>
<p>Overall increasing the utilization of a scarce resource like space
seems like a good thing, even if renters like myself get the short end
of the stick.</p>
<p>The higher housing prices will also generate higher property
taxes. The surplus could be given back to the community as income, but
that would be another post.</p></div>https://blog.espindo.la/posts/airbnb-victoria/Wed, 12 Jul 2017 04:14:00 GMT