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 SmathNewbie  
#1 Posted : 21 April 2021 22:46:53(UTC)
SmathNewbie


Rank: Member

Groups: Registered
Joined: 27/02/2021(UTC)
Posts: 16

Is there such matrix function to help me get the coefficient Cf based on ratio s/h and B/s from given table in matrix form?

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

Offline overlord  
#2 Posted : 21 April 2021 23:38:34(UTC)
overlord


Rank: Advanced Member

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

Was thanked: 506 time(s) in 337 post(s)
Originally Posted by: SmathNewbie Go to Quoted Post
Is there such matrix function to help me get the coefficient Cf based on ratio s/h and B/s from given table in matrix form?

You can either use linterp() or InterpBilinear().
They can also find an interpolated value between title numbers.
Please look at the Reference Book for further information.

Regards
Offline SmathNewbie  
#3 Posted : 22 April 2021 00:05:55(UTC)
SmathNewbie


Rank: Member

Groups: Registered
Joined: 27/02/2021(UTC)
Posts: 16

Originally Posted by: overlord Go to Quoted Post
Originally Posted by: SmathNewbie Go to Quoted Post
Is there such matrix function to help me get the coefficient Cf based on ratio s/h and B/s from given table in matrix form?

You can either use linterp() or InterpBilinear().
They can also find an interpolated value between title numbers.
Please look at the Reference Book for further information.

Regards


Thank you. Found it here. https://en.smath.com/for..._Interpolate-Matrix.aspx

Learn new things every day.
Offline Jean Giraud  
#4 Posted : 22 April 2021 00:24:29(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: SmathNewbie Go to Quoted Post
Is there such matrix function to help me get
the coefficient Cf based on ratio s/h and B/s
from given table in matrix form?

Spline(M,x,y) is universal.
Construct 1/1 from the given example, forget decoration <, >
Just for interpolation, you don't need the rotation system.
Cheers ... Jean

Spline Matrix Tutorial RECTANGULAR Surface Plot.sm (23kb) downloaded 22 time(s).

thanks 1 user thanked Jean Giraud for this useful post.
on 22/04/2021(UTC)
Offline Jean Giraud  
#5 Posted : 22 April 2021 00:33:04(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
... nice example done for Smath Community visitor.
Construct rough data table, spline at will, plot is most delightful.
How do you manage ... Jean

SplineRectangularMatrix Isentropic Surface.sm (458kb) downloaded 12 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 22/04/2021(UTC)
Offline SmathNewbie  
#6 Posted : 22 April 2021 01:13:21(UTC)
SmathNewbie


Rank: Member

Groups: Registered
Joined: 27/02/2021(UTC)
Posts: 16

Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: SmathNewbie Go to Quoted Post
Is there such matrix function to help me get
the coefficient Cf based on ratio s/h and B/s
from given table in matrix form?

Spline(M,x,y) is universal.
Construct 1/1 from the given example, forget decoration <, >
Just for interpolation, you don't need the rotation system.
Cheers ... Jean

Spline Matrix Tutorial RECTANGULAR Surface Plot.sm (23kb) downloaded 22 time(s).



Beautiful. I love the way you present all math problems in such a lovely form.

Even though it is a very rare case, when x and/or y values exceed the range in my posted table the function will return the value more or less than it should be because I think the table cap the values. I wanted to make changes to the Spline function to reflect this but my limited knowledge in programing and Smath prevents me from doing that. Any suggestions?
Offline Jean Giraud  
#7 Posted : 22 April 2021 19:50:04(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
See you soon tomorrow ... Jean.

... here is, play with rotation.

Spline Matrix Tutorial RECTANGULAR Surface Plot Example.sm (24kb) downloaded 9 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 22/04/2021(UTC)
Offline SmathNewbie  
#8 Posted : 22 April 2021 20:47:20(UTC)
SmathNewbie


Rank: Member

Groups: Registered
Joined: 27/02/2021(UTC)
Posts: 16

Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: Jean Giraud Go to Quoted Post
See you soon tomorrow ... Jean.

... here is, play with rotation.

Spline Matrix Tutorial RECTANGULAR Surface Plot Example.sm (24kb) downloaded 9 time(s).


Awesome. When x=70, y=0.5, I need it to be 1.75 per code because x>45 but the function gives me 1.83. How would I modify the code for Spline to achieve this.

Offline mkraska  
#9 Posted : 22 April 2021 21:37:25(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 1120 time(s) in 718 post(s)
Obviously the function uses linear extrapolation beyond the limits of the data array.

Without touching the function you can enforce constant extrapolation by repeating the first or last rows or columns of data.

surface.png
surface.sm (19kb) downloaded 10 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 23/04/2021(UTC)
Offline Jean Giraud  
#10 Posted : 22 April 2021 22:46:35(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: SmathNewbie Go to Quoted Post
Awesome. When x=70, y=0.5, I need it to be 1.75 per code because x

... as simple as that, preserving last two cols linearity.

Augment.PNG
thanks 1 user thanked Jean Giraud for this useful post.
on 23/04/2021(UTC)
Offline SmathNewbie  
#11 Posted : 23 April 2021 00:41:11(UTC)
SmathNewbie


Rank: Member

Groups: Registered
Joined: 27/02/2021(UTC)
Posts: 16

Me feeling dumb. Thanks, Jean and MKraska
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.