Message Boards Message Boards

Create 2D slices with changing number of variables + Manipulate?

Posted 8 years ago

Hello,

I am going to have a n-dimensional function and I would like to able plot 2D planes for the rest of the variables fixed to a number. For example:

u = w^2  y^3 + x^5 z^4 + I z^6 + I z^2 Sin[y + x - 1]+k*Sin[w*pi]

I have 5 variables in here and lets assume I want to fix z w plane and plot with sliding y,z, and k. I have many issues to fix to get what I want to do,

  1. I want to able to create number of sliders dynamically. For the example above it is 3 but it could be 5. There is this question but I failed to adapt to my situation. http://mathematica.stackexchange.com/questions/1199/manipulate-with-a-variable-number-of-sliders (also here there is no way to name the slider with the variable name which is needed of course)

  2. In my code how can I avoid z evaluated and updated in the inputfields. I want to keep inputfields as they are.

  3. As I want to create dynamically number of sliders , I want to transfer the limits of the plots and sliders from the inputfield.

Thank you for your help.

Manipulate[
 DynamicModule[{u = 
    z^2 Sin[\[Pi] x] + z^4 Cos[\[Pi] y] + y^6 Cos[2 \[Pi] y], 
   vars = {x, y, z}, varlims = {{1, 2}, {3, 4}, {5, 6}}, poi = {x, y},
    svars = {z}},
  Column[{Style["Ploter", "Function"] ,
    Row[{"Function  ", InputField[u]}, Spacer[20]],
    Row[{"Variables ", InputField[Dynamic[vars]]}],
    Row[{"Variable limits ", InputField[Dynamic[varlims]]}],
    Row[{"Plane of interest", InputField[Dynamic[poi]]}],
    Row[{"Variying variables", InputField[Dynamic[svars]]}],
    InputField[
     Dynamic[Plot3D[u, {x, -3, 3}, {y, -2, 2}, 
       PerformanceGoal -> "Quality", Mesh -> None, 
       ColorFunction -> Function[{x, y, z}, Hue[z]], 
       PlotLegends -> BarLegend[Hue[z]], ImageSize -> Full]], 
     FieldSize -> {30, 15}]}]], {{z, 16, "z"}, 0, 1, 0.0001}, 
 ContinuousAction -> False]
POSTED BY: Erdem Uguz
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract