# Equal area algorithm to find shock location

I am looking to solve 1D burgers equation with various random initial conditions. What is the best algorithm to find the exact solution?

One method that is covered in literature is the equal area principle (R. J. LeVeque, Numerical Methods for Conservation Laws). Is this the standard procedure employed in numerics papers on limiters (for ex: this paper) for the exact solutions?

Can anyone provide a pseudo-code or algorithm to implement this method to find the shock location and hence the exact solution?

• No, what one usually uses is the method of characteristics with a newton iteration. In the region where characteristics have crossed, you need to initialize the iteration with a good guess so you converge to the right value. – David Ketcheson Jun 14 '18 at 11:22
• How exactly do you represent "exact solutions"? On computers, you cannot store the values of a function everywhere (because there are infinitely many points, but only finitely much memory). The only way to represent a function exactly is to provide a formula, but most solutions of PDEs can not be written as a formula. – Wolfgang Bangerth Jun 14 '18 at 22:50
• @DavidKetcheson I understand that method of characteristics with newton iteration gives the weak solution. However, when there are shocks this method results in multi-valued solution which can be eleminated by equal-area rule. Can you please expand on how to do this? For reference page 11 in this document. – gk1 Jun 17 '18 at 16:12
• @WolfgangBangerth Can't method of characteristics be used to get the exact solutions. I don't need to store it every point, I just need a representation like the red line in Fig. 4.1 of this paper, for example. Am I misunderstanding your point? Put in other words, my question was how to apply method of characteristics when there is a shock. – gk1 Jun 17 '18 at 16:28
• I see, you just need a procedure to compute the solution on a piece of paper. Yes: in that case you get a multivalued solution, and you need to be able to select. In general, entropy conditions (or the Rankine-Hugoniot condition) are what selects the physical one. – Wolfgang Bangerth Jun 21 '18 at 3:04