Piecewise Quadratic Approximation

Do you simply make sure that the two "pieces" at each interval are connected with the same slope at the break point?In summary, a piecewise quadratic approximation is a function that is constructed using parabolas on specific intervals in the given domain. It is a type of piecewise function that is continuous if the two pieces at each interval are connected with the same slope at the break point. To find a piecewise quadratic approximation of a given function, the arches of the function are approximated using parabolas that match the zeroes and max/min points of the function.
  • #1
malindenmoyer
31
0
Could somebody explain what exactly a "piecewise quadratic approximation" is?

Problem Statement

Find a piecewise quadratic approximation P(x) of f(x), where

[tex]f(x)=\sin{4x}\; on \; [0,\pi][/tex]

Plot f(x) and P(x) on [tex][0,\pi][/tex].

What is the maximum value of the following:

[tex]|f(x)-P(x)| \; on \;[0,\pi][/tex]

The problem goes on to say:

Can you find a piecewise approximation to f(x) that is continuous on [tex][0,\pi][/tex] and each "piece" is a polynomial?

Attempt at Solution

I know that a piecewise is typically a set of linear functions defined at several intervals in the given domain of x. Is this what the problem is asking, except a quadratic approximation at several intervals? If so, how is one supposed to come up with that; it seems rather ambiguous. My thoughts are the same for the next part regarding the "continuous piecewise approximation".

The first part of the problem not listed asked to find a quadratic approximation of f(x), which I can do using a Taylor Series.

I have never heard of the term piecewise quadratic approximation and therefore stumped. If somebody could please give an explanation of what the problem is asking us to find, that would be greatly appreciated.
 
Physics news on Phys.org
  • #2
malindenmoyer said:
Could somebody explain what exactly a "piecewise quadratic approximation" is?

Problem Statement

Find a piecewise quadratic approximation P(x) of f(x), where

[tex]f(x)=\sin{4x}\; on \; [0,\pi][/tex]

Plot f(x) and P(x) on [tex][0,\pi][/tex].

What is the maximum value of the following:

[tex]|f(x)-P(x)| \; on \;[0,\pi][/tex]

The problem goes on to say:

Can you find a piecewise approximation to f(x) that is continuous on [tex][0,\pi][/tex] and each "piece" is a polynomial?

Attempt at Solution

I know that a piecewise is typically a set of linear functions defined at several intervals in the given domain of x. Is this what the problem is asking, except a quadratic approximation at several intervals? If so, how is one supposed to come up with that; it seems rather ambiguous. My thoughts are the same for the next part regarding the "continuous piecewise approximation".

A piecewise function can be constructed with any functions, not just linear ones. I think the answer is yes about what they are asking. Since quadratics are parabolas I'm guessing you should approximate each arch of your sine function with a parabola. You should be able to match the zeroes and the max/min points.
The first part of the problem not listed asked to find a quadratic approximation of f(x), which I can do using a Taylor Series.

The first two terms of a Taylor series for this function would be essentially useless.
 
  • #3
Thanks for the reply, and sorry about the double post. I hadn't realized I had posted the question in the wrong forum per the first thread's instructions.

Regarding your reply, what does it mean by "continuous piecewise function?"

And why would finding the second order Taylor expansion of [tex]\sin{4x}[/tex] be useless? It would give a pretty good approximation per the given domain.
 
  • #4
A "piecewise continuous function" is a function that is continuous everywhere except at specific points (that separate the "pieces"). A piecewise quadratic function is a function that is given by specific quadratic formulas on the "pieces" between points and, if the two formulas on either side of a "break point" give the same value at that break point, then it is continuous, not "piecewise continuous".

The first two terms of the Taylor expansion of sin(4x) is NOT a "pretty good approximation" except close to the point about which the function is expanded. You might make it a good approximation by taking a large number of points but even then you will have a problem with matching end values.

