Can i get a mathematical function out of this picture?

Click For Summary

Discussion Overview

The discussion revolves around finding a mathematical function to model the output of an infrared sensor that returns voltage values relative to distance. The context includes the need for high precision in the project while managing memory constraints within a micro-controller.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant describes the project and the need for a function to mimic the sensor's output behavior, emphasizing the requirement for high precision.
  • Another participant questions the meaning of "high precision," suggesting that visible artifacts in the graph may indicate limitations in measurement accuracy.
  • It is proposed that linear interpolation could be a viable solution, with suggestions to create a table of values that accounts for varying slopes in the data.
  • Some participants suggest exploring different mathematical functions, such as exponential decays or inverse functions, while noting that these may not surpass the accuracy of linear interpolation.
  • A participant raises the issue of flexibility, asking if the curve might change over time or with different materials, which could affect calibration needs.
  • One participant suggests that the curve resembles the function xe^{-x}, indicating a potential model for the data.
  • Another participant recommends using electronics to linearize the sensor response, implying a hardware-based approach to improve accuracy.

Areas of Agreement / Disagreement

Participants express various viewpoints on the best approach to model the sensor output, with no consensus reached on a single method or function. The discussion includes both support for linear interpolation and exploration of alternative mathematical models.

Contextual Notes

Limitations include potential measurement artifacts affecting perceived precision, the need for calibration depending on component aging or material changes, and the unresolved nature of the mathematical modeling approach.

Who May Find This Useful

Individuals working on projects involving sensor data processing, those interested in mathematical modeling of physical phenomena, and practitioners seeking methods for data interpolation and accuracy enhancement.

Bayoudh101
Messages
12
Reaction score
0
i am working for a small project at home , and for it i am using an infra red sensor . which returns a voltage value relative to distance .
this picture describes the output : (given by the datasheet) :

pnGRf0u.png

(the picture is highly precise)

now all of the distances that i will be getting are superior than 8cm so it's a bijective function for me . within the micro-controller , the only solution that was able to find is to make a large array of floats with segments of voltage and the corresponding distance values . i need high precision with this project so that solution would consume a massive amount of memory and would cut down from other of the project's aspects .
is there anyway i can find a function that mimic with good precision the behavior of the evolution these values ?
thank you .
 
Last edited by a moderator:
Mathematics news on Phys.org
Picture did not seem to come through. Can you re-attach?
 
  • Like
Likes   Reactions: Bayoudh101
dkotschessaa said:
Picture did not seem to come through. Can you re-attach?
done , thank you for responding sir .
 
What does "high precision" mean? The visible corners in the graph look like measurements artifacts. If you can see deviations from a smooth curve by eye, it cannot be that precise.

You can store some values and then make linear interpolations between them.

You can try exponential decays, 1/x, 1/x2 functions and so on, but they won't beat the accuracy of linear interpolations - if you measurements are all really accurate.
 
  • Like
Likes   Reactions: Bayoudh101
thank you sir .
 
Make a linear interpolation table of the graph. Where things are relatively flat (ie same slope) you can space the x,y points further apart and where things change you can select more x,y points.

Some examples are provided in the article:

https://en.wikipedia.org/wiki/Interpolation
 
Bayoudh101 said:
i need high precision with this project

Do you also need flexibility? For example, will the actual curve on the device change as the component ages? Will you need to calibrate the system if you use a new type of paper?
 
The curve looks like xe^{-x}...
 
Use electronics to linearise the sensor response .
 
Last edited:

Similar threads

Replies
2
Views
1K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 10 ·
Replies
10
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K