Romberg's method

In numerical analysis, Romberg's method[1] is used to estimate the definite integral by applying Richardson extrapolation[2] repeatedly on the trapezium rule or the rectangle rule (midpoint rule). The estimates generate a triangular array. Romberg's method is a Newton–Cotes formula – it evaluates the integrand at equally spaced points. The integrand must have continuous derivatives, though fairly good results may be obtained if only a few derivatives exist. If it is possible to evaluate the integrand at unequally spaced points, then other methods such as Gaussian quadrature and Clenshaw–Curtis quadrature are generally more accurate.

The method is named after Werner Romberg, who published the method in 1955.

Method

Using , the method can be inductively defined by where and . In big O notation, the error for R(nm) is:[3]

The zeroeth extrapolation, R(n, 0), is equivalent to the trapezoidal rule with 2n + 1 points; the first extrapolation, R(n, 1), is equivalent to Simpson's rule with 2n + 1 points. The second extrapolation, R(n, 2), is equivalent to Boole's rule with 2n + 1 points. The further extrapolations differ from Newton-Cotes formulas. In particular further Romberg extrapolations expand on Boole's rule in very slight ways, modifying weights into ratios similar as in Boole's rule. In contrast, further Newton-Cotes methods produce increasingly differing weights, eventually leading to large positive and negative weights. This is indicative of how large degree interpolating polynomial Newton-Cotes methods fail to converge for many integrals, while Romberg integration is more stable.

By labelling our approximations as instead of , we can perform Richardson extrapolation with the error formula defined below: Once we have obtained our approximations , we can label them as .

When function evaluations are expensive, it may be preferable to replace the polynomial interpolation of Richardson with the rational interpolation proposed by Bulirsch & Stoer (1967).

A geometric example

To estimate the area under a curve the trapezoid rule is applied first to one-piece, then two, then four, and so on.

One-piece approximation
One-piece. Note since it starts and ends at zero, this approximation yields zero area.
Two-piece approximation
Two-piece
Four-piece approximation
Four-piece
Eight-piece approximation
Eight-piece

After trapezoid rule estimates are obtained, Richardson extrapolation is applied.

  • For the first iteration the two piece and one piece estimates are used in the formula 4 × (more accurate) − (less accurate)/3. The same formula is then used to compare the four piece and the two piece estimate, and likewise for the higher estimates
  • For the second iteration the values of the first iteration are used in the formula 16 × (more accurate) − (less accurate)/15
  • The third iteration uses the next power of 4: 64 × (more accurate) − (less accurate)/63 on the values derived by the second iteration.
  • The pattern is continued until there is one estimate.
Number of pieces Trapezoid estimates First iteration Second iteration Third iteration
4 MALA/3 16 MA − LA/15 64 MA − LA/63
1 0 4×16 − 0/3 = 21.333... 16×34.667 − 21.333/15 = 35.556... 64×42.489 − 35.556/63 = 42.599...
2 16 4×30 − 16/3 = 34.666... 16×42 − 34.667/15 = 42.489...
4 30 4×39 − 30/3 = 42
8 39

Example

As an example, the Gaussian function is integrated from 0 to 1, i.e. the error function erf(1) ≈ 0.842700792949715. The triangular array is calculated row by row and calculation is terminated if the two last entries in the last row differ less than 10−8.

0.77174333
0.82526296  0.84310283
0.83836778  0.84273605  0.84271160
0.84161922  0.84270304  0.84270083  0.84270066
0.84243051  0.84270093  0.84270079  0.84270079  0.84270079

The result in the lower right corner of the triangular array is accurate to the digits shown. It is remarkable that this result is derived from the less accurate approximations obtained by the trapezium rule in the first column of the triangular array.

Implementation

Here is an example of a computer implementation of the Romberg method (in the C programming language):

#include <stdio.h>
#include <math.h>

void print_row(size_t i, double *R) {
  printf("R[%2zu] = ", i);
  for (size_t j = 0; j <= i; ++j) {
    printf("%f ", R[j]);
  }
  printf("\n");
}

