# Approximating a drawing with a function

• May 27th, 2011, 02:14 PM
Approximating a drawing with a function
Hey Guys

Assume someone draws some arbitrary function on an x-y plane on graph paper.

Is there a way someone can create an actual mathematical function to match the drawing with a great deal of accuracy?

For example, if someone draws a parabola then it can be reasonably appoximated with a function. However, if the drawing looks more strange, then it would be difficult to easily come up with the function.

Maybe there is a way to write the function as a sum of terms. One could keep adding more terms to decrease or increase the value of the function over some specific part.
• May 27th, 2011, 04:38 PM
mathman
If it is a single valued function, one can specify the values at a set of points and fit a polynomial to those points.
• May 27th, 2011, 07:15 PM
DrRocket
Re: Approximating a drawing with a function
Quote:

Hey Guys

Assume someone draws some arbitrary function on an x-y plane on graph paper.

Is there a way someone can create an actual mathematical function to match the drawing with a great deal of accuracy?

For example, if someone draws a parabola then it can be reasonably appoximated with a function. However, if the drawing looks more strange, then it would be difficult to easily come up with the function.

Maybe there is a way to write the function as a sum of terms. One could keep adding more terms to decrease or increase the value of the function over some specific part.

1. The graph IS the function

2. If you mean to approximate the given function with some member of a given class of functions, there are lots of ways to do that:
a. A least squares fit of a [polynomial of given degree.
b. Splines passing through any given finite set of points on the graph.
c. Fourieer series approximations by a sum of sinusoids.
d. Approximation by sums of other orthogonal functions
and many more.

A lot depends on your specific application.
• June 1st, 2011, 01:20 AM
Well there are of course way to approximate functions.
For example, a fourier series can be used to approximate a square wave.

However, I want to know if it is possible to approximate a function that exhibits nearly every type of behavior

Say, it is periodic over some interval, and then it slowly transforms into a straight line, then it looks like a a square wave over some interval, then it has an asymptote at a few places.

Can something really bizarre be approximated with a great deal of accuracy if one is given a detailed drawing of the funciton on graph paper.
• June 1st, 2011, 04:08 AM
MagiMaster
Yes, there are ways to approximate any function to within an arbitrary degree of precision using simpler pieces. The question is just how many pieces you want to use, since rougher functions and higher precision need more (sometimes a lot more) pieces.

(Caveat: I suspect that there may actually be some mild restrictions on the type of functions that can be so approximated, since something like:

is still a well defined function.)
• June 1st, 2011, 10:40 AM
DrRocket
Well there are of course way to approximate functions.
For example, a fourier series can be used to approximate a square wave.

However, I want to know if it is possible to approximate a function that exhibits nearly every type of behavior

Say, it is periodic over some interval, and then it slowly transforms into a straight line, then it looks like a a square wave over some interval, then it has an asymptote at a few places.

Can something really bizarre be approximated with a great deal of accuracy if one is given a detailed drawing of the funciton on graph paper.[/quote]

yes

See my earlier post.

BTW a Fourier series is not usually a very good approximation to a square wave -- Google "Gibbs phenomenon