With all the renewable energy getting on-line, electricity production becomes more stochastic, and that calls for energy buffers to even out (temporal) mismatches between production and demand. So storage models are very popular nowadays.

Statistics: Posted by outrun — May 26th, 2017, 1:08 pm

]]>

]]>

I reckon it's an optimal flow algorithm to determine the largest daily flow the system will meet. And the associated cost in delivery of the water supply.It could be a linear programming model.

These kinds of models have greater applicability than just water slushing in pipes. Very useful stuff IMO.

Yes, dynamic programming.

It's like a large bucket where people take out water and which you have to fill to ensure it doesn't run empty. The inflow rate schedule is the thing you optimize and the cost is typically non-constant. The cost could be deterministic (e.g. you have a 3 year contract where the "office hour electricity prices" are always X and "nighttime prices" are always Y) or dynamic/stochastic. Dynamic comes in two flavors: the price can be a stochastic spot price, or you can have a forward market. If it's dynamic then you end up with option type of models.

The inflow rate you need to optimize also has an upperbound, and so does the bucket volume.

There storage models show up in various places. This was clean water production, but I've also build gas storage models where companies would buy and store gas when the market prices are low, and extract and sell it when the prices are high. A power plant that's used fuel to generate electricity is also very similar. All are almost the same thing!

Statistics: Posted by outrun — May 26th, 2017, 8:49 am

]]>

I think this is not a feasible project for Amin in the short term. Formal mathematics and symbols won't help. You first need to get insights into the issues (I am sure that Paul will testify to this) I would suggest to start with convection diffusion/Burgers' equation to encounter essential modelling difficulties.

Here is a nice,well-written article (as with waterhammer they use Method of Characteristics) with Strang Splitting (cool) to model the convection part.

Strange that this approach is not used so much in finance..

http://www4.ncsu.edu/~acherto/papers/Ch ... rganov.pdf

Program it up and examine the output.

Statistics: Posted by Cuchulainn — May 26th, 2017, 8:30 am

]]>

Statistics: Posted by Cuchulainn — May 26th, 2017, 8:12 am

]]>

I (very) vaguely remember having to model valve characteristics in the model

Statistics: Posted by Cuchulainn — May 25th, 2017, 9:58 pm

]]>

outrun wrote:Cool. I once worked on a water storage and transportation optimising model for the Rotterdam region, and that shockwave at 1:15 was the thing to avoid. If that ever happened (due to the storage running empty and a sudden pressure drop) it would cost billions!

Exactly! The program I worked on was first on a CCD 6600 supercomputer (took 3 hours to complete), then I ported it to a Pr1me minicomputer and was faster. As time went on new snazzy valves, surge tanks and etc. had to be added to avoid such potential calamities.

I suppose your model,was a yuge network of pipes and links. What were you optimising? Flow accesssibility?

// Method of Characteristics is cool because you can reduce a PDE to a ODE and then solve the ODE along characteriistic curves. The 2X2 system is for speed and hydrostatic pressure.

Cool! So you helped them design the protections at the right places with the right dimensions based on simulations?

I had to look at the *profitability* of the company. Their operation was highly over-dimensioned because of people like you , everything had triple backups, their target failure rate was once every 5000 years.

I had to figure out how they could make more money. That had to be found by minimising cost, and the main cost element was energy consumption. They have big pump and pipes that transport huge amounts of water from lakes in the region, then they have to clean that water which also consumes a lot of energy, then pump it in a buffer reservoir, and finally push it into the regional nets.

To optimize the reservoir I looked at water consumption patters (people shower in the morning, they cook in the evening, they hardly use any water at night etc). Based on that I made a real option model of the water reservoir and how to operate it up in such a way that it alway had enough water to match demand while at the same time minimize their energy cost. I use Bellman equations for this. At night electricity prices are half that of daytime prices so they ended up cleaning more water at night, and less during the day-time, and and as consequence letting the volume in the reservoir swing more during the day. That last bit was hard to sell to the ultra-conservative managers.

Changing the collection schedule of water from the lakes was also very interesting. I tried to move that to the night time as well, but the resistance of the pipes grows with the flow speed. transporting a lot at night at higher flow rates and less during the day increases the overall eletricity consumption, .. but not the costs of electricity.

It was a great fun project, mainly because of the peek in the kitchen, and because it was interesting to expose them to QF methods and ideas.

Statistics: Posted by outrun — May 25th, 2017, 7:42 pm

]]>

Cool. I once worked on a water storage and transportation optimising model for the Rotterdam region, and that shockwave at 1:15 was the thing to avoid. If that ever happened (due to the storage running empty and a sudden pressure drop) it would cost billions!

