how do i interpolate non increasing data
Mostrar comentarios más antiguos
Hello everybody,
I need help to interpolate simulation data. In my case, i have 3 matrixes.
and I need a 3-D interpolation.
X(axis ) is Torque,
Y(axis) is rpm,
and my z(axis is the efficiency).
First, I build a 2-D Dataset from x and y, that works.
Now i need the Datas from z, but z is non strictly monotonically increasing.
I am using griddedinterpolation for x and y with 'spline'.
How can I interpolate my efficiency with non-increasing values.
Kind regards.
3 comentarios
Bob Thompson
el 27 de Feb. de 2019
John D'Errico
el 28 de Feb. de 2019
I need to see your data. Very often, people mistake what kind of interpolation is appropriate for their problem. Best would be if you provide the data itself as a .mat file, attached to a comment. Then I can take the data, look at it, understand what problem you are running into, plot it, rotate the plot, etc.
Not as good is if you simply attach a plot figure. At least let me look at the data in some way.
Without the data? This is hard to know. Why not? Because z being non-monotonic is not relevant. At best, I might guess that you have points in 3-d where the data does not represent a single valued function of the input. Thus, for a single (x,y) pair, you can have TWO distinct z values. For example, suppose your data lies on the surface of an entire sphere in 3-d? Now tools like griddedinterpolant, scatteredInterpolant, griddata, interp2, etc. are all completely unusable.They are not designed to solve that class of problem. But I cannot know what is truly the issue until you show us the data itself.
Guillaume
el 28 de Feb. de 2019
z does no need to be monotonic. The z values do not affect the failure or success of griddedInterpolant. The x and y values on the other hand do. You have not told us how you're generated the x and y value. Most likely the problem is there, so show us your code.
[torque, speed] = ndgrid(1:100, 100:100:5000); %Nm and rpm
efficiency = rand(size(torque)); %definitively not monotonic
F = griddedInterpolant(torque, speed, efficiency) %NO ERROR!
efficiency vs speed and torque tends to look like an elliptic paraboloid which should work well with griddedInterpolant but as John said, if your surface is special it may not be suitable. If it's spherical I'd say your simulation has failed. In any case, having an idea of what it looks like would indeed be useful.
Respuestas (1)
Daniel H
el 28 de Feb. de 2019
0 votos
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
