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 ola_nicolas  
#1 Posted : 18 March 2018 01:05:44(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 114
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Greetings to everyone.

I have tried to solve a system of nonlinear equations using the "GivenFind" procedure. I've attached two screenshots below with the bugs returned by the program. In the first image, the program has returned: "x - undefined" error, as can be seen. I then defined the vector x, and the program returned the error "GivenFind - the function is not defined" as in the second image. What could be wrong?
GivenFind 1.jpg GivenFind 2.jpg

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

Offline Jean Giraud  
#2 Posted : 18 March 2018 02:38:36(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: ola_nicolas Go to Quoted Post
"GivenFind" procedure.


It is not an Smath procedure. The native procedure "FindRoots"
Which to me is a non sense as you are given something and want to find.

Solve GivenFind PetShop.sm (14kb) downloaded 30 time(s).

Solve TREASURY_1 [Iterate L, Lc].sm (37kb) downloaded 20 time(s).
Offline ola_nicolas  
#3 Posted : 18 March 2018 08:49:55(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 114
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Bonjour Jean Giraud.
.
I tried before, including the way you suggest it. In addition I analyzed some examples I found on the forum. The results were the same. I attach a new image to one of the examples you gave me in your answer. You may notice a similar error. Therefore, please help me solve the problem.

GivenFind 3.jpg
Offline omorr  
#4 Posted : 18 March 2018 10:05:29(UTC)
omorr


Rank: Administration

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

Was thanked: 318 time(s) in 268 post(s)
Hello,

Just suppress evaluation of the marked region.

nonlin.PNG
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline ola_nicolas  
#5 Posted : 18 March 2018 11:06:26(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 114
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
hello omorr.

The result is the same. I have not attached a new image. I specify that if I define the sizes x, y and z, the program returns the error "FindRoot - the function is undefined"

Edited by user 18 March 2018 11:23:17(UTC)  | Reason: Not specified

Offline omorr  
#6 Posted : 18 March 2018 11:58:48(UTC)
omorr


Rank: Administration

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

Was thanked: 318 time(s) in 268 post(s)
BTW, I still have a frustrating experience in SMath whenever I try to numerically solve a nonlinear system of equations F(X)=0 given n valued vector function F(X) with unknown vector X with n elements when, say, n >= 10.
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Jean Giraud  
#7 Posted : 18 March 2018 17:34:21(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: omorr Go to Quoted Post
BTW, I still have a frustrating experience in SMath whenever I try to numerically solve a nonlinear system of equations F(X)=0 given n valued vector function F(X) with unknown vector X with n elements when, say, n


Bonjour Radovan, please give us an example.

Offline omorr  
#8 Posted : 18 March 2018 18:01:58(UTC)
omorr


Rank: Administration

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

Was thanked: 318 time(s) in 268 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: omorr Go to Quoted Post
BTW, I still have a frustrating experience in SMath whenever I try to numerically solve a nonlinear system of equations F(X)=0 given n valued vector function F(X) with unknown vector X with n elements when, say, n


Bonjour Radovan, please give us an example.



Bonjour Jean, ça va?

We already had this discussion some time ago - see this post, please.
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 18/03/2018(UTC)
Offline ola_nicolas  
#9 Posted : 19 March 2018 13:02:34(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 114
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Greetings to all

Here is a practical and very laborious way to solve the initial problem. The three basic non-linear equations are those on a yellow background. The MathCAD program's symbolic calculation facilities were used to solve two of the basic equations in relation to the η and λ variables. The necessary substitutions were made in the third equation and I was able to define the function N (n) in this way. The equation N (n) = 0 is solved using the "solve" function in Smath. A second function (Λ (λ)) was then elaborated which was solved in turn using the same function. Finally, one of the two equations solved in relation to the variables η and λ is actually calculated. The whole calculation process lasted about 60 minutes. I wonder how long it would take if I did not have the facilities of MathCAD's symbolic calculation ?! Probably a lot of hours. What would have happened if (as Radovan had said) the number of variables would have been greater than 3 ?! It would have been frustrating indeed. Therefore, if Smath developers read this post, I think it would be good to consider the possibility of implementing a "Given-Find" and / or "Given-Minerr" computation procedures similar to those used in MathCAD. I attached here along with the image of the Smath solution, a picture of solving the same problem in MathCAD by using the "Given-Find" procedure. It lasted only as long as it was necessary to edit the necessary relationships in that spreadsheet. Otherwise, all the best.

Smath 3 nonlinear solving.jpg MathCAD 3 nonlinear solving.jpg

