Problems with look up table

Hi. I'm having some problems with using a look-up table in Matlab using the function fixpt_interp1(xdata,ydata,x,sfix(8),1 (x scale), sfix(16), 1, 'Floor').
xdata = 0:1:40
ydata = [0.0 0.0 55.0 .......... 7580 (at rated) .... 0 (cutoff)]
My xdata and ydata is a power curve for a wind turbine, with xdata being wind speeds and ydata being Power at this particular wind speed. My x-variable is a time series of wind speeds between 0 - 35 m/s. I want to insert my wind speed time series so that the output of the function is a power time series.
My problem is that once a wind speed is between two integers, for example 9.1 m/s, the output gives me the equivalent power of 9 m/s (3750 kW). I know that 'Floor' makes this happen, because 'Ceiling' will make it go to the power of 10 m/s (4850 kW). Still, I thought this function would interpolate between the two points, giving me a power of 3860 kW, but it doesn't seem so.
Therefore I tried to interpolate the curve using:
yi = interp1(xdata,ydata,xi), where
xi = 0:0.1:40
When I then insert yi and xi in fixpt_interp1, I get the right amount of power for 9.1 m/s, but it messes up other things, like putting all wind speeds over 12.7 m/s to 0 kW, when 25 m/s is the cut-off speed.
Does anyone have a solution for this problem?
If you need more info, please let me know.
Jonas from Norway

2 个评论

Jan
Jan 2013-2-7
编辑:Jan 2013-2-7
What is the problem exactly? Why do you use the fixed point type? Why is 0kW replied for speeds over 12.7, when not 12.7 is the cut-off but 25? How are "other things messed up" exactly? I think, that the solution is to avoid that these "other things" are "messed up", therefore I suggest to describe this point with any details.
Please provide your full ydata such that we can see how interp1 "messes up other things".

请先登录,再进行评论。

回答(1 个)

I had a similar problem with fixpt_itnerp1. Try using the following:
y = fixpt_interp1(xdata, ydata, x, float('single'), [], float('single'), [], 'Floor');
Setting the 'x' and 'y' data types as float('single') and letting MATLAB choose it's own 'x' and 'y' scaling does the trick.

类别

帮助中心File Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by