==== Kevin: Bob's code works for me. I am running Mathematica 4.1 for SGI Reza ------------------------------------------------------------------------- Reza Malek-Madani, Director of Research and Scholarship Research Office, MS 10m, Nimitz Room 17 589 McNair Road U.S. Naval Academy Annapolis MD 21402-5031 -------------------------------------------------------------------------- >>> Kevin J. McCann

==== can you be more specific ? Are your 3D-points on a regular grid ? If not use the ContourPlot version form Tom Wickham-Jones book http://support.wolfram.com/applicationpacks/unsupported/extend/moreinfo.html On a regular grid ListContourPlot[] will do it for you. Jens > > Dear Mathgroup, > > colors indicating the height values (z) and x,y as the axes??? > > Ava. ==== I'm interested in a way of plotting a solid defined by 0 <= z <= f[x,y], g[x,y] <= 0, that's better than what I've been doing, which is to fake it using ClipFill and PlotRange something like this: f[x_, y_] := (-x + 1)*(y^2 + 1) Plot3D[ If[x^2 + y^2 <= 1, f[x, y], -1], {x, -1.1, 1.1}, {y, -1.1, 1.1}, PlotRange -> {0, 3}, ClipFill -> None, PlotPoints -> 100, Mesh -> False, BoxRatios -> {1, 1, 1}] Any ideas? ----- Selwyn Hollis http://www.math.armstrong.edu/faculty/hollis ==== How about << Calculus`Integration` Plot3D[f[x, y]*Boole[ x^2 + y^2 Áå 1], {x, -1.1, 1.1}, {y, -1.1, 1.1}, BoxRatios->{1,1,1},PlotPoints -> 100] This graph looks exactly the same as yours so it's only advantage is that it is not faked. If you would rather see something different, you might load <

