Applications of Calculus and Numerical Methods

In summary, the conversation was about a new user wanting to know how to use calculus and interpolation in their engineering projects. They also wanted to understand the practical side of these concepts and were looking for resources to learn more about their application. The conversation also delved into the difference between interpolation and extrapolation, as well as the use of splines in fitting data. The expert provided a summary of the main points discussed, including the use of polynomials for interpolation and the process of differentiation for splines.
  • #1
nebbione
133
0
Hi, I'm a new user of this forum and i wanted to know how i can use calculus and interpolation in my projects.
I'm a student in engineering and i usually do home made electronics and computer programming projects, i would like to include calculus to my projects and understand the practical side of what I'm studying but sometimes in calculus and linear algebra for me it's diffcult to understand the practical aspects of some arguments or theorems.
Math for me is really enjoyable when i understand how i can apply the concepts to my projects and my work, i wanted to know : how can i use calculus for my electronics and computer engineering projects ?
And why scientists and engineers use interpolation instead of keeping tables ?
Does anybody know a good book or web source where i can really learn the full application of the concepts of calculus that I'm studying?

Sorry for my bad english.
 
Physics news on Phys.org
  • #2
nebbione said:
Hi, I'm a new user of this forum and i wanted to know how i can use calculus and interpolation in my projects.
Welcome to PF; and woo! That's a big subject!
And why scientists and engineers use interpolation instead of keeping tables ?
The tables have to come from someplace.
The important ones come from experiments - like a time series of measurements (voltage vs time for eg).

What do we do if we need a number that is not on the table?

Does anybody know a good book or web source where i can really learn the full application of the concepts of calculus that I'm studying?
That would be none - there are lots of works that will give you bits and pieces but the full understanding would take a large chunk of a library.

In physics, math is a language and a tool. Concentrate on the things you need and build your understanding over time as you use the tools and talk to others in the language.
 
  • #3
Thank you ! You gave me a very good explanation, i understand now! Anyway I tried and understood the technique to make a polynomial interpolation, but i still don't understand how to make a linear or spline interpolation... can somebody explain me how to do it or link me a website where this is explained? Because I didn't find anything but the definitions and wikipedia page, but can't imagine the method.
 
  • #4
It is basically the same idea with a different equation.
You'll understand faster if you play around with one.
 
  • #5
Calculus and interpolation huh?

Well let us say you have a table of data. That is the y values for a series of x values. Each data point is therefore a pair of values (y,x)

Well polynomial interpolation of degree N means that you take a polynomial of degree N and make it 'fit' your data at each of the data points. That is you make the value of your polynomial at each x equal to your y data at that point.

So the polynomial equation is

y = axN + bxN-1 + cxN-2...dx + e

If you substitute each pair of x and y values in turn you will obtain a set of simultaneous equations you can solve for the constants a, b, c etc.

Since you have N+1 constants ypu will require N+1 data points to give N+1 equations.

Linear interpolation is just using a polynomial of degree one. This requires N+1 points ie 2 points to fit a straight line.

OK so your polynomial 'fits' the data at each point and you interpolate by using it to calculate y at some x you haven't measured at.

You asked about calculus and splines.

Well your polynomial will fit the y values at each measured x, but it will not in genreal have the same slope as the real curve at these points.

For instance there are many many functions that are zero at x = 0 but have vastly different slopes at x = 0.

Enter splines.

Differentiate the polynomial and do the same matching for the slopes at selected or all points.

The process of differentiation will lower all the equations by one degree so you will loose the cosntant and have one less point and simultaneous equation.


If you have more data points than you need for a given polynomial there are many possible solutions and you then need statistical techniques to chose the best one.
 
  • #6
Thank you very much for the explanation! But if i have my table of data what is the procedure to get a a linear function with the interpolation ? I didn't understand. With polynomial interpolation i use systems but with linear ? what is the procedure ?
 
  • #7
To perform linear interpolation you only require two points and you are approximating the change form one to the other by a straight line ( a polynomial of degree one as I said)

That is y = ax + b

So you can obtain the equations

y1 = ax1 + b

y2 = ax2 + b

Since you know (x1, y1) and x2, y2) you can solve the above for a and b.

Then you can calculate y3 for some x3 that is between x1 and x2

Strictly

x1 < x3 < x2

is called interpolation.

If you use your expression to calculate a y for x outside this range ie

if x3 < x1 or if x3 > x2

Then the process isc alled extrapolation. Extrapolation is inherently less relaible than interpolation, sometimes spectacularly so.
 
  • #8
thank you very much i undestand now!
And for the spline ? i just have to derive the polynomial function found with the polynomial interpolation ??
 
  • #9
Differentiate not derive.

Consider again my linear example.

You may have noticed that if you calculate a and b for the equation

y = ax + b

knowing (x1,y1) and (x2,y2)

then differentiate it


[tex]\frac{{dy}}{{dx}} = a[/tex]

So

[tex]a = \frac{{{y_2} - {y_1}}}{{{x_2} - {x_1}}}[/tex]

rearrange the differential


[tex]dy = adx[/tex]


so having calculated a we can calculate y3 for any x3


[tex]{y_3} - {y_1} = a({x_3} - {x_1})[/tex]


or


[tex]{y_3} = {y_1} + a({x_3} - {x_1})[/tex]


Now if you have a higher degree polynomial you have to differentiate it and set up more simultaneous equations to match slopes for the spline.
 
Last edited:
  • #10
Ok, let me see:
If after a polynomial interpolation i find a polynomial form like :

3x^4+4x^3-35x^2+42x+9

i only have to differentiate this (respect x). is that right ? and the polynomial form that i find is:

