Message Boards Message Boards

Export code that contains InputField as CDF format?

Posted 6 years ago

I have created a code in Wolfram Mathematica. I want it to be CDF file. I selected File-> CDF Export -> Standalone. I was told that the file doesn't work. I think it is because of InputField. It has to work for all functions.

Clear[f, der1]
Manipulate[Grid
  [{{Column
     [{Row[{Framed[Style["Functions", Bold, White, 25], 
         Background -> Red, RoundingRadius -> 1
         ]}]}]},        
   {Column
     [{
      Row[{"Type the function:   ", 
        InputField[Dynamic[f], Background -> LightYellow]}],    
      Row[{"Domain: ", 
        dom = Simplify[FunctionDomain[f, x, Reals]]}],     
      Row[{"Range: ", FunctionRange[f, x, y]}],
      Row[{"f[0] ", f /. x -> 0}],
      Row[{"f[x]=0 ", Simplify[x /. Solve[f == 0, x, Reals]]}],
      Row[{"First derivative ", der1 = Simplify[D[f, x]]}],  
      Row[{"Second derivative ", der2 = Simplify[D[f, x, x]]}],
      Row[{"First derivative = 0 ", 
        zeder = Solve[der1 == 0, x ]}],      
      Row[{"Function is increasing: ", Reduce[der1 > 0, x]}],
      Row[{"Function is decreasing: ", Reduce[der1 < 0, x]}],
      Row[{"Points of discontinuity: ", 
        dis = Solve[Denominator[Together[f]] == 0, Reals]}],
      Row[{"First derivative - points of discontinuity: ", 
        noder = Solve[Denominator[Together[der1]] == 0, Reals]}],
      Row[{"Extrema: ", 
        extr = Union[
          Sort[Join[{axisxfrom}, {axisxto}, {zeder}, {noder}, \
{dis}]]]}], 
      Row[{"Maximal values ", 
        Maximize[{f, axisxfrom <= x <= axisxto}, x]}],
      Row[{"Minimal values: ", 
        Minimize[{f, axisxfrom <= x <= axisxto}, x]}], 
      Row[{"Function is convex ", Reduce[der2 > 0, x]}],
      Row[{"Function is concave ", Reduce[der2 < 0, x]}],
      Plot[f, {x, axisxfrom, axisxto}, 
       PlotRange -> {axisyfrom, axisyto}, Background -> LightGreen]
      }]}}],
 {axisxfrom, -5}, {axisxto, 5}, {axisyfrom, -2}, {axisyto, 2}]
POSTED BY: Lucie C
3 Replies

Would be nice to mention that you already asked that question and that you received the answer explaining that if your teacher uses FreePlayer then you can only use numeric input fields and workaround the limitation with predefined set of functions.

https://mathematica.stackexchange.com/q/180690/5478

The only way to make non numeric InputFields work in .cdf is to have an enterprise Mathematica license which allows enterprise deploymen. This most likely isn't the case here.

Or to tell the teacher to open the .cdf from Mathematica rather than a FreePlayer.

POSTED BY: Kuba Podkalicki
Posted 6 years ago

I have to send it to someone and I don't know what he has (FreeCDF or EnterpriseCDF). Is there some way to make it work even in Free CDF?

POSTED BY: Lucie C

Are you exporting to FreeCDF or EnterpriseCDF? Only the latter supports InputField.

POSTED BY: Gustavo Delfino
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