Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5679 > unrolled thread

Re: Problems plotting 3D surface and using manipulate

Started byHeike Gramberg <heike.gramberg@gmail.com>
First post2011-10-16 11:15 +0000
Last post2011-10-16 11:15 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Problems plotting 3D surface and using manipulate Heike Gramberg <heike.gramberg@gmail.com> - 2011-10-16 11:15 +0000

#5679 — Re: Problems plotting 3D surface and using manipulate

FromHeike Gramberg <heike.gramberg@gmail.com>
Date2011-10-16 11:15 +0000
SubjectRe: Problems plotting 3D surface and using manipulate
Message-ID<j7eecv$eke$1@smc.vnet.net>
To get something that is reasonably responsive you could do something like

functionName[x_, y_, a_?NumericQ, b_, c_] := Sin[a x/4] + Cos[b y/4]*c

ptlist = Tuples[{Range[10, 40], Range[10, 90]}];
(* ptlist is the list of (x,y)-pairs *)

Manipulate[
 Module[{interp, x, y},
  interp = Interpolation[{{##}, functionName[##, a, b, c]} & @@@
     ptlist];
  Plot3D[interp[x, y], ##, ColorFunction -> "Rainbow",
     PlotRange -> {-2, 2}, PlotPoints -> 20] & @@
   Join[{{x}, {y}}, interp[[1]], 2]], {{a, 0.4}, 0, 1}, {{b, 0.4}, 0,
  1}, {{c, 0.4}, 0, 1}]


Heike

On 15 Oct 2011, at 12:03, Adam McGee wrote:

> Good afternoon,
>
> I could really do with some help with this.
>
> I have an array containing a series of x, y pairs, and I have a 
formula which takes these x, y pairs as inputs along with three other 
variables a, b, & c to calculate the z value.
>
> What I need to be able to do is calculate the corresponding z value 
for each x, y pair, then create a surface through these x, y, z points. 
I want to be able to use Manipulate with three slider bars to update the 
values of a, b, and c which in turn update the z calculation and update 
the plot.
>
> The stage I am currently at is as follows:
>
> Manipulate [ ListPoint3d [ Table [ functionName [x, y, a, b, c], {x, 
10, 40}, {y, 10, 90} ], ColorFunction -> "Rainbow" ], {a, 0, 1}, {b, 0, 
1}, {c, 0, 1} ]
>
> With the above example I am not using the correct input matrix 
containing x & y just to try and get it working, but the slider bars are 
unresponsive and it also doesn't look like the values are being 
calculated correctly either.
>
> Any feedback/advice would be greatly appreciated,
> Many thanks
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web