# Integration and Differentiation

Discussion in 'Mathematics and Physics' started by koolguy, Oct 23, 2015.

1. ### koolguyActive Member

Joined:
Aug 24, 2010
Messages:
2,196
Likes:
9
Can we use this Integration and Differentiation in micro ??

2. ### KeepItSimpleStupidWell-Known MemberMost Helpful Member

Joined:
Oct 30, 2010
Messages:
9,916
Likes:
1,097
ONLINE
the term is "numerical methods" Both integration and differentiation are done all the time when implementing a PID algorithm.

• Like x 1
3. ### koolguyActive Member

Joined:
Aug 24, 2010
Messages:
2,196
Likes:
9
how it is done?

Joined:
Jan 12, 1997
Messages:
-
Likes:
0

5. ### MrAlWell-Known MemberMost Helpful Member

Joined:
Sep 7, 2008
Messages:
11,029
Likes:
951
Location:
NJ

Hi,

Basic integration in time is done by accumulating the input times the time increment.
So if you take samples every 0.1 second you have a time increment of 0.1 second so you multiply each sample by 0.1 and add that to the previous result:
sum=sum+dt*v[k]
where
dt is the time increment,
v[k] is the sample measurement at that time.

The basic first derivative in time can be calculated by taking the difference of two successive samples and divided by the time increment:
dv/dt[k]=(v[k+1]-v[k])/dt

and a slightly better way is to take samples at k-1 and at k+1:
dv/dt[k]=(v[k+1]-v[k-1])/(dt+dt)

where you might note that we get the derivative for the sample k by using samples k-1 and k+1 rather than sample k itself. It's sometimes referred to as the "Central Means" derivative.

There are a lot of different numerical methods for different things so you might look into this more on the web or ask more questions here

• Like x 1