Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


2 Pages12>
Options
Go to last post Go to first unread
Offline Neeky  
#1 Posted : 24 August 2022 17:25:23(UTC)
Neeky

Rank: Newbie

Groups: Registered
Joined: 24/08/2022(UTC)
Posts: 8

Dear forum users! I turn to you for advice on the SMath program. I am attaching a file in .sm format with suggestions for improving the accuracy of calculations in the SMath program and questions for the presented calculation.

Found an error in the last question. I am attaching the updated file.

Improving Calculation Accuracy.sm (79kb) downloaded 12 time(s).

Edited by user 26 August 2022 10:29:46(UTC)  | Reason: Error in the last question

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Razonar  
#2 Posted : 25 August 2022 01:15:42(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi Neeky. Some notes about your questions.

Improving Calculation Accuracy.sm (34kb) downloaded 22 time(s).
Improving Calculation Accuracy.pdf (255kb) downloaded 29 time(s).

Best regards.
Alvaro.
thanks 2 users thanked Razonar for this useful post.
on 25/08/2022(UTC),  on 25/08/2022(UTC)
Offline Jean Giraud  
#3 Posted : 25 August 2022 13:59:00(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
... this version for your convenience.
Previous deleted.

Improving Calculation Accuracy RootSecant.sm (29kb) downloaded 20 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 25/08/2022(UTC)
Offline Neeky  
#4 Posted : 26 August 2022 16:36:02(UTC)
Neeky

Rank: Newbie

Groups: Registered
Joined: 24/08/2022(UTC)
Posts: 8

Thank you very much for the tip to use the bisection method!

Please tell me how it is possible to implement in the SMath program an algorithm for calculating the roots of an equation that (an equation) contains Bessel functions. Equation with Bessel functions.sm (4kb) downloaded 10 time(s).
Offline Jean Giraud  
#5 Posted : 26 August 2022 20:24:54(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Neeky Go to Quoted Post
Please tell me how it is possible to implement in the SMath program an algorithm for calculating the roots of an equation that (an equation) contains Bessel functions

Immediately, answer is no from Smath built-in Bessel... Why ?
Smath built-in Bessel has no derivative for roots solver.
Visit ► Samples ► Solve Grand TREASURY ► sheet 0
You can have Bessel from Computer Approximation ... attached.
Cheers ... Jean.

Bessel J0,Y0.sm (23kb) downloaded 13 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 29/08/2022(UTC)
Offline Razonar  
#6 Posted : 27 August 2022 04:25:12(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Neeky Go to Quoted Post
...
Please tell me how it is possible to implement in the SMath program an algorithm for calculating the roots of an equation that (an equation) contains Bessel functions.


Hi. Use bisection method.

Equation with Bessel functions.sm (25kb) downloaded 24 time(s).
Equation with Bessel functions.pdf (78kb) downloaded 14 time(s).

Best regards.
Alvaro

Edited by user 27 August 2022 04:28:52(UTC)  | Reason: Not specified

thanks 1 user thanked Razonar for this useful post.
on 29/08/2022(UTC)
Offline Jean Giraud  
#7 Posted : 27 August 2022 15:20:06(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
This document solve Smath built-in mwbesselj(0,x)
1. rootDichotomy for the roots.
2. rootSecant for solving intersection with linear f(x) ... typical.
Jean.

Bessel SOLVE.sm (23kb) downloaded 15 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 29/08/2022(UTC)
Offline Neeky  
#8 Posted : 29 August 2022 15:47:41(UTC)
Neeky

Rank: Newbie

Groups: Registered
Joined: 24/08/2022(UTC)
Posts: 8

Thanks for the help.
Now I can determine the roots of such equations.
My calculations that contain these equations are calculated correctly.
The only thing I don't understand is the algorithm presented in Razonar's post..
Could you please tell me how to deal with this algorithm?
Offline Razonar  
#9 Posted : 29 August 2022 21:23:42(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Neeky Go to Quoted Post
Thanks for the help.
Now I can determine the roots of such equations.
My calculations that contain these equations are calculated correctly.
The only thing I don't understand is the algorithm presented in Razonar's post..
Could you please tell me how to deal with this algorithm?


Hi. Some comments added.

Equation with Bessel functions Explain.sm (43kb) downloaded 10 time(s).
Equation with Bessel functions Explain.pdf (259kb) downloaded 10 time(s).

Best regards.
Alvaro.

Edited by user 29 August 2022 21:30:15(UTC)  | Reason: Not specified

thanks 2 users thanked Razonar for this useful post.
on 30/08/2022(UTC),  on 30/08/2022(UTC)
Offline Jean Giraud  
#10 Posted : 29 August 2022 22:47:10(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Neeky Go to Quoted Post
Now I can determine the roots of such equations.

If you provide a sample, that will help mutually.
As offered, you can solve for roots & intersections.

Offline overlord  
#11 Posted : 30 August 2022 00:07:27(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,124
Turkey

Was thanked: 506 time(s) in 337 post(s)
Originally Posted by: Razonar Go to Quoted Post
Hi. Some comments added.

