Curve fitting function

Curve fitting function - Is there a curve fitting function in Smath? - Messages

#1 Posted: 1/13/2022 7:38:26 AM
rex

rex

1 likes in 10 posts.

Group: User

Hello,
Is there any curve fitting function in Smath?
I mean using the defined points to find the function of these points!
Thanks a lot!
#2 Posted: 1/14/2022 12:00:26 AM
rex

rex

1 likes in 10 posts.

Group: User

Wrote

... for best examination: close Smath ... open a virgin session.
This way, as you will download, both will be resident in same session.
Open include to inspect the content, close back.
Open Test UpDated ... F9 to run
Test Updated contents 5 stand alone fit examples.
If it does not work wrt your Smath version ... bug.
Try it ... report ... Jean

Genfit Algo Include.sm (36 KiB) downloaded 46 time(s).
Genfit Algo Include Test UpDated.sm (145 KiB) downloaded 45 time(s).



Hi Jean,
Thanks for your reply!
I tired the .sm file, but it doesn't work well. Meanwhile, the Genfit Algo Include.sm needs rename as GenfitAlgoInclude.sm.

I put the two .sm files in the same location, tSmath_error.pnghen I opened the Test Updated.sm, and pressed F9 to run....the error is shown in the picture.
The information of my Smath is Version 0.99
Looking forward to your feedback, thanks!

[attach]42964
#3 Posted: 1/14/2022 12:53:11 AM
CBG

CBG

77 likes in 312 posts.

Group: User

Hello

Maybe you can deal with Least Squares Fit

Define_a_Variable_Ajust_by_Last_Square.sm (58 KiB) downloaded 74 time(s).

Ajust_by_Last_Square_Selection.sm (54 KiB) downloaded 47 time(s).

Best Regards

Carlos
#4 Posted: 1/14/2022 2:04:40 AM
overlord

overlord

551 likes in 1332 posts.

Group: Moderator

Wrote

I mean using the defined points to find the function of these points!


Answer is YES
I don't know an embedded function for this.
But you can write your own function.
Lagrange Interpolation Method can be used.
maple() command is not necessary but it simplifies the function.
Giving more points, curve gets more complex.
Here is some examples for your request.

Regards

lagrange.sm (26 KiB) downloaded 50 time(s).

Click to enlarge

Click to enlarge

Click to enlarge

Click to enlarge
2 users liked this post
sergio 1/14/2022 6:15:00 AM, Alvaro Diaz Falconi 1/14/2022 4:19:00 PM
#5 Posted: 1/14/2022 2:55:13 AM
rex

rex

1 likes in 10 posts.

Group: User

Wrote

Hello

Maybe you can deal with Least Squares Fit

Define_a_Variable_Ajust_by_Last_Square.sm (58 KiB) downloaded 74 time(s).

Ajust_by_Last_Square_Selection.sm (54 KiB) downloaded 47 time(s).

Best Regards

Carlos



Hi Carlos,

This works really fine, thanks for sharing this!
#6 Posted: 1/14/2022 2:57:10 AM
rex

rex

1 likes in 10 posts.

Group: User

Wrote

Answer is YES
I don't know an embedded function for this.
But you can write your own function.
Lagrange Interpolation Method can be used.
maple() command is not necessary but it simplifies the function.
Giving more points, curve gets more complex.
Here is some examples for your request.

Regards

lagrange.sm (26 KiB) downloaded 50 time(s).

Click to enlarge

Click to enlarge

Click to enlarge

Click to enlarge



Hi, thanks for sharing this, I will try to learn your file!
#7 Posted: 1/14/2022 5:36:56 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Hello,
Is there any curve fitting function in Smath?
I mean using the defined points to find the function of these points!
Thanks a lot!



Maxima plugin has the Fit() function, see this post

In the interactive handbook, you find it in the Function Index page.


2022-01-14 09_32_53-Reference book.png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
sergio 1/14/2022 6:15:00 AM
#8 Posted: 1/14/2022 6:56:58 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hi. Some fitting curves functions in the attached.

fit.pdf (527 KiB) downloaded 77 time(s).
fit.sm (377 KiB) downloaded 62 time(s).

Best regards.
Alvaro.
3 users liked this post
NDTM Amarasekera 1/14/2022 11:23:00 AM, sergio 1/14/2022 7:23:00 AM, Fridel Selitsky 1/14/2022 7:26:00 AM
#9 Posted: 1/14/2022 10:56:33 AM
overlord

overlord

551 likes in 1332 posts.

Group: Moderator

Wrote

Hi, thanks for sharing this, I will try to learn your file!


You are welcome.
My function is direct method, may not be suitable for large data sets.
Razonar's and mkraska's samples are good to investigate too for that purpose.

Regards
#10 Posted: 1/14/2022 4:25:17 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Hi ovlerlord.

Wrote

Answer is YES



Yes, it is YES.

Wrote


Lagrange Interpolation Method can be used.
maple() command is not necessary but it simplifies the function.



This version of your application doesn't need maple for get the simplified lagrange polynom.

lagrange.sm (22 KiB) downloaded 44 time(s).

Best regards.
Alvaro.
1 users liked this post
overlord 1/14/2022 5:46:00 PM
#11 Posted: 1/17/2022 12:15:21 AM
rex

rex

1 likes in 10 posts.

Group: User

Wrote

Wrote

Hi Jean,
Thanks for your reply!


Please, attach your raw data set., i.e: not freaked by else.
Two more examples attached.

Genfit Frechet DIFFICULT.sm (128 KiB) downloaded 22 time(s).
Genfit Kirby_2 [Reduced] Copy.sm (81 KiB) downloaded 26 time(s).

A fitting session is mostly governed by the model and techniques.
In short: sky is the limit. Some data set can only be fitted by hand.
Plenty are willing in Smath Community.
Take care ... Jean



File not found.File not found.

Hi Jean,

see the stress-strain data, I would say I am really happy about this forum. I got a lot of fit function information from here! Thanks all!
#12 Posted: 1/17/2022 4:55:01 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: User

Wrote



File not found.File not found.



Hi. Three fitting models for your data.

fit_stress_strain.sm (523 KiB) downloaded 59 time(s).
fit_stress_strain.pdf (635 KiB) downloaded 60 time(s).

Best regards.
Alvaro.
1 users liked this post
Fridel Selitsky 1/17/2022 5:00:00 AM
#13 Posted: 1/17/2022 5:58:00 AM
rex

rex

1 likes in 10 posts.

Group: User

Wrote

Wrote



File not found.File not found.



Hi. Three fitting models for your data.

fit_stress_strain.sm (523 KiB) downloaded 59 time(s).
fit_stress_strain.pdf (635 KiB) downloaded 60 time(s).

Best regards.
Alvaro.



Wow, it's amazing!
Thanks Alvaro!
#14 Posted: 1/26/2022 6:21:34 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

Hi Jean,
Thanks for your reply!
I tried the .sm file, but it doesn't work well.


You have detected a bug wrt your SS version, maybe earlier ones ?
Silent Smath Community ?
If you open the governing Conjugate Gradient ... it could be
the symbolic module has not been saved Symbolic, a common bug reported.
By same token, I will delete all previous attachments.
Please, don't hesitate ... Take care ... Jean.
I guess your original raw data is the one from Alvaro ?
  • New Posts New Posts
  • No New Posts No New Posts