Mathematically modeling a real system in C#

  • Thread starter Thread starter btb4198
  • Start date Start date
  • Tags Tags
    Modeling System
Click For Summary
To mathematically model a real system producing sinewave-like data in C#, a user seeks to fit a sinewave equation to their measurements. The data exhibits noise, leading to inconsistencies in predicted values, particularly in amplitude (A) and vertical shift (B). Suggestions include using numerical optimization libraries available in C# or even Excel for curve fitting, emphasizing the need for a clear understanding of the model being applied. The user is encouraged to provide more data points for better accuracy and to clarify their fitting process, as the current approach seems flawed. Ultimately, a correct implementation of the sine function and optimization techniques is crucial for achieving reliable predictions.
  • #31
Can we see something of the results ?
 
Technology news on Phys.org
  • #32
BvU said:
Can we see something of the results ?
1633719542356.png
This is a fit that I did today. And it fit the data that I measure. it is off at little as you do down. and I think it is because I did not iterate it. I think to iterated it , I would have to solute for A B and w again . I just do not know when to stop.
 
Last edited:
  • Haha
Likes pbuk
  • #33
btb4198 said:
View attachment 290391This is a fit that I did today. And it fit the data that I measure. it is off at little as you do down. and I think it is because I did not iterate it. I think to iterated it , I would have to solute for A B and w again . I just do not know when to stop.
You should adjust the vertical scale on your graph. What you show here looks like nothing more than a horizontal line, ##y \approx 100##.
 
  • #34
Mark44 said:
You should adjust the vertical scale on your graph. What you show here looks like nothing more than a horizontal line, ##y \approx 100##.
I have been trying... but the graphing calculator does not let me... it is very frustrating, I am only using it because it comes with my computer .
 
  • #35
btb4198 said:
I have been trying... but the graphing calculator does not let me... it is very frustrating, I am only using it because it comes with my computer .
Try desmos instead.
 
  • #37
btb4198 said:
I have been trying... but the graphing calculator does not let me... it is very frustrating, I am only using it because it comes with my computer .
It looks like you are using the Windows Calculator to do the graphs.
Click the icon circled below to open the Graph Options dialog.
pic1.png


On the Graph Options dialog, you can change the scale on the x-axis or the y-axis, change the units (radians, degrees, or grads), or change the line thickness.
pic2.png

You'll get a more useful graph by changing the limits on the y-axis to better show the oscillation.
 
  • Like
Likes sysprog

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
85
Views
8K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 6 ·
Replies
6
Views
477
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K