Prev: does it make sense ? Provisio,
Next: Typsetting
From: Regina on 25 Feb 2010 01:52 i have the following problem: i have two functions: f[Q] and x[Q] and i want f[x]. i cant invert x[Q], so i do this like this: fx=Interpolation[Table[{x[Q],f[Q]},{Q,0,10,0.1}]] this work fine. but now my function depends on 2 variables: f[Q,R] with given x[Q] and y[R]. How can i now interpolate the function f[x,y]? (I tried 'ListInterpolation' but couldnt find a solution) any help appreciated.
From: dh on 25 Feb 2010 07:46 Hi Regina, you are nearly there, Interpolation can do it, but you need to feed it correctly. Here is an example: f[Q_,R_]:= Q R; x[Q_]:=2 Q; y[R_]:=0.5 R; dat=Flatten[Table[{{x[Q],y[R],f[Q,R]}},{Q,0,10},{R,0,10}],2]; fun=Interpolation[dat]; Plot3D[fun[x,y],{x,0,20},{y,0,5}] Daniel On 25.02.2010 07:52, Regina wrote: > i have the following problem: > i have two functions: f[Q] and x[Q] and i want f[x]. i cant invert > x[Q], so i do this like this: > fx=Interpolation[Table[{x[Q],f[Q]},{Q,0,10,0.1}]] > this work fine. > but now my function depends on 2 variables: f[Q,R] with given x[Q] and > y[R]. How can i now interpolate the function f[x,y]? > (I tried 'ListInterpolation' but couldnt find a solution) > any help appreciated. > -- Daniel Huber Metrohm Ltd. Oberdorfstr. 68 CH-9100 Herisau Tel. +41 71 353 8585, Fax +41 71 353 8907 E-Mail:<mailto:dh(a)metrohm.com> Internet:<http://www.metrohm.com>
|
Pages: 1 Prev: does it make sense ? Provisio, Next: Typsetting |