What is the optimum number of resolution for the conversion from cartesian to polar and vice versa?
조회 수: 1 (최근 30일)
이전 댓글 표시
I am having a very strange issue with interpolation that I cannot seem to debug - I am hoping fresh eyes will help. The problem is best described if I explain it as follows:
I have cartesian data Z(x,y) where x and y are vectors that describe the locations of the values of Z. To get this data onto a polar grid described by (rc, thetac) I just do
[thg,rg] = meshgrid(thetac,rc);
[xn,yn] = pol2cart(thg,rg);
Z = interp2(x,y,Z,xn,yn);
which works fine. I have linearly interpolated from the original cartesian grid to the cartesian version of my polar grid. Great. and I did couple of function on that , followed by converting back from polar to Cartesianas below:
[X,Y]= meshgrid(x,y);
Z2 = griddata(xn,yn,Z,X,Y);
Now, does any one has any idea about the optimum resolution of this system? I mean the relation between (x,y) and (thetac, rc).
댓글 수: 2
dpb
2015년 8월 9일
I don't follow what we're supposed to have ideas about??? You initially speak of having some problem you can't debug then ask what seems to be a subjective question...what is the specific problem? Without any data we can't reproduce anything to even begin to look at...
답변 (1개)
Walter Roberson
2015년 8월 9일
"optimum" implies there there is a value at which something is at its best and other values are somehow less good. In order to mechanically determine an optimum value, there would have to be a calculation that one could perform that would return some measure of the "goodness" with that value, and then one would have to apply an optimization technique.
In your problem, it could certainly be argued that "no" points would not be an adequate solution, which implies that "more than 0" would be better. However, there is nothing in your description that would allow us to say that "as many as you can hold in memory" would be somehow worse than (say) 20.
There is a rather important problem in Mathematics whose solution is thought to be approximately 10^9608. Mathematicians are not upset about it being that large: mathematicians are upset because no-one knows how to prove that it is that large or to prove what the exact value is. So when you ask for the "optimal" value without describing a penalty against using large values, 10^9608 might be the answer given.
댓글 수: 4
Stephen23
2015년 8월 10일
When you define a metric for "ignorable changes", then you have the answer to your question.
dpb
2015년 8월 10일
To add just another point on the idea of "optimum" and interpolation; that will also strongly depend on the shape of the interpolated function--the more nonlinear it is, the finer the resolution required to accurately represent it.
I'd note that starting with a regular grid in cartesian space and transforming to cylindrical coordinates will result in the identical points but the spacing between them will no longer (obviously) be linear. Vice versa in going the other direction; what's uniform in r,theta isn't in x,y. Which is the more appropriate (if either has any advantage) will also be dependent upon the interpolant dependance upon location--if it's got a regular angular component, for example, that might be a more appropriate gridding than cartesian.
참고 항목
카테고리
Help Center 및 File Exchange에서 Scenario Creation and Recording에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!