Best regards.
Alvaro.

Mentioned procedure for finding when solve(), diff(), etc would work is useful.

Thanks

2022-08-30_00-05.png
Offline Neeky  
#12 Posted : 30 August 2022 11:14:28(UTC)
Neeky

Rank: Newbie

Groups: Registered
Joined: 24/08/2022(UTC)
Posts: 8

Hello!

Thank you very much for your clarification and for taking the time to answer my question.

Due to the fact that I am not a mathematician or a programmer, it is still very difficult for me to understand these algorithms.

Best regards.
Nikolai.
Offline Jean Giraud  
#13 Posted : 30 August 2022 17:43:23(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Neeky Go to Quoted Post
Due to the fact that I am not a mathematician or a programmer, it is still very difficult for me to understand these algorithms.
Best regards.
Nikolai.

You have to be the Smth Mathematician in some of these built-in functions.

BesselJ(x,0)... is strctly 0 from x=0 ... ∞
Thus, you can multiply by anything.
As a desirable effect, it constrains
x*BesselJ(x,1)to start @ 0
for profitable inspection suite.
Psi(x)+BesselJ(x,0)renders superbly Psi(x).
What complains here is for smarter than me
Cheers ... Jean.

Neeky.sm (22kb) downloaded 8 time(s).


thanks 1 user thanked Jean Giraud for this useful post.
on 01/09/2022(UTC)
Offline Jean Giraud  
#14 Posted : 01 September 2022 01:01:45(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Hello Nikolai,
Your Bessel PDF is interesting.
It has a close relationship with Weibull.
As demonstrated, not optimized.
Added solve roots/datum, accurate algo style.
Cheers ... Jean.

Stat Treasury_11 PDF Weibull_Bessel.sm (17kb) downloaded 6 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 01/09/2022(UTC)
Offline Neeky  
#15 Posted : 01 September 2022 17:23:46(UTC)
Neeky

Rank: Newbie

Groups: Registered
Joined: 24/08/2022(UTC)
Posts: 8

Originally Posted by: Jean Giraud Go to Quoted Post
Hello Nikolai,
Your Bessel PDF is interesting.
It has a close relationship with Weibull.
As demonstrated, not optimized.
Added solve roots/datum, accurate algo style.
Cheers ... Jean.

Stat Treasury_11 PDF Weibull_Bessel.sm (17kb) downloaded 6 time(s).


Hello Jean Giraud,

Thank you for your attention to my questions and for tips on how to improve the accuracy of calculations.

The equation whose roots I need to find is correctly written in SMath:
F(x) = x * Bessel(1;x) - 1,01 * Bessel(0;x).

Tell me, please, is it possible to apply the algorithm you proposed to determine the roots of this equation?

Best regards,
Nikolai
Offline Jean Giraud  
#16 Posted : 01 September 2022 19:55:17(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Neeky Go to Quoted Post
... is it possible to apply the algorithm you proposed to determine the roots of this equation?

Immediate answer is NO from brute force.
I try to manage my Waterloo ... !
thanks 1 user thanked Jean Giraud for this useful post.
on 02/09/2022(UTC)
Offline Jean Giraud  
#17 Posted : 01 September 2022 23:36:35(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Neeky Go to Quoted Post
Tell me, please, is it possible to apply the algorithm you proposed to determine the roots of this equation?

Now, answer is YES from individual Dichotomy.
Accuracy is in the range of ~ 15 D.
Enjoy ... Jean.

Nikolai roots.sm (45kb) downloaded 11 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 02/09/2022(UTC)
Offline Jean Giraud  
#18 Posted : 02 September 2022 14:37:58(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Neeky Go to Quoted Post
The equation whose roots I need to find is correctly written in SMath:
F(x) = x * Bessel(1;x) - 1,01 * Bessel(0;x).
Tell me, please, is it possible to apply the algorithm you proposed to determine the roots of this equation?

... here is your project Nikolai !
As far as I understand your roots demand.
f(x) is not scalar wrt 'x' for the solver/scanner solve(■,■,■,■)
but compatible with roots-Dichotomy command line.
Please, don't hesitate for more ... Jean.

Nikolai roots.sm (59kb) downloaded 12 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 02/09/2022(UTC)
Offline Neeky  
#19 Posted : 02 September 2022 15:35:52(UTC)
Neeky

Rank: Newbie

Groups: Registered
Joined: 24/08/2022(UTC)
Posts: 8

Jean and Alvaro thank you very much for your efforts.

It was extremely important to get feedback on this issue.

Now my knowledge of mathematics and programming has been improved.

Best regards,
Nikolai
Offline Jean Giraud  
#20 Posted : 02 September 2022 21:50:21(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Neeky Go to Quoted Post
Jean and Alvaro thank you very much for your efforts.

This augmented version includes min/max Golden ratio.
In case you would want to fit upper/lower envelope,
you will need those support points and more.
Cheers ... Jean.

Nikolai roots.sm (79kb) downloaded 8 time(s).
Users browsing this topic
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.