I would suggest this- take an odd number of x values from 0 to [itex]\pi[/itex], say [itex]x_0= 0[/itex], [itex]x_1, x_2, [/itex], etc. to [itex]x_n= \pi[/itex] with n even. You need an odd number (and n even since I started with "0") because it take three points to determine a parabola. Use [itex]\{(x_0, sin(4x_0), (x_1, sin(4x_1), (x_2, sin(4x_2)\}[/itex]to determine the first parabola, [itex]\{(x_2, sin(4x_2)), (x_3, sin(4x_3), (x_5, sin(4x_5)\}[/itex] to determine the second, etc.
 
  • #5
malindenmoyer said:
Thanks for the reply, and sorry about the double post. I hadn't realized I had posted the question in the wrong forum per the first thread's instructions.

Regarding your reply, what does it mean by "continuous piecewise function?"

A function that is continuous but has different formulas on different intervals in its domain. For example if f(x) = - x on (-oo, 0] and x2 on [0,oo). The two pieces agree at x = 0 so the function is well defined and continuous from both sides there.

And why would finding the second order Taylor expansion of [tex]\sin{4x}[/tex] be useless? It would give a pretty good approximation per the given domain.

sin(4x) has two full periods on [0,π]. There is no way for a second degree polynomial, whose graph is a parabola, to come anywhere near approximating that on the whole interval.
 
  • #6
HallsofIvy said:
I would suggest this- take an odd number of x values from 0 to [itex]\pi[/itex], say [itex]x_0= 0[/itex], [itex]x_1, x_2, [/itex], etc. to [itex]x_n= \pi[/itex] with n even. You need an odd number (and n even since I started with "0") because it take three points to determine a parabola. Use [itex]\{(x_0, sin(4x_0), (x_1, sin(4x_1), (x_2, sin(4x_2)\}[/itex]to determine the first parabola, [itex]\{(x_2, sin(4x_2)), (x_3, sin(4x_3), (x_5, sin(4x_5)\}[/itex] to determine the second, etc.

That strikes me as unnecessarily complicated given the loose statement of the problem. Don't pick any old odd number of points. For each arch of the sine function use the parabola matching its zeroes and max/min point. This can be easily and quickly done by hand and gives a pretty good approximation.
 
  • #7
LCKurtz said:
That strikes me as unnecessarily complicated given the loose statement of the problem. Don't pick any old odd number of points. For each arch of the sine function use the parabola matching its zeroes and max/min point. This can be easily and quickly done by hand and gives a pretty good approximation.

I feel like that would be the best way to do it. However, regarding the continuous piecewise, how would you go about doing that?
 
  • #8
malindenmoyer said:
I feel like that would be the best way to do it. However, regarding the continuous piecewise, how would you go about doing that?

Your parabolas are going to match up at the zeroes of the sine function aren't they?
 
  • #9
Yes, that is what I was thinking. My question comes from the fact that there are two parts to the problem: 1) find a piecewise quadratic, which can be done by the method you suggested, and 2) find a continuous piecewise, where each piece is a polynomial.

I hope you can see where my confusion is coming from.
 
  • #10
malindenmoyer said:
Yes, that is what I was thinking. My question comes from the fact that there are two parts to the problem: 1) find a piecewise quadratic, which can be done by the method you suggested, and 2) find a continuous piecewise, where each piece is a polynomial.

I hope you can see where my confusion is coming from.

Actually, I'm not sure what is bothering you. Draw a picture of two periods of a sine curve. The arches kind of look like parabolas don't they? Imagine replacing each arch with a little parabola which almost matches the sine curve, hitting it exactly at its zeroes and max/min on each arch. Don't you see the connected parabolas are continuous and approximate the sine curve?
 
  • #11
Yes, I understand that...but what does it mean by a CONTINUOUS piecewise.

Here is what I have so far, which suffices for the first part of the problem (I think):

[PLAIN]http://people.tamu.edu/~malindenmoyer/tamu/sin4x_plot.png

What do I do next? That is, to come up with a continuous quadratic approximation versus the piecewise approximation.
 
Last edited by a moderator:
  • #12
Nice picture. Well, your function is a piecewise defined function because you have different formulas for the approximations to the different arches, right?

And your formulas are all second degree [quadratic] polynomials, yes?

And you know what a continuous function is, right? Does the graph you drew of the approximation have any jumps, holes, or other discontinuities? Is it continuous?

If it is, I would say you have a continuous piecewise quadratic approximation.
 
  • #13
Yes that was my reasoning as well. I just thought it was strange the problem dedicated two parts to essentially doing one thing...

Now that I have the piecewise function...how would I go about computing

the maximum of [tex]|f(x)-P(x)|[/tex] on [tex][0,\pi][/tex]
 
Last edited:
  • #14
Well, you have a lot of symmetry so you could probably look at one arch. Sounds like a calculus maximization problem to me.
 

FAQ: Piecewise Quadratic Approximation

1. What is a piecewise quadratic approximation?

A piecewise quadratic approximation is a mathematical technique used to approximate a function using a series of quadratic functions. It involves dividing the domain of the function into smaller intervals and fitting a quadratic function to each interval.

2. How is a piecewise quadratic approximation different from a regular quadratic approximation?

A regular quadratic approximation uses a single quadratic function to approximate the entire function, while a piecewise quadratic approximation uses multiple quadratic functions to approximate different parts of the function. This allows for a more accurate approximation of complex functions with varying characteristics.

3. What are the advantages of using piecewise quadratic approximation?

Piecewise quadratic approximation allows for a more accurate representation of complex functions compared to regular quadratic approximation. It also allows for better visualization and understanding of the function, as it can be broken down into smaller intervals. Additionally, piecewise quadratic approximation is computationally efficient and can be easily implemented in computer programs.

4. What are the limitations of piecewise quadratic approximation?

Piecewise quadratic approximation is limited by the number of intervals chosen to approximate the function. If the intervals are too large, the approximation may not be accurate enough. Additionally, piecewise quadratic approximation may not be suitable for all types of functions, such as those with discontinuities or sharp corners.

5. How is piecewise quadratic approximation used in real-world applications?

Piecewise quadratic approximation has many practical applications, such as in data analysis, signal processing, and image compression. It is also used in the field of engineering to approximate complex systems and in the field of finance to model stock market trends. Additionally, piecewise quadratic approximation is commonly used in computer graphics to create smooth curves and surfaces.

Back
Top