/*
INPUT:
(*f) : pointer to the function to be integrated
a    : lower limit
b    : upper limit
max_steps: maximum steps of the procedure
acc  : desired accuracy

OUTPUT:
Rp[max_steps-1]: approximate value of the integral of the function f for x in [a,b] with accuracy 'acc' and steps 'max_steps'.
*/
double romberg(double (*f)(double), double a, double b, size_t max_steps, double acc) 
{
  double R1[max_steps], R2[max_steps]; // buffers
  double *Rp = &R1[0], *Rc = &R2[0]; // Rp is previous row, Rc is current row
  double h = b-a; //step size
  Rp[0] = (f(a) + f(b))*h*0.5; // first trapezoidal step

  print_row(0, Rp);

  for (size_t i = 1; i < max_steps; ++i) {
    h /= 2.;
    double c = 0;
    size_t ep = 1 << (i-1); //2^(n-1)
    for (size_t j = 1; j <= ep; ++j) {
      c += f(a + (2*j-1) * h);
    }
    Rc[0] = h*c + .5*Rp[0]; // R(i,0)

    for (size_t j = 1; j <= i; ++j) {
      double n_k = pow(4, j);
      Rc[j] = (n_k*Rc[j-1] - Rp[j-1]) / (n_k-1); // compute R(i,j)
    }

    // Print ith row of R, R[i,i] is the best estimate so far
    print_row(i, Rc);

    if (i > 1 && fabs(Rp[i-1]-Rc[i]) < acc) {
      return Rc[i];
    }

    // swap Rn and Rc as we only need the last row
    double *rt = Rp;
    Rp = Rc;
    Rc = rt;
  }
  return Rp[max_steps-1]; // return our best guess
}

Here is an implementation of the Romberg method (in the Python programming language):

def print_row(i, R):
  """Prints a row of the Romberg table."""
  print(f"R[{i:2d}] = ", end="")
  for j in range(i + 1):
    print(f"{R[j]:f} ", end="")
  print()

def romberg(f, a, b, max_steps, acc):
  """
  Calculates the integral of a function using Romberg integration.

  Args:
      f: The function to integrate.
      a: Lower limit of integration.
      b: Upper limit of integration.
      max_steps: Maximum number of steps.
      acc: Desired accuracy.

  Returns:
      The approximate value of the integral.
  """
  R1, R2 = [0] * max_steps, [0] * max_steps  # Buffers for storing rows
  Rp, Rc = R1, R2  # Pointers to previous and current rows

  h = b - a  # Step size
  Rp[0] = 0.5 * h * (f(a) + f(b))  # First trapezoidal step

  print_row(0, Rp)

  for i in range(1, max_steps):
    h /= 2.
    c = 0
    ep = 1 << (i - 1)  # 2^(i-1)
    for j in range(1, ep + 1):
      c += f(a + (2 * j - 1) * h)
    Rc[0] = h * c + 0.5 * Rp[0]  # R(i,0)

    for j in range(1, i + 1):
      n_k = 4**j
      Rc[j] = (n_k * Rc[j - 1] - Rp[j - 1]) / (n_k - 1)  # Compute R(i,j)

    # Print ith row of R, R[i,i] is the best estimate so far
    print_row(i, Rc)

    if i > 1 and abs(Rp[i - 1] - Rc[i]) < acc:
      return Rc[i]

    # Swap Rn and Rc for next iteration
    Rp, Rc = Rc, Rp

  return Rp[max_steps - 1]  # Return our best guess

References

Citations

