The Student Room Group

Numerical Methods difficulties

Hello everyone :smile:

I'm basically stuck with a report I have to write for a resit unit; my main issue is that I don't quite understand how to do part of it, so here begins one of my questions:

I'm using matlab to implement my own numerical integration method, and I've chosen to use the composite simpsons rule. I've got a list of criteria for my function to complete, and one of these criteria is that my function should also be able to deal with the case that the approximation does not converge (for example, if the integral is unbounded).

Now, I understand what an unbounded integral is, and I understand what it means when an integral doesn't converge, but my main question is how to get a numerical approximation to an integral that doesn't converge? I've done some research, but most of what I have found seems to be too confusing for me to understand.

My second question:

How could I get this integration method to deal with non-finite end points?
(edited 9 years ago)
Hi there,

While you're waiting for an answer, did you know we have 300,000 study resources that could answer your question in TSR's Learn together section?

We have everything from Teacher Marked Essays to Mindmaps and Quizzes to help you with your work. Take a look around.

If you're stuck on how to get started, try creating some resources. It's free to do and can help breakdown tough topics into manageable chunks. Get creating now.

Thanks!

Not sure what all of this is about? Head here to find out more.
Original post by BENOO
Hello everyone :smile:
I've got a list of criteria for my function to complete, and one of these criteria is that my function should also be able to deal with the case that the approximation does not converge (for example, if the integral is unbounded).


I guess this just means that your function should be able to identify such a case and report it; you clearly can't produce an approximation to an unbounded integral.


My second question:

How could I get this integration method to deal with non-finite end points?


You mean for something like 11x2dx\int_1^\infty \frac{1}{x^2} dx ?
Reply 3
Original post by atsruser
I guess this just means that your function should be able to identify such a case and report it; you clearly can't produce an approximation to an unbounded integral.


I guess you're right, I've emailed the guy who set it but I'm not quite sure what the answer is. I can do that though, even if it's not right, and change it dependant on the reply :smile: Thanks for your help, helpful to know I'm not going crazy worrying about something that I can't do only to not have to do it!

Original post by atsruser

You mean for something like 11x2dx\int_1^\infty \frac{1}{x^2} dx ?


And yeah, just like that; really don't understand how I could get a numerical approximation to that.
Reply 4
Original post by BENOO


And yeah, just like that; really don't understand how I could get a numerical approximation to that.


You can just integrate between 1 and x for larger and larger x and observe that it converges to some value.
Reply 5
Original post by around
You can just integrate between 1 and x for larger and larger x and observe that it converges to some value.


I suppose that's the only way to do it really :P


As for my first question also, am I right in thinking that if the approximated error increases rather than decreases, then the iteration does not converge?
Original post by BENOO
I suppose that's the only way to do it really :P


It's one way, but I suspect numerical analysts will have dreamed up others.


As for my first question also, am I right in thinking that if the approximated error increases rather than decreases, then the iteration does not converge?


I don't think so. Consider 1sinxx2dx\int_1^\infty \frac{\sin x}{x^2} dx. This converges, but if you truncate the domain of integration at (in)appropriate points, then the values given by Simpson's rule may not be monotonically decreasing, giving the impression that the integral diverges.
Reply 7
Original post by atsruser
It's one way, but I suspect numerical analysts will have dreamed up others.



I don't think so. Consider 1sinxx2dx\int_1^\infty \frac{\sin x}{x^2} dx. This converges, but if you truncate the domain of integration at (in)appropriate points, then the values given by Simpson's rule may not be monotonically decreasing, giving the impression that the integral diverges.


So what do you think is the best way to go about stopping my function if it doesn't converge? Is a limit on the number of iterations the best way, or can you think of some other way? :/

Quick Reply

Latest