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


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

manipulate with user entered functions and variables

Started bynmueggen@gmail.com
First post2013-05-23 07:56 +0000
Last post2013-05-23 07:56 +0000
Articles 1 — 1 participant

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


Contents

  manipulate with user entered functions and variables nmueggen@gmail.com - 2013-05-23 07:56 +0000

#14599 — manipulate with user entered functions and variables

Fromnmueggen@gmail.com
Date2013-05-23 07:56 +0000
Subjectmanipulate with user entered functions and variables
Message-ID<knki3o$if5$1@smc.vnet.net>
I am trying to create a manipulate interface that would allow a user to enter a set of independent variables and a function of these variables.  The program would then return calculations based on partial derivatives of the function with respect to the given variables.  Eventually this would lead to an error propagation program for undergraduate physics labs.


This program allows for 2 variables and produces a list of partial derivatives of the function with respect to the variables.  It works just fine.

Manipulate[{D[f, var[1]], D[f, var[2]]}, {var[1], x}, {var[2], y}, {f,
   x^2 + y^3}]



I would like to extend it to an adjustable number of variables, which I think I can do with nested manipulate commands, but I also need the code to adjust how many derivatives need to be calculated, so I want to replace the list of derivative commands with a Table.  I tried this:

Manipulate[
 Table[D[f, var[i]], {i, 1, 2}], {var[1], x}, {var[2], y}, {f,
  x^2 + y^3}]

This program doesn't work.  I suspect that the Table command is somehow causing it to calculate the derivatives before the expressions for the variables and/or function are defined from the manipulate controls.  I get the same problem when using Sum or Do commands instead of Table.

Any suggestions would be appreciated.

Thankyou,

Nathan

[toc] | [standalone]


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


csiph-web