Bibliography

  • Richardson, L. F. (1911), "The Approximate Arithmetical Solution by Finite Differences of Physical Problems Involving Differential Equations, with an Application to the Stresses in a Masonry Dam", Philosophical Transactions of the Royal Society A, 210 (459–470): 307–357, Bibcode:1911RSPTA.210..307R, doi:10.1098/rsta.1911.0009, JSTOR 90994
  • Romberg, W. (1955), "Vereinfachte numerische Integration", Det Kongelige Norske Videnskabers Selskab Forhandlinger, 28 (7), Trondheim: 30–36
  • Thacher Jr., Henry C. (July 1964), "Remark on Algorithm 60: Romberg integration", Communications of the ACM, 7 (7): 420–421, doi:10.1145/364520.364542
  • Bauer, F.L.; Rutishauser, H.; Stiefel, E. (1963), Metropolis, N. C.; et al. (eds.), "New aspects in numerical quadrature", Experimental Arithmetic, High-speed Computing and Mathematics, Proceedings of Symposia in Applied Mathematics (15), AMS: 199–218
  • Bulirsch, Roland; Stoer, Josef (1967), "Handbook Series Numerical Integration. Numerical quadrature by extrapolation", Numerische Mathematik, 9: 271–278, doi:10.1007/bf02162420
  • Mysovskikh, I.P. (2002) [1994], "Romberg method", in Hazewinkel, Michiel (ed.), Encyclopedia of Mathematics, Springer-Verlag, ISBN 1-4020-0609-8
  • Press, WH; Teukolsky, SA; Vetterling, WT; Flannery, BP (2007), "Section 4.3. Romberg Integration", Numerical Recipes: The Art of Scientific Computing (3rd ed.), New York: Cambridge University Press, ISBN 978-0-521-88068-8

Read other articles:

Ini adalah nama Batak Toba, marganya adalah Manalu. Jimmy Ramoz Manalu Dansatintel Bais TNIPetahanaMulai menjabat 18 Desember 2023 PendahuluBambang HerqutantoPenggantiPetahanaAsintel Kaskogabwilhan IIMasa jabatan27 September 2023 – 18 Desember 2023 PendahuluMuhammad AliPenggantiBambang HerqutantoInspektur Sekolah Staf dan Komando Angkatan DaratMasa jabatan19 April 2022 – 27 September 2023 PendahuluDiding Sutisna SukarmaPenggantiMuhammad AliKomandan Korem 033/Wira Pra...

 

 

Katleho Makateng Nazionalità  Lesotho Calcio Ruolo Attaccante Squadra  Richards Bay Carriera Squadre di club1 2017-2020 Litsilo? (?)2020-2022 LDF? (?)2022- Richards Bay? (?) Nazionale 2022- Lesotho5 (0) 1 I due numeri indicano le presenze e le reti segnate, per le sole partite di campionato.Il simbolo → indica un trasferimento in prestito. Statistiche aggiornate all'11 maggio 2023 Modifica dati su Wikidata · Manuale Katleho Makateng (Pitseng, 20 settembre 1998) �...

 

 

Artikel ini perlu dikembangkan agar dapat memenuhi kriteria sebagai entri Wikipedia.Bantulah untuk mengembangkan artikel ini. Jika tidak dikembangkan, artikel ini akan dihapus. Anies - MuhaiminKampanye untukPemilihan umum Presiden Indonesia 2024KandidatAnies BaswedanGubernur DKI Jakarta (2017–2022)Muhaimin IskandarWakil Ketua DPR RI (2019–sekarang)AfiliasiKoalisi PerubahanStatusDidaftarkan:19 Oktober 2023Diresmikan:13 November 2023Tokoh kunciMuhammad Syaugi (Captain Timnas AMIN) Sudi...

مرسيدس بنز دبليو 116معلومات عامةالنوع طراز سيارة الفئة مرسيدس بنز الفئة إس العلامة التجارية مرسيدس-بنز المصنع مرسيدس بنزالإنتاج 1972التجميع زيندلفينغن المحرك وناقل الحركةالمحرك محرك بنزين الأبعادقاعدة الإطارات 2,865 مـم (112.8 بوصة) , SEL: 2,965 مـم (116.7 بوصة)الطول 4,960 مـ...

 

 