12x^3+12x^2-70x+42

So the result of spline interpolation right ?
Is it done like this ?

Anyway thank you for the collaboration
 
  • #11
No there is more to it but I am now going to ask you to do some work.

What is the shape of the curves y = ax2 and y = ax3 ?

Particularly what happens (what is the sign of y) when x is negative?
 
  • #12
the shape of the first one is a parabola and the second one is like a turned straight S.
For the first one, the sign of y is always positive and for the second one the sign of y is positive if x is positive and negative if x is negative.

But what is the matter of this with interpolation ?
 
  • #13
Well for most tabulated functions (or measured ones) in the real world we expect y to increase as x increases.

This means that we do not want approximating functions like a parabola that falls in the second quadrant and turns at the y-axis (zero slope) and starts going up again into the first quadrant.

The cubic that I asked about is ideal for this because it comes up from below in the third quadrant, crosses the y-axis with a definite slope and keeps going up into the first quadrant.

Gosh it is easier to draw all this than say it!

Anyway that is why the first order spline we normally use is a cubic spline, which you will normally see referenced.
 
  • #14
i'll think about it ! anyway i think you are saying that we try to use odd polynomials because the positive ones are always positive with spline interpolations ?
 
  • #15
Very often we break the full range of the datset into shorter sections.

Each section is approximated by its own cubic spline.
These will in general have different constants, but the same form.

When we are using a cubic spline we are approximating our data by a general cubic

y = ax3 + bx2 + cx + d

There are four constants, but instead of making this cubic match the data points we make the first and second derivatives at the end of the first spline match the beginning of the spline in the second section and so on.

That way the splines for each sections blend smoothly one into the next.

Incidentally the word spline comes from the way an old fashioned draftsman would have used a flexible steel strip to bend round the plotted data points to provide a curved ruler to draw the plotted line. A bent steel strip, fixed at four points naturally takes up a cubic profile.

This means solving the simultaneous equations

y' = 3ax2 + 2bx + c
y'' = 6ax + 2b

for the end of one spline and the beginning of the next.
 
  • #16
ok thanks a lot! anyway which is a nice way that i can use calculus in my electronics and comupter engineering projects ? what can i analyze and how can i include functions and plots ? Sorry for a too general question, but I'm trying to get a better understing on how i can apply calculus and numerical methods.
 
  • #17
You'll get better help if you reveal some of your projects.

The application of calculus to digital electronics may not be very impressive since much of calculus (of the ordinary sort) does not deal with discrete quantities.

If you have some projects using analog electronics, someone might point out how calculus applies.
.
 
  • #18
Ok for example one of my new projects is two joystick system for pc made with a PIC that can be connected to a pc via usb!

Is there a way i can make some analysis etc... ?
Anothere project is a small robot with three wheels that is controlled by infrared and has ultrasonic distance sensor and it is programmed to not touch the wall (it will change its direction). I even designed the circuit with photo resistence so that when it's darker it will light his own LEDs.

How can i use calculus and numerical methods or linear algebra to this kind of projects ? what data can i collect ? what could be an interesting function about these things ?
 
  • #19
In terms of data collection, you need to specify the I/O protocol for the device.

As long as you can can capture the direct data (it used to be done through using IN and OUT assembler commands, but modern OS design and device driver interaction is a lot better) and then just flush it to a file.

If you want to process the data, then you can but you can write the raw data to some file in some format and then deal with it later on.

Analyzing the data though is another story and a whole other issue that depends on tonnes of things.
 
  • #20
Sorry but i don't understand what you wrote.

I try to better formulate my question:
How can i include data collection for interpolation andcalculus to my Comp.Eng projects ?
 
  • #21
If you had a robot with acceleration and velocity sensors, the calculation of it's position from the output of those sensors could involve interpolation and numerical integration. It might also involve some linear algebra.
 
  • #22
ok i understand now about interpolation and calculus!
but what about the linear algebra you are talking about ?
 
  • #23
To represent how the position and orientation of an object changes in space, people often use matrices or quaternions. You can find information about this by searching for sites that explain how to do 3D animation of an object in motion.
 
  • #24
Ok thanks a lot! I understand now! Very kind!
 

1. What is the difference between calculus and numerical methods?

Calculus is a branch of mathematics that deals with the study of continuous change, while numerical methods are techniques used to approximate solutions to mathematical problems that cannot be solved analytically.

2. How is calculus used in real-life applications?

Calculus is used in a wide range of real-life applications, such as engineering, physics, economics, and biology. It is used to model and analyze systems that involve continuous change, such as motion, growth, and optimization.

3. What are some common applications of numerical methods?

Numerical methods are used in various fields, including engineering, physics, finance, and computer science. Some common applications include solving differential equations, finding roots of equations, and optimization problems.

4. How do calculus and numerical methods work together in solving problems?

Calculus provides the theoretical framework for understanding and formulating problems, while numerical methods provide practical techniques for finding approximate solutions to these problems. Together, they allow us to solve complex problems that would be impossible to solve using either approach alone.

5. Are there any limitations to using calculus and numerical methods?

While calculus and numerical methods are powerful tools, they do have limitations. Calculus can only be applied to problems that can be described using continuous functions, and numerical methods can only provide approximate solutions that are subject to errors. Additionally, some problems may be too complex or require too much computational power to solve using these methods.

Similar threads

Replies
5
Views
1K
Replies
13
Views
2K
Replies
46
Views
1K
Replies
4
Views
2K
Replies
26
Views
2K
Replies
26
Views
1K
Replies
8
Views
504
  • STEM Academic Advising
Replies
16
Views
419
Replies
36
Views
4K
Back
Top