Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Mido0  
#1 Posted : 04 March 2017 09:36:15(UTC)
Mido0


Rank: Member

Groups: Registered
Joined: 10/01/2017(UTC)
Posts: 21
Man
Canada
Location: Alberta

Hi,
I am new to SMath and still learning. I had two unknown with two equations and was trying to solve them simultaneously but unfortunately SMath does not have the "solve block" option as in MathCad (if there is a way please let me know).
so I consolidate the two equations into one quadratic equation with one unknown, and tried to use the "solve" function to get the roots of the equation but it says that there is no real roots while it has!! so what i am doing wrong?!
please help!!
Solve.sm (94kb) downloaded 19 time(s).Sketch (1).png

Edited by user 04 March 2017 09:47:00(UTC)  | Reason: Not specified

Offline omorr  
#2 Posted : 04 March 2017 10:56:43(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,734
Man
Serbia

Was thanked: 312 time(s) in 266 post(s)
Hello,

You have the problem with inconsistent units. Either get rid of them or add unit 'm to argument w in calling solve(Eq3(w*'m)=0,w). You will get two results (0.2162, 1.4238).

Reards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 05/03/2017(UTC)
Offline mkraska  
#3 Posted : 04 March 2017 13:51:45(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,583
Germany

Was thanked: 858 time(s) in 546 post(s)
You can solve the original equations using FindRoot() from the Plugin Nonlinear Solvers or Solve() from the Maxima Plugin.
FindRoot() requires initial guesses, to be given with correct dimension (unit)
Solve() does not need initial guesses but leaves you with the chance or problem to select the correct solution.

BTW, why did you re-define MPa and kN? These are available in the units selector dialog. Also, mPa is confusing as it would read as Millipascal.
Solve_kr.sm (101kb) downloaded 46 time(s).
solve-2.png
Solve-1.png

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 05/03/2017(UTC)
Offline Mido0  
#4 Posted : 05 March 2017 01:25:33(UTC)
Mido0


Rank: Member

Groups: Registered
Joined: 10/01/2017(UTC)
Posts: 21
Man
Canada
Location: Alberta

Thanks Martin and Radovan,
Radovan, I tried what you said and did not work, can you kindly send the file, and for your information, if you have not changed my numbers then the answer should not be what you mentioned, so the units thing must mess with the results!! Also I want to understand why the units are inconsistent? units between what exactly? Eq(w) has an area unit because (W) is squared.

Also Martin thanks for the file, it seems the Maxima plugin can't open on my computer for some reason. I am running on windows 10 which i am not sure it is incompatible with it or not. I searched and found that you posted a portable version of SMath that works with Maxima but the website would not open "https://extmoodle.th-brandenburg.de/course/view.php?id=34"

Also, is there an English version of the manual you created in SMath? it looks great but I don't know German unfortunately
Thanks again, really appreciate it.

error plugin.png
Offline mkraska  
#5 Posted : 05 March 2017 02:19:01(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,583
Germany

Was thanked: 858 time(s) in 546 post(s)
Originally Posted by: Mido0 Go to Quoted Post


Also Martin thanks for the file, it seems the Maxima plugin can't open on my computer for some reason. I am running on windows 10 which i am not sure it is incompatible with it or not.
I searched and found that you posted a portable version of SMath that works with Maxima but the website would not open "https://extmoodle.th-brandenburg.de/course/view.php?id=34"

Also, is there an English version of the manual you created in SMath? it looks great but I don't know German unfortunately


The maxima plugin doesn't work with Win10. You can still open the file and ignore the maxima stuff. I corrected the units in the definitions of the parameters. FindRoot should do the job anyways.

In the extension manager (Tools> Plug-ins) go to the Interactive books tab. In the online gallery you find a bilingual english/german handbook. If you set this as default you can open the book using the [?] button of the toolbar.




Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline Mido0  
#6 Posted : 05 March 2017 02:40:43(UTC)
Mido0


Rank: Member

Groups: Registered
Joined: 10/01/2017(UTC)
Posts: 21
Man
Canada
Location: Alberta

Thanks again Martin, may I ask why the findroot function gives only one solution? And on what bases it chooses which root for the result.
Offline omorr  
#7 Posted : 05 March 2017 11:34:10(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,734
Man
Serbia

Was thanked: 312 time(s) in 266 post(s)
Originally Posted by: Mido0 Go to Quoted Post
Radovan, I tried what you said and did not work, can you kindly send the file, and for your information, if you have not changed my numbers then the answer should not be what you mentioned, so the units thing must mess with the results!! Also I want to understand why the units are inconsistent? units between what exactly? Eq(w) has an area unit because (W) is squared.


Here is the corrected file Solve_corr.sm (102kb) downloaded 44 time(s).,

Solve_corr.PNG

The results were different from Martin's solution because of h.c in the equation Eq.3(w) (there was h mistakenly instead of h.c).

I hope that you figured out why the units are not consistent if you put only w without unit length. Actually, you have to give w the unit, not use it without it. Then the equation will be right. In the Eq.3(w) unit of w must be unit length in order the equation to be in units length squared (unit consistent).

Regards,
Radovan

P.S. Davide's FindRoout() uses the algorithm which solves the nonlinear equation giving only one solution (requiring an initial value) while solve() uses search algorithm in the given range (range can be change as third and fourth parameter)

Edited by user 05 March 2017 11:40:27(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline mkraska  
#8 Posted : 05 March 2017 11:54:55(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,583
Germany

Was thanked: 858 time(s) in 546 post(s)
Originally Posted by: Mido0 Go to Quoted Post
Thanks again Martin, may I ask why the findroot function gives only one solution? And on what bases it chooses which root for the result.

As Radovan said, if multiple solutions exist, the result depends on the initial guess, where the algorithm starts. The range of initial values leading to a particular solution can be quite different and is depending on the particular shape of the function and the algorithm in use. If you use NewtonRaphson instead of FindRoot, you get the same results but with different ranges of convergence.

With FindRoot, you need initial guesses quite close to the second solution in order to actually get it. That's why symbolic solutions are preferrable if available.

2017-03-05 09_51_11-SMath Studio 0.98.6179 - [Solve_kr.sm].png
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline Mido0  
#9 Posted : 05 March 2017 22:48:44(UTC)
Mido0


Rank: Member

Groups: Registered
Joined: 10/01/2017(UTC)
Posts: 21
Man
Canada
Location: Alberta

Thanks again for both of you Martin and Radovan, really appreciate it.
So it seems that I have an issue with my SMath version, when I opened your file Radovan, it was not able to calculate the Solve function as it happened with me (see attached). is that because I am running with Windows 10?
Solve_Error.png

Also Martin, Can you send another link to the SMath Poratble version?, because your link in you signature does not work.
Thanks alot.
Offline mkraska  
#10 Posted : 05 March 2017 23:46:25(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,583
Germany

Was thanked: 858 time(s) in 546 post(s)
Originally Posted by: Mido0 Go to Quoted Post

Also Martin, Can you send another link to the SMath Poratble version?, because your link in you signature does not work.
Thanks alot.


I need to ask our IT guys what happened to the Moodle system. I hope to get this fixed tomorrow.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Offline omorr  
#11 Posted : 05 March 2017 23:55:07(UTC)
omorr


Rank: Administration

Groups: Registered, Administrators, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,734
Man
Serbia

Was thanked: 312 time(s) in 266 post(s)
Originally Posted by: Mido0 Go to Quoted Post

So it seems that I have an issue with my SMath version, when I opened your file Radovan, it was not able to calculate the Solve function as it happened with me (see attached). is that because I am running with Windows 10?

I do not think so (I was using Win10 for your file as well). As far as I know, the problem with solve() when it reported "No real roots" is usually with the search range for roots. It can be set globally in Tools->Options->Calculation->Roots(range) or locally with third and fourth argument. I think in you case it might be zero and one like solve( , ,0,1). By the way, you can also use roots() function for the numerical roots or (as Marting suggested) the symbolical solution. Besides Maxima you have maple plugin as well.

Regards,
Radovan

roots2.PNG

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
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.