==== I just got started with mathematica. Two basic questions. 1. it seems that printing the help file is not very convenient. Since no page information is available, i cannot print specific pages of interest and can only do print selection which is not efficient. 2. save as special doesn't work I tried save as TeX and html but nothing produced. thanks if you can explain how to do these in correct way. ==== 1. Yes, the help menu could be improved, in several other ways. One option for you might be to obtain a copy of the Mathematic Book. You could find a used copy. It wouldn't really even have to be for version 4. The book for version 3 would serve your purposes almost entirely. Maybe someone in this group has a version 3 book that they would part with. 2. When you save a file as html, or tex, try explicitly putting the file extension on the file name you are creating, such as PeanutAnalysis.tex or PopcornVolumeCalculations.htm > I just got started with mathematica. Two basic questions. > 1. it seems that printing the help file is not very convenient. Since > no page information is available, i cannot print specific pages of > interest and can only do print selection which is not efficient. 2. save as special doesn't work > I tried save as TeX and html but nothing produced. > thanks if you can explain how to do these in correct way. > ==== I have just installed mathematica 4.2. When I click Help Brower, it automatically rebuild index and never return response until it crash. Could anyone tell me what this problem is and how to fix it? Andrew ==== Good day All, Needs[[PackageName`] I get: Needs::nocont : Context PackageName` was not created when Needs was evaluated. If I open the notebook and run it before saving it as a Package, the package will be listed when I write $Packages. I wonder what I am missing here?? Miguel ************************************************** ************************************************** Miguel Cruz 460 The Bullpen Science Complex College of Forestry and Conservation University of Montana Missoula, MT 59812 ************************************************** ==== you package create not the context that Mathematica expect. You have a file PackageName.m but in the file the context BeginPackage[PackageName`] is not created. Jens > > Good day All, > > Needs[[PackageName`] > I get: > Needs::nocont : Context PackageName` was not created when Needs was evaluated. > > If I open the notebook and run it before saving it as a Package, the > package will be listed when I write $Packages. > I wonder what I am missing here?? > Miguel > > ************************************************** > ************************************************** > Miguel Cruz > 460 The Bullpen Science Complex > College of Forestry and Conservation > University of Montana > Missoula, MT 59812 > > ************************************************** ==== In relation to a research problem, I have three arrays/vectors X,Y,Z of dimension 3000 X 1 each. I need to find a list of numerical values for dz/dx or dz/dy. I could not find any command for numerical differentiation using forward, backward or central diference formulas. Then I need to plot contours of those differential values. How do I do this? I am pretty much new in handling Mathematica. Sreeparna ==== The Johannes Kepler University of Linz, Austria, School of Science and Technology, welcomes all applications for the position of Professor in Computational Science (Symbolic Computation) (succession of Prof. Bruno Buchberger) at the Institute for Symbolic Computation (RISC-Linz). The position is to be filled at the earliest possible date. For further details see also the web page http://www.risc.uni-linz.ac.at/institute/Ausschreibung ==== I cannot view the newsgroup as I am stuck behind a firewall here, but if you I am new to using mathematica (currently I have version 4.1, should be getting a trial copy of version 5 soon, my os is winNT). I have been attempting to do some programming and need to automate a calculation, to be done far too many times to attempt it manually. A previous calculation outputs a sum of fractions in terms of z, all are of the form gz^h/(az^b+cz^d+ez^f). I need to do a calculation involving the numbers a-h. I would like to be able to input the fraction, automatically assign the correct numbers from it to the variables a-h, then do the calculation and output the result. Ideally, if I could input the sum of all the fractions directly as output from the previous calculation and do this for each one, then output an answer which is the sum of the results for each fraction that would be best. I have found my way around programming in basic functions, but am unsure as to how to input a standard form of equation and automatically assign the values to the variables for calculation. Any help would be greatly appreciated. Laura Pickard. intended recipient you must not use, disclose, distribute, copy, print, subject to monitoring and auditing. ==== I'm going to assume that in gz^h/(az^b+cz^d+ez^f) the exponents b, d, f are distinct. Define the pattern pat := (g_.*z^h_.)/(a_.*z^b_. + c_.*z^d_. + e_.*z^f_.) (The dots after the blanks make those bits optional, defaulting to 1.) Next define the rule pick := pat -> {a, b, c, d, e, f, g, h} Now, for example, (2*z^3)/(3*z + 7*z^2 - 2*z^5) /. pick {3, 1, 7, 2, -2, 5, 2, 3} For a list of such fractions, say, r := Random[Integer, {1, 9}]; test := Cases[Table[(r*z^r)/(r*z^r + r*z^r + r*z^r), {10}], pat]; just apply the rule to the list: results = test /. pick {{3, 5, 3, 6, 6, 7, 7, 9}, {7, 3, 5, 7, 5, 8, 7, 2}, {1, 2, 4, 8, 3, 9, 6, 7}, {1, 2, 5, 7, 9, 9, 1, 8}} and if you want to add them, Plus @@ results {12, 12, 17, 28, 23, 33, 21, 26} Hope this helps... ----- Selwyn Hollis http://www.math.armstrong.edu/faculty/hollis I cannot view the newsgroup as I am stuck behind a firewall here, but > if you I am new to using mathematica (currently I have version 4.1, should be > getting a trial copy of version 5 soon, my os is winNT). I have been > attempting to do some programming and need to automate a calculation, > to be > done far too many times to attempt it manually. A previous calculation outputs a sum of fractions in terms of z, all > are of > the form gz^h/(az^b+cz^d+ez^f). I need to do a calculation involving > the > numbers a-h. I would like to be able to input the fraction, > automatically > assign the correct numbers from it to the variables a-h, then do the > calculation and output the result. Ideally, if I could input the sum > of all > the fractions directly as output from the previous calculation and do > this > for each one, then output an answer which is the sum of the results > for each > fraction that would be best. I have found my way around programming in > basic functions, but am unsure as to how to input a standard form of > equation and automatically assign the values to the variables for > calculation. Any help would be greatly appreciated. > Laura Pickard. intended recipient you must not use, disclose, distribute, copy, print, subject to monitoring and auditing. ==== First, a point on syntax: multiplication requires inserting a * or leaving an empty space between factors. Second, if I understand correctly, you wish to substitute the variable z by a - h? In that case, use ReplaceAll (/.), e.g. In[2]:= g*(z^h/(a*z^b + c*z^d + e*z^f)) /. z -> a - h Out[2]= (g*(a - h)^h)/(a*(a - h)^b + c*(a - h)^d + e*(a - h)^f) This may be applied to any expression, in your case the sum of all the fractions at the same time. Tomas Garza Mexico City ----- Original Message ----- > attempting to do some programming and need to automate a calculation, to be > done far too many times to attempt it manually. A previous calculation outputs a sum of fractions in terms of z, all are of > the form gz^h/(az^b+cz^d+ez^f). I need to do a calculation involving the > numbers a-h. I would like to be able to input the fraction, automatically > assign the correct numbers from it to the variables a-h, then do the > calculation and output the result. Ideally, if I could input the sum of all > the fractions directly as output from the previous calculation and do this > for each one, then output an answer which is the sum of the results for each > fraction that would be best. I have found my way around programming in > basic functions, but am unsure as to how to input a standard form of > equation and automatically assign the values to the variables for > calculation. Any help would be greatly appreciated. > Laura Pickard. intended recipient you must not use, disclose, distribute, copy, print, subject to monitoring and auditing. > ==== This approach could be streamlined if the powers must be positive integers. coef[expr_, var_Symbol:z] := Module[{n=Numerator[expr], d=Denominator[expr]}, DeleteCases[Flatten[{Cases[1+d, a_*var^b_. :> {a,b}], {{DeleteCases[1+d, a_*var^b_.]-1,0}}, Cases[1+n, a_*var^b_. :> {a,b}], {{DeleteCases[1+n, a_*var^b_.]-1,0}}},1],{0,0}]]; rbe[cl_List, var_Symbol:z] := Module[{terms=#[[1]]*var^#[[2]]& /@ cl}, Last[terms]/(Plus@@Drop[terms,-1])]; expr=g*z^h/(a*z^b+c*z^d+e*z^f); coef[expr] {{a, b}, {c, d}, {e, f}, {g, h}} expr==rbe[%] True Using x as the variable rather than z: expr=g/(a*x^b+c*x^d+e*x^f); coef[expr,x] {{a, b}, {c, d}, {e, f}, {g, 0}} expr==rbe[%,x] True expr=g*z^h/(a*z^b+c*z^d+e); coef[expr] {{a, b}, {c, d}, {e, 0}, {g, h}} expr==rbe[%] True expr=g/(a*z^b+c*z^d+e); coef[expr] {{a, b}, {c, d}, {e, 0}, {g, 0}} expr==rbe[%] True expr=3*z^2/(7*z^(1/2)+6*z+9*z^(-1)); coef[expr] {{9, -1}, {7, 1/2}, {6, 1}, {3, 2}} expr==rbe[%] True Bob Hanlon << I cannot view the newsgroup as I am stuck behind a firewall here, but if you I am new to using mathematica (currently I have version 4.1, should be getting a trial copy of version 5 soon, my os is winNT). I have been attempting to do some programming and need to automate a calculation, to be done far too many times to attempt it manually. A previous calculation outputs a sum of fractions in terms of z, all are of the form gz^h/(az^b+cz^d+ez^f). I need to do a calculation involving the numbers a-h. I would like to be able to input the fraction, automatically assign the correct numbers from it to the variables a-h, then do the calculation and output the result. Ideally, if I could input the sum of all the fractions directly as output from the previous calculation and do this for each one, then output an answer which is the sum of the results for each fraction that would be best. I have found my way around programming in basic functions, but am unsure as to how to input a standard form of equation and automatically assign the values to the variables for calculation. >>