British post-hardcore band This article is about the Welsh band. For other bands with similar names, see Blackout (disambiguation). This article relies excessively on references to primary sources. Please improve this article by adding secondary or tertiary sources. Find sources: The Blackout band – news · newspapers · books · scholar · JSTOR (September 2010) (Learn how and when to remove this template message) The BlackoutThe Blackout performing ...

 

 

Mughal-e-AzamPoster rilis teatrikalSutradaraK. AsifProduserShapoorji PallonjiDitulis olehAmanKamal AmrohiK. AsifWajahat MirzaEhsan RizviPemeranPrithviraj KapoorDilip KumarMadhubalaDurga KhotePenata musikNaushadSinematograferR. D. MathurPenyuntingDharamvirPerusahaanproduksiSterling Investment CorporationTanggal rilis5 Agustus 1960Durasi197 menitNegaraIndiaBahasaHindiUrduAnggaran₹10.5–15 jutaPendapatankotor₹110 juta[1] Mughal-e-Azam (Indonesia: Kaisar Mughal) adala...

Нескученский лесукр. Нескучненський ліс Расположение 47°48′ с. ш. 36°50′ в. д.HGЯO Страна Украина ОбластьДонецкая область РайонВолновахский район Нескученский лес Нескученский лес Медиафайлы на Викискладе Нескученский лес — ландшафтный заказник мест...

 

 

French singer (born 1946) Géraldine Gogly[1][2](born 18 April 1946 in Paris[3]) is a French singer. Biography She started her career in 1966 with the label Polydor, releasing a 45' EP La rivière me disait (The river has said to me). Guy Lux then invited her to perform in his show Le Palmarès des chansons. She has performed in the debut of Enrico Macias at L'Olympia. She represented Switzerland in the Eurovision Song Contest 1967 in Vienna with the song Quel cœur va...

 

 

