From: Jon Olick <zelexi@gm...>  20090310 06:03:19

Hi Matt, The way I've done this in the past is to first define the number of degrees you want the polynomial to have. Degree >= than 3 gives a continuous nonlinear curve which sounds like what you want. For degree 3 it would look something like: f(a,b) = c0*a*a + c1*b*b + c2*a*b + c3*a + c4*b + c5 You then reform this into a Ax = b problem. You can do this by having x be the unknown constants [c0 c1 c2 c3 c4 c5]. Set A as a m by 6 matrix [a*a b*b a*b a b 1] and set b as the m by 1 matrix of the values you get for f(a,b). Where m is the number of function samples. Solve the Ax = b like usual and you have your constants. And yeah, its not going to be very fast if m is large. ;) Best, Jon Olick On Mon, Mar 9, 2009 at 8:10 PM, Matt J <mjohnson2005@...> wrote: > How can I approximate a function such as func(a, b) = using polynomials? > > Right now I can use Maple and minimax to generate an approximation for > any function that can be derived over a given domain. > > However it is not clear to me how I can extend that function into > multiple variables, e.g. func(t, theta) , t = 0..1, theta = (PI, PI) > > My numerical approximation book covers least square fitting of > nonlinear function for a single variable and a linear function for a > multivariant function, so it seems like it may be possible to extend > that to a multivariable nonlinear function. Is this the right > approach or is there another way to do this? One issue with this > approach is I'd have to generate a lot of data from my reference > function (and it isn't clear how big dt or d(theta) steps would be to > get an optimal solution) and I imagine it would be slow. Note that the > latter isn't an issue, since I would generate it offline > > Matthew > > >  > _______________________________________________ > GDAlgorithmslist mailing list > GDAlgorithmslist@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithmslist > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithmslist > 