Improving Calculation Accuracy

Improving Calculation Accuracy - Determining the zeros of an equation using "solve" function and using Newton's method - 消息

#1 已发布: 2022/8/24 11:25:23
Nikolay

Nikolay

0个赞,共8个帖子。

组: User

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 (78.21 KiB)已下载 1295 次。
#2 已发布: 2022/8/24 19:15:42
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Hi Neeky. Some notes about your questions.

Improving Calculation Accuracy.sm (33.28 KiB)已下载 1279 次。
Improving Calculation Accuracy.pdf (254.89 KiB)已下载 759 次。

Best regards.
Alvaro.
2位用户喜欢此帖子
Nikolay 2022/8/25 06:57:00, sergio 2022/8/25 05:48:00
#3 已发布: 2022/8/25 07:59:00
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

... this version for your convenience.
Previous deleted.

Improving Calculation Accuracy RootSecant.sm (28.47 KiB)已下载 1306 次。
1位用户喜欢此帖子
Nikolay 2022/8/25 08:10:00
#4 已发布: 2022/8/26 10:36:02
Nikolay

Nikolay

0个赞,共8个帖子。

组: User

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 (3.47 KiB)已下载 1232 次。
#5 已发布: 2022/8/26 14:24:54
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

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 (22.64 KiB)已下载 1275 次。
1位用户喜欢此帖子
Nikolay 2022/8/29 04:47:00
#6 已发布: 2022/8/26 22:25:12
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

...
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 (24.15 KiB)已下载 1297 次。
Equation with Bessel functions.pdf (77.54 KiB)已下载 776 次。

Best regards.
Alvaro
1位用户喜欢此帖子
Nikolay 2022/8/29 04:47:00
#7 已发布: 2022/8/27 09:20:06
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

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 (22.87 KiB)已下载 1264 次。
1位用户喜欢此帖子
Nikolay 2022/8/29 04:47:00
#8 已发布: 2022/8/29 09:47:41
Nikolay

Nikolay

0个赞,共8个帖子。

组: User

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?
#9 已发布: 2022/8/29 15:23:42
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

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 (42.62 KiB)已下载 1259 次。
Equation with Bessel functions Explain.pdf (258.62 KiB)已下载 866 次。

Best regards.
Alvaro.
2位用户喜欢此帖子
Nikolay 2022/8/30 05:07:00, churichuro 2022/8/29 19:50:00
#10 已发布: 2022/8/29 16:47:10
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

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.

#11 已发布: 2022/8/29 18:07:27
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Wrote

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
#12 已发布: 2022/8/30 05:14:28
Nikolay

Nikolay

0个赞,共8个帖子。

组: User

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.
#13 已发布: 2022/8/30 11:43:23
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

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 (21.7 KiB)已下载 1286 次。


1位用户喜欢此帖子
Nikolay 2022/9/1 10:53:00
#14 已发布: 2022/8/31 19:01:45
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

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 (16.25 KiB)已下载 1298 次。
1位用户喜欢此帖子
Nikolay 2022/9/1 10:53:00
#15 已发布: 2022/9/1 11:23:46
Nikolay

Nikolay

0个赞,共8个帖子。

组: User

Wrote

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 (16.25 KiB)已下载 1298 次。



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
#16 已发布: 2022/9/1 13:55:17
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

... 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 ... !
1位用户喜欢此帖子
Nikolay 2022/9/2 04:56:00
#17 已发布: 2022/9/1 17:36:35
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

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 (44.48 KiB)已下载 1276 次。
1位用户喜欢此帖子
Nikolay 2022/9/2 04:56:00
#18 已发布: 2022/9/2 08:37:58
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

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 (58.95 KiB)已下载 1279 次。
1位用户喜欢此帖子
Nikolay 2022/9/2 09:30:00
#19 已发布: 2022/9/2 09:35:52
Nikolay

Nikolay

0个赞,共8个帖子。

组: User

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
#20 已发布: 2022/9/2 15:50:21
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

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 (78.33 KiB)已下载 1258 次。
  • 有新帖
  • 无新帖