1990 live album by Max Roach and Dizzy GillespieMax + Dizzy: Paris 1989Live album by Max Roach and Dizzy GillespieReleased1990RecordedMarch 23, 1989VenueMaison de la Culture de la Seine-Saint-Denis, Bobigny, FranceGenreJazzLength125:52LabelA&M CD 6404ProducerJohn SnyderDizzy Gillespie chronology Live at the Royal Festival Hall(1989) Max + Dizzy: Paris 1989(1990) The Paris All Stars Homage to Charlie Parker(1989) Max Roach chronology Bright Moments(1986) Max + Dizzy: Paris 1989(198...

British TV comedy series (1990–1998) This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Harry Enfield & Chums – news · newspapers · books · scholar · JSTOR (August 2020) (Learn how and when to remove this message) Harry Enfield & ChumsAlso known asHarry Enfield's Television ProgrammeHarry Enfield Pres...

 

 

  提示:此条目页的主题不是中華人民共和國最高領導人。 中华人民共和国 中华人民共和国政府与政治系列条目 执政党 中国共产党 党章、党旗党徽 主要负责人、领导核心 领导集体、民主集中制 意识形态、组织 以习近平同志为核心的党中央 两个维护、两个确立 全国代表大会 (二十大) 中央委员会 (二十届) 总书记:习近平 中央政治局 常务委员会 中央书记处 �...

 

 

Russian actor and comedian In this name that follows Eastern Slavic naming customs, the patronymic is Viktorovich and the family name is Khazanov. Gennady KhazanovГеннадий ХазановBornGennady Viktorovich Khazanov (1945-12-01) 1 December 1945 (age 78)Moscow, Russian SFSR, Soviet UnionOccupation(s)Actor, humorist, parodistYears active1967–presentTitlePeople’s Artist of the RSFSR (1991)Awards Full cavalier of the Order For Merit to the Fatherland Order of Friendsh...

British politician (born 1982) Will QuinceOfficial portrait, 2023Minister of State for Health and Secondary Care[a]In office8 September 2022 – 13 November 2023Prime MinisterLiz TrussRishi SunakPreceded byMaria CaulfieldSucceeded byAndrew StephensonMinister of State for School StandardsIn office7 July 2022 – 7 September 2022Prime MinisterBoris JohnsonPreceded byRobin WalkerSucceeded byJonathan GullisParliamentary Under-Secretary of State for Children and FamiliesI...

 

 

The Weightlifting events at the 2010 Commonwealth Games were held at the Jawaharlal Nehru Stadium, Delhi from 4 to 12 October 2010. Weightlifting medal count   *   Host nation (India)RankNationGoldSilverBronzeTotal1 Nigeria (NGR)545142 Samoa (SAM)30033 India (IND)*22484 Australia (AUS)22155 Canada (CAN)2125 Malaysia (MAS)21257 Nauru (NRU)11028 New Zealand (NZL)02029 Sri Lanka (S...

 

 

Kota Pagar Alam PagaralamKotaKota Pagar AlamTranskripsi bahasa daerah • Abjad Jawiڤاڬر عالم • Surat Uluꤶꤱꥑꥆꤾꤸ꥓Dari Atas, Kiri ke kanan: Gunung Dempo, Tari Kebagh Khas Pagar Alam, Kawasan Taman Kota, Perkebunan Teh di kawasan Gunung Dempo LambangMotto: Besemah Kota Perjuangan[a]Letak kota Pagar Alam di Sumatera SelatanKota Pagar AlamLetak kota Pagar Alam di Sumatera SelatanTampilkan peta SumatraKota Pagar AlamKota Pagar Alam (Indo...

Sports arena in Peristeri, west Athens, Greece Peristeri Olympic Boxing HallFull namePeristeri Olympic Boxing HallLocationPeristeri, Athens, GreeceCapacityIndoor Arena:8,400 (original capacity)2,305 (current capacity)Football Pitch: 3,000ConstructionOpened2004Construction cost€14.7 million euros (2004 money) 38°00′47″N 23°42′59″E / 38.01306°N 23.71639°E / 38.01306; 23.71639 The Peristeri Olympic Boxing Hall is an indoor arena that is located in Peristeri,...

 

 

Soviet chess grandmaster (1911–1995) In this name that follows Eastern Slavic naming customs, the patronymic is Moiseyevich and the family name is Botvinnik. Mikhail BotvinnikBotvinnik in 1962Full nameMikhail Moiseyevich BotvinnikCountrySoviet UnionBorn(1911-08-17)August 17, 1911Kuokkala, Grand Duchy of Finland, Russian EmpireDiedMay 5, 1995(1995-05-05) (aged 83)Moscow, RussiaTitleGrandmaster (1950)World Champion1948–19571958–19601961–1963Peak rating2630 (July 1971)...

 

 

У этого термина существуют и другие значения, см. Солсбери (значения). ГородСолсбериSalisbury Солсберийский собор 51°04′26″ с. ш. 1°47′36″ з. д.HGЯO Страна  Великобритания Регион Юго-Западная Англия Церемониальное графство Уилтшир История и география Площадь 11,3 км�...

For other uses, see Xinzhou (disambiguation). Not to be confused with Qinzhou. Prefecture-level city in Shanxi, People's Republic of ChinaXinzhou 忻州市Prefecture-level cityFoguang Temple in Wutai CountyLocation of Xinzhou City jurisdiction in ShanxiXinzhouLocation of the city centre in ShanxiCoordinates (Xinzhou Municipal Government): 38°24′58″N 112°44′02″E / 38.416°N 112.734°E / 38.416; 112.734CountryPeople's Republic of ChinaProvinceShanxiCounty-l...

 

 

هذه المقالة بحاجة لصندوق معلومات. فضلًا ساعد في تحسين هذه المقالة بإضافة صندوق معلومات مخصص إليها. اضطهاد اليهود اضطهاد اليهود جزء رئيسي من التاريخ اليهودي، وهو ما أدى إلى موجات متنقلة من اللاجئين في مختلف أنحاء مجتمعات الشتات. السلوقيون عندما وقعت منطقة يهودا تحت سلطة ال�...