==== properly. when I Input>>U[3], the output did not contain the variable 't'. Please help me to see is there anything wrong with them.Hope to hear from you soon. T[n_] := Module[{list1 = {}, i, m =1, yes}, While[mÁ.86 n, yes = 1/(n - 1)! Sum[Binomial[n, i]*(-1)^(n - i)*(i - x)^(n - 1), {i, m, n}]; list1 = PrependTo[list1, yes]; m = m + 1]; list1] U[n_] := Module[{list2 = {},j = 1, r}, While[j Á.86 n, p[x_] = Part[T[n], j]; r = p[t + n - j]; list2 = PrependTo[list2, r]; j = j + 1]; list2] Loh _________________________________________________________________ Are you in love? Find a date on MSN Personals http://match.msn.com.my/ ==== I am looking for the solution to the following problem and am grateful for any hints: Consider the pure function: In[1] := f = Function[ { x, y }, Function[ { a, b, c, d, e, f }, a*x + b *y + c + d + e + f] ]; I can then In[2]:= f[ 2, 2 ] Out[2]= Function[{a$, b$, c$, d$, e$, f$}, a$ 2 + b$ 2 + c$ + d$ + e$ + f$] The result is, as expected, another function. A complete call would look like this: In[3]:= f[ 2, 2 ][ 1, 2, 3, 4, 5, 6 ] Out[3]= 24 Fine. Now i can for example differentiate In[4]:= D[ f[ x, y ], { x, 1 } ] Out[4]= Function[{a$, b$, c$, d$, e$, f$}, a$] and a function is returned. Nice. The problem is that i would like to use constructors and selectors to create a new level of abstraction. For this reason i define In[5]:= MakeMyHead[ a_, b_, c_, d_, e_, f_ ] := myHead[ a, b, c, d, e, f ]; and In[6]:= GetTestValues[ myHead[ a_, b_, c_, d_, e_, f_ ] ] := { a, b, c, d, e, f }; This works as follows: In[7]:= example = MakeMyHead[ 1, 2, 3, 4, 5, 6 ] Out[7]= myHead[1, 2, 3, 4, 5, 6] and In[8]:= GetTestValues[ example ] Out[8]= {1, 2, 3, 4, 5, 6} The problem is now that i would like a code that in pseudo code does this: (* pseudo code f = Function[ { x, y }, Function[ { mh_myHead }, Module[ { a, b, c, d, e, f }, { a, b, c, d, e, f } = GetTestValues[ mh ]; a*x + b *y + c + d + e + f] ] ] *) a) Is it possible to hand over specific data types to functions, like myHead? b) How can i create additional local variables in a function. Differentiating the expression a*x + b*y + c... should be independent of the value of the variables a,b,c,... Any suggestions on how to do this? Much thanks in advance. Oliver Oliver Ruebenkoenig,