2
$\begingroup$

I have a function:

f[x_,y_] = x*y // ScientificForm;
Manipulate[f[x,y], {x, 10^-1, 10^-10}, {y, 0.01, 1, 0.01}]

When I try to execute it - it does work. However I want my x to increment in following manner: for x, 10^-1, 10^-2, 10^-3, ..., 10^-10 and for y, 0.01, 0.02, ..., 0.1, ..., 0.11, ..., till eventually 1;

I can't get my head around this. Could somebody please share any links on how to actually build interface in Mathematica. That would be very much appreciated

$\endgroup$
1
  • $\begingroup$ You could use Manipulate[f[10^x, y], {x, -10, -1}, {y, 0.01, 1, 0.01}] with the f you already have. Does that do what you want? $\endgroup$
    – acl
    Commented Jul 18, 2014 at 22:42

2 Answers 2

2
$\begingroup$

Using the logManipulator from my answer to Logarithmic slider, you can also achieve your objective via

Manipulate[
 f[x, y],
 {x, 10.^-10, 10^-1, 10, logManipulator[##] &},
 {y, 0.01, 1, 0.01}]

Code for logManipulator:

ClearAll[logManipulator];
With[{smallerRule = {Large -> Medium, Medium -> Small, Small -> Tiny}},
 logManipulator[Dynamic[x_], range_: {1, 10}, 
   OptionsPattern[Manipulator]] := With[{
    logrange = Log10[range],
    imagesize = OptionValue[ImageSize] /. Automatic -> Medium,
    inputfieldsize = 
     OptionValue[ImageSize] /. Automatic -> Medium /. smallerRule,
    enabled = OptionValue[Enabled],
    continuousaction = OptionValue[ContinuousAction],
    appearance = 
     First[Cases[OptionValue[Appearance], 
        Tiny | Small | Medium | Large] /. {} -> {Automatic}],
    labeled = ! FreeQ[OptionValue[Appearance], "Labeled"] || ! 
       FreeQ[OptionValue[AppearanceElements], "InlineInputField"],
    opener = 
     OptionValue[AppearanceElements] /. {Automatic -> True, 
       All -> True, None -> False, 
       l_List :> (Cases[l, Except["InlineInputField"]] =!= {})},
    inputfield = 
     MatchQ[OptionValue[AppearanceElements], Automatic | All] ||
      ! FreeQ[OptionValue[AppearanceElements], "InputField"],
    appearanceelements = 
     OptionValue[AppearanceElements] /. {Automatic -> All, None -> {},
        l_List :> Cases[l, Except["InlineInputField" | "InputField"]]},
    autoaction = OptionValue[AutoAction],
    exclusions = OptionValue[Exclusions]},
   ReleaseHold@MakeExpression[
     PaneBox[
      DynamicModuleBox[{
        Typeset`open$$ = ! FreeQ[OptionValue[Appearance], "Open"],
        Typeset`paused$$ = OptionValue[PausedTime],
        Typeset`rate$$ = OptionValue[AnimationRate],
        Typeset`dir$$ = OptionValue[AnimationDirection]},
       StyleBox[
        DynamicBox[
         FEPrivate`FrontEndResource["FEExpressions", "Manipulator04"][
          Dynamic[x],
          Dynamic[Log10[x], (x = 10^#) & ],
          logrange,
          imagesize,
          inputfieldsize,
          enabled,
          continuousaction,
          appearance,
          labeled,
          opener,
          inputfield,
          appearanceelements ,
          autoaction,
          exclusions,
          Dynamic[Typeset`open$$],
          Dynamic[Typeset`paused$$],
          Dynamic[Typeset`rate$$],
          Dynamic[Typeset`dir$$]]],
        DynamicUpdating -> True],
       DynamicModuleValues :> {}],
      BaselinePosition -> (OptionValue[BaselinePosition] /. Automatic -> Baseline),
      ImageMargins -> OptionValue[ImageMargins]],
     StandardForm]]
 ]
$\endgroup$
1
$\begingroup$
f[x_, y_] = x*y;

Manipulate[
 f[x, y] // ScientificForm,
 {{x, 10.^-6}, 10.^Range[-1, -10, -1]},
 {{y, .5}, 0.01, 1, 0.01, Appearance -> "Labeled"}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.