Edited by user 19 March 2018 13:20:48(UTC)  | Reason: Not specified

Offline omorr  
#10 Posted : 19 March 2018 13:51:47(UTC)
omorr


Rank: Administration

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

Was thanked: 318 time(s) in 268 post(s)
Hello,

It seems that for your problem there is a solution (do not know if it is a viable one). FindRoot() will do the job here. One might consider FindRoot() similar to Given/Find in Mathcad.

FindRoot3.GIF

FindRoot3.sm (14kb) downloaded 20 time(s).

Edited by user 19 March 2018 13:58:52(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 19/03/2018(UTC)
Offline Jean Giraud  
#11 Posted : 19 March 2018 15:45:21(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: ola_nicolas Go to Quoted Post
Therefore, if Smath developers read this post, I think it would be good to consider the possibility of implementing a "Given-Find" and / or "Given-Minerr" computation procedures similar to those used in MathCAD.


I claimed for that ... no answer. Mathcad Given/Find, Given/Minerr are/were Mathsoft proprietary
from "Numerical Recipes" [improved methods]. In a loop, Given/find goes up to 399 steps.
In common use, past few visible conditions it's no problem. We did a project from blank
knowledge up to 22 conditions, it lasted at least a week. Generally, the problem has some
sort of model guide line. If NOT, pedal in patience [pedal in butter].

Given/Minerr would be a great asset in Smath. Otherwise, we have the Conjugate Gradient,
just a bit more difficult to manage but 62 optimized model functions were done.
The difficulty, even in Mathcad Given/Minerr [LM] is that many models are very reactive
and LM fails ... only manual fit are possible. I have not yet managed to Minerr/Solve DE
in Smath ... Original from Mathsoft, extended from Russian Mathcad Collabs.

Cheers.
Offline ola_nicolas  
#12 Posted : 19 March 2018 16:48:35(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 114
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Hello

@Radovan: It works

@Jean Giraud: I can not comment. For now, I've managed to solve the problem. Another time I will see.

Edited by user 19 March 2018 16:56:43(UTC)  | Reason: Not specified

Offline Davide Carpi  
#13 Posted : 19 March 2018 16:53:59(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: ola_nicolas Go to Quoted Post
My variant is a portable one, which I installed recently and I would not want to change it for the time being.


Which version?
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline ola_nicolas  
#14 Posted : 19 March 2018 17:00:56(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 114
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Hello

It is 0.98.6484 but it does not matter. It finally worked.
... As it seems (to work) I have to copy the examples I download directly from the forum into a page of my program.

Edited by user 19 March 2018 17:12:23(UTC)  | Reason: Not specified

Offline Davide Carpi  
#15 Posted : 19 March 2018 17:25:45(UTC)
Davide Carpi


Rank: Advanced Member

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

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: ola_nicolas Go to Quoted Post
As it seems (to work) I have to copy the examples I download directly from the forum into a page of my program


It is possible, there were several changes in the worksheet structure since your version, thus something from newer worksheets might confuse your version.... good that it worked within the clipboard Good

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline ola_nicolas  
#16 Posted : 19 March 2018 17:38:50(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 114
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Hello

Finally it worked in this version

FindRoot.jpg
Offline ElSid  
#17 Posted : 19 March 2018 18:17:27(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
ola_nicolas,
Please repost working sheet. I am not getting your solutions FindRoot(ES).smz (3kb) downloaded 15 time(s).
Offline ola_nicolas  
#18 Posted : 19 March 2018 19:03:40(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 114
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Hello

Here's the Smath file. The other was an image file.

FindRoot.sm (9kb) downloaded 26 time(s).
Offline omorr  
#19 Posted : 19 March 2018 19:12:19(UTC)
omorr


Rank: Administration

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

Was thanked: 318 time(s) in 268 post(s)
Originally Posted by: ElSid Go to Quoted Post
ola_nicolas,
Please repost working sheet. I am not getting your solutions FindRoot(ES).smz (3kb) downloaded 15 time(s).


This is a matter of third and fourth parameter of FindRoot() function (numerical precision). The solution will be different if you change them. Just look at the order of magnitude of the solutions. The second and third values are quite close to zero. Therefore, one might expect this behavior.
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 19/03/2018(UTC)
Offline Jean Giraud  
#20 Posted : 19 March 2018 19:28:46(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: ola_nicolas Go to Quoted Post
For now, I've managed to solve the problem

I don't think so ! Check I recomposed correctly.

GivenFind PossibleBug.sm (236kb) downloaded 19 time(s).


Users browsing this topic
Guest
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.