I am modeling electrostatic problems with the boundary elements method. I \ am first solving plane electrodes. My method involves Green function, so \ result is a continuous function of spatial variables x and y. Method of visualization is ContourPlot[], which draws equipotencial lines for calculated field. My question would be how one draws himself solid force-field lines? (they are lines perpendicular to aboves). Thank you for any comment, Borut Levart ==== It is indeed possible. However, you wouldn't like to have all the formatting stuff from Word into your Mathematica file. I suggest you save your file as text (i.e., File|Save As|\...\|Text, and you will have your file with a .txt extension. Then use ReadList and the file will be read without any hitch. Be careful to give the exact path to your file. It is a good idea to use !! to see your file before reading it just to make sure it is there. Tomas Garza Mexico City I would like to know if it is possible to actually import > an word .doc file into Mathematica. I already tried to do > it using the \import\ command however the document did not > appear to have been converted successfully into > mathematica. > I would appreciate any advise. > ==== > > I would like to know if it is possible to actually import an word .doc \ file > into Mathematica. I already tried to do it using the \import\ command > however the document did not appear to have been converted successfully \ into > mathematica. > > I would appreciate any advise. > > Mathematica will not import .doc files directly, but there are some easy alternatives. You can, in Word, select the entire document, copy and paste it into Mathematica. Or, you can save it as a .rtf file from Word and open the .rtf file in Mathematica. Sincerely, John Fultz jfultz@wolfram.com User Interface Group Wolfram Research, Inc. ==== > I would like to know if it is possible to actually import an word .doc > file into Mathematica. I already tried to do it using the \import\ > command however the document did not appear to have been converted > successfully into mathematica. The Microsoft Word document format is proprietary, meaning that Microsoft does not publish its specification. There are several elements of the format that do not have any meaningful representation in a notebook. If you wish to bring the textual contents of a Word document into the a notebook, you can do the following: 1) Save your original document as Rich Text Format (RTF) form Word. 2) Open the exported RTF file in the front end using the standard menu command File -> Open. RTF reading is a feature available only on the Windows front end. -- User Interface Programmer paulh@wolfram.com Wolfram Research, Inc. Disclaimer: Opinions expressed herein are those of the author alone. ==== I have a rather straight forward question on pattern matching. Say that I have a expression given as: (kg m^2) /(s^2) When I try a pattern matching substitution such as: (kg m^2) /(s^2) /. (kg m)/(s^2) -> n Returns: (kg m^2) /(s^2) Am I missing some sort of rule? How can I do this sort of pattern \ matching. Mike ==== Until now I have been using Mathematica just as a tool for calculations \ and >datamanipulation. However, lately I've been considering writing reports \ and >other documents using the Notebook as a worldprocessor. In some Style >sheets there are Styles for automatic numbering of equations and figures >which i would like to use but modify a little bit for my purposes. I have \ a >question that came up during my work with changing the format of the >\Numberedfigure\-Style in the \Report\ Style Sheet. I want to use LEFT adjustment of the figuretext indicataing the number of >the figure instead of the default Center adjustment. Editing the Style >Sheet Notebook defing the Style \NumberedFigure\ one can see that the >figurenumber-text is displayed using the CellFrameLabel Option for the \ main >Cell. My question is therefore, Is it possible to left adjust the >CellFrameLabel with respect to the whole Cell or is it bound to the \ center >of its frames? If the Anser is NO could anyone give me some hints to >reformulate the Cell definition without using CellFrameLabel option but >still have the figurenumber-text leftadjusted below the figure. If \ possible >I also would like to put some additional text right after the \Figure X\ \ text. /Helge Helge Andersson >Chalmers University of Technology >Sweden There are no perfect ways of doing this, but here are some things that you can do: 1) Add whitespace to the CellFrameLabel (like a bunch of tabs). This is not \ ideal and assumes that the window size is fixed, but it's easy to do. 2) Insert the CounterBox directly into the cell. For cells that contain graphics, this can be a bit tricky so here's a palette that does the trick. NotebookPut[ Notebook[{Cell[ BoxData[ButtonBox[\Make Figure\, Active -> True, ButtonEvaluator -> Automatic, ButtonFunction :> Module[{nb = InputNotebook[], in}, in = NotebookRead[nb]; If[Head[in] =!= Cell, Print[in]; Return[]]; in = ReplacePart[in, \NumberedFigure\, 2]; NotebookWrite[nb, Cell[TextData[{in, \\\nFigure \, CounterBox[\NumberedFigure\]}], \ \NumberedFigure\, CellFrameLabels -> {{None, None}, {None, None}}]] ] ]], \Text\]}, WindowClickSelect -> False, ShowCellBracket -> False, WindowSize -> {125, FitAll}, WindowFrame -> \Palette\, WindowElements -> {}, WindowFrameElements -> {\CloseBox\}]] -------------------------------------------------------------- Omega Consulting \The final answer to your Mathematica needs\ Spend less time searching and more time finding. http://www.wz.com/internet/Mathematica.html ==== I have the following Problem: Given a Set of Variables, i.e. L = {x,n}, I want transform a given expression, polynomial in theese variables, say f = (a+b+n+x)*n into Monomials in the given Variables, here f = (a+b+n+x)*n -> (a+b) n + n^2 + x n is desired. The Problem is, that Expand[f, x_ /; MemberQ[L, x]] yields a n + b n + n^2 + n x which is \too expanded\, while Collect[f, x_ /; MemberQ[L, x]] yields n\\^2 + n(a + b + x) But this is \not expanded enough\, because collect works recursively. So I didn't find an implemented Command doing the thing. (The whole thing is a bit timecritical, large polynomials may appear, and the Command will be used frequently). Any Ideas? Detlef ==== > -----Original Message----- > Sent: Friday, April 26, 2002 9:28 AM > To: mathgroup@smc.vnet.net > > > > I hope someone can help me with this I know the solution > should be easy > but I am still learning how pure functions work. > > I am trying to pick out a position in a list were a number falls i.e. > > Position[xBins, _?(#1<=x <= #2 &)]. I keep getting errors Like these > > > Function::slotn: Slot number 2 in #1¾x¾#2& cannot be filled > from \\ > (#1¾x¾#2&)[List]. > > Function::slotn: Slot number 2 in > #1¾x¾#2& cannot be filled from \\ > (#1¾x¾#2&)[-1]. > > In[83]:= > Function::slotn: Slot number 2 in #1¾x¾#2& cannot be filled from > \\ > (#1¾x¾#2&)[-0.995]. > > General::stop: Further output of > Function::slotn will be suppressed during \\ > this calculation. > > > Can I make a comparison with the nth and nth+1 element in a > pure function. > Thank you, > > > > Shawn, it was only after a couple of replies, as I began to understand your question. If you want to classify single events to predefined bins - especially if \ you have got many bins - you may use binary search, instead of linearly \ scanning the list of values delimiting the bins: In[2]:= Attributes[binarySearch] = {HoldFirst}; In[3]:= binarySearch[xBins_, x_] := Module[{lo = 1, mid, hi = Length[xBins], BS}, BS[lo_, hi_] := If[lo == hi - 1, lo, If[ x < xBins[[ mid = Floor[(lo + hi)/2] ]], BS[lo, mid], BS[mid, hi]] ]; Which[x < xBins[[lo]], 0, x < xBins[[hi]], BS[lo, hi], True, hi] /; hi >= 1] But if you have all your data together, it might be preferable to sort all your data first, and then bin your data in a single linear scan (merge) \ over the data and the (sorted) list describing the bins. This has no better asymptotic complexity but uses Mathematicas built-in Sort which cannot be beaten by a program like this one above (as long as we have no kernel version of binary search). Just to show how your - as I surmise - first idea might get working, look \ at this: In[13]:= lst=Sort[Table[Random[],{10}]] Out[13]= {0.0501495,0.155844,0.306824,0.395722,0.400529, 0.44935,0.631482,0.632848,0.77239,0.816055} In[14]:= x = Random[] Position[Partition[lst, 2, 1], bin_ /; (#1 <= x < #2 & @@ bin)] Out[14]= 0.76333 Out[15]= {{8}} This also works if your bins are not contiguous. Then just replace Partition[lst,2,1] by a list of pairs of lower and upper bounds for each of the bins (then they also need not be sorted). -- Hartmut binarySearch[xBins_, x_] := Module[{lo = 1, mid, hi = Length[xBins]}, Which[x < xBins[[lo]], 0, x < xBins[[hi]], (If[#1 == #2 - 1, #1, If[x < xBins[[mid = Floor[(#1 + #2)/2]]], #0[#1, mid], #0[mid, #2]]] &) [lo,hi], True, hi] /; hi >= 1] ==== I have an NDSolve solution for two different variables in InterpolatingFunction form. I'm trying to get 2 different 3D plots. But I'm having error messages about some point of the solutions that they are not real numbers on this point. How can I get this plots? Can I ignore these error messages? Deniz ==== It seems I have an identical problem to Frederic Fontaine dated 22 Jun 1999 that didn't get answered in the threads. I'm ALSO having troubles with the syntax of the Weights option in NonlinearRegress. I want to input an equation not simply values. I'm not a member of this list so Im not sure if this will get back to me either... I'd appreciate any help, for ease I have cut and pasted his eloquent version... NonlinearRegress, Weights, Syntax Dion Lewis University of Tasmania Physics Department