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

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline davidlimtw  
#1 Posted : 27 January 2021 22:23:36(UTC)
davidlimtw


Rank: Member

Groups: Registered
Joined: 07/01/2021(UTC)
Posts: 27
Man
United Kingdom

Hi,

I've have a loop interpolating and searching for values. I not sure what went wrong, the loop is suppose to return 4 answer, however I am only getting (1), the last value.

Appreaciate some help and guidane.

Page7.sm (46kb) downloaded 14 time(s).

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

Offline Jean Giraud  
#2 Posted : 28 January 2021 02:27:26(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: davidlimtw Go to Quoted Post
I've have a loop interpolating and searching for values. I not sure what went wrong, the loop is suppose to return 4 answer, however I am only getting (1), the last value.

Sorry Collab, I don't understand what you are interpolating.
That sub-spaces technique is very useful in many applications.
Cheers ... Jean

Page7 Subspaces.sm (42kb) downloaded 7 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 28/01/2021(UTC)
Offline overlord  
#3 Posted : 28 January 2021 03:48:48(UTC)
overlord


Rank: Advanced Member

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

Was thanked: 509 time(s) in 339 post(s)
Originally Posted by: davidlimtw Go to Quoted Post
Hi,

I've have a loop interpolating and searching for values. I not sure what went wrong, the loop is suppose to return 4 answer, however I am only getting (1), the last value.

Appreaciate some help and guidane.

Page7.sm (46kb) downloaded 14 time(s).

Below you can find corrected file.
I have revised some equations in var_file() and G().
They were trying to reach out of matrix.
Since I don't have original mathcad file this is best I can do.
I did some error check but maybe you have to dig further.

Regards



page7.png

Edited by user 28 January 2021 06:54:31(UTC)  | Reason: Not specified

thanks 1 user thanked overlord for this useful post.
on 28/01/2021(UTC)
Offline davidlimtw  
#4 Posted : 28 January 2021 13:54:46(UTC)
davidlimtw


Rank: Member

Groups: Registered
Joined: 07/01/2021(UTC)
Posts: 27
Man
United Kingdom

Hi Overlord,

Thanks for the reply. Although the val_file() is not returning the same answer as per the attached MathCAD but the overall loop actual works.

Capture14.JPG

Capture14_2.JPG



See attached calculation in mathcad.

Page 7.xmcd (98kb) downloaded 6 time(s).

Edited by user 28 January 2021 14:07:25(UTC)  | Reason: Not specified

Offline Razonar  
#5 Posted : 28 January 2021 15:23:25(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: davidlimtw Go to Quoted Post
Hi Overlord,

Thanks for the reply. Although the val_file() is not returning the same answer as per the attached MathCAD but the overall loop actual works.


Hi. val_find() returns the vector index, so it must to be the mathcad answer plus one, because ORIGIN:=0 in mathcad.

val_find.sm (135kb) downloaded 6 time(s).

Clipboard01.jpg

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 28/01/2021(UTC)
Offline Jean Giraud  
#6 Posted : 28 January 2021 15:45:12(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)
Page19 Search_Locate.sm (370kb) downloaded 8 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 28/01/2021(UTC)
Offline davidlimtw  
#7 Posted : 28 January 2021 16:48:40(UTC)
davidlimtw


Rank: Member

Groups: Registered
Joined: 07/01/2021(UTC)
Posts: 27
Man
United Kingdom

Thanks Alvaro for your comment.

Jean, that is cool stuff... you can draw something like this in the SMath...
Offline overlord  
#8 Posted : 28 January 2021 16:54:19(UTC)
overlord


Rank: Advanced Member

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

Was thanked: 509 time(s) in 339 post(s)
Originally Posted by: davidlimtw Go to Quoted Post
Hi Overlord,

Thanks for the reply. Although the val_file() is not returning the same answer as per the attached MathCAD but the overall loop actual works.

See attached calculation in mathcad.

Page 7.xmcd (98kb) downloaded 6 time(s).

Having the mathcad file revealed the difference of two programs.
The problem is n_min and n_max in smath version.
Mathcad assigns them [0 0], [0 1] and [1 1] only, whatever you enter.
min_offset and max_offset can be calculated within bounds of 9x9 matrix by them.
By that, offsets are always lower then 9 during max_offset=ii*n_max+1.
Your current smath function will produce out of matrix.
Because n_min and n_max are [1 1], [1 2] and [2 2].
And by adding ii to them it will be bigger than 9.
Algorithm should be revised with respect to that.
n_min and n_max should be lowered by 1 to correct it.
You can find re-revised file according to this.
If anything is unusual you can tell, we will try to fix it.

Regards

Page7_re-revised.sm (48kb) downloaded 9 time(s).
thanks 1 user thanked overlord for this useful post.
on 28/01/2021(UTC)
Offline davidlimtw  
#9 Posted : 28 January 2021 19:09:44(UTC)
davidlimtw


Rank: Member

Groups: Registered
Joined: 07/01/2021(UTC)
Posts: 27
Man
United Kingdom

Hi Overloard,

Thanks for the comprehensive explaination. I will look into it and let you know if there are any bug.
Offline Jean Giraud  
#10 Posted : 28 January 2021 20:30:02(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: davidlimtw Go to Quoted Post
Jean, that is cool stuff... you can draw something like this in the SMath...

Your project can be done entirely in Smath.
Unfortunately, it is not modular, unexplained
it reduces the de-bug sanity procedure.
Cheers ... Jean

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