does the query points in gridfit function need to start from zero?

Hi,
I have a syntax in the form
id=gridfit(P,T,isd,P_v,T_v);
where P,T,isd are mxn matrices respectively and P_v,T_v are query points which are vectors of same order.
When I run the command its showing me warnings like shown below.
Warning: xnodes(1) was decreased by: 0.00034779, new node = 0.000706
Warning: xnodes(end) was increased by: 0.031914, new node = 0.10956
Warning: ynodes(1) was decreased by: 223.9438, new node = -223.5738
Warning: ynodes(end) was increased by: 98.383, new node = 223.5585
Warning: Rank deficient, rank = 1918702, tol = 4.754832e-06.
My P_v and T_v values doesn't actually start from zero. I suspect maybe this is a problem and I'm not sure.
Can anyone plz tell me what would be the exact problem?
Thanks in advance
Manoj.

 Respuesta aceptada

John D'Errico
John D'Errico el 7 de Abr. de 2019
Editada: John D'Errico el 7 de Abr. de 2019
No. There is no requirement about needing to start from zero. In fact, those were WARNINGS, not errors. It MAY indicate a problem in how you are trying to use gridfit. Hard to know.
Gridfit is a tool designed to fit a surface over some domain of points. You specify a grid of nodes, where it builds a lattice based on the grid you specify.
But suppose your data goes outside of the grid you give it? gridfit cannot then interpolate those data points that live outside of the lattice you specified. It cannot use those points, because they live in places beyond the grid.
There are several problems in those warnings. First, the question of why it had to expand the grid. For example, suppose you posed data to fit a surface to that varies from -100 to +100 in both x and y? But now you specify grid points that span only from 0 to 1?
I don't know what your data looks like. But it appears that you have created a severe mismatch of the gridded surface you want to build, compared to your data.
More important is the warning of rank deficiency. That problemly suggests your data has some serious problem in it. Perhaps you only supplied two data points, then wanted to build an entire surface. Or perhaps they all lie in a straight line. It is hard to know without seeing your data to be able to help you more.

4 comentarios

manoj saladi
manoj saladi el 7 de Abr. de 2019
Editada: manoj saladi el 7 de Abr. de 2019
Hi,
Basically I derived data of torque and flux , their size is 1xk and 1xk The original data which I have for torque and fluxe are of order mxn and current of order 1xm. I used meshgrid to convert current into mxn order. Where k>n>m
my intention is to obtain current of order mxn for the torque and flux vectors which I derived (1xk order as I mentioned above)
so i used gridfit
current_which_I_want=gridfit(flux_original,Torque_original,current_meshgrid,flux_derived,Torque_derived)
  • flux_original order mxn (contains positive values, the positive values keeps on decreasing from left to right until certain value and then starts increasing again, from top to bottom the values keep on decreasing until certain value and increase again)
  • Torque_original order mxn (contains positive, zero and negative values, values from left to right are negative keeps reducing reaches zero and starts increasing positively)
  • current_meshgrid order mxn (actually its order is 1xm, I used meshgrid to convert it to order mxn, each row has same value in this matrix from beginning to end)
  • flux_derived order 1xk (contains only positive values, increasing)
  • Torque_derived order 1xk (contains only positive values, increasing)
My initial feeling that you are doing something wrong here is growing much stronger. You have data that initially is mxn in flux and torque.
current, which SHOULD be treated as an unknown "function", dependent on both flux and torque, is a vector of length m, so of size 1xm.
So you replicate current, until it is the same size as the other arrays. So now it is constant in one dimension. That means there really is no reason to use gridfit at all.
Eventually, you reshape each array, so they are 1xk, but why? You already do have a grid of points. So my guess is those arrays of dependent variable pairs, thus flux and torque, does not form a nice rectangular grid.
Regardless, the fact that you replicated rows of your dependent variable makes this into something that gridfit is not needed to solve at all.
Anyway, you are doing several things that seem to be mathematically problematic. As well, you still have a problem where you seem to have a problem in the data that I cannot really diagnose without actually seeing your data. It would be simplest if you attached a copy of your data to a comment using a .mat file. Or, if you do not wish to post your data online, then please contact me via e-mail, and you can send it that way.
Ok, let me be more clear. I derived two vectors, one of them is torque and the other one is flux.
These vectors should serve me as break points for 2d lookup tables in simulink. The table data in the lookup tables should be currents. But the problem is that the currents is not a matrix but a vector. So, my intention is to make this current vector into a matrix, so that I can use it as a table data in 2d lookup table with my derived torque and flux vectors as my break points. Like as in the picture below
id lookup.PNG
I have currents as a vector from a data sheet and torque, flux as matrices, but I want to derive currents as a matrix based on the torque and flux vectors which I derived (not the one in data sheet). I felt like gridfit can derive the current as a matrix. Am I think in a wrong way?
Syntax: Current_matrix = gridfit(flux_datasheet, Torque_datasheet, currentvector_datasheet,flux_derived,torque_derived);
Thank you.
Having seen your other question on this, where you finally showthe data you have available, this is not a problem that gridfit cansolve happily, nor should you use that tool. Your data is insufficient to create that surface.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2017b

Preguntada:

el 6 de Abr. de 2019

Comentada:

el 9 de Abr. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by