Re: [Scilab-users] 3D interpolation : comments adding
linear_interpn(repetitus, repetita, repetitum) = repeated -- View this message in context: http://mailinglists.scilab.org/Scilab-users-3D-interpolation-comments-adding-tp4035998p4036009.html Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com. ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] 3D interpolation : comments adding
Le 25/03/2017 à 19:38, paul.carr...@free.fr a écrit : Hi Tim That's indeed what I've read as well; my need remains to get a linear interpolation between physical points ... I'm still digging in order to find a "pleasant" code :_) linear_interpn() is made for that: https://help.scilab.org/docs/6.0.0/en_US/linear_interpn.html Samuel ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] 3D interpolation : comments adding
Hi Tim That's indeed what I've read as well; my need remains to get a linear interpolation between physical points ... I'm still digging in order to find a "pleasant" code :_) Thanks for the feedback Paul Le 2017-03-25 17:52, t...@wescottdesign.com a écrit : > The help says that splin2d generates bicubic patches, so presumably > it's not linear interpolation. > > On 2017-03-25 00:24, paul.carr...@free.fr wrote: > >> Hi All >> >> To go further in 2D/3D interpolation as I started in my previous >> emails, I built the example here after. >> >> As suggested, I had a look to >> - cshep2d but but seems can not be used here (dimensions issue) >> - splin2d + interp2d >> >> In the later case, Am I right to say that splin2d "cross-sections" >> the surface in order to define the "best spline" passing through the >> nodes (in the cross section obviously), then the >> interpolation/calculation is basically using this new 2D function, >> right ? >> >> if so this is not a linear interpolation between 2 nodes (as I >> expect), isn't it? >> >> Paul >> >> >> >> mode(0) >> >> n=10; >> x = linspace(0,300,(n+1))';// abscissa >> t = [0 25 100]; // temperature >> z = 20*rand((n+1),3);// ordinate >> // Nota : we must have the same number of data for both x and z >> >> // plot3d >> clf() >> a=get("current_axes"); >> a.x_label; x_label=a.x_label; x_label.text=" X abscissa"; >> a.y_label; y_label=a.y_label; y_label.text=" Temperature T"; >> a.z_label; z_label=a.z_label; z_label.text=" y ordinate"; >> plot3d(x,t,z) >> >> // Nota: if I do a cross section normal to XoZ plane, I've the basic >> curve z=f(x,T)) -> seems correct >> >> // interpolation >> xp = [22 103 236]' >> tp = [5 56 85]' >> >> [Xp,Tp] = ndgrid(xp,tp) >> >> ___ >> users mailing list >> users@lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] 3D interpolation : comments adding
The help says that splin2d generates bicubic patches, so presumably it's not linear interpolation. On 2017-03-25 00:24, paul.carr...@free.fr wrote: > Hi All > > To go further in 2D/3D interpolation as I started in my previous emails, I > built the example here after. > > As suggested, I had a look to > - cshep2d but but seems can not be used here (dimensions issue) > - splin2d + interp2d > > In the later case, Am I right to say that splin2d "cross-sections" the > surface in order to define the "best spline" passing through the nodes (in > the cross section obviously), then the interpolation/calculation is basically > using this new 2D function, right ? > > if so this is not a linear interpolation between 2 nodes (as I expect), isn't > it? > > Paul > > > > mode(0) > > n=10; > x = linspace(0,300,(n+1))';// abscissa > t = [0 25 100]; // temperature > z = 20*rand((n+1),3);// ordinate > // Nota : we must have the same number of data for both x and z > > // plot3d > clf() > a=get("current_axes"); > a.x_label; x_label=a.x_label; x_label.text=" X abscissa"; > a.y_label; y_label=a.y_label; y_label.text=" Temperature T"; > a.z_label; z_label=a.z_label; z_label.text=" y ordinate"; > plot3d(x,t,z) > > // Nota: if I do a cross section normal to XoZ plane, I've the basic curve > z=f(x,T)) -> seems correct > > // interpolation > xp = [22 103 236]' > tp = [5 56 85]' > > [Xp,Tp] = ndgrid(xp,tp) > > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] 3D interpolation : comments adding
Try this: n=21; x = linspace(0,300,n)';// abscissa t = [0 25 100];// temperature z = n*sin(x/n).*.cos(t/n); // ordinate clf() a=get("current_axes"); a.x_label.text=" X abscissa"; a.y_label.text=" Temperature T"; a.z_label.text=" Z ordinate"; // linear interpolation xp = [22 103 236]; tp = [5 56 85]; [Xp,Tp] = ndgrid(xp,tp); Zp = linear_interpn(Xp,Tp, x, t, z); plot3d(x,t,z) // requires Scilab-6 for scatter plot: scatter3(Xp(:), Tp(:), Zp(:), "markerEdgeColor", "black","markerFaceColor", [.9 .3 .0]) Rgds, Rafael <http://mailinglists.scilab.org/file/n4036001/3D_linear_interpolation.png> -- View this message in context: http://mailinglists.scilab.org/Scilab-users-3D-interpolation-comments-adding-tp4035998p4036001.html Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com. ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
[Scilab-users] 3D interpolation : comments adding
Hi All To go further in 2D/3D interpolation as I started in my previous emails, I built the example here after. As suggested, I had a look to - cshep2d but but seems can not be used here (dimensions issue) - splin2d + interp2d In the later case, Am I right to say that splin2d "cross-sections" the surface in order to define the "best spline" passing through the nodes (in the cross section obviously), then the interpolation/calculation is basically using this new 2D function, right ? if so this is not a linear interpolation between 2 nodes (as I expect), isn't it? Paul mode(0) n=10; x = linspace(0,300,(n+1))';// abscissa t = [0 25 100]; // temperature z = 20*rand((n+1),3);// ordinate // Nota : we must have the same number of data for both x and z // plot3d clf() a=get("current_axes"); a.x_label; x_label=a.x_label; x_label.text=" X abscissa"; a.y_label; y_label=a.y_label; y_label.text=" Temperature T"; a.z_label; z_label=a.z_label; z_label.text=" y ordinate"; plot3d(x,t,z) // Nota: if I do a cross section normal to XoZ plane, I've the basic curve z=f(x,T)) -> seems correct // interpolation xp = [22 103 236]' tp = [5 56 85]' [Xp,Tp] = ndgrid(xp,tp)___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] 3D interpolation
thanks all for the answers; I didn't know about ndgrid and I'm currently having a look on it (seems to be quite interesting) Samuel: from your example and the help doc, I need to understand how to proceed to perform linear interpolations (temperatures and abscissa's in my example) Paul Le 2017-03-24 21:40, Samuel Gougeon a écrit : > Le 24/03/2017 à 18:40, paul.carr...@free.fr a écrit : > >> Hi all, >> >> I don't know if my question is relavante (or not), but I'm wondering >> what is the best way to perform a 3D interpolation, from for the >> matrix definition to the interpolation procedure. >> >> Let me using a basic example: I've some curves y = f(x,T) defining a >> material behaviour at different temperatures i.e. 1 curve (x,y) per >> temperature: >> - y = f(x,20) >> - y = f(x,100) >> - y = f(x,200) >> >> etc. >> >> What is the best way to define a single matrix? [x y T] ? > > It depends on whether f() is vectorized or not. It could be something > like > t = [20 100 200]; > [X, T] = ndgrid(x, t); > Y = f(X,T); > // or > Y = feval(x, t); > > Then: > M = [X(:) Y(:) T(:)]; > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] 3D interpolation
Le 24/03/2017 à 18:40, paul.carr...@free.fr a écrit : Hi all, I don't know if my question is relavante (or not), but I'm wondering what is the best way to perform a 3D interpolation, from for the matrix definition to the interpolation procedure. Let me using a basic example: I've some curves y = f(x,T) defining a material behaviour at different temperatures i.e. 1 curve (x,y) per temperature: - y = f(x,20) - y = f(x,100) - y = f(x,200) etc. What is the best way to define a single matrix? [x y T] ? It depends on whether f() is vectorized or not. It could be something like t = [20 100 200]; [X, T] = ndgrid(x, t); Y = f(X,T); // or Y = feval(x, t); Then: M = [X(:) Y(:) T(:)]; ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] 3D interpolation
That doesn't show up in the help for 5.5.2. Is it a 6.x thing, or is there a toolbox? Looks interesting, at any rate. On Fri, 2017-03-24 at 18:45 +0100, CRETE Denis wrote: > Hello ! > Did you try cshep2d + eval_cshep2d ? > HTH > Denis > > [@@ THALES GROUP INTERNAL @@] > > Unité Mixte de Physique CNRS / THALES > 1 Avenue Augustin Fresnel > 91767 Palaiseau CEDEx - France > Tel : +33 (0)1 69 41 58 52 Fax : +33 (0)1 69 41 58 78 > e-mail : > denis.cr...@thalesgroup.com <mailto:%20denis.cr...@thalesgroup.com> > http://www.trt.thalesgroup.com/ump-cnrs-thales > http://www.research.thalesgroup.com > > De : users [mailto:users-boun...@lists.scilab.org] De la part de paul > .carr...@free.fr > Envoyé : vendredi 24 mars 2017 18:41 > À : User Scilab > Objet : [Scilab-users] 3D interpolation > > Hi all, > > I don't know if my question is relavante (or not), but I'm wondering > what is the best way to perform a 3D interpolation, from for the > matrix definition to the interpolation procedure. > > Let me using a basic example: I've some curves y = f(x,T) defining a > material behaviour at different temperatures i.e. 1 curve (x,y) per > temperature: > - y = f(x,20) > - y = f(x,100) > - y = f(x,200) > > etc. > > What is the best way to define a single matrix? [x y T] ? > > > Next step is to be able to perform a 3D interpolation whatever is the > temperature (for a given x) ... any advice? (of course I'm looking to > interp3D flag. > > Thanks for any feedback > > Paul > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -- Tim Wescott www.wescottdesign.com Control & Communications systems, circuit & software design. Phone: 503.631.7815 Cell: 503.349.8432 ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] 3D interpolation
I'm not an expert. But: I did a quick spin through the help files and came up with splin2d and interp2d. It looks like what you want -- get the splines in x and T using splin2d, and find the y values for a given x and T using interp2d. I don't know if this is the very best way to do this mathematically -- I know that this sort of 2D interpolated look-up is used extensively in engine management units in cars (they're called "maps" in that lingo), so there's probably a lot of research on accuracy vs. efficiency tradeoffs. On Fri, 2017-03-24 at 18:40 +0100, paul.carr...@free.fr wrote: > Hi all, > > I don't know if my question is relavante (or not), but I'm wondering > what is the best way to perform a 3D interpolation, from for the > matrix definition to the interpolation procedure. > > Let me using a basic example: I've some curves y = f(x,T) defining a > material behaviour at different temperatures i.e. 1 curve (x,y) per > temperature: > - y = f(x,20) > - y = f(x,100) > - y = f(x,200) > > etc. > > What is the best way to define a single matrix? [x y T] ? > > > Next step is to be able to perform a 3D interpolation whatever is the > temperature (for a given x) ... any advice? (of course I'm looking to > interp3D flag. > > Thanks for any feedback > > Paul > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -- Tim Wescott www.wescottdesign.com Control & Communications systems, circuit & software design. Phone: 503.631.7815 Cell: 503.349.8432 ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] 3D interpolation
Hello ! Did you try cshep2d + eval_cshep2d ? HTH Denis [@@ THALES GROUP INTERNAL @@] Unité Mixte de Physique CNRS / THALES 1 Avenue Augustin Fresnel 91767 Palaiseau CEDEx - France Tel : +33 (0)1 69 41 58 52 Fax : +33 (0)1 69 41 58 78 e-mail : denis.cr...@thalesgroup.com<mailto:denis.cr...@thalesgroup.com> <mailto:%20denis.cr...@thalesgroup.com> http://www.trt.thalesgroup.com/ump-cnrs-thales http://www.research.thalesgroup.com De : users [mailto:users-boun...@lists.scilab.org] De la part de paul.carr...@free.fr Envoyé : vendredi 24 mars 2017 18:41 À : User Scilab Objet : [Scilab-users] 3D interpolation Hi all, I don't know if my question is relavante (or not), but I'm wondering what is the best way to perform a 3D interpolation, from for the matrix definition to the interpolation procedure. Let me using a basic example: I've some curves y = f(x,T) defining a material behaviour at different temperatures i.e. 1 curve (x,y) per temperature: - y = f(x,20) - y = f(x,100) - y = f(x,200) etc. What is the best way to define a single matrix? [x y T] ? Next step is to be able to perform a 3D interpolation whatever is the temperature (for a given x) ... any advice? (of course I'm looking to interp3D flag. Thanks for any feedback Paul ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
[Scilab-users] 3D interpolation
Hi all, I don't know if my question is relavante (or not), but I'm wondering what is the best way to perform a 3D interpolation, from for the matrix definition to the interpolation procedure. Let me using a basic example: I've some curves y = f(x,T) defining a material behaviour at different temperatures i.e. 1 curve (x,y) per temperature: - y = f(x,20) - y = f(x,100) - y = f(x,200) etc. What is the best way to define a single matrix? [x y T] ? Next step is to be able to perform a 3D interpolation whatever is the temperature (for a given x) ... any advice? (of course I'm looking to INTERP3D flag. Thanks for any feedback Paul___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] 3d interpolation griddata
Hello, the cshep2d macro should fit your needs. S. Le 12/11/2014 22:40, simond a écrit : Hi, I am trying to convert a matlab code using griddata. Unfortunately, I havent succeed to solve the problem with the available scilal functions (linear_interpn, interpd..). I have a data set of disordered points (x,y,z), with x,y the position, and z the elevation. I m trying to interpolate all this points to create a 3d digital elevation model. 1) I create a meshgrid xx=min(x):1:max(x) yy=min(y):1:max(y) [xy,yx]=meshgrid(xx,yy) 2) I would like to interpolate all the elevation points z for my new grid (xy,yx) such as xy,yx,zz=griddata(x,y,z,xy,yx) But i cannot find the scilab equivalence... Thank you very much for your response. Simon -- View this message in context: http://mailinglists.scilab.org/3d-interpolation-griddata-tp4031468.html Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com. ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
[Scilab-users] 3d interpolation griddata
Hi, I am trying to convert a matlab code using griddata. Unfortunately, I havent succeed to solve the problem with the available scilal functions (linear_interpn, interpd..). I have a data set of disordered points (x,y,z), with x,y the position, and z the elevation. I m trying to interpolate all this points to create a 3d digital elevation model. 1) I create a meshgrid xx=min(x):1:max(x) yy=min(y):1:max(y) [xy,yx]=meshgrid(xx,yy) 2) I would like to interpolate all the elevation points z for my new grid (xy,yx) such as xy,yx,zz=griddata(x,y,z,xy,yx) But i cannot find the scilab equivalence... Thank you very much for your response. Simon -- View this message in context: http://mailinglists.scilab.org/3d-interpolation-griddata-tp4031468.html Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com. ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users