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

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Cornel  
#1 Posted : 07 October 2024 20:11:16(UTC)
Cornel


Rank: Advanced Member

Groups: Registered
Joined: 04/10/2024(UTC)
Posts: 39
Man

Hi,

How to make Smath root function to work as in Mathcad Prime. Right now I am not interestead in find the solution with Solve or maple plugin. Only I want to know it it is possible to make Smath to behave the same way for this root function.

mathcadprimvssmath1.png

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

Offline Cornel  
#2 Posted : 07 October 2024 21:40:48(UTC)
Cornel


Rank: Advanced Member

Groups: Registered
Joined: 04/10/2024(UTC)
Posts: 39
Man

Maybe as an idea on how to start, something like that: but using only one FindRoot, and iterating the radom(20)+i (second parameter of FindRoot)

3.png
Offline Davide Carpi  
#3 Posted : 07 October 2024 22:44:39(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,703
Man
Italy
Location: Italy

Was thanked: 1376 time(s) in 901 post(s)
Like this?

always remember to check the results, sometimes FindRoot might return a result far from the solution.

FindRoot_range_random.sm (10kb) downloaded 1 time(s).
2024-10-07 11_35_41-SMath Solver - [FindRoot_range_random.sm].png

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Cornel  
#4 Posted : 08 October 2024 00:13:02(UTC)
Cornel


Rank: Advanced Member

Groups: Registered
Joined: 04/10/2024(UTC)
Posts: 39
Man


1.png
Online uni  
#5 Posted : 08 October 2024 00:24:39(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,576
Man
Russian Federation

Was thanked: 1325 time(s) in 776 post(s)
maple-solve-optimization-numeric.JPG
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 08/10/2024(UTC)
Offline Cornel  
#6 Posted : 08 October 2024 00:30:21(UTC)
Cornel


Rank: Advanced Member

Groups: Registered
Joined: 04/10/2024(UTC)
Posts: 39
Man

Originally Posted by: uni Go to Quoted Post
maple-solve-optimization-numeric.JPG


But this is the result with maple engine. The same result should not be obtained also with Maxima engine, as I showed above by using Solve? So, we need always to check the results with both engines? Seems strange then to me...
Offline Cornel  
#7 Posted : 08 October 2024 06:41:36(UTC)
Cornel


Rank: Advanced Member

Groups: Registered
Joined: 04/10/2024(UTC)
Posts: 39
Man

uni, what I do dont yet understand îs why Maxima engine (by using Solve(f(x), x)) gives that "strânge" 4 results (different by maple and mathcad prime results)?

Edited by user 08 October 2024 06:44:07(UTC)  | Reason: Not specified

Offline Razonar  
#8 Posted : 08 October 2024 07:20:46(UTC)
Razonar


Rank: Advanced Member

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

Was thanked: 900 time(s) in 574 post(s)
Some comments. The solutions for mathcad's solve and SMath's FindRoots are numerical, so they depend on the initial values, and are susceptible to returning wrong values, without this being considered a bug in the function itself. Therefore, Davide's recommendation to verify the solutions is very accurate. In addition, they can find numerous solutions to a second or fourth degree polynomial equation, even if there is a theorem that says they are exactly two and four respectively.

The solutions for Maple and Maxima are symbolic. If they were wrong, that is, they did not verify the initial equation, then it would be necessary to state that it is a bug in the program. But both systems return the same solution, except that they are expressed differently, which is perfectly valid. This is a way of showing that the solutions for Maple and Maxima are the same.

roots.sm (9kb) downloaded 6 time(s).

root.png

Best regards.
Alvaro.

Edited by user 08 October 2024 07:24:11(UTC)  | Reason: Not specified

thanks 1 user thanked Razonar for this useful post.
on 08/10/2024(UTC)
Online uni  
#9 Posted : 08 October 2024 07:50:22(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,576
Man
Russian Federation

Was thanked: 1325 time(s) in 776 post(s)
Imagine that the fourth root of -1 is the root of the imaginary unit and that is a 45 degree rotation. Rotate each solution from the unit vector by the appropriate angle in the desired direction.

In computer algebra, there is a problem with the output of equivalent expressions. If two solutions are equivalent, then the more compact textual representation is usually chosen for display. The symbolic engine can be asked to output in a different form. Such capabilities should be available.

Edited by user 08 October 2024 08:09:33(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline Cornel  
#10 Posted : 08 October 2024 09:20:43(UTC)
Cornel


Rank: Advanced Member

Groups: Registered
Joined: 04/10/2024(UTC)
Posts: 39
Man

Ok Alvaro, now I can understand. Thanks You all for all responses.
Offline mkraska  
#11 Posted : 08 October 2024 20:52:53(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 2,026
Germany

Was thanked: 1153 time(s) in 739 post(s)
Note that you can use Assign() for more options to control the display of solutions given as boolean equations (here you want the numerical values). The side effect is that the equations are converted to assignments. This is actually the primary task of Assign().

Blatt32.png
Blatt32.sm (6kb) downloaded 14 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Users browsing this topic
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.