Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Romberg and Simpson combination

Subject: Romberg and Simpson combination

From: ze lu

Date: 21 Nov, 2010 08:06:04

Message: 1 of 6

I am trying to help a friend out with a problem, but I can't seem to write the code. Can someone help me with this? That will be greatly appreciated!
The problem is as follows:

Develop an adaptive quadrature by combining (composite) Simpson's rule and Romberg integration as follows:
 On each interval [a; b], let h = (b- a)/4 and get the values of given function at 5 point
xj = a + j * h, with j = 0; 1; 2; 3; 4.
 Compute Simpson's rule to get Q1, and composite Simpson's rule to get Q2.
 Work out the correct Romberg integration rule for Simpson's rule; apply it Q1 and Q2 to
get a new estimate Q.
 When abs(Q - Q2) is less than given tolerance, accept Q as true integral value; otherwise
subdivide [a; b] into two intervals of equall length and recursively apply the same adaptive
quadrature to them.
 Make sure you do not ever calculate the given function more than once at any given point.
Your program should take tolerance as an input argument, and return the integral and number
of function evaluations. Report the results obtained from running your code on the function
f(x) = 10/x^2 *sin(10/x) on the interval [1; 2] with tolerance 10^-8.

Subject: Romberg and Simpson combination

From: John D'Errico

Date: 21 Nov, 2010 11:01:06

Message: 2 of 6

"ze lu" <demijet01@yahoo.com> wrote in message <icajtc$hue$1@fred.mathworks.com>...
> I am trying to help a friend out with a problem, but I can't seem to write the code. Can someone help me with this? That will be greatly appreciated!
> The problem is as follows:
>
> Develop an adaptive quadrature by combining (composite) Simpson's rule and Romberg integration as follows:
>  On each interval [a; b], let h = (b- a)/4 and get the values of given function at 5 point
> xj = a + j * h, with j = 0; 1; 2; 3; 4.
>  Compute Simpson's rule to get Q1, and composite Simpson's rule to get Q2.
>  Work out the correct Romberg integration rule for Simpson's rule; apply it Q1 and Q2 to
> get a new estimate Q.
>  When abs(Q - Q2) is less than given tolerance, accept Q as true integral value; otherwise
> subdivide [a; b] into two intervals of equall length and recursively apply the same adaptive
> quadrature to them.
> Make sure you do not ever calculate the given function more than once at any given point.
> Your program should take tolerance as an input argument, and return the integral and number
> of function evaluations. Report the results obtained from running your code on the function
> f(x) = 10/x^2 *sin(10/x) on the interval [1; 2] with tolerance 10^-8.

Sorry. We tend not to do your homework for you.

Even if this is not your work (still undetermined)
why should we help you to help someone else
cheat on their homework?

If you have a specific question about something that
failed, then ask. But don't ask for someone to write
code for a homework problem.

john

Subject: Romberg and Simpson combination

From: K

Date: 21 Nov, 2010 22:24:56

Message: 3 of 6

hilarious. ming gu's student.

Subject: Romberg and Simpson combination

From: david smith

Date: 23 Nov, 2010 01:47:03

Message: 4 of 6

K <user@compgroups.net/> wrote in message <laudneU5pL6lAXTRnZ2dnUVZ_rOdnZ2d@giganews.com>...
> hilarious. ming gu's student.
>
I just finished the code. I was already in progress of coding when I posted the message. I didn't want to post my code here because I was afraid that other people would use it as their own... I was hoping someone would respond to help, and I would then privately message my code to them.

But what ever.

Subject: Romberg and Simpson combination

From: jordan

Date: 15 Apr, 2012 01:20:36

Message: 5 of 6

"david smith" wrote in message <icf6en$3dt$1@fred.mathworks.com>...
> K <user@compgroups.net/> wrote in message <laudneU5pL6lAXTRnZ2dnUVZ_rOdnZ2d@giganews.com>...
> > hilarious. ming gu's student.
> >
> I just finished the code. I was already in progress of coding when I posted the message. I didn't want to post my code here because I was afraid that other people would use it as their own... I was hoping someone would respond to help, and I would then privately message my code to them.
>
> But what ever.

Hey David, do u mind to email me this code if u still have it? thanks

Subject: Romberg and Simpson combination

From: lu lu

Date: 20 Apr, 2012 20:30:31

Message: 6 of 6

Hey;
       Could you help me with this program, I will be really appreciate, my email address is ufozb919@hotmail.com. Thanks!

"jordan " <luyijiajordan0713@hotmail.com> wrote in message <jmd7p4$n55$1@newscl01ah.mathworks.com>...
> "david smith" wrote in message <icf6en$3dt$1@fred.mathworks.com>...
> > K <user@compgroups.net/> wrote in message <laudneU5pL6lAXTRnZ2dnUVZ_rOdnZ2d@giganews.com>...
> > > hilarious. ming gu's student.
> > >
> > I just finished the code. I was already in progress of coding when I posted the message. I didn't want to post my code here because I was afraid that other people would use it as their own... I was hoping someone would respond to help, and I would then privately message my code to them.
> >
> > But what ever.
>
> Hey David, do u mind to email me this code if u still have it? thanks

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us