Mathematically modeling a real system in C#

  • Thread starter Thread starter btb4198
  • Start date Start date
  • Tags Tags
    Modeling System
Click For Summary

Discussion Overview

The discussion revolves around the mathematical modeling of a real system using sinewave fitting in C#. Participants explore how to predict values from a dataset that appears to resemble a sinewave, while addressing challenges related to data representation, fitting algorithms, and the limitations of available tools.

Discussion Character

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

Main Points Raised

  • One participant presents a dataset that they believe resembles a sinewave and seeks an algorithm for fitting a sinewave model to this data.
  • Another participant questions the clarity and coherence of the initial post, specifically regarding the definitions of parameters A and B.
  • Several participants suggest that explicitly writing out the model to be fitted would be beneficial for clarity.
  • There is a discussion about the adequacy of the number of data points for fitting a sinusoidal curve, with some participants expressing skepticism about the representativeness of the provided data.
  • One participant mentions the lack of built-in sinusoidal fitting functions in C# and suggests using optimization libraries available in other programming languages or tools like Excel.
  • Another participant provides a link to a resource for optimization libraries in C#, explaining how to set up a fitting function for the sinewave model.
  • Concerns are raised about the participant's ability to graph the data and fit the model correctly, with some suggesting that learning to code the fitting process may be necessary.
  • One participant expresses frustration over the lack of clarity in the discussion and the challenges of coding the fitting algorithm without a clear understanding of the underlying mathematics.

Areas of Agreement / Disagreement

Participants generally agree that a clearer model definition and more data points may be necessary for effective fitting. However, there is disagreement regarding the adequacy of the provided data and the best approach to take for fitting the sinewave model in C#.

Contextual Notes

Participants note limitations related to the number of data points, the clarity of the model parameters, and the absence of built-in fitting functions in C#. There are unresolved questions about the mathematical steps required for fitting and the representation of the data.

  • #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   Reactions: 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   Reactions: sysprog

Similar threads

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