Exactly! The program I worked on was first on a CCD 6600 supercomputer (took 3 hours to complete), then I ported it to a Pr1me minicomputer and was faster. As time went on new snazzy valves, surge tanks and etc. had to be added to avoid such potential calamities.

I suppose your model,was a yuge network of pipes and links. What were you optimising? Flow accesssibility?

// Method of Characteristics is cool because you can reduce a PDE to a ODE and then solve the ODE along characteriistic curves. The 2X2 system is for speed and hydrostatic pressure.

Statistics: Posted by Cuchulainn — May 25th, 2017, 6:37 pm

]]>

]]>

https://en.wikipedia.org/wiki/Water_hammer

While back I wrote the program for Stadtsverwarming for den Haag using this model. Method of Characteristics.

Statistics: Posted by Cuchulainn — May 25th, 2017, 3:28 pm

]]>

]]>

I'm trying to use the cumulats method which you can find here:

http://www.math.ku.dk/~rolf/DufGoldJoD.pdf

I also code a Monte Carlo method to compare the prices of swaptions computed via the cumulats method. I have found some errors between the 2 prices for swaptions ATM.

Does anyone has any advice? Is it possible that this approximation does not work well in the ATM case?

When I try to price ITM and OTM swaptions, the prices computed with the 2 methods are pretty close (both G3 and CIR2).

Statistics: Posted by Elia — May 25th, 2017, 7:39 am

]]>

]]>

Amin wrote:For those friends who would want to solve other partial differential equations like Navier Stokes in 3d using this method, they would have to use a Taylor series expansion in 4d (3d space + 1d time) where they would need derivatives of initial data for each velocity component (in 3d) with respect to space for all three dimensions and they could substitute the Navier Stokes PDE for time dependent partial derivatives in order to convert them into spatial derivatives with respect to initial data. Boundary conditions would require some extra tact. Though writing this program is on my list of things to do and I plan to post it here, if you would want some challenging application of Navier Stokes PDE with special boundaries using this new method, I would love to try to be of help.

There would also be special cases when all spatial derivatives of velocity vector components would not be available and we would need special methods to solve the PDE that could take advantage of the knowledge of the analytic structure of the solution of Navier Stokes PDE.

In three space dimensions and time, given an initial velocity field, there exists a vector velocity and a scalar pressure field, which are both smooth and globally defined, that solve the Navier–Stokes equations.

If you solve it I get 10% of the prize.

Of course, we can use Taylor expansion of components of vector velocity as a function of its 3d position + time. All we need are initial space derivatives of velocity vector components which are given by initial data and partial derivative of each velocity component with respect to initial time which are in turn converted to space derivatives of the initial data using Navier Stokes equation. Space derivatives of pressure(used in calculation of time derivatives after substitution of Navier Stokes equation where they occur) would be found by application of Bernoulli principle on initial velocity data and time derivatives of pressure which would be non zero in case of unsteady flow would again be found by appropriate application of Bernoulli's principle. If we cannot find all derivatives of velocity and pressure we can write a simple explicit numerical algorithm to advance the solution in time whose order would depend upon number of derivatives of velocity and pressure that are available or the number of derivatives of velocity components and pressure that can easily be calculated. Once we have found velocity forward in time, we can easily apply Bernoulli principle again to calculate pressure field forward in time.

Do friends agree?

Statistics: Posted by Amin — May 24th, 2017, 6:36 pm

]]>

To do an exact comparison between the quoted EURGBP and the synthetic EURGBP XCCY I think you first have to bootstrap the EURUSD FX forwards and the GBPUSD FX forwards, then obtain the synthetic EURGBP forwards as the ratio of the formers, and finally from that synthetic curve reprice the EURGBP XCCY to find the spread that makes its PV = 0.

To do an approximate comparison you can do this:

- start with the case of 1 period (3 months) XCCY swaplets that start today. If you disregard the difference in discount factors between 3 months EUR discounting and 3 month GBP discounting then you will see that the 1 period EURGBP spread should be equal to approximately the difference between the 1 period GBPUSD spread and the 1 period EURUSD spread (there would be no approximation if the spreads were paid upfront, the day count applied to the spreads were all the same, and the EURGBP swaplet was collateralized in USD)
- next consider that a resettable XCCY is just a sum of forward start 1 period XCYY swaplets, and you obtain that the resettable EURGBP XCCY spread is approximately equal to the difference between the resettable GBPUSD spread and the resettable EURUSD spread.

Statistics: Posted by antoineconze — May 24th, 2017, 8:46 am

]]>