Beginner--Using subscripts in vectors
- To: mathgroup at smc.vnet.net
- Subject: [mg64479] Beginner--Using subscripts in vectors
- From: kt at squeakydolphin.com
- Date: Sat, 18 Feb 2006 02:50:18 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I'm taking a class in Evolutionary Computation and I would like to provide the other students with some plots of around 20 2D functions that are defined over any length vector (of real numbers). I've defined a few of them already and it is more laborous that I would think it need be. What I'm currently doing is describing the function using standard mathematical notation in a text cell and then defining it again in a way that Mathematica can understand it in the next cell. The real problem is doing summations over vector components. I would like "Subscript[x, i]" to be interpretted as "Part[x, i]" and n to be interpretted as "Length[x]" when I do the plot. I would then like to be able to tell mathematica to plot it over all two dimensional vectors where "Subscript[x, i]" ranges from -10.0 to 10.0 for each i. Is there anyway I can do this? An example: Schwefel's Problem 1.2 is defined as: \!\(f \((x)\)\ = \ \[Sum]\+\(i = 1\)\%n\((\[Sum]\+\(j = 1\)\%i x\_j)\)\^2\) I would like to be able to pass this in to Mathematica and get a 3D plot out of this function for i ranging from 1 to 2 and Subscript[x, i] ranging from -10 to 10 without having to translate the formula again.. Oh, I don't mind changing f(x) to be f[x]. I know that's how mathematica wants it. Thank you all very much. Link to the forum page for this post: http://www.mathematica-users.org/webMathematica/wiki/wiki.jsp?pageName=Special:Forum_ViewTopic&pid=8365#p8365 Posted through http://www.mathematica-users.org [[postId=8365]]