2278 === Subject: Re: image not displaying properly Can you please send in the image to Tech Support (web: http://support.wolfram.com/getsupport.cgi or email: support@wolfram.com). We will be very glad to investigate this further. Onkar Singh Wolfram Research Technical Support > > I am running Linux, distribution Ubuntu 8.10. I was using Mathematica > 6.0 previously and was doing fine importing certain images (format > PDF). However, these simple images do not import properly anymore in > version 7.0. If you think you might have some insight, please reply to > me and I can send you the image. I can't attach it here because of > group policy. > > > Ramiro > > === Subject: Re: Debugging Mathematica Code (Mathematica 7) On 20 Jan., 12:57, Jens-Peer Kuska > > the Wolfram Workbench has an excellent debugger > and there are situations where you need it. > > BTW: What is so complicated ? > - go to the Evaluation Menu and open the Debugger > - now type into a notebook > > foo[0] = 1 > foo[n_Integer] /; n > 0 := n*foo[n - 1] > > use the mouse and mark in > foo[n_Integer] /; n > 0 := n*foo[n - 1] > the foo[n - 1] expression. > > Go to the debugger window and use > Break at selection Now the foo[n - 1] > has a red frame. > > Finally go to the notebook window and enter > > foo[4] > > as an input. And ... ta ta ta > The Stack window show the stack > and all is as it should. Now press Continue > ind the debugger menu to see the next > step in the recursion ... > > Jens > > No, there isn't a decent explanation. > You can check prior posts by me and others on debugging, but this is > the conclusion, basically. > Anyway, the general feeling among knowledgeable users is that you do > not really need a debugger. > These users just sprinkle print statements here and there to see > intermediate results. > I additionally also use On[] and Off[] which help me see clearly the > code flow. > You don't really need much more. > > hth > >> Hello Experts, > >> I made my fist steps with the Mathematica (so called) debugger and= st= > umbled >> immediately. Is there anywhrere a documentation of this tool that is >> worth it's name (a criterion which the Mathematica 7 documentatin on d= ebu= > g >> surely fails). I've tried a lot, but I'm still at the stage trial an >> error. > > >> Mike Hi Jens, but: Sometimes it works, sometimes not. I used step and step in, to see waht the code does, but it seems that frequent swithceing breakpoint on and of irritates the debugger and it's behavior gets a bit, say, probabilisitc, and therefore I was looking for documentation (for it could be my fault in missusing the tool without knowing there is a missuse). So I returned to the insertion of Print-Statements. But I would like more to have a debugger which works well - it's more easy and comfortable like the print-statement workaround. Mike === Subject: Re: Fitting problem I don't know if Mathematica has a way of doing what you need. But maybe try this. suppose you have f1(x1,x2), f2(x1,x2,x3),...for your models define ft(x1,x2,x3...)=f1(x1,x2)+f2(x1,x2,x3)+f3(..).... find the best fit for ft(x1,x2,x3...). Chenhui > > i have the following situation: > > 5 mathematical models describing the formation of different species. > The models (so the species) are interdependent, means.. they all have > the same parameters but some of the have also other additional > parameter. Example: Model 1 has a parameter lifetime1... model 2 > will include this parameter liftime1 and a new parameter > lifetime2. > > My trouble is now to find best fit values for the parameters in all > the models at the same time. I don't want to find a best fit for model > 1 and then find out when doing best fit for model 2 that model 2 won't > work with the parameter values found in the first run with model 1. So > the fitting must consider all the models to find best fit values for > the parameter. > > I wonder if this achievable with mathematica or if i would be better > of with other software > > thank you for your help > > Ktota > > > === Subject: Re: Fitting problem here is an attempt to tackle your problem: We have one independent variable, time: t. we have datasets d1:{{t1,d11},{t2,d12}.. d2:{{t1,d21},{t2,d22}.. .. we have models with parameters p (not all models may need all parameters): mod1[t,p1,p2..] mod22[t,p1,p2..] ... we define data interpolation functions that we will use to define an error function: int1:=Interpolation[d1] int2:=Interpolation[d2] ... define an error function: err[t_,p1_,..]:= (f1[t]-mod1[t,p1,..])^2 + (f2[t]-mod2[t,p1,..])^2+... we define artificial zero data: artdat={{t1,0}{t2,0},..} Finally we fit err against the zero data: FindFit[artdat,err[t,p1,..],{p1,p2,..},t] hope this helps, Daniel i have the following situation: 5 mathematical models describing the formation of different species. > The models (so the species) are interdependent, means.. they all have > the same parameters but some of the have also other additional > parameter. Example: Model 1 has a parameter lifetime1... model 2 > will include this parameter liftime1 and a new parameter > lifetime2. My trouble is now to find best fit values for the parameters in all > the models at the same time. I don't want to find a best fit for model > 1 and then find out when doing best fit for model 2 that model 2 won't > work with the parameter values found in the first run with model 1. So > the fitting must consider all the models to find best fit values for > the parameter. I wonder if this achievable with mathematica or if i would be better > of with other software thank you for your help Ktota === Subject: Re: Mathematica Calls Home > The following is a bit more puzzling. Another kind of outbound connection > attempts, rated as medium risk, takes place in occasions when saving my > notebooks. Then Mathematica tries to connect to the IP 194.224.66.27 (DNS) > on port 53. A whois shows that this IP is registered by Akamai Technologies. Does this ring any bells? A quick search shows that it's a company that mirrors servers in order to offer faster internet connection. Perhaps the machine you save your notebooks to is a mirrored one. cheers, Peltio === Subject: Re: Mathematica Calls Home Good. I will keep allowing the connections by default. And what about the global hooks Mathematica tries to set, probably on the keyboard and surely on the mouse? I prevent them from taking place without any apparent side effect or lack of functionality. E. Martin-Serrano -----Original Message----- === Subject: Re: Mathematica Calls Home >My firewall is detecting outbound Internet connection attempts by >Mathematica 6.0.1. Right. This is one of the features introduced in Mathematica by version 6. Among other things, by default, Mathematica accesses Wolfram's servers to update the online documentation or to access curated data used by some of the built-in functions. See the discussion that can be found by searching on tutorial/InternetConnectivity in the documentation center for more details. If you don't care to have Mathematica connect to the internet, this can be disabled in Mathematica's preferences. Of course, this will mean certain functionality of Mathematica will not be available to you. === Subject: Basic questions on list manipulation in the Mathematica Way I have some basic questions about using lists in Mathematica. Specifically I have a table that serves as sort of a database with the following structure: ct = { { sym1 -> {val1->20, val2->300, val3->1000, ... }, { sym2 -> {val1->50, val2->500, val3->20000,...}, ... } sym1, sym2, ... are people and val1, val2 ... represent attributes of each person. Now I'm trying to go in and modify values. I can do it, but I think not well and I think with a programming language mindset instead of a Mathematica mindset. Here is my specific question. In order to change a specific value in the list above (valxxx) for a given individual (symxxx), I created this function: changeVal[ who_, class_, amnt_ ] := ( ct[[ Position[ ct, who ][[ 1, 1 ]], 2 ]] = ReplacePart[ ct[[ Position[ ct, who ][[ 1, 1 ]], 2 ]], Position[ ct[[ Position[ ct, who ][[ 1, 1 ]] ]], class ][[ 1, 2 ]] -> (class -> amnt) ] ); Now I know there is a better way than that using list manipulation and patterns. Can some of you experienced pros help me out? I call this write only code because I don't know that I could explain it once it's written. Perhaps a more fundamental question: is this the right way to store data in lists? Or would it be better to just have the values and reference them by index number? === Subject: Coloring the Controls area of Manipulate Hi Is there any mechanism to choose the background color for the controls area in the Manipulate output? Sometimes it is difficult to read values from the Gray background that is the default. Asim Ansari === Subject: Re: Using Coefficient on an equation In my Init file, I have the following code: Unprotect[Equal]; listableQ[f_]:=MemberQ[Attributes[f],Listable] Equal /: lhs : (f_Symbol)?listableQ[___, _Equal, ___] := Thread[Unevaluated[lhs], Equal] It causes Listable functions (like Coefficient) to thread over Equal. (I think that's useful.) Bobby > > > > the first example is wrong. Coefficient only works on polynomial or > > list of polynomials. It does not work on expressions with head Equal. > > Daniel > > > > >> f = a*x^2 + b*x + c == 0; > >> First@Coefficient[f, x^2] > >> > >> a > >> > >> or > >> > >> Coefficient[First@f, x^2] > >> > >> a > >> > >> Bobby > >> > > >> > >>> If f=a*x^2+b*x+c, Coefficient[f,x^2] obviously returns a. > >>> But if f=a*x^2+b*x+c==0, it returns 0. > >>> > >>> The problem arose using the Calculus`VariationalMethods` package. > >>> It (unfortunately) returns the Euler-Lagrange equations as > >>> such, so I have to remove the useless ==0 appendage for > >>> Coefficient to work properly. Is there a simple direct way out? > >>> > >> > >> > >> > > > -- DrMajorBob@longhorns.com === Subject: Problem in generating a IF cycle which Mathematica 6.0 another question just to finish my release.... This is the actual list I have: Quit[]; SetDirectory[C:UsersproprietarioDesktopDesktopTESI DatiBitmapPaziente 1]; nome = p6.bmp; Import[nome, ImageSize]; row = ToExpression[Import[nome, ImageSize]][[1]]; col = ToExpression[Import[nome, ImageSize]][[2]]; vmax = row*col; gv = Array[f, vmax]; gl = Take[Import[nome, GrayLevels]]; i= 0; Do[Do[ i=i + 1; gv[[i]] = gl[[j, k]], {k, 1, col}], {j, 1, row}]; It returns me an array which have these values... 0. 0. 0. 0. 0. 0. 0. 0. 0.1764705882352941 0.1764705882352941 0.1764705882352941 0.8941176470588235 0. 0. 0. 0. (this is just a part of the array) Now I have to wite a if cycle which, when it reads 0. (in the array) it gives back just 0 (without . to be clear) i.e., i need a new array : 0 0 0 0 0 0 0 0 0.1764705882352941 0.1764705882352941 0.1764705882352941 0.8941176470588235 0 0 0 Valeria === Subject: slots with 2 indexed array? First I produce some dummy data, 4000 of what I call signals, 1024 samples each. sigs = Table[10 i + j, {i, 4000}, {j, 1024}]; len = Length[sigs]; I'd like to modify these signals. The For statement below works. I can use a slot function on each of the sigs specified by i. For[i = 1, i < len + 1, i++, sigs[[i]] = If[# >= 2048, # - 2048, # + 2048] & /@ sigs[[i]] ] Surely there's a way to use slots on a double indexed array but I haven't found it yet. If I try to let # represent every entry in sigs, the If statement isn't processed: sigs = If[# >= 2048, # - 2048, # + 2048] & /@ sigs; I tried Which that Help says uses HoldAll but that doesn't work either; Which[] still isn't evaluated. I tried using #2 and ## instead of # but that doesn't work. In reading about slot functions I haven't seen any examples using multi indexed arrays. === Subject: Why does the Shooting Method fail? Hi I have a set of coupled nonlinear differential equations with boundary conditions that I am solving using the shooting method. The mathematica notebook can be downloaded at http://web.mit.edu/~shahriar/Public/submission2.nb In the line where eqn2 is defined I show that if eta' is 0.1 the shooting method works and the boundary conditions of vz[xend]==0 and w [xend]==0 is satisfied. If I change the eta' to 0.01 (which is a case I do want) I dont get it to converge to these boundary conditions. I have tried numerous things like changing the stepsize, number of steps and even reverse shooting and it doesnt work. I have even changed the range for the variables A and B that determine the starting slope of vz[x] and w[x] but that doesnt do much. I would greatly appreciate it if someone can help me on this matter. Shahriar === Subject: Re: problem importing an image >I am running Linux, distribution Ubuntu 8.10. I was using >Mathematica 6.0 previously and was doing fine importing certain >images (format PDF). However, these simple images do not import >properly anymore in version 7.0. If you think you might have some >insight, please reply to me and I can send you the image (its just >about 5kb). It is very unlikely the issue you are having is related to a specific image. But note, you haven't specified the issue. What do you mean by improperly imported? And what is the Mathematica code you used that led to this problem? === Subject: Re: Mathematica Calls Home On 1/20/09 at 1:22 PM, eMartinSerrano@telefonica.net (E. >And what about the global hooks Mathematica tries to set, probably >on the keyboard and surely on the mouse? I prevent them from taking >place without any apparent side effect or lack of functionality. Another feature introduced by version 6 is the ability to control Mathematica with a joy stick or other game controller. Possibly by doing as you describe above, you are eliminating this functionality. However, if all you use is an ordinary mouse and keyboard, then I suppose the functionality you are disabling is something you aren't using and consequently see no effect. But why go to the trouble of disabling some set of interfaces in the default installation? What do you gain? What harm is there in leaving these enabled? === Subject: =?windows-1252?Q?Why_isn=92t_the_increase_in_frequency=2Fperiodicity_of?= Why isn't the increase in frequency/periodicity of this waveform not showing up tia sal2 I'm using the manipulate command to view what the wave form will look like will look like if I increase the frequency. But when I vary the variable =A1=A7a=A1=A8 to 3 the waveform only shows one complete wave instead of 3 Example I vary the variable =A1=A7a=A1=A8 to 3 it should show 3 waveforms repeating but instead it shows just 1 waveform in 1/3 the time. Here=A1=A6s an image of what it's doing along with the code http://test.onewithall.net/math/waveform.jpg Here's the code below: tmin:=0 tmax:=2 Pi per1=Pi; startPer1=0; fpr1[t_]:={Sin[Mod[t-startPer1,per1]+startPer1],startPer1> >>> [Unless your TeX input has some error, in which case the typeset >>> output >>> will only appear up a point where the error occurs; a description >>> and >>> explanation of the error will appear in a third log window -- and >>> hitting some other key combo will take you back to the input window >>> **with the cursor positioned at the point or line where the error >>> was >>> encountered.] >> >>> This has been the case for many years. >> >> Amazing. That means they must have produced a mind-reading version of >> TeX that I am not aware of. In all versions that I know (and I have >> been using TeX,LateX,Ams-Latex etc for decades) the cursor will >> appear not at the place where the error (for example a missing right >> brace })occurred but at the place where TeX first notices some inconsistency >> with its syntax - which is almost never the place where the error >> actually occurred. At that point you have got to manually find the >> actual error, which can be far from simple. The only TeX >> implementation that I know that partly gets around this problem is >> the Mac TeX system Textures (http://www.bluesky.com/products/products_frames. > html >> ), which continually typesets your output as you type (without the >> need to hit any keys), which usually will make you aware of an error >> as soon as it occurs rather than much later, when you try to typeset >> the you course code. Moreover, Textures has several other nice >> features that are implemented only imperfectly in other versions. But >> there are major caveats - a Mac OS X version is still only in beta, >> years after Mac OS X occurred, and Textures costs hundreds of >> dollars. > >> But, and here is something anyone considering TeX should carefully >> ponder upon. Before Mac OS X appeared, there were many persons >> (including myself) willing to pay hundreds of dollars for Textures >> and more for regular upgrades, in spite of the fact that lots of free TeX >> implementations have always existed on the Mac (I myself now use TeX >> Shop with Japanese PTex engine). This was because TeXtures avoids the >> huge amount of hassle that installing and using TeX is for any >> beginner and even for an experienced user. Then Blue Sky, the company >> that makes Textures, failed to come up with a Mac OS X compatible >> version and most users reluctantly drifted away to other programs. >> But if you look mailing lists where TeX on Mac OS is discussed you will >> find that many are intending to return (even though it will cost them >> money) as soon as a full featured version is again available. Which >> only proves that standard, free implementations of TeX are far form >> the sort of thing some make them out to be. I strongly recommend you >> to try TeX, but I suspect you will be soon back to using Mathematica >> (if not Word). > > Have you tried installing TeXLive? > > -- m > Yes. It certianly makes keeping up to date with various packages easier, but I don't think it addresses the issues I mentioned and does not have the features Textures offers (or used to). Among these were: 1. Continuously updated preview 2. Traffic light - an interactive device that keeps you informed while you are typing if your input is syntactically correct (so you can catch errors as they occur 3. Synchronicity. Command-click on any text in the preview and you are taken to the corresponding point in your source code. Do the same to any word in the source code and you are taken to the right place in the preview. This also works in TeXShop but very unpredictably: by command clicking in the preview you can be taken to a completely wrong place in the source code. TeXtures is also a single application consisting both of a TeX engine and an editor, you could paste pictures directly into it and they appear in correct place in the typeset window, it works with color, it was extremely fast (much faster then any implementation of TeX I have ever tried on any platform. The original version for 68K Macs was written in Assembler, which probably contributed to the difficulties with subsequent changes in Apple's hardware and operating system). This is just another example that the continual changes in computer technology are not necessarily all progress. Mathematica is actually = an exception and the new Dynamic capabilities are, in my opinion, an advance comparable to the invention of Desktop Publishing itself. Of course whether this really catches on or remains on of these brilliant = and promising but never fully realized inventions, of which there are = quite a few in the history of technology, remains to be seen. Andrzej Kozlowski === I know of no journal in the life sciences area that accepts TeX or LateX. Of course, my knowledge is restricted to only a few of the 1000s of journals floating around, but it's a good sample. faculty's student newspaper. So I've had my share. When I turned to human factors research I had to -reluctantly- give it up for Wordperfect and later Word. Because my reports usually contain only a few equations that's not much of a problem. Not that working with WP or Word was much of a pleasure in those days. Stability was not a feature then. Actually, I think I now prefer Word to LaTeX. For one thing there's WYSIWYG. Proofreading is so much better when you can see and correct the results immediately without switching between a multitude of programs and windows. LaTeX had all kinds of problems. Figures never appeared where you wanted them. Quite often they ended up bunched together at the end of a chapter. You needed a kludge like the here.sty style file. Using different fonts was next to impossible. LaTeX2e that appeared later improved that (so I have heard). However, years later, when I tried to typeset my plain LaTeX based thesis once again, I couldn't get it to compile with the then current 2e version. So much for compatibility. Equations of more than average complexity easily filled up half a page of code rubbish and were a pain to debug. Spellchecking less than basic. Try to write a multiple language peace and spellcheck that in LaTeX. Virtually no picture tools. No tracked changes. No collaboration tools etc etc. I don't want to start a flame war. Just balancing the discussion somewhat. I am well aware of many or most of the problems of Word. === >Is TeX a version of HTML, then? No. TeX and LaTeX significantly pre-date HTML. About the only > relationship between TeX and HTML is that from the perspective > of the source document you actually create TeX is a markup language. I genuinely hate to toss around so many critical views and comments on this group -- but another deeply _negative_ relationship between HTML and TeX is that the creators of HTML, despite their coming at least inb many cases from intensely technical backgrounds, apparently never consider the possibility of incorporating TeX directly into HTML, as one of its supported formats. === > Then Blue Sky, the company > that makes Textures, failed to come up with a Mac OS X compatible > version and most users reluctantly drifted away to other programs. But = > > if you look mailing lists where TeX on Mac OS is discussed you will > find that many are intending to return (even though it will cost them > money) as soon as a full featured version is again available. Which > only proves that standard, free implementations of TeX are far form > the sort of thing some make them out to be. I strongly recommend you > to try TeX, but I suspect you will be soon back to using Mathematica As an intensive user of Textures from its beginning right up to its (apparent) end a few years back, I fully agree that Textures was an absolutely superb, almost unbelievably good implementation of TeX for the Mac up through OS 9. Wanting to be able to continuing using Textures in fact kept me on OS 9 after OS X came out for far longer than I should have stayed with it. I also fully agree that whatever has been going on with Blue Sky and Textures since then seems to be weird, garbled, bizarre, and sad (perhaps even more so than some of the weird and bizarre aspects of Wolfram and Mathematica since Version 5). But as someone who eventually made the transition to the TeXLive and TeXShop implementation of TeX for the Mac that's distributed on CDs to members of TUG (requiring only the very modest dues that TUB charges), I can also attest that this implementation is also really quite good, not too painful to get installed and running, and then perfectly usable. The skilled volunteers who assemble this CD could still benefit from a few lessons in how to prepare simple, clear and helpful instructions and user documentation, especially for new or novice users. But their documentation failings are nothing like the documentation idiocies in those areas that Mathematica now seems trapped in. === I downloaded LyX last night and so far have mixed reactions... I'm used to editing WYSIWYG in NeoOffice. It's weird seeing the text spaced all funky-like (non-proportional fonts or something like that) UNTIL you decide to make it printable or PDF. I'll spend a little time, though, and see if I can get used to it. Bobby > For live documents nothing comes close to Mathematica. However, if you > need > to use a widely-accepted standard then LaTeX is the best solution. If you > like to edit your LaTeX code directly then the WinEdt/MiKTeX combination > is > quite usable, but I much prefer to use a GUI to hide the LaTeX code. With > this in mind, for the past 5 years or so I have used Publicon > (www.wolfram.com/products/publicon) to create LaTeX files, but Publicon > is > so > I am concerned about its future. Recently, I have been looking at the > free > Lyx (http://wiki.lyx.org), and after a month of playing around with it I > have nothing but praise for this wonderful piece of software. Also, > transferring Publicon->Lyx via LaTeX seems to be robust. One could > create a > semi-live document by hot-linking the LaTeX to demonstrations (or > whatever) > running in Mathematica Player. For instance, static diagrams in the > document > could have interactive counterparts that run in Player. > -- DrMajorBob@longhorns.com === > What I find odd is using a text editor for this. > > Is TeX a version of HTML, then? > > Bobby The final version of TeX was developed in 1980-81 at Stanford, and was placed on the public domain in 1982. It was written in Pascal but the 81 beta Versatek. HTML came out in 1991-93, see http://en.wikipedia.org/wiki/HTML === Subject: Re: What is QGamma[q,z] Hi Ted, for a definition have a look at e.g.: http://mathworld.wolfram.com/q-GammaFunction.html Daniel > Q function are new in Mathematica 7. > What applications are there for these things? > Also I can't understand the definition of these things because the > Mathematica documentation uses notation I never herd of. > Could sombody explain the definition of QGamma[q,z] in terms of > functions I am likely to know about. Ted Ersek === Subject: Re: What is QGamma[q,z] > Q function are new in Mathematica 7. > What applications are there for these things? > Also I can't understand the definition of these things because the > Mathematica documentation uses notation I never herd of. > Could sombody explain the definition of QGamma[q,z] in terms of > functions I am likely to know about. > > Ted Ersek > > No, they cannot be explained in terms of you are likely to know about but they are analogues of the functions you surely know about (the ones without the q). The classical ones correspond to q=1. The starting point is the q-binomial theorem and the q-Pascal Triangle, which is pretty well explained here: http://demonstrations.wolfram.com/QPascalTriangle/ You might also look at this: http://demonstrations.wolfram.com/QTrigonometricFunctions/ These things are quite useful, both in pure mathematics (e.g. the so called Ramanujan's Summation formula) and in physics in connection with quantum theory. Also, the q-binomial coefficients have a nice geometric interpretation in terms of areas under lattice paths due to Polya, but all of this would take too long to describe here. If I can find the time for it I will make a Mathematica Demonstration of Polya's interpretation of the q-Binomial Theorem some day, but I it won't happen very soon (perhaps someone else might want to do it earlier). Anyway, all of this is described in the classic text:Andrews,Askey,Roy Special Functions, Chapter 10. Andrzej Kozlowski === Subject: Re: What is QGamma[q,z] http://mathworld.wolfram.com/q-Analog.html http://en.wikipedia.org/wiki/Q-analog which gives you definitions and applications of these generalizations of well known function. Maybe easiest to understand is the Q exponential as a generalization of the standard exponential http://en.wikipedia.org/wiki/Q-exponential In principle, the definitions of these Q functions is given perfectly in the Mathematica documentation. However, it appears a standard difficulty of such a documentation, that it cannot teach you the mathematical background or give an overview of applications. Otherwise it would get just too vast. So, I agree that for the uninitiated some Mathematica functions may appear to be completely mysterious at first (or even second) sight and even after carefully reading the documentation. I do not see how this could be avoided. Maybe there should be a referenz section with links into the (internet) literture. But this is not new to Mathematica 6 or 7. Even old stuff, like LUDecomposition[] for example, cannot be understood from the Mathematica documentation alone. One has to go to a good book or so. Michael > Q function are new in Mathematica 7. > What applications are there for these things? > Also I can't understand the definition of these things because the > Mathematica documentation uses notation I never herd of. > Could sombody explain the definition of QGamma[q,z] in terms of > functions I am likely to know about. Ted Ersek === Subject: Re: What is QGamma[q,z] > Q function are new in Mathematica 7. > What applications are there for these things? > Also I can't understand the definition of these things because the > Mathematica documentation uses notation I never herd of. > Could sombody explain the definition of QGamma[q,z] in terms of > functions I am likely to know about. > > Ted Ersek Hi Ted, the Q function or Q series is a generalization of the hypergeometric http://en.wikipedia.org/wiki/Q-series === Subject: Re: What is QGamma[q,z] In the documentation for these functions, there's a link in the More About section that you could try clicking on. You could also try reading the Wikipedia page for q-Pochhammer. MathWorld probably has more information as well. -Daniel === Subject: Re: What is QGamma[q,z] MathWorld to the rescue! http://mathworld.wolfram.com/q-GammaFunction.html > Q function are new in Mathematica 7. > What applications are there for these things? > Also I can't understand the definition of these things because the > Mathematica documentation uses notation I never herd of. > Could sombody explain the definition of QGamma[q,z] in terms of > functions I am likely to know about. Ted Ersek -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: Extract Integrate values here is a small function that changes your output to a piecewise function: ex2piec[ex_] := Piecewise@ Most[ex]; Note that plotting a piecewise function often needs an increase of the option PlotPoints. hope this helps, Daniel > Hello there, does anyone has an idea how i can extract integral output (i have > several line of output for different conditions) and automatically > make an expression which i can plot on a graph. Integrate output: > { > {0., t <= 87.5}, > {2679.69- 61.25 t + 0.35 t^2, 87.5 < t <= 137.5}, > {-10554.7 + 131.25 t - 0.35 t^2, 137.5 < t <= 155.}, > {-6950.94 + 84.75 t - 0.2 t^2, 155. < t <= 187.5}, > {5353.75- 46.5 t + 0.15 t^2, 187.5 < t <= 205.}, > {-7253.75 + 76.5 t - 0.15 t^2, 205. < t <= 255.}, > {2500., !(* > TagBox[True, > PiecewiseDefault, > AutoDelete->False, > DeletionWarning->True])} Manual typing of the above information to get it ploted: } > If[t <= 87.5, 0, > If[t <= 137.5, 2679.6874999999995- 61.24999999999999 t + 0.35 t^2, > If[t <= 155, -10554.6875 + 131.25 t - 0.35 t^2, > If[t <= 187.5, -6950.937500000001 + 84.75 t - > 0.19999999999999996 t^2, > If[t <= 205, > 5353.750000000001 - 46.50000000000001 t + > 0.15000000000000002 t^2, > If[t <= 255, -7253.750000000001 + 76.50000000000001 t - > 0.15000000000000002 t^2, 2500 > ]]]]]]/31200 > === Subject: production quality 2-D graphs with mathematica Most books and sites on mathematica graphics tend to focus on the very impressive 3-D visualizations that mathematica can perform. However, what are the resources for making a simple 2-D graph production/professional quality? Another way of saying this is, it seems the defaults for the lines, data points, and fonts for Plot[] ( and related functions) are not for production quality. Are there any examples of the options used for graphs which go into journals, papers, reports, etc? === Subject: Re: bug in LinearProgramming Veit, I can only confirm the problem (checked syntax etc.) but have no idea what's going on. If you use the interior-point method with sol = LinearProgramming[c, m, b, lu, d, Method -> InteriorPoint] then the issue is recognized properly. Roman. > This is a re-post because the original did not draw any comments. > The data > c = {1, 1}; > m = {{1, 0}, {1, -2}, {-1, 1}}; > b = {{1, 0}, {0, 1}, {0, 1}}; > lu = {{0, 1}, {0, 1}}; > d = {Reals, Reals}; > used in > LinearProgramming[c, m, b, lu, d] > corresponds to the problem > minimize x1+x2 > subject to the constraints > x1 == 1, x1-2*x2 >= 0, -x1+x2 >= 0 > with real variables in the ranges > 0 <= x1 <= 1, 0 <= x2 <= 1 > It's clear that this problem has no solution, and Mathematica > recognizes this fact. > But when the domain of x2 is changed to Integers, Mathematica returns > the solution > x1 == 1., x2 == 1 > This violates the constraint x1-2*x2 >= 0. > > **** earlier posting **** > Here is a simple linear programming problem: > > c = {1, 1}; > m = {{1, 0}, {1, -2}, {-1, 1}}; > b = {{1, 0}, {0, 1}, {0, 1}}; > lu = {{0, 1}, {0, 1}}; > d = {Reals, Reals}; > > sol = LinearProgramming[c, m, b, lu, d] > > Mathematica 6 returns: > > LinearProgramming::lpsnf : No solution can be found that > satisfies the constraints. > > which is obviously correct. But if I change the domain of the second > variable, > > d = {Reals, Integers}; > > then Mathematica gives the solution > > sol = {1., 1}. The problem is that > > m.sol = {1., -1., 0.} > > violates the bound vector b (second component should be greater than 0). > Is there a bug, or am I getting the syntax wrong? > > Veit Elser === Subject: Re: bug in LinearProgramming I get the same result as you (in version 7) and it doesn't look right to me! Bobby > This is a re-post because the original did not draw any comments. > The data > c = {1, 1}; > m = {{1, 0}, {1, -2}, {-1, 1}}; > b = {{1, 0}, {0, 1}, {0, 1}}; > lu = {{0, 1}, {0, 1}}; > d = {Reals, Reals}; > used in > LinearProgramming[c, m, b, lu, d] > corresponds to the problem > minimize x1+x2 > subject to the constraints > x1 == 1, x1-2*x2 >= 0, -x1+x2 >= 0 > with real variables in the ranges > 0 <= x1 <= 1, 0 <= x2 <= 1 > It's clear that this problem has no solution, and Mathematica > recognizes this fact. > But when the domain of x2 is changed to Integers, Mathematica returns > the solution > x1 == 1., x2 == 1 > This violates the constraint x1-2*x2 >= 0. > > **** earlier posting **** > Here is a simple linear programming problem: > > c = {1, 1}; > m = {{1, 0}, {1, -2}, {-1, 1}}; > b = {{1, 0}, {0, 1}, {0, 1}}; > lu = {{0, 1}, {0, 1}}; > d = {Reals, Reals}; > > sol = LinearProgramming[c, m, b, lu, d] > > Mathematica 6 returns: > > LinearProgramming::lpsnf : No solution can be found that > satisfies the constraints. > > which is obviously correct. But if I change the domain of the second > variable, > > d = {Reals, Integers}; > > then Mathematica gives the solution > > sol = {1., 1}. The problem is that > > m.sol = {1., -1., 0.} > > violates the bound vector b (second component should be greater than 0). > Is there a bug, or am I getting the syntax wrong? > > Veit Elser > -- DrMajorBob@longhorns.com === Subject: Re: Map onto one column of a matrix Maybe some expert will know a direct method, but otherwise this is a case where one could define a useful routine. MapOnColumn::usage = MapOnColumn[f,n][matrix] will Map f onto the elements of column n in the matrix.; SyntaxInformation[MapOnColumn] = {ArgumentsPattern -> {_ , _}}; MapOnColumn[f_, n_][matrix_?MatrixQ] /; 1 <= n <= Part[Dimensions[matrix], 2] := Transpose[MapAt[f /@ # &, Transpose[matrix], n]] data = {{a, b}, {c, d}}; data // MapOnColumn[f, 2] {{a, f[b]}, {c, f[d]}} David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ data = {{a, b}, {c, d}}; and we want to map a function onto just the second column, so we want to end up with {{a, f[b]}, {c, f[d]}}. The best way I've found to do this is with MapAt: MapAt[f, data, Table[{i, 2}, {i, Length@data}]] Is there a better way? I keep hoping there's some notation similar to what's used in Part that lets you refer to a whole column with All, -Daniel === Subject: Re: Map onto one column of a matrix >data = {{a, b}, {c, d}}; >and we want to map a function onto just the second column, so we >want to end up with >{{a, f[b]}, {c, f[d]}}. >The best way I've found to do this is with MapAt: >MapAt[f, data, Table[{i, 2}, {i, Length@data}]] >Is there a better way? There are a variety of other ways. These include: f[Last@#]&/@data (* works since 2nd column is the last column *) data/.{a_,b_}->{a,f[b]} (* for two column array *) data/.{a_,b_,c__}->{a,f[b],c} (* for n column array *) Or if you like the data[[All,1]] construct and f has the attribute Listable then Transpose@{data[[All,1]],f[data[[All,2]]]} === Subject: Re: Multiple PDF Pages using Export File > SaveAs offers the choice to save the notebook in PDF, and does so, even with many pages. > Don, I don't think the functionality you want exists. I hope someone > for my applications. I think I read somewhere that Mathematica only > supports single page export in PDF (can't find it now) and this is indeed > my experience. What do I do? I write 4 PDF files and then use the Adobe Acrobat assemble into a single > PDF option. >> Hi All! >> >> I'm interested in generating one PDF graphic per page as in >> >> fourpages=Table[Graphics[Circle[], ImageSize -> {s, s}], {s, 100, 200, 25}] >> >> followed by something like >> >> Export[file.pdf, Table[{Page[i] -> fourcircles[[i]]}, {i, 1, 4}], PDF] >> >> Without the nonexistent function Page[i], i.e., just fourcircles[[i]], the >> four images are horizontally juxtaposed in the same page and not >> on separate pages. >> >> Another words, one table[[i]] graphic per one PDF page for four pages. >> >> >> Don J. Orser >> > -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Problem with an integral Hi. I'm working with a little problem in Mathematica 7.0.0. I want to integrate this function fun = x^(n + 1)*E^(-x + (I*k)/x) Assuming that both n and k are greater than zero, I write integral = FullSimplify[Assuming[{k > 0, n > 0}, Integrate[fun, {x, 0, [Infinity]}]]] And I obtain a symbolic result. But, when I want to put some specific value, like this integral /. {n -> 1, k -> 1} I obtain always ComplexInfinity, and/or other errors. So, I've tried to evaluate numerically the integral for the same specific values, in this way NIntegrate[Evaluate[fun /. {n -> 1, k -> 1}], {x, 0, [Infinity]}] And I obtain a finite numeric result. So, there's some error in symbolic computation, or I miss something when I try to integrate the formula? === Subject: Re: DO and LISTPLOT > I use to run my routines in Mathematica 5.2. Now I have installed the > 7.0. And this simple routine of making several plot one after the > other seems not to work anylonger. Do[ ListPlot[AzScan[i], > AxesLabel -> {[Beta][[Degree]], I[a.u.]}, > BaseStyle -> {Large, FontFamily -> Arial, Bold}, > PlotStyle -> {Red, PointSize[0.01]}, > PlotLabel -> Azimuthal Scan], {i, 65, 160}] > Does anyone have a clue what I am doing wrong? Since version 6.0, you must enclose your plot command within a *Print* statement when used in compound expressions (graphics are not side effects anymore). For instance, Do[Print[Plot[Sin[a*x], {x, 0, 2 Pi}]], {a, 1, 4}] --Jean-Marc === Subject: Re: DO and LISTPLOT The result of a Do expression is always the final value from the loop -- which makes a lot of sense. What happened with Mathematica < 6.0 is that a ListPlot (and other Plot-type expressions) produced the graphics display as a side-effect, not as a result. In 6.0+, the result of a ListPlot (etc.) IS the graphic. So your Do loop returns as result -- and thus displays -- only the final value returned, namely, ListPlot[AzScan[160],...]. So if you want to see each and every one of the plots, simply wrap the ListPlot expression with Print. > Hallo, > I use to run my routines in Mathematica 5.2. Now I have installed the > 7.0. And this simple routine of making several plot one after the > other seems not to work anylonger. Do[ ListPlot[AzScan[i], > AxesLabel -> {[Beta][[Degree]], I[a.u.]}, > BaseStyle -> {Large, FontFamily -> Arial, Bold}, > PlotStyle -> {Red, PointSize[0.01]}, > PlotLabel -> Azimuthal Scan], {i, 65, 160}] > Does anyone have a clue what I am doing wrong? Luigi > -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: DO and LISTPLOT > > Do[ > > ListPlot[AzScan[i], > AxesLabel -> {[Beta][[Degree]], I[a.u.]}, > BaseStyle -> {Large, FontFamily -> Arial, Bold}, > PlotStyle -> {Red, PointSize[0.01]}, > PlotLabel -> Azimuthal Scan]//Print, > > {i, 65, 160}] > > ?? > > Jens > > Hallo, > I use to run my routines in Mathematica 5.2. Now I have installed th= e > 7.0. And this simple routine of making several plot one after the > other seems not to work anylonger. > > Do[ > > ListPlot[AzScan[i], > AxesLabel -> {[Beta][[Degree]], I[a.u.]}, > BaseStyle -> {Large, FontFamily -> Arial, Bold}, > PlotStyle -> {Red, PointSize[0.01]}, > PlotLabel -> Azimuthal Scan], > > {i, 65, 160}] > > Does anyone have a clue what I am doing wrong? > > Luigi well, it is a DO loop with a ListPlot instruction.... === Subject: Re: DO and LISTPLOT Starting in Version 6 plots are no longer displayed as a 'side effect' but are regular output. Do produces no regular output. However, you can get the plots if you Print them from within the Do loop. Do[Print[Plot[Sin[i x], {x, 0, Pi}]], {i, 1, 3}] But you don't normally have to Print them if you do one at a time. The following produces a plot directly. Notice that there is no ; at the end of the statement. Plot[Sin[x], {x, 0, Pi}] David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ Hallo, I use to run my routines in Mathematica 5.2. Now I have installed the 7.0. And this simple routine of making several plot one after the other seems not to work anylonger. Do[ ListPlot[AzScan[i], AxesLabel -> {[Beta][[Degree]], I[a.u.]}, BaseStyle -> {Large, FontFamily -> Arial, Bold}, PlotStyle -> {Red, PointSize[0.01]}, PlotLabel -> Azimuthal Scan], {i, 65, 160}] Does anyone have a clue what I am doing wrong? Luigi === Subject: Re: DO and LISTPLOT Luigi, I'm not 100% certain but I noticed some changes to PlotLabel and AxesLabel from V5.2 to V6.0. If found what is best is to a knew format, using Frame->True and then add labeling with FrameLabel->{{left,right},{top,bottom}}. The change seems to have occured with PlotLabel. > Hallo, > I use to run my routines in Mathematica 5.2. Now I have installed the > 7.0. And this simple routine of making several plot one after the > other seems not to work anylonger. > > Do[ > > ListPlot[AzScan[i], > AxesLabel -> {[Beta][[Degree]], I[a.u.]}, > BaseStyle -> {Large, FontFamily -> Arial, Bold}, > PlotStyle -> {Red, PointSize[0.01]}, > PlotLabel -> Azimuthal Scan], > > {i, 65, 160}] > > > Does anyone have a clue what I am doing wrong? > > Luigi > > === Subject: Re: Formatting in text cells ... Hi Dave, wrt to your first question: I don't seem to have this problem. Could you post an example of a cell that's having this problem? > > Recently, (actually inspired by the What editor ... thread) I have > had occasion to use Mathematica 7 as a text entry tool -- explanatory > text followed by numbered equations, followed by more text & more > numbered equations. By and large, it's proving an easier environment > for this sort of task than MS Word (and equation editor), though not > nearly as easy as WordPerfect's equation editor from 5.1 / 6 days. > > I have two (!) problems. > > 1. Text cells are just fine unless they include explanatory text with > either super or subscripts. When these are involved, it seems that > justification rules go out the window; one line might end halfway > across the window while another might go all the way to the end of the > window. I can get this effect simply by having something like > Subscript[F, z] in the middle of a text cell, and on looking a little > closer, commas appear to be the signal to start a new line > irrespective of whether it's appropriate to do so. How can I get text > cells to run to the end of the window when they are long enough to do > so, and still contain symbols with super & subscripts? > > 2. Upon printing, some _parts_ cells which contain text as well as > symbols and super & subscripts are printed with a darker background. > Why is this, and more importantly, how do I get rid of it? > > > Dave. === Subject: Re: Map onto one column of a matrix data = {{a, b}, {c, d}}; and we want to map a function onto just the second column, so we want > to end up with {{a, f[b]}, {c, f[d]}}. The best way I've found to do this is with MapAt: MapAt[f, data, Table[{i, 2}, {i, Length@data}]] Is there a better way? I keep hoping there's some notation similar to > what's used in Part that lets you refer to a whole column with All, You could try data[[All, 2]] = f /@ data[[All, 2]]; For instance, In[1]:= data = {{a, b}, {c, d}}; data[[All, 2]] = f /@ data[[All, 2]]; data Out[3]= {{a, f[b]}, {c, f[d]}} --Jean-Marc === Subject: Re: Map onto one column of a matrix Daniel, Perhaps data[[All, 2]] = f /@ data[[All, 2]] is what you're looking for? > > data = {{a, b}, {c, d}}; > > and we want to map a function onto just the second column, so we want > to end up with > > {{a, f[b]}, {c, f[d]}}. > > The best way I've found to do this is with MapAt: > > MapAt[f, data, Table[{i, 2}, {i, Length@data}]] > > Is there a better way? I keep hoping there's some notation similar to > what's used in Part that lets you refer to a whole column with All, > > -Daniel === Subject: Re: Map onto one column of a matrix This might seem more intuitive: data = {{a, b}, {c, d}} Replace[data, {x_, y_} :> {x, f@y}, 1] {{a, b}, {c, d}} {{a, f[b]}, {c, f[d]}} or Transpose@{data[[All, 1]], f /@ data[[All, 2]]} {{a, f[b]}, {c, f[d]}} Bobby > > data = {{a, b}, {c, d}}; > > and we want to map a function onto just the second column, so we want > to end up with > > {{a, f[b]}, {c, f[d]}}. > > The best way I've found to do this is with MapAt: > > MapAt[f, data, Table[{i, 2}, {i, Length@data}]] > > Is there a better way? I keep hoping there's some notation similar to > what's used in Part that lets you refer to a whole column with All, > > -Daniel > -- DrMajorBob@longhorns.com === Subject: Re: Map onto one column of a matrix try: data = {{a, b}, {c, d}}; data[[All, 2]] = f /@ data[[All, 2]] ; data hope this helps, Daniel data = {{a, b}, {c, d}}; and we want to map a function onto just the second column, so we want > to end up with {{a, f[b]}, {c, f[d]}}. The best way I've found to do this is with MapAt: MapAt[f, data, Table[{i, 2}, {i, Length@data}]] Is there a better way? I keep hoping there's some notation similar to > what's used in Part that lets you refer to a whole column with All, -Daniel > === Subject: Re: Map onto one column of a matrix Daniel, this may be what you're after: {#1, f[#2]} & @@@ data > > data = {{a, b}, {c, d}}; > > and we want to map a function onto just the second column, so we want > to end up with > > {{a, f[b]}, {c, f[d]}}. > > The best way I've found to do this is with MapAt: > > MapAt[f, data, Table[{i, 2}, {i, Length@data}]] > > Is there a better way? I keep hoping there's some notation similar to > what's used in Part that lets you refer to a whole column with All, > > -Daniel > > === Subject: Re: Map onto one column of a matrix data = {{a, b}, {c, d}}; MapAt[f, #, {-1}] & /@ data data /. {q_, r_?AtomQ} :> {q, f[r]} Jens data = {{a, b}, {c, d}}; and we want to map a function onto just the second column, so we want > to end up with {{a, f[b]}, {c, f[d]}}. The best way I've found to do this is with MapAt: MapAt[f, data, Table[{i, 2}, {i, Length@data}]] Is there a better way? I keep hoping there's some notation similar to > what's used in Part that lets you refer to a whole column with All, -Daniel > === Subject: Writing Assistant/Stylesheet Chooser problem I recently discovered the Writing Assistant palette. When I click on Stylesheet Chooser, the palette that opens only shows the left half of the window contents. I haven't found a way to resize the window to see the whole contents. This problem appears to be due to the fact that I have set the default magnification to 150%. When I change the default to 100%, I can see all of the contents. (This has been a problem in the past with earlier built-in palettes.) Does anyone know a fix? --Mark === Subject: sector-based analysis using FInancialData[] Does Mathematica 7 have sector index data available via the FinancialData[] function? I can get a list of sectors with this: FinancialData[Sectors] and I can get prices on the iShares funds which track sector indexes i.e: Dow Jones U.S. Consumer Goods Index (IYK), Dow Jones U.S. Consumer Services Index (IYC), Dow Jones U.S. Select Home Construction Index (ITB), S&P Global Consumer Discretionary Index (RXI), S&P Global Consumer Staples Index (KXI), Dow Jones U.S. Energy Sector Index Fund (IYE), Dow Jones U.S. Oil & Gas Exploration & Production Index Fund (IEO), Dow Jones U.S. Oil Equipment & Services Index Fund (IEZ) .. but these only give data back (at best) to 2000. Can I get data for the indexes themselves? If so where do I find the symbol names? Thx. === Subject: Re: Problem with NMinimize The NMinimize documentation states: For nonlinear functions, NMinimize may sometimes find only a local minimum It also mentions two solutions: Specifying a starting interval can help in achieving a better local minimum [-> See NMinimize doc section Possible issues to find out how] and Specifying a non-default method could give a better solution [--> See the Method option in the section Options] === Subject: Re: Problem in Dot Product of 4x4 Matrices with Chop[] the matrix. Bobby > > I'm a student studying in the Mechanical Engineering Department of > Technical University of Istanbul (ITU). > > I'm having problems in Mathematica. I use Mathematica for analyzing a > KUKA robot. First, I have to define related reference frames on the > robot's links according to DH, and then, I have to find the > transformation matrix that maps end-effector {E} to base {0}. When I try > to write the transformation matrix between the first two links (a dot > product of three 4x4 matrices (1 translation + 2 rotations)), > functions like 0.Sin[[Theta]], which, in turn, results in a HUGE > resultant matrix. > > products.. I mean, I don't want any terms multiplied by zero to appear > in my resultant matrix. > > -- DrMajorBob@longhorns.com === Subject: Shorthand for MapThread All - I frequently use Map and MapThread, and find Map's shorthand: f /@ {a,b,c} to be very convenient. As far as I can tell, MapThread has no corresponding infix notation. Can anyone tell me if it's possible (and if so, how) to make my own? E.g. f[#1,#2]& /@@ {{a,b,c},{d,e,f}} Marty === Subject: Locators with complete graph, Kn Hi All, I'm trying to create a complete graph with n vertices, with each vertex having a locator, so that I can drag the vertices to show isomorphic graphs to Kn. I'm able to create locators at specific locations (p1, p2 etc...), but am going round in circles trying to improve the code so that can dynamically generate locators at p1, p2, ..., pn. I've tried working with DynamicModule, but the code below seems like the closest to a solution. Manipulate[ ptpairs = Tuples[Table[{Cos[t], Sin[t]}, {t, 0, 2 Pi, 2 Pi/n}], 2]; pts = Tuples[Table[{Cos[t], Sin[t]}, {t, 0, 2 Pi, 2 Pi/n}], 1]; Graphics[ Line[{p1, p2}], PlotRange -> 2 ], {{p1, pts[[1]][[1]]}, Locator}, {{p2, pts[[2]][[1]]}, Locator}, {n, 2, 10, 1}] Any ideas or thoughts would be appreciated. Jamie === Subject: Re: Non-deterministic numerical inaccuracies in hello Bob yes, its a macbook running 2GHz Intel Core Duo. I haven't had a chance to test the code on 64bit Mac yet, but others have and say its fine. Peter 2009/1/2 David Bailey : >> Bob >> >> my mac is 32 bit and runs the code fine. >> Peter >> >> > Does it use an x86 chip (I am not sure)? Also, the details of the C > compiler may vary between operating systems. A long time ago, I used to > work on a Fortran compiler, and the fact that the coprocessor registers > held more bits that the variables whose value they represented, caused > some subtle problems! > > I am, of course, only guessing, but it is hard to see how else a bug > like this would arise! > > David Bailey > http://www.dbaileyconsultancy.co.uk > > === Subject: Hash function of strings Hello all. I'm trying to calculate the MD5 Hash function of a series of strings and I'm getting different results from the true MD5. I have searched the group and I have found that the Hash[] function is including the of the strings. A solution is proposed, creating a temporary file and then using FileHash. My problem is that I want to calculate the Hash of about one million strings, so creating temporary files is impossible. Can you think in a method to calculate the Hash very quickly, without the ? === Subject: How to plot strings s_i at point {x_i,y_i} ? Hello! I have a set of triplets {{x1,y1,s1},{x2,y2,s2},...}. I would like to make a plot where the third element of each triplet, a string, is plotted at the coordinate given by the the first two elements of the triplet. How can I acheive this? Of course I don't mind reorganizing the format of the data. It seems to me that PlotMarkers is not willing to help me, since I want different markes within the same data set. John === Subject: Re: Non-deterministic numerical inaccuracies in Mathematica 7 Excellent post. This confirms WRI's suspicions. > On Dec 30 2008, 4:53 am, Sjoerd C. de Vries= > Hi all, > > Last week Budgemano posted an issue which involved numericalinaccura= ci= > > esin Mathematica 7. Due to the xmas season it hasn't > > > > received much attention, or so it seems. > > Meanwhile, I've been able to drill the problem down to the following > code: > > myMod := Module[ > {p}, > Dot[{0.5018839897852984567457648, 0.544293499215831476457645674576, > 0.67220312964800834576456745674567}, {-0.5359693986690249`,= > -0.41257352636613975`, -0.736559494563862`}]*{-0.5359693986690249`, > -0.41257352636613975`, -0.736559494563862`} - {0.5579131132707782`, > 0.2715072333003815`, 0.7842300557273234`}] > > For[ii = 1, ii <= 250, ii++, > If[myMod =!= myMod, > Print[Iteration <> ToString[ii] <> fails comparison ]];] > > As you can see the module myMod is called twice every iteration. Its > calculations only involve constants, so the results should always be > the same. However, on my system (Mathematica 7.WinXP) the results diffe= r = > from one > call to the other at seemingly random times. > > > I believe I can tell you exactly why this is happening. It is not > caused by Mathematica. Google says that Mathematica uses the > Intel Math-Kernel-Library. We use the M.K.L. in our programs too, > and we see the same stuff. > > The bad news is that it is a consequence of the M.K.L. which can't > be avoided. The good news is that you should not care about it. > If the difference seems important then you are doing something > wrong. > > of many functions in their M.K.L. Basic-Linear-Algebra-System > (B.L.A.S.). One version works if the memory blocks that store the > data begin at a memory address that is a multiple of 16. This is > faster. If the data does not begin at a multiple of 16. All memory > blocks begin at a multiple of 8. > > The algorithms for the multiple of 16 are the same as the non- > multiple of 16, but the code is different. The fast code uses > the SSE registers. The slow code uses the FPU registers. > > Programs do not have any choice about where memory blocks begin. > When you use new to get an array in C++ the computer will pick > some memory block somewhere. Sometimes it begins at a memory > address that is divisible by 16. When that array is used by > the B.L.A.S. in the M.K.L. then the fast code is used. Other > times the slow code is used because the memory address is not > divisible by 16. Memory addresses are randomly chosen by the > computer's memory allocater. > > The B.L.A.S. algorithm is always the same. The only difference is > in the lowest order digits. The FPU registers dont work the same > as the SSE registers exactly. If you see big important > differences between the two results it means your results are > algorithm or a sensitive matrix. > > While you use a program that uses the Math-Kernel-Library you > will always see the non-deterministic numerical inaccuracies > if you use linear algebra and floating point numbers. This is > not caused by Mathematica, they are victims of Intel also!! > > On the 64-bit Intel CPU, there are no FPU registers, so there are > not two different implementations in the M.K.L. for functions. > The bug does not appear on 64-bit. There is a different M.K.L. > library from Intel for the 64-bit CPU. And also it only is > manufactured for Linux and Windows, not Mac. === Subject: Re: Non-deterministic numerical inaccuracies in Mathematica 7 > I believe I can tell you exactly why this is happening. But why this happens only with Mathematica 7 but not with Mathematica 5.2 and not with Mathematica 6? === Subject: Help with graphics and plots - corrupted installation Hi all, All of a sudden my Mathematica 7 installation stopped displaying graphics and plots and all output seems to be in plain text. I have ver 6 still installed and it works properly but the ver 7 is also producing an error message upon startup - DumpGet::bgcor: Binary file D:Program FilesWolfram ResearchMa<<52>>dowsFEKernelInit.mx is corrupted. Not sure what may have caused this nor how I can go about fixing it. Any suggestions appreciated, before I reinstall the whole thing === Subject: Re: Sound Spectrogram over time, in 3D, using Fourier? Hi Sjoerd, 1. I see that a returned Fourier number at position s corresponds to a frequency (s-1)/T Hz. What is the best way to get a frequency value (x) for every number in the list fourier returned (y=intensity)? I'd like to plot the data so that the x-axis values correspond to frequency. Dealing in Hertz, is T the sample duration in seconds? 5. What is the best way to collect a large number of DFTs and add them to a list? I'm guessing I need hundreds of DFTs in order to get a smooth 3D plot. Again, thank you. Justin === Subject: Re: Problem in Dot Product of 4x4 Matrices with Transcendental 2009/1/2 Arda Aytekin : > I want to ask one more question if possible. Yesterday, while I was > searching the discussion list for the keyword transcendental to see if my > question had been answered before, I noticed that Mathematica is capable of > writing Sin[[Theta]+[Alpha]] as s_[Theta][Alpha] (Sin[1+2] -> s12) so > that the result looks better (i.e. more compact). However, I cannot find the > related topic now. > > In the topic was some command like TrigTo.. but I couldn't find any > information on Mathematica's Documentation. Does Mathematica normally > contain such a function/command, or is it a part of some third-party package > to be installed? [I'm currently using v7] There exist numerous built-in functions to do such transformtations: *TrigFactor*, *TrigExpand*, *TrigReduce*, *TrigToExp*, as well as functions such as *Factor*, *Simplify*, or *FullSimplify* (usually with the help of the option *Trig*) to name a few. There are all well documented in the documentation center, with great variety of examples. Here is an example using the expression you mentioned. In[1]:= Sin[theta + alpha] // TrigExpand Out[1]= Cos[theta] Sin[alpha] + Cos[alpha] Sin[theta] In[2]:= % // TrigReduce Out[2]= Sin[alpha + theta] -- Jean-Marc === Subject: Re: Problem in Dot Product of 4x4 Matrices with Transcendental Hi Arda, One possible solution would be to use Chop on the result to make near- zero terms go to zero. Applying the rule 0. -> 0 to the result using ReplaceAll (postfix shortcut /.) will also work, if you do not have any other numbers in your result. > > I'm a student studying in the Mechanical Engineering Department of Techni= cal University of Istanbul (ITU). > > I'm having problems in Mathematica. I use Mathematica for analyzing a KUK= A robot. First, I have to define related reference frames on the robot's li= nks according to DH, and then, I have to find the transformation matrix tha= t maps end-effector {E} to base {0}. When I try to write the transformation= matrix between the first two links (a dot product of three 4x4 matrices (1= ome transcendental functions like 0.Sin[[Theta]], which, in turn, result= s in a HUGE resultant matrix. > ducts.. I mean, I don't want any terms multiplied by zero to appear in my r= esultant matrix. > === Subject: Re: Problem in Dot Product of 4x4 Matrices with Transcendental > I'm having problems in Mathematica. I use Mathematica for analyzing a KUKA > robot. First, I have to define related reference frames on the robot's links > according to DH, and then, I have to find the transformation matrix that maps > end-effector {E} to base {0}. When I try to write the transformation matrix > between the first two links (a dot product of three 4x4 matrices (1 > transcendental functions like 0.Sin[[Theta]], which, in turn, results in a > HUGE resultant matrix. products.. I mean, I don't want any terms multiplied by zero to appear in my > resultant matrix. Mathematica does not simplify automatically expressions that contain floating-point numbers (inexact arithmetic) and symbolic (exact) values (those are two different computational models). To simplify the resulting matrix you could use the built-in function *Rationalize* or, even better, only enter exact values in the original matrices. In[1]:= m1 = {{0., Sin[theta]}, {1., Cos[theta]}}; m2 = {{Cos[theta], Sin[theta]}, {-Sin[theta], Cos[theta]}}; m1.m2 Rationalize[m1.m2] Out[3]= {{0. Cos[theta] - Sin[theta]^2, 0. Sin[theta] + Cos[theta] Sin[theta]}, {1. Cos[theta] - Cos[theta] Sin[theta], Cos[theta]^2 + 1. Sin[theta]}} Out[4]= {{-Sin[theta]^2, Cos[theta] Sin[theta]}, {Cos[theta] - Cos[theta] Sin[theta], Cos[theta]^2 + Sin[theta]}} In[5]:= m1 = Rationalize[{{0., Sin[theta]}, {1., Cos[theta]}}] m2 = Rationalize[{{Cos[theta], Sin[theta]}, {-Sin[theta], Cos[theta]}}] m1.m2 Out[5]= {{0, Sin[theta]}, {1, Cos[theta]}} Out[6]= {{Cos[theta], Sin[theta]}, {-Sin[theta], Cos[theta]}} Out[7]= {{-Sin[theta]^2, Cos[theta] Sin[theta]}, {Cos[theta] - Cos[theta] Sin[theta], Cos[theta]^2 + Sin[theta]}} -- Jean-Marc === Subject: Re: Graph of some built-in functions blows up Mathematica V7 Roger, The same happens on my system which is the same as yours. A complete crash of Mathematica 7 and Mathematica 6 runs just fine. I'd suggest you contact the Wolfram support guys on this (http://support.wolfram.com/ if they haven't read this already) as it seems a serious issue. > Hello Mathematica UG: > > $Version = 7.0 for Microsoft Windows (32-bit) (November 10, 2008) > > The following commands are from a notebook downloaded from this > Mathworld page:http://mathworld.wolfram.com/DeltaFunction.html > > (f0 = {1/Pi [Epsilon]/(x^2 + [Epsilon]^2), [Epsilon] Abs[ > x]^([Epsilon] - 1), > 1/2/Sqrt[Pi [Epsilon]] Exp[-x^2/4/[Epsilon]], > 1/Pi/x Sin[x/[Epsilon]], 1/[Epsilon] AiryAi[x/[Epsilon]], > 1/[Epsilon] Re[BesselJ[1/[Epsilon], (x + 1)/[Epsilon]]], > Abs[1/[Epsilon] Exp[-x^2/[Epsilon]] > LaguerreL[n, 2 x/[Epsilon]]]}) // > ColumnForm // TraditionalForm > > << Graphics`Colors` (* gets deprecation errors in V7 *) > > Show[GraphicsArray[ > Block[{$DisplayFunction = Identity}, > Partition[ > Plot[Evaluate[ > Table[# /. {[Epsilon] -> e, > n -> 1}, {e, .1, .2, .02}]], {x, -3, 3}, > PlotRange -> atic, {0, > 3}}, {Automatic, All}], > AxesLabel -> TraditionalForm /@ {x, HoldForm[#] /. n -> 1}= , > PlotStyle -> {Red, Orange, Yellow, Green, Blue, Violet}] &= /@ > f0, 3, 3, {1, 1}, {}]]] (*,GraphicsSpacing->{-.15,.2} *)] > > It runs for a while then a box comes up titled Formatting Notebook > contents. Then Mathematica blows up. > > This same code does run in Mathematica V6. > > Since it does not issue an error message, I am not sure how to isolate > what is wrong other than removing the functions from f0, one-by-one. > > If anyone has another approach to take, I would appreciate any advice. > > TIA. > > > Roger Williams > Franklin Laboratory === Subject: Re: Graph of some built-in functions blows up Mathematica V7 that is a bug and you should remove the GraphicsArray[] (f0 = {1/Pi [Epsilon]/(x^2 + [Epsilon]^2), [Epsilon] Abs[ x]^([Epsilon] - 1), 1/2/Sqrt[Pi [Epsilon]] Exp[-x^2/4/[Epsilon]], 1/Pi/x Sin[x/[Epsilon]], 1/[Epsilon] AiryAi[x/[Epsilon]], 1/[Epsilon] Re[BesselJ[1/[Epsilon], (x + 1)/[Epsilon]]], Abs[1/[Epsilon] Exp[-x^2/[Epsilon]] LaguerreL[n, 2 x/[Epsilon]]]}) Partition[ Plot[Evaluate[ Table[# /. {[Epsilon] -> e, n -> 1}, {e, .1, .2, .02}]], {x, -3, 3}, PlotRange -> 3}}, {Automatic, All}], AxesLabel -> TraditionalForm /@ {x, HoldForm[#] /. n -> 1}, PlotStyle -> {Red, Orange, Yellow, Green, Blue, Brown}] & /@ f0, 2] work fine. Jens > Hello Mathematica UG: $Version = 7.0 for Microsoft Windows (32-bit) (November 10, 2008) The following commands are from a notebook downloaded from this > Mathworld page: http://mathworld.wolfram.com/DeltaFunction.html > (f0 = {1/Pi [Epsilon]/(x^2 + [Epsilon]^2), [Epsilon] Abs[ > x]^([Epsilon] - 1), > 1/2/Sqrt[Pi [Epsilon]] Exp[-x^2/4/[Epsilon]], > 1/Pi/x Sin[x/[Epsilon]], 1/[Epsilon] AiryAi[x/[Epsilon]], > 1/[Epsilon] Re[BesselJ[1/[Epsilon], (x + 1)/[Epsilon]]], > Abs[1/[Epsilon] Exp[-x^2/[Epsilon]] > LaguerreL[n, 2 x/[Epsilon]]]}) // > ColumnForm // TraditionalForm << Graphics`Colors` (* gets deprecation errors in V7 *) Show[GraphicsArray[ > Block[{$DisplayFunction = Identity}, > Partition[ > Plot[Evaluate[ > Table[# /. {[Epsilon] -> e, > n -> 1}, {e, .1, .2, .02}]], {x, -3, 3}, > PlotRange -> > 3}}, {Automatic, All}], > AxesLabel -> TraditionalForm /@ {x, HoldForm[#] /. n -> 1}, > PlotStyle -> {Red, Orange, Yellow, Green, Blue, Violet}] & /@ > f0, 3, 3, {1, 1}, {}]]] (*,GraphicsSpacing->{-.15,.2} *)] It runs for a while then a box comes up titled Formatting Notebook > contents. Then Mathematica blows up. This same code does run in Mathematica V6. Since it does not issue an error message, I am not sure how to isolate > what is wrong other than removing the functions from f0, one-by-one. If anyone has another approach to take, I would appreciate any advice. TIA. > Roger Williams > Franklin Laboratory > === Subject: Fourier Transform Graph Coordinates Hi all, I am wanting to compare Fourier Transform graphs in a Java Program. For thi= s I need the coordinates, or graph points of the created Fourier Transform = graph. For example using the Mathematica example: In[]:= Fourier[{-1,-1,-1,-1,1,1,1,1}] Out[]:= {0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 - 1.70= 711 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 - 0.29= 2893 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 + 0.29= 2893 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 + 1.7= 0711 [ImaginaryI]} In[]:= ListPlot[Abs[Fourier[{-1, -1, -1, -1, 1, 1, 1, 1}]], Out[]:= A zig zag graph. I want the coordinates of this graph. I have tried exporting it as a table = but it is indecipherable. Idealy the graph would be in the style: X Y 1 10 2 23 3 24 4 27 5 31 Etc The style is not the concern though it is just getting the data which gener= ates the graph. Yours David Fourie BSc Computer Science David.fourie@ncl.ac.uk MPhil Computational Neuroscience D809 ext - 8593 === Subject: MathLinkException ErrorCode 11 Can anyone give me a hint about what this might mean? I'm getting an exception when I call the Compute() command, which looks like this: Wolfram.NETLink.MathLinkException: Error code: 11. Connected MathLink program has closed the link, but there might still be data underway. at Wolfram.NETLink.WrappedKernelLink.NextPacket() at Wolfram.NETLink.KernelLinkImpl.WaitForAnswer() at Wolfram.NETLink.MathKernel.Connect() at Wolfram.NETLink.MathKernel.Compute() at Wolfram.NETLink.MathKernel.Compute(String input) at ...... This code is running in a web service, and it's possible that more than one instance of the service is trying to create a kernel and compute on it at the same time...could this be causing the problem? === Subject: Re: Test for composite digit Correction. There was a case where FixedPoint did not converge, for instance on next3[98304], where 9 is replaced by Infinity rather than extending the digit-list. Below is a code that works and is also simpler. Note that stick is so named because it sticks with any legal digit string it reaches. Part of the point was to generalize as much as I could. Redefine allowed, and you'll get entirely different results. FixedPoint iterations are limited (I think) to the number of digits in the input, and they're pretty FAST iterations. Clear[allowed, minAllowed, ok3, better, stick, next4, take] allowed[n_Integer?Positive] := {{4, 6, 8, 9}, {0, 1, 2, 3, 5, 7}}[[ Mod[n, 2, 1]]] minAllowed[n_Integer?Positive] := Min@allowed@n take[a_List, 0] = {minAllowed@1}; take[a_List, k_Integer] := Take[a, k] ok3[k_, {j_}] := MemberQ[allowed[j], k] better[9, _] = {Infinity}; better[k_, j_] := better[k, j] = {Min@Complement[allowed[j], Range[0, k]]} stick[d : {Infinity, ___Integer}] := minAllowed /@ Range[1 + Length@d] stick[d : {left___Integer, x_Integer, Infinity, right___Integer}] := Join[{left}, better[x, 1 + Length@{left}], minAllowed /@ Range[2 + Length@{left}, Length@d]] stick[d : {__Integer}] := Module[{k, bad = Position[MapIndexed[ok3, d], False, 1, 1]}, If[bad == {}, d, bad = bad[[1, 1]]; k = d[[bad]]; Join[take[d, bad - 1], better[k, bad], minAllowed /@ Range[bad + 1, Length@d]] ] ] test4 = Rest@NestList[next4, 98304, 100]; // Timing {0.009854, Null} test2 = Rest@NestList[next2, 98304, 100]; // Timing {8.75782, Null} test2 == test4 True next5[n_Integer] := Length@Rest@FixedPointList[stick, IntegerDigits[n + 1]] test[n_] := Tally[next5 /@ RandomInteger[{10^6, 10^7}, n]] test[10000] // Timing {2.10739, {{3, 5369}, {2, 3200}, {4, 1362}, {1, 58}, {7, 1}, {5, 9}, {6, 1}}} Bobby > A less confusing version: > > Clear[allowed, ok3, better, stick, next3] > allowed[n_Integer? > Positive] := {{4, 6, 8, 9}, {0, 1, 2, 3, 5, 7}}[[Mod[n, 2, 1]]] > minAllowed[n_Integer?Positive] := Min@allowed@n > maxAllowed[n_Integer?Positive] := Max@allowed@n > ok3[k_, {j_}] := MemberQ[allowed[j], k] > better[k_, j_] := > better[k, j] = {Min@Complement[allowed[j], Range[0, k]]} > stick[d : {one_Integer, ___Integer}] /; ! ok3[one, {1}] := > > If[one > maxAllowed@1, > minAllowed /@ Range[1 + Length@d], > Join[better[one, 1], minAllowed /@ Range[2, Length@d]] > ] > stick[d : {one_Integer, two_Integer, ___Integer}] /; ! ok3[two, {2}] := > > If[ > two > maxAllowed@2, > Join[better[one, 1], minAllowed /@ Range[2, Length@d]], > Join[{one}, better[two, 2], minAllowed /@ Range[3, Length@d]] > ] > stick[d : {__Integer}] /; > Position[MapIndexed[ok3, d], False, 1, 1] == {} := d > stick[d : {__Integer}] := > Module[{k, bad = Position[MapIndexed[ok3, d], False, 1, 1][[1, 1]]}, > k = d[[bad]]; > If[ > k > maxAllowed@bad, > Join[Take[d, bad - 2], better[k, bad - 1], > minAllowed /@ Range[bad, Length@d]], > Join[Take[d, bad - 1], better[k, bad], > minAllowed /@ Range[bad + 1, Length@d]] > ] > ] > > RandomInteger[{1, 7*10^5}] > next2@% // Timing > next3@%% // Timing > > 354808 > > {1.39235, 404040} > > {0.000342, 404040} > > Bobby > > >> Something like this (naive but effective): >> >> Clear[ok1, composite, next1] >> composite[n_] := n > 1 && ! PrimeQ@n >> SetAttributes[composite, Listable] >> ok1[n_] /; 1000 <= n <= 9999 := >> Module[{digits = IntegerDigits[n]}, {True, False, True, False} == >> composite@digits] >> ok1[n_] /; 100 <= n <= 999 := >> Module[{digits = IntegerDigits[n]}, {True, False, True} == >> composite@digits] >> next1[n_Integer] /; n < 10^4 := >> Module[{k = n + 1}, While[k < 10^4 && ! ok1@k, k++]; k] >> >> test1 = Rest@NestList[next1, 844, 100] >> >> {854, 856, 858, 859, 874, 876, 878, 879, 904, 906, 908, 909, 914, >> 916, 918, 919, 924, 926, 928, 929, 934, 936, 938, 939, 954, 956, 958, >> 959, 974, 976, 978, 979, 4040, 4041, 4042, 4043, 4045, 4047, 4060, >> 4061, 4062, 4063, 4065, 4067, 4080, 4081, 4082, 4083, 4085, 4087, >> 4090, 4091, 4092, 4093, 4095, 4097, 4140, 4141, 4142, 4143, 4145, >> 4147, 4160, 4161, 4162, 4163, 4165, 4167, 4180, 4181, 4182, 4183, >> 4185, 4187, 4190, 4191, 4192, 4193, 4195, 4197, 4240, 4241, 4242, >> 4243, 4245, 4247, 4260, 4261, 4262, 4263, 4265, 4267, 4280, 4281, >> 4282, 4283, 4285, 4287, 4290, 4291} >> >> If you ALWAYS want to start with a composite digit and alternate, you >> could generalize to >> >> Clear[composite, ok2] >> composite[n_] := MemberQ[{4, 6, 8, 9}, n] >> SetAttributes[composite, Listable] >> ok2[digits_List] := >> MatchQ[composite@ >> digits, {PatternSequence[True, False] ..} | {PatternSequence[True, >> False] .., True} | {True}] >> ok2[n_Integer] := ok2@IntegerDigits@n >> ok2[other_] = False; >> next2[n_Integer] := Module[{k = n + 1}, While[! ok2@k, k++]; k] >> >> test2 = Rest@NestList[next2, 844, 100] >> >> {854, 856, 858, 859, 874, 876, 878, 879, 904, 906, 908, 909, 914, >> 916, 918, 919, 924, 926, 928, 929, 934, 936, 938, 939, 954, 956, 958, >> 959, 974, 976, 978, 979, 4040, 4041, 4042, 4043, 4045, 4047, 4060, >> 4061, 4062, 4063, 4065, 4067, 4080, 4081, 4082, 4083, 4085, 4087, >> 4090, 4091, 4092, 4093, 4095, 4097, 4140, 4141, 4142, 4143, 4145, >> 4147, 4160, 4161, 4162, 4163, 4165, 4167, 4180, 4181, 4182, 4183, >> 4185, 4187, 4190, 4191, 4192, 4193, 4195, 4197, 4240, 4241, 4242, >> 4243, 4245, 4247, 4260, 4261, 4262, 4263, 4265, 4267, 4280, 4281, >> 4282, 4283, 4285, 4287, 4290, 4291} >> >> test1 == test2 >> >> True >> >> All that gets very slow for large n, however, so (slightly awkward)... >> >> Clear[allowed, ok3, better, stick, next3] >> allowed[n_Integer? >> Positive] := {{4, 6, 8, 9}, {0, 1, 2, 3, 5, 7}}[[Mod[n, 2, 1]]] >> ok3[k_, {j_}] := MemberQ[allowed[j], k] >> better[k_, j_] := {Min@Complement[allowed[j], Range[0, k]]} >> stick[d_List] /; VectorQ[d, IntegerQ] := >> Module[{k, firstBad = Position[MapIndexed[ok3, d], False, 1, 1]}, >> Which[ >> firstBad == {}, d, >> firstBad == {{1}}, >> If[(k = d[[1]]) > Max@allowed@1, >> Min /@ allowed /@ Range[1 + Length@d], >> Join[better[k, 1], Min /@ allowed /@ Range[2, Length@d]] >> ], >> firstBad == {{2}}, If[ >> (k = d[[2]]) > Max@allowed@2, >> Join[{1 + d[[1]]}, Table[Min@allowed@k, {k, 2, Length@d}]], >> Join[{d[[1]]}, better[k, 2], >> Min /@ allowed /@ Range[3, Length@d]] >> ], >> True, firstBad = firstBad[[1, 1]]; If[ >> (k = d[[firstBad]]) > Max@allowed@firstBad, >> Join[Take[d, firstBad - 2], {1 + d[[firstBad + 1]]}, >> Table[Min@allowed@k, {k, firstBad, Length@d}]], >> Join[Take[d, firstBad - 1], better[k, firstBad], >> Min /@ allowed /@ Range[firstBad + 1, Length@d]] >> ] >> ] >> ] >> >> RandomInteger[{1, 7*10^5}] >> next2@% // Timing >> next3@%% // Timing >> >> 194872 >> >> {5.74494, 404040} >> >> {0.000277, 404040} >> >> Bobby >> >> >>> Math folks, >>> >>> I am trying to write an algorithm which will test for a digit within a >>> number being composite, i.e. {4, 6, 8, or 9} >>> >>> For example: >>> >>> Let's say I start with the number 844. The next number in my sequence >>> will be the smallest number greater than 844 which satisfies: >>> >>> 1) a three digit number with first and third digits composite, and the >>> second digit not composite, or a >>> 2) a four digit number with first and third digits composite, and the >>> second and fourth digits not composite. >>> >>> The answer will be 854, and I want the algorithm to be able to find >>> this. >>> >>> I may then want to find a number of any specified arbitrary length >>> with digits composite or not composite as desired. >>> >>> >>> Diana >>> >> >> >> > > > -- DrMajorBob@longhorns.com === Subject: Problems combining new v7.0 Image command with other graphics The new image processing features of Mathematica are very useful and very much needed at least for my work. There are, however, three key features that are missing in my opinion or are implemented in an inconsistent fashion: 1) The ability to manipulate image data that is not scaled between 0 and 1. In many cases image data represent useful physical information (e.g. brightness of stars, temperature etc...) which are usually encoded in reals. Scaling everything between 0 and 1 to be able apply the image processing routines like ImageCrop[], ImageTake[] and ImagePartition[] seems clumsy and unnecessary. My previous experience with the IDL language didn't require jumping through these kind of hoops. Note that the Raster[] command does give the possibility of scaling data on the fly for display. 2) The ability to apply image processing to user defined regions. It would be very useful to be able to define regions of interest (say with polygons) and apply image processing or information extraction techniques to this region only instead of treating the whole image. 3) Inconsistent behaviour with respect to combined graphics. An example is given below illustrating how difficult it is to combine Image data with other Mathematica graphics. The fact that the Show[] command works with a single image but not with multiple image + graphic combinations seems to be inconsistent with the syntax and purpose of the Show[] command. Using Raster[] we get the expected behaviour but cannot use the new image processing routines of v. 7.0. If you have any work arounds for the above problems or comments I would be interested in hearing these. Mac Example: Generate an small test image img = RandomReal[{0, 1}, {100, 200}]; This works and produces a graphic in the notebook Image[img] This also works Show[Image[img]] However, although show works with a single image, showing several graphics combined produces the error Image is not a Graphics primitive even though the Show[] syntax is respected. Show[Image[img, ImageSize -> 200], Graphics@Circle[]] This also produces a the same error Graphics@Image[img] whereas graphics can be combined using the old-fashioned Raster command without problem Show[Graphics@Raster[img], Graphics[{Red, Circle[{100, 50}, 40]}]] === Subject: loading autosaved package using Needs[] according to comment at the top of autosaved packages, these files can be loaded using Needs[] instead of Get[]. (************************************************************************) (* This file was generated automatically by the Mathematica front end. *) (* It contains Initialization cells from a Notebook file, which *) (* typically will have the same name as this file except ending in *) (* .nb instead of .m. *) (* *) (* This file is intended to be loaded into the Mathematica kernel using *) (* the package loading commands Get or Needs. Doing so is equivalent *) (* to using the Evaluate Initialization Cells menu command in the front *) (* end. *) (************************************************************************) it doesn't work for me... Needs[phd_thesis_common.m] Needs::cxt: Invalid context specified at position 1 in Needs[phd_thesis_common.m]. A context must consist of valid symbol names separated by and ending with `. >> any help/suggestions appreciated. Mitch === Subject: Re: Non-deterministic numerical inaccuracies in Mathematica 7 > On Dec 30 2008, 4:53 am, Sjoerd C. de Vries= > Hi all, > > Last week Budgemano posted an issue which involved numerical inaccur= acies > in Mathematica 7. Due to the xmas season it hasn't > > received much attention, or so it seems. > > Meanwhile, I've been able to drill the problem down to the following > code: > > myMod := Module[ > {p}, > Dot[{0.5018839897852984567457648, 0.544293499215831476457645674576, > 0.67220312964800834576456745674567}, {-0.5359693986690249`,= > -0.41257352636613975`, -0.736559494563862`}]*{-0.5359693986690249`, > -0.41257352636613975`, -0.736559494563862`} - {0.5579131132707782`, > 0.2715072333003815`, 0.7842300557273234`}] > > For[ii = 1, ii <= 250, ii++, > If[myMod =!= myMod, > Print[Iteration <> ToString[ii] <> fails comparison ]];] > > As you can see the module myMod is called twice every iteration. Its > calculations only involve constants, so the results should always be > the same. However, on my system (Mathematica 7.WinXP) the results diffe= r = > from one > call to the other at seemingly random times. > > > I believe I can tell you exactly why this is happening. It is not > caused by Mathematica. Google says that Mathematica uses the > Intel Math-Kernel-Library. We use the M.K.L. in our programs too, > and we see the same stuff. > > The bad news is that it is a consequence of the M.K.L. which can't > be avoided. The good news is that you should not care about it. > If the difference seems important then you are doing something > wrong. > > of many functions in their M.K.L. Basic-Linear-Algebra-System > (B.L.A.S.). One version works if the memory blocks that store the > data begin at a memory address that is a multiple of 16. This is > faster. If the data does not begin at a multiple of 16. All memory > blocks begin at a multiple of 8. > > The algorithms for the multiple of 16 are the same as the non- > multiple of 16, but the code is different. The fast code uses > the SSE registers. The slow code uses the FPU registers. > > Programs do not have any choice about where memory blocks begin. > When you use new to get an array in C++ the computer will pick > some memory block somewhere. Sometimes it begins at a memory > address that is divisible by 16. When that array is used by > the B.L.A.S. in the M.K.L. then the fast code is used. Other > times the slow code is used because the memory address is not > divisible by 16. Memory addresses are randomly chosen by the > computer's memory allocater. > > The B.L.A.S. algorithm is always the same. The only difference is > in the lowest order digits. The FPU registers dont work the same > as the SSE registers exactly. If you see big important > differences between the two results it means your results are > algorithm or a sensitive matrix. > > While you use a program that uses the Math-Kernel-Library you > will always see the non-deterministic numerical inaccuracies > if you use linear algebra and floating point numbers. This is > not caused by Mathematica, they are victims of Intel also!! > > On the 64-bit Intel CPU, there are no FPU registers, so there are > not two different implementations in the M.K.L. for functions. > The bug does not appear on 64-bit. There is a different M.K.L. > library from Intel for the 64-bit CPU. And also it only is > manufactured for Linux and Windows, not Mac. I work on a Linux platform that happens to show the two results. In a debug kernel I was able to ascertain that this even/odd alignment mod 8 is in fact the cause. Specifically, we get two possible results for the following input. myMod5 := Dot[{0.50188398978529847, 0.54429349921583148, 0.67220312964800832}, {-0.53596939866902493, -0.41257352636613975, -0.73655949456386205}] As one can see below, myMod5 will give one of two results. In[86]:= InputForm[myMod5] Out[86]//InputForm= -0.988673145974262 In[87]:= InputForm[myMod5] Out[87]//InputForm= -0.9886731459742619 Use of Module/Block, Table/Do, etc. are sort of red herrings. They do in fact affect the outcome, but I believe that is because they affect the memory layout in some subtle way. For example, if I do Do[Print[InputForm[myMod5]],{20}] I see the less precise result (the one ending ...262 ). If instead I do InputForm[Table[myMod5,{20}]] I only see the more precise result (ending in ...2619). But when I just enter InputForm[myMod5] (as above, In[86] and In[87]), I can get either result. Tracking in a debugger revealed that the one with the more precision arises when one or both addresses of the vector are equal to 8 mod 16 (that is, aligned to 8 but not 16 bytes). The less precise result appears only to happen when both vectors are aligned to 16 bytes. The code that produces these results is ddot in the MKL. My own theory, apparently incorrect, was that registers were all the same but that store-to-memory happened in ways that depended on vagaries of register availability. But this theory might account for the following similar item, that showed up in some private email I recently had regarding platform dependent differences of the logistic map. x = 0.052903130124606165; On a 64 bit Linux OS: In[24]:= InputForm[x = 4*x*(1 - x)] In[25]:= InputForm[x = 4*x*(1 - x)] Out[25]//InputForm= 0.6410014364858487 On a 32-bit Linux OS: In[23]:= InputForm[x = 4*x*(1 - x)] In[24]:= InputForm[x = 4*x*(1 - x)] Out[24]//InputForm= 0.6410014364858488 This platform dependent behavior is by no means a bug; it just shows that IEEE arithmetic can give rise to different results depending on usage of extended precision registers and intermediate stores. I do not know whether the different results on one platform, due to alignment dependent MKL behavior, is regarded as a bug by the developers of that library. analysis of the issue. Even the things that turned out to be red herrings seem interesting (and were by no means obviously off the mark). Daniel Lichtblau Wolfram Research === Subject: generalization of Bernoulli numbers to Pascal types Here is a new way to use the exponential like expansions to get a generalized Bernoulli number B(n,m): ( I thought of these about a week ago, but just got around to getting Mathematica to give me an expansion) I tried the (2*n-1)!! version but Mathematica failed on it. Here is the code if anyone can get it to work: Clear[p] Table[(2*n - 1)!!, {n, 0, 10}] p[x] = FullSimplify[1/Sum[x^(n - 1)/(2*n - 1)!!, {n, 1, Infinity}]] Table[ SeriesCoefficient[ Series[p[x], {x, 0, 30}], n], {n, 0, 30}] %I A154242 %S A154242 1,3,45,1890,56700,748440,10216206000,8756748000,2841962760000, %T A154242 24946749107280000,8232427205402400000,103279541304139200000, %U A154242 3101484625363300176000000,1431454442475369312000000 %N A154242 Bernoulli like expansion of polynomials: 1/Sum[x^(n - 1)/((2*n)!/n!), {n, 1, Infinity}]=2* Exp[-x/4] *Sqrt[x]/(Sqrt[Pi]*Erf[Sqrt[x]/2]). denominators of the rational sequence. %C A154242 The row sum sequences of the Pascal types are: %C A154242 row(n,m)={2^n,n!,2^n*n!,(2*n-1)!!,(2*n)!/n!}. Each one can be expanded as a Bernoulli like: %C A154242 f(x)=x/(Sum[x^n/Row(n,m),{n,0,Infinity}]-1)=Sum[B[n,m]*x^n/n!,{n,0,Infinity} ]; %C A154242 Here the m=4. %F A154242 a(n)=Denominator[Expansion[1/Sum[x^(n - 1)/((2*n)!/n!), {n, 1, Infinity}]=2* Exp[-x/4] *Sqrt[x]/(Sqrt[Pi]*Erf[Sqrt[x]/2])]]. %t A154242 Clear[p]; p[x] = FullSimplify[1/Sum[x^(n - 1)/((2*n)!/n!), {n, 1, Infinity}]]; %t A154242 Table[ Denominator[SeriesCoefficient[Series[p[x], {x, 0, 30}], n]], {n, 0, 30}] %K A154242 nonn %O A154242 0,2 %I A154243 %S A154243 2,1,1,1,1,1,23,23,157,97051,1614583,331691,1418383997,5720927, %T A154243 1868325937,1207461869239,118209298450003,3069893653, %U A154243 14303719087308533,65108016166881997,310766859240153209819 %V A154243 2,-1,1,-1,-1,1,23,-23,157,97051,-1614583,-331691,1418383997,-5720927, %W A154243 -1868325937,1207461869239,118209298450003,-3069893653, %X A154243 -14303719087308533,65108016166881997,-310766859240153209819 %N A154243 Bernoulli like expansion of polynomials: 1/Sum[x^(n - 1)/((2*n)!/n!), {n, 1, Infinity}]=2* Exp[-x/4] *Sqrt[x]/(Sqrt[Pi]*Erf[Sqrt[x]/2]). numerators of the rational sequence. %C A154243 The row sum sequences of the Pascal types are: %C A154243 row(n,m)={2^n,n!,2^n*n!,(2*n-1)!!,(2*n)!/n!}. Each one can be expanded as a Bernoulli like: %C A154243 f(x)=x/(Sum[x^n/Row(n,m),{n,0,Infinity}]-1)=Sum[B[n,m]*x^n/n!,{n,0,Infinity} ]; %C A154243 Here the m=4. %F A154243 a(n)=Numerator[Expansion[1/Sum[x^(n - 1)/((2*n)!/n!), {n, 1, Infinity}]->2* Exp[-x/4] *Sqrt[x]/(Sqrt[Pi]*Erf[Sqrt[x]/2])]]. %t A154243 Clear[p]; p[x] = FullSimplify[1/Sum[x^(n - 1)/((2*n)!/n!), {n, 1, Infinity}]]; %t A154243 Table[ Numerator[SeriesCoefficient[Series[p[x], {x, 0, 30}], n]], {n, 0, 30}] %K A154243 sign %O A154243 0,1 -- Respectfully, Roger L. Bagula 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :http://www.geocities.com/rlbagulatftn/Index.html alternative email: rlbagula@sbcglobal.net === Subject: Re: a LOT of Mathematica bugs (some very old) I can respond to a few of these. > [...] > Terrible Performance > > x = IE; > Timing[Do[x = x /. IE -> E^(IE/E), {12}]; x] > > {4.687, E^E^(-1 + > E^(-1 + E^(-1 + > E^(-1 + E^(-1 + > E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + IE/E)))))))))= ))} > > mathematica 2.2 do it in a flash : > [...] Here is a more direct example: Timing[Im[-1 - E^ (-1 - E^(-1 - E^(-1 - E^(-1 - E^(-1 - E^(-1 - E^(-1 - E^(-1 - e^ (-1)))))))))]] This slowdown is currently under investigation. My hope is to restore something closer to the old behavior. Though the code is sufficiently complex that I make no guarantees in this regard. I should mention that there are similar examples where the speed improves significantly between versions 2.2 and later. Here is one such. Timing[(-1/5 + (47*I)/20) ^ (1/10000)] > SparseArray > [...] > ******* > Mathematica eats a lot system memory when this sparseArray > is (eg 300 x 300 x300) - Is it needed/by design ? > > gg = SparseArray[{i_, j_, 1} -> 1, {300, 300, 300}]; Using rules with patterns causes level recursion and substantial index iteration in the process of constructing the sparse array. This in turn seems to require considerable memory. One can generally improve on this situation by giving explicit pattern-free rules. dim1 = 200; dim2 = 200; dim3 = 100; In[28]:= Timing[gg1 = SparseArray[{i_, j_, 1} -> 1, {dim1, dim2, dim3}];] Out[28]= {2.12668, Null} In[29]:= Timing[gg2 = SparseArray[Flatten[Table[{i, j, 1} -> 1, {i,dim1}, {j,dim2}]], {dim1, dim2, dim3}];] Out[29]= {0.140978, Null} f you set all dimensions to 300, gg2 will build without fuss in around 0.27 seconds on my machine.On a machine with substantial memory and good speed, I can get gg1 in around 14 seconds (I really did not want to risk hanging my own desktop). > ********* > generated output does not mach the display > > ReplaceAll[ > Plus[Times[-1, Power[E, Times[1, Power[x, -1]]]], > Power[E, Plus[Times[1, Power[x, -1]], Power[x, Times[-1, x]]]]], > Rule[x, DirectedInfinity[-1]]] I see a result of Indeterminate. I believe that to be a viable outcome for this input. > ******************* > Sum[(-x k)^k, {k, 0, Infinity}] > ******************* > Function tends to Log[2] > f[k2_] = N[-1 Sum[(1/k) (-1)^k, {k, 1, k2}]] // FullSimplify > > But this series diverges > NSum[ (-1)^k (f[k]/k), {k, 1, Infinity}] > [...] I suspect NSum gets fooled, using default behavior, from having insufficiently many points to assess convergence. One gets what I think is a better result by using more terms. NSum[ (-1)^k (f[k]/k), {k, 1, Infinity}, NSumTerms->200] This gives -1.06272 + small imaginary part. Alternatively one can tell NSum to not check for convergence. In[61]:= NSum[ (-1)^k (f[k]/k), {k, 1, Infinity}, VerifyConvergence- >False] SequenceLimit::seqlim: The general form of the sequence could not be determined, and the result may be incorrect. Out[61]= -1.07067 I do not know if the claim of divergence is a bug or a feature. Daniel Lichtblau Wolfram Research === Subject: Re: a LOT of Mathematica bugs (some very old) The bug below need the package here to visualize or > generated output does not mach the display > > ReplaceAll[ > Plus[Times[-1, Power[E, Times[1, Power[x, -1]]]], > Power[E, Plus[Times[1, Power[x, -1]], Power[x, Times[-1, x]]]]], > Rule[x, DirectedInfinity[-1]]] Bob Hanlon escreveu: > In your first example just increase the working precision > > Plot[2^-s LerchPhi[-1, s, 1/2], {s, -6.75, -7}, > WorkingPrecision -> 20] > > > > Bob Hanlon > > > > control error > Plot[2^-s LerchPhi[-1, s, 1/2], {s, -6.75, -7}] > > > Same expression not FullSimplify (ing) - not bug? > {E^(-(((1 + E) (E + E^(-(1 + E) [Pi])))/E)), > E^((-1 - E) (1 + E^(-1 - (1 + E) [Pi])))} // FullSimplify > > ********************************************** > Terrible Performance > > x = IE; > Timing[Do[x = x /. IE -> E^(IE/E), {12}]; x] > > {4.687, E^E^(-1 + > E^(-1 + E^(-1 + > E^(-1 + E^(-1 + > E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + IE/E)))))))))))} > > mathematica 2.2 do it in a flash : > > x=IE; > Timing[Do[x=x/.IE->E^(IE/E),{12}];x] > > {0. Second, Power[E, Power[E, > > -1 + Power[E, -1 + Power[E, > > -1 + Power[E, -1 + Power[E, > > -1 + IE/E > -1 + E > -1 + E > -1 + E > -1 + E > -1 + E > -1 + E ]]]]]]} > > try this to hang the system > > x = IE; > Timing[Do[x = x /. IE -> E^(IE/E), {15}]; x] > > > > SparseArray > > ss = SparseArray[{i_, j_, 1} -> 1, {4, 4, 4}] > ss // MatrixForm > Map[Sin, ss] // MatrixForm (*Fails*) > ss // FullForm > Map[Sin, ss] // FullForm > > > > ******* > Mathematica eats a lot system memory when this sparseArray > is (eg 300 x 300 x300) - Is it needed/by design ? > > gg = SparseArray[{i_, j_, 1} -> 1, {300, 300, 300}]; > ********* > generated output does not mach the display > > ReplaceAll[ > Plus[Times[-1, Power[E, Times[1, Power[x, -1]]]], > Power[E, Plus[Times[1, Power[x, -1]], Power[x, Times[-1, x]]]]], > Rule[x, DirectedInfinity[-1]]] > > ******************* > Sum[(-x k)^k, {k, 0, Infinity}] > ******************* > Function tends to Log[2] > f[k2_] = N[-1 Sum[(1/k) (-1)^k, {k, 1, k2}]] // FullSimplify > > But this series diverges > NSum[ (-1)^k (f[k]/k), {k, 1, Infinity}] > > ********************** > version 6 (ok) - 7 results differs > > InverseLaplaceTransform[E^((1 - Sqrt[1 + 4*s])/2), s, t] > **************** === Subject: Front end tokens and window maximization I was wondering if there is anywhere to get a list of all of the front end tokens? I know you can see the key mappings and menu mappings in the MenuSetup.tr and KeyEventTranslations.tr files, but there are many front end tokens not listed in these files. Also, does anyone know the front end token for window maximization? FrontEndTokenExecute[nb, WindowMiniaturize] Does anyone know a similar one for maximization? Of course, having a list of all tokens would make life much easier! Jason === Subject: Re: Please answer to my questions,thank you. Hi Olfa, [comments between your text lines] > 1-reduce: f(f(f(...(v) i times=f(f(f(...(w) j times. I've tried nest = like this: > Nest[f,v,i]=C5 Nest[f,w,j] > , but I have this error: > Nest::intnm: Non-negative machine-size integer expected at position 3 in = Nest[f,v,i] and > Nest::intnm: Non-negative machine-size integer expected at position 3 in = Nest[f,w,j] > =C2 Well, Mathematica is really gung-ho to get to work for you. It really wants to Nest so badly, but then you give it nothing to chew on. Quite naturally, it complains. You didn't tell it how often to Nest. I'm not sure what you want to achieve here. Solve this equation for the unknown f,v,i,w, and j? Impossible. But even if it would be possible you're using the wrong syntax. Should be something like Solve [Nest[f, v, i] == Nest[v, w, j], {v}] or so. > 2-I want to use lists symbollically like this: m, mP,l,lP are lists, j,jP= ,i,iP are variables.By symbolically I mean without specifying the concrete > elements and the concrete length of these lists > i<=iP,j-Length[m]=C5 jP-Length[mP], > Join[l,m]=C5 Join[lP,mP], > Nest[Rest,m,i]=C5 Nest[Rest,mP,iP] > There are some weird codes in there that I'm trying to interpret. Not really sure whether I get it all. You can't really have abstract lists in Mathematica. You can say something like d = Array[c, i] and e=Array[b,j], but you'll get the same complaints as above. The assignments have been made and replacing i with a number yields a real list for d: In[55]:= d /. i -> 5 Out[55]= {c[1], c[2], c[3], c[4], c[5]} so far so good, but if you try to Join d and e you get nonsense: In[58]:= Join[d, e] During evaluation of In[58]:= Array::ilsmn: Single or list of non- negative machine-size integers expected at position 2 of Array [c,i,b,j]. >> Out[58]= Array[c, i, b, j] I guess you could make some functions yourself that operate on abstract lists but that would be hard work. > 3-when I have j I'm sorry, but this doesn't make sense at all. Why would i have to equal N? This is only true if j equals N-1, but you claim that j 4-solve this system of equations: xP = 1 + a/yP=C2 and |yP-xP| <= = epsilon > Since this involves an inequality Solve can't be used. If a and epsilon are symbolic FindInstance can also not be used. Reduce should work, but it doesn't get me an answer within a couple of minutes, so with a small rewrite it becomes: Reduce[{xP == 1 + a/yP, (yP - xP)^2 <= epsilon2}, {xP, yP}] and now Reduce seems to be able to solve the system. > Yours faithfully, > Olfa MRAIHI === Subject: Re: Simplification question I have the same, but what's the problem with that? I don't think Mathematica always finds the simplest form of expressions with goniometric functions, but you can steer it that way. In this case, with the help of the Algebraic manipulation palette, select the first result, do TrigExpand on all, then TrigFactor on all, then FullSimplify on each of the expression in parenthesis separately, then FullSimplify on all, and you've got the other expression. The problem here is actually a minimization issue. The first expression is in a local minimimum of complexity and to find a better minimum you have first to increase the complexity before it finally can be reduced. This is not trivial at all. Mathematica is very clever overall, but success is not guaranteed > can anyone please confirm this: > > On my machine Mathematica 6.03 produces: > > Simplify[dab^2 Cos[2 [Alpha]] - dab^2 + 2 dbp^2] > -dab^2 + 2 dbp^2 + dab^2 Cos[2 [Alpha]] > > FullSimplify[dab^2 Cos[2 [Alpha]] - dab^2 + 2 dbp^2] > -dab^2 + 2 dbp^2 + dab^2 Cos[2 [Alpha]] > > FullSimplify[dab^2 (Cos[2 [Alpha]] - 1) + 2 dbp^2] > 2 (dbp^2 - dab^2 Sin[[Alpha]]^2) > > Simplify[dab^2 (Cos[2 [Alpha]] - 1) + 2 dbp^2] > 2 (dbp^2 - dab^2 Sin[[Alpha]]^2) > > FullSimplify[-dab^2 + 2 dbp^2 + > dab^2 Cos[2 [Alpha]] - (-2 dab^2 Sin[[Alpha]]^2 + 2 dbp^2)] > 0 > > Checked on v7 - same result! === Subject: Re: Simplification question > can anyone please confirm this: > On my machine Mathematica 6.03 produces: Simplify[dab^2 Cos[2 [Alpha]] - dab^2 + 2 dbp^2] > -dab^2 + 2 dbp^2 + dab^2 Cos[2 [Alpha]] FullSimplify[dab^2 Cos[2 [Alpha]] - dab^2 + 2 dbp^2] > -dab^2 + 2 dbp^2 + dab^2 Cos[2 [Alpha]] FullSimplify[dab^2 (Cos[2 [Alpha]] - 1) + 2 dbp^2] > 2 (dbp^2 - dab^2 Sin[[Alpha]]^2) Simplify[dab^2 (Cos[2 [Alpha]] - 1) + 2 dbp^2] > 2 (dbp^2 - dab^2 Sin[[Alpha]]^2) FullSimplify[-dab^2 + 2 dbp^2 + > dab^2 Cos[2 [Alpha]] - (-2 dab^2 Sin[[Alpha]]^2 + 2 dbp^2)] > 0 Checked on v7 - same result! Same results on my system. Since you did not tell what surprised you, I assume that this is the last result, which is perfectly correct, indeed. In[1]:= $Version Out[1]= 6.0 for Mac OS X x86 (64-bit) (May 21, 2008) In[2]:= -dab^2 + 2 dbp^2 + dab^2 Cos[2 [Alpha]] - (-2 dab^2 Sin[[Alpha]]^2 + 2 dbp^2) Out[2]= -dab^2 + dab^2 Cos[2 [Alpha]] + 2 dab^2 Sin[[Alpha]]^2 In[3]:= % // TrigReduce Out[3]= 0 In[4]:= %% // TrigFactor Out[4]= 0 In[5]:= %%% // TrigToExp Out[5]= 0 In[6]:= %%%% // Factor Out[6]= dab^2 (-1 + Cos[2 [Alpha]] + 2 Sin[[Alpha]]^2) In[7]:= TrigExpand[-1 + Cos[2 [Alpha]]] Out[7]= -1 + Cos[[Alpha]]^2 - Sin[[Alpha]]^2 In[8]:= % + 2 Sin[[Alpha]]^2 Out[8]= -1 + Cos[[Alpha]]^2 + Sin[[Alpha]]^2 In[9]:= % // TrigReduce Out[9]= 0 --Jean-Marc === Subject: Re: Mathematica 7 much slower than Mathematica 6 on Limit You can also try plotting the function, as a function of 'd'. When I did this for d=10^6 to d=10^7, the value appears to decrease linearly with log[d], from around 36.5 to 32 or so. Are you sure it will approach some limit as d->oo ?? Tom >> >> It speeds things up. My original goal was to get this limit to d -> Infin= >ity but 1000 was about as high as I could go. Now I got it up to 10^6 in st= >eps and the result doesn't appear to be converging at all. At 10^7 I get er= >rors. I had to use the Scale->1000 option to get above d-> 1000. Perhaps my= > >You don't really need Limit or NLimit if all values are reals, in this >case. You can just substitute and get the numerical value > >h = 1.575; er = 4.7; er2 = (er - 1)/2; >p[k_] := Sqrt[1 - k^2]; >120 Pi EllipticK[a/d]/EllipticK[p[a/d]]/ > Sqrt[1 + > er2 EllipticK[ > p[a/d]] EllipticK[Sinh[Pi a/2/h]/Sinh[Pi d/2/h]]/ > EllipticK[a/d]/ > EllipticK[p[Sinh[Pi a/2/h]/Sinh[Pi d/2/h]]]] /. {a -> 0.5, > d -> 10^6} // N > >36.4602 > > >For d->10^8 it takes some time, but I suppose it will get the right >answer. > > === Subject: GroebnerBasis never finishes GroebnerBasis[ { 2401*t1*t3 + 2401*t2*t3 - 2401*t3^2 - 245*t1*v2 - 245*t2*v2 + 490*t3*v2 - 25*v2^2, 4802*t1*t3 - 2401*t3^2 - 490*t1*v2 + 490*t3*v2 - 25*v2^2, -49*t*t3 + 49*t1*t3 + 5*t*v2 - 5*t1*v2, 10*H - 49*t3^2 - 49*t4^2 + 98*t4*t5 - 49*t5^2 - 10*t4*v2 + 10*t5*v2 - 10*w1, -10*H - 49*t3^2 - 49*t4^2 + 98*t4*t6 - 49*t6^2 + 10*t3*v2 - 10*t4*v2 + 10*t6*v2 - 10*w2 }, {t1,t2,t3,t4,t5,t6,v2,w1,w2,H}, MonomialOrder -> Lexicographic] === Subject: Problem in v7 exporting/importing large files In the past, using Mathematica v5.2 under 64-bit Linux I have been unable to successfully export and then re-import data files in .mx (=93Dump=94) format whenever they exceed 2 GB in size. Recently I=92ve reexamined this issue with Mathematica v7.0 running under Windows 64 file, restart with a fresh kernel, and attempt to import the file. Alas, this still fails in v7.0 (but with different error messages): ----------------------------------------------------------------- $Version 7.0 for Microsoft Windows (64-bit) (November 10, 2008) Timing[testlist = Table[1., {4 10^8}];] {24.406,Null} ByteCount[testlist] 3200000124 Timing[Export[test.mx, testlist]] {54.281,test.mx} {MemoryInUse[], MaxMemoryUsed[]} {3215978448,3216549384} FileByteCount[test.mx] 3200000388 (* Restart Mathematica kernel *) Timing[testlist = Import[test.mx];] Get::bigfile : The file C:UserswintestDocumentstest.mx is too large to be read into memory. >> Import::fmterr : Cannot import data as MX format. >> {0.093,Null} ----------------------------------------------------------------- So I have two questions and one request: 1) Why can I export a large .mx file but not import it? Is this an expected and/or documented limitation of 64-bit Mathematica, or a bug? (It certainly seems reasonable to expect that under a 64-bit OS I should be able to both write and read files up to the size of available memory.) 2) Can anyone suggest a workaround? Is there an alternative large- file format (preferably compact with fast I/O) that I should try? 3) Can someone please test whether this problem persists for v7 under 64-bit Linux and Mac OS? Ron === Subject: inverting Laplace transforms I need to invert a few expressions representing Laplace transforms. I have heard that MATHEMATICA can be used for this purpose. Can anybody tell me how to do this? For example, I need to find a function f(t) for which the Laplace transform F(s) is F(s) = Sqrt[s + a]/(Sqrt[s] * (s - b)) where a > 0 and b > 0 are constants. Leslaw === Subject: How to use PrivateFontOptions? I wish to have symbols like [HappySmiley] rendered by particular system font, not by Mathematica's font. But Mathematica automatically replaces such symbols and renders them by it's own font. I tried to use PrivateFontOptions option to turn off this behavior but I have failed. I tried the following: In[1]:= Style[:263a :263b, PrivateFontOptions -> {OperatorSubstitution -> False, WindowsUseTrueTypeNames -> False}, FontFamily -> Lucida Sans Unicode, Large] Out[1]= [HappySmiley] =E2=98=BB I am doing something wrong? How to do this? === Subject: Re: Decimals from the Get Coordinates Tool This topic came up (for Version 6, at least) a few months ago. See the thread: read/7d280139e0df269f/7c6b3173d78ac85c?hl=en&lnk=gst&q=Get+Graphics+C= oordinates+accuracy#7c6b3173d78ac85c John Jowett > I have a difficulty with the Get Coordinate tool, which can be > easily seen with a plot like the following: > > Plot[Sin[x], {x, 170000, 170005}] > > When I call the tool and click on the plot, all the x coordinates > assume the same value, i.e. there appears to be a truncation to a > predefined accuracy which is not compatible with the scale. E.g. I > might get: > {{1.7*^5, -0.9755}, {1.7*^5, -0.4589}, {1.7*^5, 0.5653}} > > $Version = 7.0 for Microsoft Windows (32-bit) (November 10, 2008) > > Are you aware of any way to specify the accuracy of the output > coordinates, thus avoiding this problem? > > (Of course, in my context it is not possible to subtract 170000 from > the x-axis !) > > Al === Subject: Re: Azimuth in Mathematica I was always wondering why ArcTan[] alow one and two arguments, i.e., ArcTan[x] and ArcTan[x,y] (x, and y in *that* order) Jens > Is there a function in Mathematica that would return the azimuth between > two points with known coordinates, 0 being North? > For example having A(0,0), B(1,0) - the azimuth should be 90 degrees > its like ArcTan[dx/dy], but I need the quadrant taken into account as > well and I need it to handle 90 and 270 degrees properly too /it doesn't need to convert the angles to degrees, rads is ok/ > === Subject: Re: Azimuth in Mathematica You can use ArcTan second format, ArcTan[x,y], for that. It takes the quadrant into account. The result is the usual 0 degrees at the positive x-axis, pi/2 rad for the positive y-axis etc. You have to convert it to compass angles. azimuth[x_, y_] := Mod[90 - ArcTan[x, y]/[Degree], 360] will do this. You the need to convert > Is there a function in Mathematica that would return the azimuth between > two points with known coordinates, 0 being North? > For example having A(0,0), B(1,0) - the azimuth should be 90 degrees > its like ArcTan[dx/dy], but I need the quadrant taken into account as > well and I need it to handle 90 and 270 degrees properly too > > /it doesn't need to convert the angles to degrees, rads is ok/ === Subject: Re: Azimuth in Mathematica Use the two-argument form of ArcTan: ArcTan[z] gives the arc tangent tan^-1(z) of the complex number z. ArcTan[x,y] gives the arc tangent of y/x, taking into account which quadrant the point (x,y) is in. CO > Is there a function in Mathematica that would return the azimuth between > two points with known coordinates, 0 being North? > For example having A(0,0), B(1,0) - the azimuth should be 90 degrees > its like ArcTan[dx/dy], but I need the quadrant taken into account as > well and I need it to handle 90 and 270 degrees properly too /it doesn't need to convert the angles to degrees, rads is ok/ -- Curtis Osterhoudt cfo@remove_this.lanl.and_this.gov PGP Key ID: 0x4DCA2A10 Please avoid sending me Word or PowerPoint attachments See http://www.gnu.org/philosophy/no-word-attachments.html === Subject: Re: What Am I Doing Wrong? you must select something. Jens > I just move my Mathematica 6.0 to a new machine and informed Wolfram > about it. Just recently I found the 6.0.3.0 disk and upgraded the v6.0. > I used to be able to use Copy As freely but after the upgrade, which > also went through Wolfram approval, all options in Copy As are grayed > out except LateX and MathML. What do I need to do? 'Kale === Subject: Re: What Am I Doing Wrong? > I just move my Mathematica 6.0 to a new machine and informed Wolfram > about it. Just recently I found the 6.0.3.0 disk and upgraded the v6.0. > I used to be able to use Copy As freely but after the upgrade, which > also went through Wolfram approval, all options in Copy As are grayed > out except LateX and MathML. What do I need to do? 'Kale I suggest you uninstall Mathematica from your machine, and then install the 6.0.3 disk. David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Re: Azimuth in Mathematica Use the two argument form of ArcTan az[ptA_, ptB_] := Pi/2 - ArcTan @@ (ptB - ptA) ptA = {0, 0}; ptB = {1, 0}; ptC = {0, -1}; {#[[1]], #[[2]], az @@ ##} & /@ DeleteCases[Tuples[{ptA, ptB, ptC}, 2], {x_, x_}] {{{0, 0}, {1, 0}, Pi/2}, {{0, 0}, {0, -1}, Pi}, {{1, 0}, {0, 0}, -(Pi/2)}, {{1, 0}, {0, -1}, (5*Pi)/4}, {{0, -1}, {0, 0}, 0}, {{0, -1}, {1, 0}, Pi/4}} Bob Hanlon > Is there a function in Mathematica that would return the azimuth > between two points with known coordinates, 0 being North? > For example having A(0,0), B(1,0) - the azimuth should be 90 degrees > its like ArcTan[dx/dy], but I need the quadrant taken into account as > well and I need it to handle 90 and 270 degrees properly too > > /it doesn't need to convert the angles to degrees, rads is ok/ === Subject: Re: how to solve this problem? and Element[{x,y},Reals] and With[{z = x + I*y}, FullSimplify[{Re[z], Im[z]}, Element[{x, y}, Reals]] ] is more complicated ? Jens > Hi: > I want to define the variables x and y are real at first,then: > z=x+I*y; > Re[z]=x > Im[z]=y > Using Assumptions Assuming? But i don not know how to use it. Is > there other ways to get that? > I know in another system, it is easy, as in > assume(x,real,y,real); > So what is in Mathematica? > === Subject: Re: how to solve this problem? Now we use TagSet to tell mathematica that Re[x] should always return x Im[x] should always return 0 Re[y] should always return y Im[y] should always return 0 TagSet remembers that for variable x, if the function Re[] is apply, the answer is x. This property is set in the definition of variable x z = x + y I x /: Re[x]=x; x /: Im[x]=0; y /: Re[y]=y; y /: Im[y]=0; === Subject: Re: how to solve this problem? Hi Ising, You don't make yourself very clear. Let me try to analyze what you ask sentence by sentence. I want to define the variables x and y are real at first Variables are not typed and may have any possible numeric, textual or symbolic values without declarations. No need to define them as real. If you give them a particular value, Mathematica will know the type. If you want Mathematica to make assumptions about their values, indeed you can use Assuming and Assumptions, but quite often that's not necessary. z=x+I*y; No problem. Mathematica does this even when x and y are not numeric (they may even be pictures). They also don't need to be defined at this stage at all. Re[z]=x Houston, we have a problem! You can assign something to a variable, but what you are doing here is trying to extend the definition of the function Re. Re being a built-in function is protected against changes in its definition and this yields an error. Not sure what you want to achieve here. Do you want to set the real part of z to x then? You have already done that in the first line. Do you want to test for equality? That's done with ==, not =. Im[z]=y Same. Using 'Assumptions' 'Assuming'? Assumptions is an OPTION for certain functions such as Integrate and Simplify. It is used like this: Integrate[x^a, {x, 0, 1}, Assumptions -> a > 0] Now the integration is performed assuming a>0 (and implicitely that a is real, because for a complex value it doesn't make sense to say it's greater than 0). Assuming is a FUNCTION that sets up an environment for its second argument, which may be one or more statements. These statements, calculations, function calls in this second argument are then all evaluated with the assumptions made in the first part of Assuming. It is used like this: Assuming[a > 0, {Integrate[1/(x + a), {x, 0, 1}], FourierTransform[1/ (x^2 + a), x, w]}] But i don not know how to use it. Is there other ways to get that? What would you think of reading some introductory text in the manual? Mathematica has an extensive documentation system built-in right under the help menu. Judging from what you have written thus far you don't seem to have used that very much. The examples I have used above are copied straight from this manual. > Hi: > I want to define the variables x and y are real at first,then: > z=x+I*y; > Re[z]=x > Im[z]=y > Using Assumptions Assuming? But i don not know how to use it. Is > there other ways to get that? > I know in another system, it is easy, as in > assume(x,real,y,real); > So what is in Mathematica? === Subject: Re: how to solve this problem? > I want to define the variables x and y are real at first,then: > z=x+I*y; > Re[z]=x > Im[z]=y > Using Assumptions Assuming? But i don not know how to use it. Is > there other ways to get that? > I know in another system, it is easy, as in > assume(x,real,y,real); > So what is in Mathematica? AFAIK, there exist no built-in assumption or domain definition mechanisms that work on a global scope within a Mathematica session. One can define global assumptions by adding assumptions to the system variable $Assumptions; however only a subset of Mathematica functions take in account assumptions and one have to call them explicitly (see the example below with square roots and Simplify). In your case, the easiest way might be to use ComplexExpand that simplifies an expression by assuming that its variables are reals. (Note that you could also explore upvalues to see if they might feet your needs. You could also have a look at the $Pre family of system variables if you want to automatically force a Simplify or ComplexExpand on every input.) In[1]:= {Sqrt[x^2], Sqrt[x^2] // Simplify} Out[1]= {Sqrt[x^2], Sqrt[x^2]} In[2]:= $Assumptions = {x >= 0} {Sqrt[x^2], Sqrt[x^2] // Simplify} Out[2]= {x >= 0} Out[3]= {Sqrt[x^2], x} In[4]:= z = x + I*y; Re[z] Im[z] Out[5]= -Im[y] + Re[x] Out[6]= Im[x] + Re[y] In[7]:= Re[z] // ComplexExpand Out[7]= x In[8]:= Im[z] // ComplexExpand Out[8]= y --Jean-Marc === Subject: Re: how to solve this problem? Clear[x, y]; z = x + I*y; Assuming[{Element[{x, y}, Reals]}, Simplify[Re[z]]] x Assuming[{Element[{x, y}, Reals]}, Simplify[Im[z]]] y Or something like Clear[defineReal]; SetAttributes[defineReal, Listable]; defineReal[x_Symbol] := Module[{}, x /: Re[x] = x; x /: Im[x] = 0;] defineReal[{x, y}]; Re[z] x Im[z] y Bob Hanlon > Hi: > I want to define the variables x and y are real at first,then: > z=x+I*y; > Re[z]=x > Im[z]=y > Using Assumptions Assuming? But i don not know how to use it. Is > there other ways to get that? > I know in another system, it is easy, as in > assume(x,real,y,real); So what is in Mathematica? === Subject: Re: Combining Plots with Different Ordinate Axes in Mathematica Hi Buz, you may e.g. use Frame and give the tick marks explicitely. E.g.: f1[x_] := Exp[-x^2]; f2[x_] := Exp[-4 (x - 1)^2]; Plot[{f1[x], f2[x + 1]}, {x, -1, 1}, Frame -> True, FrameTicks -> {{Automatic, None}, {Range[-1, 1, .5], Table[{x, x + 1}, {x, -1, 1, .5}]}}] hope this helps, Daniel > Hi All, I'd like to combine two plots in Mathematica that have different x > axes, but have similar y axes. In the first plot, the x range runs from 0 to 1.9, while in the second > plot the x values run from 2.5 to 3.5. I'd like to combine these plots together, and have one set of x values > displayed on the top edge of a frame, and the other set of x values > displayed on the bottom edge of the frame. Both plots can have a common y axis. > --Buz > === Subject: Re: Fourier[TriangleWave] Hello Sjoerd, the problem you face is that you used rational numbers in your Table. TriangleWave does not automatically return machine numbers if you feed it rationals. This happens only for spezial values like e.g. TriangleWave[1/4]. To force TriangleWave to return machine numbers, use e.g. N: Table[TriangleWave[t] // N, {t, 0, 2 [Pi], 2 [Pi]/99}] hope this helps, Daniel > TriangleWave and SquareWave are both functions introduced in M7, with > similar usage. However, if you try to do a DFT of a list of > TriangleWave values as in Fourier[Table[TriangleWave[ t], {t, 0, 2 [Pi], 2 [Pi]/99}]] you get an error message. The same problem exists for SawtoothWave. > With SquareWave and Sin: Fourier[Table[SquareWave[ t], {t, 0, 2 [Pi], 2 [Pi]/99}]] > Fourier[Table[Sin[ t], {t, 0, 2 [Pi], 2 [Pi]/99}]] it works as expected. If you use //N everything is fine. Is there anything in the properties > of these wave functions that should make these differences in handling > by Fourier reasonable or expected? > === Subject: Re: Fourier[TriangleWave] Hi Daniel, In my question I already noted that //N makes it work. The problem I have is the inconsistent behavior of TriangleWave and Fourier. Note that in my examples I feed SquareWave and Sin with exactly the same numbers and they DO work. And, by the way, TriangleWave[1/4] returns 1 without a problem and Fourier on a series of rationals works just fine. > Hello Sjoerd, > > the problem you face is that you used rational numbers in your Table. > > TriangleWave does not automatically return machine numbers if you feed > > it rationals. This happens only for spezial values like e.g. > > TriangleWave[1/4]. To force TriangleWave to return machine numbers, use > > e.g. N: > > Table[TriangleWave[t] // N, {t, 0, 2 [Pi], 2 [Pi]/99}] > > hope this helps, Daniel > > > TriangleWave and SquareWave are both functions introduced in M7, with > similar usage. However, if you try to do a DFT of a list of > TriangleWave values as in > > Fourier[Table[TriangleWave[ t], {t, 0, 2 [Pi], 2 [Pi]/99}]] > > you get an error message. The same problem exists for SawtoothWave. > With SquareWave and Sin: > > Fourier[Table[SquareWave[ t], {t, 0, 2 [Pi], 2 [Pi]/99}]] > Fourier[Table[Sin[ t], {t, 0, 2 [Pi], 2 [Pi]/99}]] > > it works as expected. > > If you use //N everything is fine. Is there anything in the properties > of these wave functions that should make these differences in handling > by Fourier reasonable or expected? > === Subject: Re: MathLinkException ErrorCode 11 Does anyone know if there is documentation of these errors and their causes anywhere? Joe === Subject: Formal symbols and DifferentialRoot A recent blog on WRI site emphasized the new capabilities of Root, which is now able to symbolically represent a solution to a transcendental equation. Along the same lines, and in my opinion even more exciting, is that with Mathematica 7.0 we can now represent solutions to Linear ODE (with arbitrary coefficients, I stress). This is done with DifferentialRoot objects. DifferentialRoot and a few other related functions use Formal symbols, a new kind of symbol which has a grey dot above and below a regular letter. There is a tutorial on Formal symbols, but the link to it from DifferentialRoot does not work. You can read the tutorial on line or you can find it in your pc by looking at the end of the Letters and Letter-like Forms tutorial === Subject: Re: how to solve this problem? Put this at the beginning: $Assumptions = {Element[x,Reals],Element[y,Reals]}; instead of Element[x,Reals] you can use x[Element]Reals Sometimes you must call Simplify in order to get every expression neatly simlified using that Assumption. === Subject: Matrix-Multiplication w NonCommutative Entries? Hi there, I want to multiply matrices with quaternionic entries in Mathematica. Dot (.) uses normal multiplication (*) for the entries. I need to change this to NonCommutativeMultiply (**) Then this would work with the Quaternions package. Does anybody know, how to do this? Thomas === Subject: Re: Matrix-Multiplication w NonCommutative Entries? > I want to multiply matrices with quaternionic entries in Mathematica. Dot (.) > uses normal multiplication (*) for the entries. I need to change this to > NonCommutativeMultiply (**) Then this would work with the Quaternions > package. Inner[NonCommutativeMultiply, m1, m2, Plus] Say we have two matrices m1 and m2. There Dot[] product m1.m2 is equivalent to the inner product Inner[Times, m1, m2, Plus]; therefore Inner[NonCommutativeMultiply, m1, m2, Plus] should do want you are looking for. In[1]:= m1 = {{a1, b1}, {c1, d1}}; m2 = {{a2, b2}, {c2, d2}}; m1.m2 Out[3]= {{a1 a2 + b1 c2, a1 b2 + b1 d2}, {a2 c1 + c2 d1, b2 c1 + d1 d2}} In[4]:= Inner[Times, m1, m2, Plus] Out[4]= {{a1 a2 + b1 c2, a1 b2 + b1 d2}, {a2 c1 + c2 d1, b2 c1 + d1 d2}} Out[5]= True In[6]:= Inner[NonCommutativeMultiply, m1, m2, Plus] Out[6]= {{a1 ** a2 + b1 ** c2, a1 ** b2 + b1 ** d2}, {c1 ** a2 + d1 ** c2, c1 ** b2 + d1 ** d2}} --Jean-Mac === Subject: Re: Matrix-Multiplication w NonCommutative Entries? use Inner[] instead of Dot[] because: Inner[f,list1,list2,g] is a generalization of Dot in which f plays the role of multiplication and g of addition. Jens > Hi there, > I want to multiply matrices with quaternionic entries in Mathematica. Dot (.) uses normal multiplication (*) for the entries. I need to change this to NonCommutativeMultiply (**) Then this would work with the Quaternions package. > Does anybody know, how to do this? > Thomas > === Subject: Manipulate, Export, .avi, forward run without the slider in the I successfully created a movie using_ Export[=E2=80=9Cmovie.avi=E2=80=9D,data,=E2=80=9D AnimationDuration=E2=80= =9D->30] data is actually a Manipulate command; data=Manipulate[GraphicsColumn[ {A[[i]],B[[i]]} ,{i,1,dim,1}] However, I haven't figured out; 1) showing only the forward loop of the movie in 30 sec (AnimationDuration). Export automatically creates forward and backward sequences and 2) I don't want to include any Sliders in the movie for presentatio n purposes (like in the Hide Controls option). Do you know which commands I should add to reach my goal in the Export or Manipulate command? I searched the Documentation Center and MathGroupArchive but I couldn't come up with the answer. I am currently using V6.0 although my institution has all the licenses including V7. I am waiting for a new machine to separately run V7 if it has the necessary options. Murat Alp, Ph.D. Institute of Neuroscience 1254 University of Oregon Eugene, OR 97403-1254 Roberts Lab Ph : 541 - 346 1808 Fax : 541 - 346 4548= === Subject: Re: CP850 or CP858 character encoding in Mathematica > I need to use for demonstrating purposes any fully-printable Extended > ASCII representation. > The most known is Code page 850 (CP850) representation:http://en.wikipedi= a.org/wiki/Code_page_850 > But more resent is Code page 858 (CP858):http://en.wikipedia.org/wiki/CP8= 58 > > I found that these encodings are not installed in Mathematica by > default: > > > During evaluation of In[1]:= Get::noopen: Cannot open C:Program Files > Wolfram ResearchMathematica7.0SystemFilesCharacterEncodings > CP850.m. >> > > Out[1]= .02 > > Is there available the missing CP850.m Package that I would install in > Mathematica for working with such encoding? > > If not, I would be very pleasant for any guidance how I can create > such Package by myself. I think that the 850 code is in the IBM-850.m file. The Euro character that is the only difference in the 858 encoding (compared to the 850 font) is in the ISO8859-15 or ISO8859-16 encodings (and others too I would guess). A handy thing to look at a range of the characters in a particular file is but each of these encoding files have varying number of characters. On my Mac version of Mathematica 7.0 these files are located in the / Applications/Mathematica/SystemFiles/CharacterEncodings folder, but on Windows, not sure where they are. You can get a list of all the installed encodings by looking at the variable $CharacterEncodings -Bob === Subject: Re: generalization of Bernoulli numbers to Pascal types You need to use a pattern in the definition of p p[x_] = 1/Sum[x^(n - 1)/(2*n - 1)!!, {n, 1, Infinity}] (Sqrt[2/Pi]*Sqrt[x])/ (E^(x/2)*Erf[Sqrt[x]/Sqrt[2]]) You don't need to use both Series and SeriesCoefficient (I only show a few terms) m = 5; Table[SeriesCoefficient[p[x], {x, 0, n}], {n, 0, m}] {1, -(1/3), 2/45, -(2/945), -(2/14175), 2/93555} Or more simply, CoefficientList[Series[p[x], {x, 0, m}], x] {1, -(1/3), 2/45, -(2/945), -(2/14175), 2/93555} Bob Hanlon > Here is a new way to use the exponential like > expansions to get a generalized Bernoulli number B(n,m): > ( I thought of these about a week ago, but just got around to getting > Mathematica to give me an expansion) > I tried the (2*n-1)!! version but Mathematica failed on it. > Here is the code if anyone can get it to work: > Clear[p] > Table[(2*n - 1)!!, {n, 0, 10}] > p[x] = FullSimplify[1/Sum[x^(n - 1)/(2*n - 1)!!, {n, 1, Infinity}]] > Table[ SeriesCoefficient[ > Series[p[x], {x, 0, 30}], n], {n, 0, 30}] > > > %I A154242 > %S A154242 > 1,3,45,1890,56700,748440,10216206000,8756748000,2841962760000, > %T A154242 > 24946749107280000,8232427205402400000,103279541304139200000, > %U A154242 3101484625363300176000000,1431454442475369312000000 > %N A154242 Bernoulli like expansion of polynomials: 1/Sum[x^(n - > 1)/((2*n)!/n!), {n, 1, Infinity}]=2* Exp[-x/4] > *Sqrt[x]/(Sqrt[Pi]*Erf[Sqrt[x]/2]). denominators of the rational > sequence. > %C A154242 The row sum sequences of the Pascal types are: > %C A154242 row(n,m)={2^n,n!,2^n*n!,(2*n-1)!!,(2*n)!/n!}. Each one can > be expanded as a Bernoulli like: > %C A154242 > f(x)=x/(Sum[x^n/Row(n,m),{n,0,Infinity}]-1)=Sum[B[n,m]*x^n/n!,{n,0,Infinity}] ; > %C A154242 Here the m=4. > %F A154242 a(n)=Denominator[Expansion[1/Sum[x^(n - 1)/((2*n)!/n!), {n, > 1, Infinity}]=2* Exp[-x/4] *Sqrt[x]/(Sqrt[Pi]*Erf[Sqrt[x]/2])]]. > %t A154242 Clear[p]; p[x] = FullSimplify[1/Sum[x^(n - 1)/((2*n)!/n!), > {n, 1, Infinity}]]; > %t A154242 Table[ Denominator[SeriesCoefficient[Series[p[x], {x, 0, > 30}], n]], {n, 0, 30}] > %K A154242 nonn > %O A154242 0,2 > > > %I A154243 > %S A154243 > 2,1,1,1,1,1,23,23,157,97051,1614583,331691,1418383997,5720927, > %T A154243 1868325937,1207461869239,118209298450003,3069893653, > %U A154243 14303719087308533,65108016166881997,310766859240153209819 > %V A154243 > 2,-1,1,-1,-1,1,23,-23,157,97051,-1614583,-331691,1418383997,-5720927, > %W A154243 -1868325937,1207461869239,118209298450003,-3069893653, > %X A154243 -14303719087308533,65108016166881997,-310766859240153209819 > %N A154243 Bernoulli like expansion of polynomials: 1/Sum[x^(n - > 1)/((2*n)!/n!), {n, 1, Infinity}]=2* Exp[-x/4] > *Sqrt[x]/(Sqrt[Pi]*Erf[Sqrt[x]/2]). numerators of the rational > sequence. > %C A154243 The row sum sequences of the Pascal types are: > %C A154243 row(n,m)={2^n,n!,2^n*n!,(2*n-1)!!,(2*n)!/n!}. Each one can > be expanded as a Bernoulli like: > %C A154243 > f(x)=x/(Sum[x^n/Row(n,m),{n,0,Infinity}]-1)=Sum[B[n,m]*x^n/n!,{n,0,Infinity}] ; > %C A154243 Here the m=4. > %F A154243 a(n)=Numerator[Expansion[1/Sum[x^(n - 1)/((2*n)!/n!), {n, > 1, Infinity}]->2* Exp[-x/4] *Sqrt[x]/(Sqrt[Pi]*Erf[Sqrt[x]/2])]]. > %t A154243 Clear[p]; p[x] = FullSimplify[1/Sum[x^(n - 1)/((2*n)!/n!), > {n, 1, Infinity}]]; > %t A154243 Table[ Numerator[SeriesCoefficient[Series[p[x], {x, 0, > 30}], n]], {n, 0, 30}] > %K A154243 sign > %O A154243 0,1 > > > > > -- > Respectfully, Roger L. Bagula > 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 > :http://www.geocities.com/rlbagulatftn/Index.html > alternative email: rlbagula@sbcglobal.net === Subject: Re: inverting Laplace transforms I'll assume you don't have a copy of Mathematica with you, otherwise I fail to understand why you haven't looked this up yourself in the excellent electronic documentation. Actually, there isn't an excuse at all because it's online as well: http://reference.wolfram.com/mathematica/guide/Mathematica.html Found in 2 seconds: http://reference.wolfram.com/mathematica/ref/InverseLaplaceTransform.html > > I need to invert a few expressions representing Laplace transforms. I hav= e heard that MATHEMATICA can be used > for this purpose. Can anybody tell me how to do this? > > For example, I need to find a function f(t) for which the > Laplace transform F(s) is > > F(s) = Sqrt[s + a]/(Sqrt[s] * (s - b)) > > where a > 0 and b > 0 are constants. > > Leslaw === Subject: Re: inverting Laplace transforms > > I need to invert a few expressions representing Laplace transforms. I have heard that MATHEMATICA can be used > for this purpose. Can anybody tell me how to do this? > > For example, I need to find a function f(t) for which the > Laplace transform F(s) is > > F(s) = Sqrt[s + a]/(Sqrt[s] * (s - b)) > > where a > 0 and b > 0 are constants. > > Leslaw See the documentation for the LaplaceTransform and InverseLaplaceTransform commands. Josiah === Subject: Re: inverting Laplace transforms > I need to invert a few expressions representing Laplace transforms. I have > heard that MATHEMATICA can be used > for this purpose. Can anybody tell me how to do this? For example, I need to find a function f(t) for which the > Laplace transform F(s) is F(s) = Sqrt[s + a]/(Sqrt[s] * (s - b)) where a > 0 and b > 0 are constants. I might state the obvious, but have you had a look at *InverseLaplaceTransform* (though I am not sure it works with constants, at least not straight out of the box)? See http://reference.wolfram.com/mathematica/ref/InverseLaplaceTransform.html --Jean-Marc === Subject: Re: Front end tokens and window maximization Hi Jason, At the bottom of http://reference.wolfram.com/mathematica/ref/FrontEndTokenExecute.html you'll find plenty of references to tokens. I haven't checked whether these are the same as you were referring to. I couldn't find a maximize token, though. The following approaches its functionality fairly well. SetOptions[EvaluationNotebook[], WindowMargins -> {{0, 0}, {0, 0}}, WindowSize -> Automatic] > > I was wondering if there is anywhere to get a list of all of the front > end tokens? I know you can see the key mappings and menu mappings in > the MenuSetup.tr and KeyEventTranslations.tr files, but there are many > front end tokens not listed in these files. > > Also, does anyone know the front end token for window maximization? > > FrontEndTokenExecute[nb, WindowMiniaturize] > > Does anyone know a similar one for maximization? Of course, having a > list of all tokens would make life much easier! > > > Jason === Subject: Re: Front end tokens and window maximization > > I was wondering if there is anywhere to get a list of all of the front > end tokens? I know you can see the key mappings and menu mappings in > the MenuSetup.tr and KeyEventTranslations.tr files, but there are many > front end tokens not listed in these files. > > Also, does anyone know the front end token for window maximization? > > FrontEndTokenExecute[nb, WindowMiniaturize] > > Does anyone know a similar one for maximization? Of course, having a > list of all tokens would make life much easier! > > > Jason I should add that I'm interested in a command for maximization because I sometimes like to work with windows with ThinFrame or no frame, and there's no way to maximize these windows outside of the frame control buttons. I added a menu item which pretty much does it (but doesn't take the frame size into account, so this only works perfectly with ThinFrame currently: Item[Maximize Window, KernelExecute[ Module[{screenWidthList, ScreenHeightList, screenWidth, screenHeight}, screenWidthList = Options[$FrontEnd, ScreenInformation][[1]][[2]][[1]][[1]][[2]][[1]]; screenHeightList = Options[$FrontEnd, ScreenInformation][[1]][[2]][[1]][[1]][[2]][[2]]; screenWidth = screenWidthList[[2]] - screenWidthList[[1]]; screenHeight = screenHeightList[[2]] - screenHeightList[[1]]; SetOptions[SelectedNotebook[], WindowSize -> {screenWidth - 2, screenHeight - 2}, WindowMargins -> {{0, screenWidth - 2}, {screenHeight - 2, 0}}]; ] ], MenuEvaluator -> Automatic], === Subject: Re: Front end tokens and window maximization > > I was wondering if there is anywhere to get a list of all of the front > end tokens? I know you can see the key mappings and menu mappings in > the MenuSetup.tr and KeyEventTranslations.tr files, but there are many > front end tokens not listed in these files. > > Also, does anyone know the front end token for window maximization? > > FrontEndTokenExecute[nb, WindowMiniaturize] > > Does anyone know a similar one for maximization? Of course, having a > list of all tokens would make life much easier! > > > Jason The full list is not documented. The reason it's not documented is because most front end tokens are still largely internal artifacts, subject to change, and not guaranteed to be absolutely stable (or crash-free) if used in the wrong way. I maintain a full-time job (and then some!) staying on top of the documented features of the front end, so I hope you'll understand if I refrain from offering support/answers/advice/bug-fixes for undocumented features. So, the list I've included at the end of this email should be considered an unsupported goodie. I offer it with no warranty, no documentation, and absolutely no promise of support from myself or Wolfram Research. But, assuming you understand those preconditions, there's no reason for us to withhold the list. The list is comparatively complete, excepting option names (which can also be used as tokens) and a few tokens I know to be in a nonfunctional state. Here's one small and potentially useful note. the MenuList tokens don't do anything. They're just menu placeholders. Here's something interesting you can do with them... DynamicModule[{font}, Row[{PopupMenu[Dynamic[font], FE`Evaluate[FEPrivate`GetPopupList[MenuListFonts]]], Spacer[20], Style[The quick brown fox, 20, FontFamily -> font]}]] FE`Evaluate[FEPrivate`GetPopupList[#]]& returns values appropriate for PopupMenu, and several FE interfaces take advantage of this, so it's unlikely to change in the future (although I wouldn't be surprised if such useful functionality makes its way into much simpler a top-level function some day). John Fultz jfultz@wolfram.com User Interface Group Wolfram Research, Inc. {AllWindowsFront, BackgroundDialog, Balance, BringToFront, CellContextDialog, CellGroup, CellLabelsToTags, CellMerge, CellSplit, CellTagsEditDialog, CellTagsEmpty, CellTagsFind, CellUngroup, Clear, ClearCellOptions, ClearNoAutoScroll, Close, CloseAll, CloseMain, ColorSelectorDialog, ColorsPanel, CompleteSelection, Copy, CopyCell, CopySpecial, CreateCounterBoxDialog, CreateGridBoxDialog, CreateHyperlinkDialog, CreateInlineCell, CreateValueBoxDialog, Cut, CycleNotebooksBackward, CycleNotebooksForward, DebuggerAbort, DebuggerClearAllBreakpoints, DebuggerContinue, DebuggerContinueToSelection, DebuggerFinish, DebuggerResetProfile, DebuggerShowProfile, DebuggerStep, DebuggerStepIn, DebuggerStepInBody, DebuggerStepOut, DebuggerToggleBreakpoint, DebuggerToggleWatchpoint, DeleteGeneratedCells, DeleteIndent, DeleteInvisible, DuplicatePreviousInput, DuplicatePreviousOutput, EditStyleDefinitions, EnterSubsession, Evaluate, EvaluateCells, EvaluateInitialization, EvaluateNextCell, EvaluateNotebook, EvaluatorAbort, EvaluatorHalt, EvaluatorInterrupt, EvaluatorQuit, EvaluatorStart, ExitSubsession, ExpirationDialog, ExplainBeepDialog, ExplainColoringDialog, ExpressionLinewrap, FileNameDialog, FindDialog, FindEvaluatingCell, FindNextMisspelling, FindNextWarningColor, FinishNesting, FixCellHeight, FixCellWidth, FontColorDialog, FontFamilyB, FontPanel, FontSizeDialog, FrontEndHide, FrontEndQuit, FrontEndQuitNonInteractive, GenerateImageCaches, GenerateNotebook, GeneratePalette, GraphicsAlign, GraphicsCoordinatesDialog, GraphicsOriginalSize, GraphicsPlotRangeAll, GraphicsPlotRangeAutomatic, GraphicsPlotRangeFixed, GraphicsRender, Group, HandleShiftReturn, HeadersFootersDialog, HelpDialog, HyperlinkGo, HyperlinkGoBack, HyperlinkGoForward, Import, ImportPictures, ImportStyleDefinitions, Indent, InsertClipPlane, InsertMatchingBraces, InsertMatchingBrackets, InsertMatchingParentheses, InsertNewGraphic, InsertObject, InsertRawExpression, InsertSoftReturn, LicAuthFailureDialog, MacintoshOpenDeskAccessory, MenuListBoxFormFormatTypes, MenuListCellEvaluators, MenuListCellTags, MenuListCommonDefaultFormatTypesInput, MenuListCommonDefaultFormatTypesInputInline, MenuListCommonDefaultFormatTypesOutput, MenuListCommonDefaultFormatTypesOutputInline, MenuListCommonDefaultFormatTypesText, MenuListCommonDefaultFormatTypesTextInline, MenuListConvertFormatTypes, MenuListDisplayAsFormatTypes, MenuListExportClipboardSpecial, MenuListFonts, MenuListFontSubstitutions, MenuListGlobalEvaluators, MenuListHelpWindows, MenuListNotebookEvaluators, MenuListNotebooksMenu, MenuListPackageWindows, MenuListPalettesMenu, MenuListPaletteWindows, MenuListPlayerWindows, MenuListPlugInCommands, MenuListPrintingStyleEnvironments, MenuListQuitEvaluators, MenuListRelatedFilesMenu, MenuListSaveClipboardSpecial, MenuListScreenStyleEnvironments, MenuListStartEvaluators, MenuListStyleDefinitions, MenuListStyles, MenuListStylesheetWindows, MenuListTextWindows, MenuListWindows, ModifyBoxFormFormatTypes, ModifyDefaultFontProperties, ModifyEvaluatorNames, ModifyFontSubstitutions, ModifyNotebooksMenu, ModifyRelatedFiles, MoveBackward, MoveForward, MoveToBack, MoveToFront, New, NewPackage, NewText, NextFunctionTemplate, NotebookMail, NotebookMailSelection, NotebookOneNote, NotebookOneNoteSelection, NotebookStatisticsDialog, Open, OpenCloseGroup, OpenSelection, OpenSelectionParents, OpenURL, OptionsDialog, PasswordDialog, Paste, PasteApply, PasteApplyNoAutoScroll, PasteDiscard, PasteDiscardNoAutoScroll, PasteSpecial, PlainFont, PreferencesDialog, PreviousFunctionTemplate, PrintDialog, PrintOptionsDialog, PrintSelectionDialog, PublishToPlayer, RebuildHelpIndex, RecordSoundDialog, RefreshDynamicObjects, RelatedFilesMenu, ReplaceParent, Revert, RunColorDialog, RunEdgeColorDialog, RunFaceColorDialog, Save, SaveRename, SaveRenameSpecial, ScrollLineDown, ScrollLineUp, ScrollNotebookEnd, ScrollNotebookStart, ScrollPageBottom, ScrollPageDown, ScrollPageFirst, ScrollPageLast, ScrollPageNext, ScrollPagePrevious, ScrollPageTop, ScrollPageUp, SelectGeneratedCells, SelectionAnimate, SelectionBrace, SelectionBracket, SelectionCloseAllGroups, SelectionCloseUnselectedCells, SelectionConvert, SelectionConvertB, SelectionDisplayAs, SelectionDisplayAsB, SelectionHelpDialog, SelectionOpenAllGroups, SelectionParenthesize, SelectionSaveSpecial, SelectionScroll, SelectionSetFind, SelectionSpeak, SelectionSpeakSummary, SelectionUnbracket, SelectNotebookWindow, SetDefaultGraphic, SimilarCellBelow, SoundPlay, SpellCheckerDialog, StackWindows, Style, StyleDefinitionsOther, StyleOther, SubsessionEvaluateCells, SystemPrintOptionsDialog, TemplateSelection, TestEvaluateNotebook, TileWindowsTall, TileWindowsWide, ToggleDebugFlag, ToggleDynamicUpdating, ToggleGrayBox, ToggleOptionListElement, ToggleShowExpression, ToggleTestingFlag, TrustNotebook, Undo, Ungroup, WindowMiniaturize, XInfoDialog, ZoomWindow} === Subject: How to solve an equation with Gamma function in it? HI everyone, I've been trying to solve this equations set below with Gamma function in it. However, instead of the solutions, I got The expression ((545-o)/(a- o))^b involves unknowns in more than one argument, so inverse functions cannot be used. Is there a way that Mathematica can get it solved? Could anyone by kindly enough to give me some advice? f[o_, a_, b_] := o + (a - o)*Gamma[1 + 1/b] g[o_, a_, b_] := e^(-(((545 - o)/(a - o))^b)) h[o_, a_, b_] := (a - o)^2 * (Gamma[1 + 2/b] - (Gamma[1 + 1/b])^2) Solve[{f[o, a, b] == 557, g[o, a, b] == 0.5, h[o, a, b] == 131.9^2}, {o, a, b}] === Subject: Re: How to solve an equation with Gamma function in it? Solve[] is for algebraic equations with symbolic solutions, your equations are not algebraic and you wish probably a numerical solution. You meam FindRoot[] and not Solve[] but you have to set initial values for the root search. Jens algebraic and > HI everyone, > I've been trying to solve this equations set below with Gamma function > in it. > However, instead of the solutions, I got The expression ((545-o)/(a- > o))^b involves unknowns in more than one argument, so inverse > functions cannot be used. > Is there a way that Mathematica can get it solved? Could anyone by > kindly enough to give me some advice? f[o_, a_, b_] := o + (a - o)*Gamma[1 + 1/b] > g[o_, a_, b_] := e^(-(((545 - o)/(a - o))^b)) > h[o_, a_, b_] := (a - o)^2 * (Gamma[1 + 2/b] - (Gamma[1 + 1/b])^2) > Solve[{f[o, a, b] == 557, g[o, a, b] == 0.5, h[o, a, b] == 131.9^2}, > {o, a, b}] === Subject: Series question: limiting total derivative order Is it possible to directly tell Series to truncate a multivariate Taylor series beyond a total derivative order? Example, for f(x,y) and total derivative order 2, I want f(0,0) + x*Derivative[1,0][f][0,0] + y*Derivative[0,1][f][0,0] + x^2*Derivative[2,0][f][0,0]/2 + x*y*Derivative[1,1][f][0,0] + y^2*Derivative[0,2][f][0,0]/2 whereas Normal[Series[f[x,y],{x,0,2},{y,0,2}]] returns also derivative terms (2,1), (1,2) and (2,2) of total orders 3, 3 and 4. These I have to get rid of a posteriori with some complicated logic to build a replacement list. === Subject: Re: Series question: limiting total derivative order Normal[Series[f[x, y], {x, 0, 2}, {y, 0, 2}]] /. Derivative[dlst__][f][args__] /; Plus[dlst] > 2 :> 0 Jens > Is it possible to directly tell Series to truncate a > multivariate Taylor series beyond a total derivative order? > Example, for f(x,y) and total derivative order 2, I want f(0,0) + x*Derivative[1,0][f][0,0] + y*Derivative[0,1][f][0,0] + > x^2*Derivative[2,0][f][0,0]/2 + x*y*Derivative[1,1][f][0,0] + > y^2*Derivative[0,2][f][0,0]/2 whereas Normal[Series[f[x,y],{x,0,2},{y,0,2}]] returns also derivative terms (2,1), (1,2) and (2,2) of total > orders 3, 3 and 4. These I have to get rid of a posteriori with > some complicated logic to build a replacement list. > === Subject: Re: Problem with Rasterize[] on Strings Hi Nathan, If no explicit size or resolution option settings are given, Rasterize[g,[Ellipsis]] will rasterize g at the size and resolution it would normally be displayed in a notebook. If you specify the ImageSize no wrapping will happen. E.g: s2 = Style[A medium length string, FontSize -> 100, FontFamily -> Times]; Rasterize[s2, ImageResolution -> 300, ImageSize -> {800, 100}] hope this helps, Daniel > I am trying to use Rasterize[] on strings, and I am running into some > strange behavior. This line works fine s1 = Style[A medium length string, FontSize-> 10, FontFamily -> > Times]; Rasterize[s1, ImageResolution -> 100] However, as I increase either the font size, or the image resolution, > the text will wrap into two or more lines: s2 = Style[A medium length string, FontSize-> 100, FontFamily -> > Times]; Rasterize[s2, ImageResolution -> 300] The strange thing is that this depends on the window size! If you make > the window very narrow (or have a low resolution screen) then it will > start wrapping sooner that it will with. So depending on your monitor > and graphics card, and what size window you use, you can find a > combination that will wrap. So if I stretch a Mathematica window across my dual-monitor set up, I > can take the string s2 up to ImageResolution-> 192 before it wraps. > With a small window it wraps at ImageResolution-> 90. I think what is going on here is that the Mathematica front end is doing > the rasterizing and it first lays out the string for the window. If > it needs to wrap, then it formats the string into two lines before it > rasterizes. The weird part is that the decision to format depends on > the resolution even though the display does not. So, even if s2 above displays correctly, and even if the result of > Rasterize[s2,ImageResolution->300] is displayed correctly (at 100 point > font size) the intermediate calculation of whether there is enough space > to rasterize somehow is done depending on window size. I think this is > a rather serious bug, because it defeats the purpose of using > ImageResolution higher than screen resolution. Note that the same > occurs for RasterSize->num when num is bigger than your window, it > wraps. My question is this - how can I avoid this word wrapping? There must be > some way to do this! One approach I have tried is to use Graphics inside Rasterize, i.e. Rasterize[Graphics[Text[s2,{0,0},{-1,0}],ImageSize->{All, 200}] , > ImageResolution -> 300] This has a couple problems: - I get lots of padding on both sides of the text. I can't seem > to control it with ImagePadding-> 0, PlotRangePadding-> 0 - Yet if I don't make ImageSize very large, I have my string cut > off. Perhaps I am not making the right incantations to Graphics[] to get this > to work properly. Here is an additional question. I am using Rasterize because I need to > send documents to computers that don't have the same fonts I have. > Normally I would use a PDF file. However Mathematica does not seem to > support the font embedding feature of PDF files. If there was a way to > enable font embedding do that I wouldn't need to Rasterize the text. Nathan This message and any attachments, may contain confidential and/or > legally privileged information. If you are not the intended recipient > of the message by the original sender, please destroy it. Message and > attachments copyright (c) 2008, all rights reserved. Any unauthorized > dissemination, distribution or copying is strictly forbidden > === Subject: Re: Problem with Rasterize[] on Strings > I am trying to use Rasterize[] on strings, and I am running into some > strange behavior. > > This line works fine > > s1 = Style[A medium length string, FontSize-> 10, FontFamily -> > Times]; > > Rasterize[s1, ImageResolution -> 100] > > However, as I increase either the font size, or the image resolution, > the text will wrap into two or more lines: > > s2 = Style[A medium length string, FontSize-> 100, FontFamily -> > Times]; > > Rasterize[s2, ImageResolution -> 300] > > The strange thing is that this depends on the window size! If you make > the window very narrow (or have a low resolution screen) then it will > start wrapping sooner that it will with. So depending on your monitor > and graphics card, and what size window you use, you can find a > combination that will wrap. > > So if I stretch a Mathematica window across my dual-monitor set up, I > can take the string s2 up to ImageResolution-> 192 before it wraps. > With a small window it wraps at ImageResolution-> 90. > > I think what is going on here is that the Mathematica front end is doing > the rasterizing and it first lays out the string for the window. If > it needs to wrap, then it formats the string into two lines before it > rasterizes. The weird part is that the decision to format depends on > the resolution even though the display does not. > > So, even if s2 above displays correctly, and even if the result of > Rasterize[s2,ImageResolution->300] is displayed correctly (at 100 point > font size) the intermediate calculation of whether there is enough space > to rasterize somehow is done depending on window size. I think this is > a rather serious bug, because it defeats the purpose of using > ImageResolution higher than screen resolution. Note that the same > occurs for RasterSize->num when num is bigger than your window, it > wraps. > > My question is this - how can I avoid this word wrapping? There must be > some way to do this! > > One approach I have tried is to use Graphics inside Rasterize, i.e. > > Rasterize[Graphics[Text[s2,{0,0},{-1,0}],ImageSize->{All, 200}] , > ImageResolution -> 300] > > This has a couple problems: > > - I get lots of padding on both sides of the text. I can't seem > to control it with ImagePadding-> 0, PlotRangePadding-> 0 > > - Yet if I don't make ImageSize very large, I have my string cut > off. > > Perhaps I am not making the right incantations to Graphics[] to get this > to work properly. > > Here is an additional question. I am using Rasterize because I need to > send documents to computers that don't have the same fonts I have. > Normally I would use a PDF file. However Mathematica does not seem to > support the font embedding feature of PDF files. If there was a way to > enable font embedding do that I wouldn't need to Rasterize the text. > > Nathan > > This message and any attachments, may contain confidential and/or > legally privileged information. If you are not the intended recipient > of the message by the original sender, please destroy it. Message and > attachments copyright (c) 2008, all rights reserved. Any unauthorized > dissemination, distribution or copying is strictly forbidden Add LineBreakWithin -> False to Style. Maxim Rytin m.r@inbox.ru === Subject: Re: Changing default meaning of ImageSize -> Automatic > I like the default behavior of the option ImageSize -> Automatic in > Graphics[] that results in automatic resizing of graphics according to > the option ImageSizeMultipliers. But the default size of any graphics > produced with this option is too small (360 pixels width) for me and I > am coerced to resize it by hand any time it is produced for making it > visible in detail. Is there a way to change this behavior and to force > Graphics[] with the option ImageSize -> Automatic produce an image > with (for example) 500 pixels width? > > In[1]:= Plot[Sin[x], {x, 0, 6 Pi}] // ImageDimensions > > Out[1]= {360, 213} I have found some partial solution for my problem. It is undocumented option ImageSizeRaw located in Formatting Options | Expression Formatting | Graphics Box Options in the Options Inspector. Setting this option to 500 makes default size of generated Graphics to be 500 pixels on screen but ImageDimensions still returns size 360. This option does not allow to set the default size to be more than 698. I do not understand the reason for this as I still do not know how to make this size to be trueful (I mean such functions as ImageDimensions and ImageCrop to return 500 pixels wide image but not 360 as this happens now even with the option I have found). === Subject: Re: Changing default meaning of ImageSize -> Automatic On 5 =D1=CE=D7, 11:26, Sjoerd C. de Vries > With the Option Inspector in the Format menu you can change this > option setting > > The ImageSize default is in Graphics Options/Image Bounding Box. > > Make sure you to have Global Preferences in the inspector's drop > down menu at the top if you want this as your system wide default. > I have found that this works correctly in Mathematica 5.2. But in Mathematica 7 changing this option has no effect at all. Thus my question remains in force: how to force Graphics[] with the option ImageSize -> Automatic produce an image with (for example) 500 pixels width? The advantage of using the Automatic value of this option is automatic resizing Graphics depending on context and according to the option ImageSizeMultipliers. === Subject: Animation = Translation + Vibration, But How? I created a cantilever in Mathematica (nothing fancy, a Graphics 3D object created with Polygon). The only thing that I want now is to simulate its movement. I thought it would be easy, but it's proving to be diabolically difficult. Boundary conditions: the cantilever should be fixed in one end, and allowed to oscillate in the other (the oscillations are predetermined by some simple trigonometric function). This system should be allowed to translate in space (a moving beam, so to speak). So it should be allowed to move in the X-Y plane and oscillate along the Z- axis. Moving it in the X-Y plane is accomplished with the Translate function. But how can I make it oscillate in a specific manner? How can I combine in one animation both movements? Any help would be greatly apprerciated, Gideon === Subject: Re: Animation = Translation + Vibration, But How? Hi Gidi, here is a very simple aproach: lever[x_, y_, phi_?NumericQ] := Module[{length = 1}, p1 = {x, y, 0}; p2 = p1 + length { Cos[phi], 0, Sin[phi]}; Line[{p1, p2}] ]; Do[ x = 0.01 t; y = 0.01 t; phi = 0.2 Sin[0.2 t]; Show[Graphics3D[{Thickness[0.1], lever[x, y, phi]}], PlotRange -> {{0, 2}, {0, 2}, {-1, 1}}] // Print; , {t, 0, 100}] hope that this get you started, Daniel I created a cantilever in Mathematica (nothing fancy, a Graphics 3D > object created with Polygon). > The only thing that I want now is to simulate its movement. I thought > it would be easy, but it's proving to be diabolically difficult. > Boundary conditions: the cantilever should be fixed in one end, and > allowed to oscillate in the other (the oscillations are predetermined > by some simple trigonometric function). > This system should be allowed to translate in space (a moving beam, so > to speak). > So it should be allowed to move in the X-Y plane and oscillate along > the Z- axis. Moving it in the X-Y plane is accomplished with the Translate > function. But how can I make it oscillate in a specific manner? How > can I combine in one animation both movements? Any help would be greatly apprerciated, Gideon > === Subject: Re: loading autosaved package using Needs[] > according to comment at the top of autosaved packages, these files can > be loaded using Needs[] instead of Get[]. > it doesn't work for me... Needs[phd_thesis_common.m] > Needs::cxt: Invalid context specified at position 1 in > Needs[phd_thesis_common.m]. A context must consist of valid symbol > names separated by and ending with `. >> Call your package phdThesisCommon.m and try Needs[phdThesisCommon`] Note that: 1. A context does not have any file extension 2. You must add a back quote at the end of each context and subcontext 3. A valid Mathematica name is made of alphanumeric characters only --Jean-Marc === Subject: Re: loading autosaved package using Needs[] ONE: Do not use underscores _ in the name of your package, rename it as phdthesiscommon.m. Underscores have a meaning in Mathematica and cannot be used in a name, the same way you cannot use a plus sign + in a name. TWO: After fixing issue ONE, be sure the file is located in a directory where Mathematica can find it, for example the directory that is obtained after evaluating the command $UserBaseDirectory in Mathematica. Hope that helps Jose Mexico -----Mensaje original----- De: Mitch Murphy [mailto:mitch@lemma.ca] Enviado el: Martes, 06 de Enero de 2009 03:09 Para: mathgroup@smc.vnet.net Asunto: according to comment at the top of autosaved packages, these files can be loaded using Needs[] instead of Get[]. (************************************************************************) (* This file was generated automatically by the Mathematica front end. *) (* It contains Initialization cells from a Notebook file, which *) (* typically will have the same name as this file except ending in *) (* .nb instead of .m. *) (* *) (* This file is intended to be loaded into the Mathematica kernel using *) (* the package loading commands Get or Needs. Doing so is equivalent *) (* to using the Evaluate Initialization Cells menu command in the front *) (* end. *) (************************************************************************) it doesn't work for me... Needs[phd_thesis_common.m] Needs::cxt: Invalid context specified at position 1 in Needs[phd_thesis_common.m]. A context must consist of valid symbol names separated by and ending with `. >> any help/suggestions appreciated. Mitch === Subject: Re: loading autosaved package using Needs[] I suggest you read the manual on Needs. It will tell you about contexts, and such things as the single quote at the end of the name and the omission of the extension. And perhaps it should be at a specific location? > according to comment at the top of autosaved packages, these files can = > be loaded using Needs[] instead of Get[]. > > (************************************************************************= ) > (* This file was generated automatically by the Mathematica front > end. *) > (* It contains Initialization cells from a Notebook file, > which *) > (* typically will have the same name as this file except ending > in *) > (* .nb instead of > .m. = *) > (* = *) > (* This file is intended to be loaded into the Mathematica kernel > using *) > (* the package loading commands Get or Needs. Doing so is > equivalent *) > (* to using the Evaluate Initialization Cells menu command in the > front *) > (* > end. = *) > (************************************************************************= ) > > it doesn't work for me... > > Needs[phd_thesis_common.m] > Needs::cxt: Invalid context specified at position 1 in = > Needs[phd_thesis_common.m]. A context must consist of valid symbol > names separated by and ending with `. >> > > any help/suggestions appreciated. > > Mitch === Subject: Re: loading autosaved package using Needs[] the word package is used in two meanings. The most common is A Mathematica package, that generate a context for all its symbols and add some useful new functions. you have the second version A collection of Mathematica definitions without a individual context, including data, definitions, computation results and unstructured stuff. Needs[] will only work, if you package generate its own context. Jens > according to comment at the top of autosaved packages, these files can > be loaded using Needs[] instead of Get[]. (************************************************************************) > (* This file was generated automatically by the Mathematica front > end. *) > (* It contains Initialization cells from a Notebook file, > which *) > (* typically will have the same name as this file except ending > in *) > (* .nb instead of > .m. *) > (* *) > (* This file is intended to be loaded into the Mathematica kernel > using *) > (* the package loading commands Get or Needs. Doing so is > equivalent *) > (* to using the Evaluate Initialization Cells menu command in the > front *) > (* > end. *) > (************************************************************************) it doesn't work for me... Needs[phd_thesis_common.m] > Needs::cxt: Invalid context specified at position 1 in > Needs[phd_thesis_common.m]. A context must consist of valid symbol > names separated by and ending with `. >> any help/suggestions appreciated. Mitch > === Subject: Re: loading autosaved package using Needs[] Hi Mitch, > Needs[phd_thesis_common.m] > Needs::cxt: Invalid context specified at position 1 in > Needs[phd_thesis_common.m]. A context must consist of valid > symbol names separated by and ending with `. >> any help/suggestions appreciated. When you usually load WRI-supplied packages, you don't specify the .m extension, so why are you doing so here? If you've defined your package using BeginPackage[packagename`] then as long as your working directory in in your search path, you can load your package using Needs[packagename`] Note the trailing ` character & no .m extension. There's a tutorial at tutorial/SettingUpMathematicaPackages in the documentation but a very simple example follows. Save the notebook as test.nb after adjusting the directory, and don't evaluate the init cells (* cell 1 *) SetDirectory[d:/Tmpfiles]; (* cell 2: set these as init. cells *) BeginPackage[test`]; Working::usage = Working[] should print Hello World; Begin[`Private`]; Working[] := Print[Hello World]; End[]; (* PRivate*) EndPackage[]; (* end init cells *) (* cell 3 *) Quit[] (* don't use the package we just created -- force it to load from disk *) (* cell 4: don't evaluate init cells !*) SetDirectory[d:/Tmpfiles]; Needs[test`] Working[] Dave. === Subject: Re: loading autosaved package using Needs[] Because WRI doesn't have the slightest interest in giving users a coherent description of how to write packages, where to put them, and how to load them. Basically, you have to put the package in a folder in your private Applications folder and then include the folder name in the Needs statement as a leading context. The Presentations package gives an example of a package with extensive annotation and explanation, and shows where to put it and how to load it. There is also an essay on writing packages. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ according to comment at the top of autosaved packages, these files can be loaded using Needs[] instead of Get[]. (************************************************************************) (* This file was generated automatically by the Mathematica front end. *) (* It contains Initialization cells from a Notebook file, which *) (* typically will have the same name as this file except ending in *) (* .nb instead of .m. *) (* *) (* This file is intended to be loaded into the Mathematica kernel using *) (* the package loading commands Get or Needs. Doing so is equivalent *) (* to using the Evaluate Initialization Cells menu command in the front *) (* end. *) (************************************************************************) it doesn't work for me... Needs[phd_thesis_common.m] Needs::cxt: Invalid context specified at position 1 in Needs[phd_thesis_common.m]. A context must consist of valid symbol names separated by and ending with `. >> any help/suggestions appreciated. Mitch === Subject: Re: GroebnerBasis never finishes > Following groebner basis took more than an hour and did not complete. I had GroebnerBasis[ > { > 2401*t1*t3 + 2401*t2*t3 - 2401*t3^2 - 245*t1*v2 - 245*t2*v2 + 490*t3*v2 - > 25*v2^2, > 4802*t1*t3 - 2401*t3^2 - 490*t1*v2 + 490*t3*v2 - 25*v2^2, > -49*t*t3 + 49*t1*t3 + 5*t*v2 - 5*t1*v2, > 10*H - 49*t3^2 - 49*t4^2 + 98*t4*t5 - 49*t5^2 - 10*t4*v2 + 10*t5*v2 - 10*w1, > -10*H - 49*t3^2 - 49*t4^2 + 98*t4*t6 - 49*t6^2 + 10*t3*v2 - 10*t4*v2 + > 10*t6*v2 - 10*w2 > }, > {t1,t2,t3,t4,t5,t6,v2,w1,w2,H}, > MonomialOrder -> Lexicographic] The third polynomial has a variable named 't' (without any number) and this variable 't' is not listed in the list of variables for the Grobner basis. So, either 't' must be renamed to something else or be added to the list. For instance, the following is virtually instantaneous: In[9]:= GroebnerBasis[{2401*t1*t3 + 2401*t2*t3 - 2401*t3^2 - 245*t1*v2 - 245*t2*v2 + 490*t3*v2 - 25*v2^2, 4802*t1*t3 - 2401*t3^2 - 490*t1*v2 + 490*t3*v2 - 25*v2^2, -49*t*t3 + 49*t1*t3 + 5*t*v2 - 5*t1*v2, 10*H - 49*t3^2 - 49*t4^2 + 98*t4*t5 - 49*t5^2 - 10*t4*v2 + 10*t5*v2 - 10*w1, -10*H - 49*t3^2 - 49*t4^2 + 98*t4*t6 - 49*t6^2 + 10*t3*v2 - 10*t4*v2 + 10*t6*v2 - 10*w2}, {t, t1, t2, t3, t4, t5, t6, v2, w1, w2, H}, MonomialOrder -> Lexicographic] // Short Out[9]//Short= {19600 H^2+192080 H t4 t5-96040 H t5^2+<<67>>+4900 w2^2,<<18>>} --Jean-Marc === Subject: Re: GroebnerBasis never finishes Hi Andrew, in V7 it executes very fast (50mSec). Could it be that one of your variables or parameters already had some value? Try again with a fresh Kernel. Daniel GroebnerBasis[ > { > 2401*t1*t3 + 2401*t2*t3 - 2401*t3^2 - 245*t1*v2 - 245*t2*v2 + 490*t3*v2 - 25*v2^2, > 4802*t1*t3 - 2401*t3^2 - 490*t1*v2 + 490*t3*v2 - 25*v2^2, > -49*t*t3 + 49*t1*t3 + 5*t*v2 - 5*t1*v2, > 10*H - 49*t3^2 - 49*t4^2 + 98*t4*t5 - 49*t5^2 - 10*t4*v2 + 10*t5*v2 - 10*w1, > -10*H - 49*t3^2 - 49*t4^2 + 98*t4*t6 - 49*t6^2 + 10*t3*v2 - 10*t4*v2 + 10*t6*v2 - 10*w2 > }, > {t1,t2,t3,t4,t5,t6,v2,w1,w2,H}, > MonomialOrder -> Lexicographic] > === Subject: Re: GroebnerBasis never finishes > Following groebner basis took more than an hour and did not complete. I h= > > GroebnerBasis[ > { > 2401*t1*t3 + 2401*t2*t3 - 2401*t3^2 - 245*t1*v2 - 245*t2*v2 + 490*t3*v2 -= 25*v2^2, > 4802*t1*t3 - 2401*t3^2 - 490*t1*v2 + 490*t3*v2 - 25*v2^2, > -49*t*t3 + 49*t1*t3 + 5*t*v2 - 5*t1*v2, > 10*H - 49*t3^2 - 49*t4^2 + 98*t4*t5 - 49*t5^2 - 10*t4*v2 + 10*t5*v2 - 10*= w1, > -10*H - 49*t3^2 - 49*t4^2 + 98*t4*t6 - 49*t6^2 + 10*t3*v2 - 10*t4*v2 + 10= *t6*v2 - 10*w2}, > > {t1,t2,t3,t4,t5,t6,v2,w1,w2,H}, > MonomialOrder -> Lexicographic] If we keep the coefficient growth in check via a prime modulus, it will finish in 38 minutes or so. Timing[gb = GroebnerBasis[{ 2401*t1*t3 + 2401*t2*t3 - 2401*t3^2 - 245*t1*v2 - 245*t2*v2 + 490*t3*v2 - 25*v2^2, 4802*t1*t3 - 2401*t3^2 - 490*t1*v2 + 490*t3*v2 - 25*v2^2, -49*t*t3 + 49*t1*t3 + 5*t*v2 - 5*t1*v2, 10*H - 49*t3^2 - 49*t4^2 + 98*t4*t5 - 49*t5^2 - 10*t4*v2 + 10*t5*v2 - 10*w1, -10*H - 49*t3^2 - 49*t4^2 + 98*t4*t6 - 49*t6^2 + 10*t3*v2 - 10*t4*v2 + 10*t6*v2 - 10*w2}, {t1,t2,t3,t4,t5,t6,v2,w1,w2,H}, Modulus->Prime[111]];] Out[5]= {2226.18, Null} The basis is fairly large, in that some elements are polynomials of many thousands of terms. In[6]:= Length[gb] Out[6]= 67 In[7]:= LeafCount[gb] Out[7]= 9904305 In[8]:= Map[Length,gb] Out[8]= {296, 1149, 332, 13028, 95350, 82706, 70760, 59782, 49596, 40683, 32475, 25340, 25947, 19701, 19706, 14284, 14282, 10279, 9793, 9803, 6693, 7033, 6681, 4352, 4341, 4371, 4352, 2493, 2545, 2475, 1296, 1296, 1576, 1552, 702, 560, 552, 233, 311, 80, 169, 381, 198, 217, 18, 123, 61, 170, 90, 52, 10, 10, 86, 82, 40, 38, 8, 48, 40, 20, 16, 10, 48, 40, 20, 16, 10} Lifting the coefficient modulus I can still get a full result in around 51 minutes (I don't show below, but it has the same length and leaf count as the modular case). I note that this is on a machine with kernel. In[9]:= Timing[gbfull = GroebnerBasis[{ 2401*t1*t3 + 2401*t2*t3 - 2401*t3^2 - 245*t1*v2 - 245*t2*v2 + 490*t3*v2 - 25*v2^2, 4802*t1*t3 - 2401*t3^2 - 490*t1*v2 + 490*t3*v2 - 25*v2^2, -49*t*t3 + 49*t1*t3 + 5*t*v2 - 5*t1*v2, 10*H - 49*t3^2 - 49*t4^2 + 98*t4*t5 - 49*t5^2 - 10*t4*v2 + 10*t5*v2 - 10*w1, -10*H - 49*t3^2 - 49*t4^2 + 98*t4*t6 - 49*t6^2 + 10*t3*v2 - 10*t4*v2 + 10*t6*v2 - 10*w2}, {t1,t2,t3,t4,t5,t6,v2,w1,w2,H} ];] Out[9]= {3071.29, Null} I've been looking in a debugger at the progress of the Groebner walk, which used in this case. I do not see anything that strikes me as obviously misguided, so I am tentatively guessing it is simply a difficult basis to compute. But I will look a bit more because there is a term order perturbation step that might need some more thought. I notice you have five polynomials. Do you really require a basis with respect to all 11 variables? Or can some be regarded as parameters? If, say, your interest is only in the t1,...,t6 variables, you can treat the rest as coefficient parameters and get a basis quite fast, as below. In[5]:= InputForm[Timing[gbrat = GroebnerBasis[{ 2401*t1*t3 + 2401*t2*t3 - 2401*t3^2 - 245*t1*v2 - 245*t2*v2 + 490*t3*v2 - 25*v2^2, 4802*t1*t3 - 2401*t3^2 - 490*t1*v2 + 490*t3*v2 - 25*v2^2, -49*t*t3 + 49*t1*t3 + 5*t*v2 - 5*t1*v2, 10*H - 49*t3^2 - 49*t4^2 + 98*t4*t5 - 49*t5^2 - 10*t4*v2 + 10*t5*v2 - 10*w1, -10*H - 49*t3^2 - 49*t4^2 + 98*t4*t6 - 49*t6^2 + 10*t3*v2 - 10*t4*v2 + 10*t6*v2 - 10*w2}, {t1,t2,t3,t4,t5,t6}, CoefficientDomain->RationalFunctions]]] Out[5]//InputForm= {0.7360459999999998, {-922368160000*H^4 - 33232930569601*t5^8 + 265863444556808*t5^7*t6 - 930522055948828*t5^6*t6^2 + 1861044111897656*t5^5*t6^3 - 2326305139872070*t5^4*t6^4 + 1861044111897656*t5^3*t6^5 - 930522055948828*t5^2*t6^6 + 265863444556808*t5*t6^7 - 33232930569601*t6^8 + 1844736320000*H^3*t*v2 + 188238400000*H^3*v2^2 - 922368160000*H^2*t^2*v2^2 - 282357600000*H^2*t*v2^3 - 14406000000*H^2*v2^4 + 94119200000*H*t^2*v2^4 + 14406000000*H*t*v2^5 + 490000000*H*v2^6 - 2401000000*t^2*v2^6 - 245000000*t*v2^7 - 6250000*v2^8 + 1844736320000*H^3*w1 - 2767104480000*H^2*t*v2*w1 - 282357600000*H^2*v2^2*w1 + 922368160000*H*t^2*v2^2*w1 + 282357600000*H*t*v2^3*w1 + 14406000000*H*v2^4*w1 - 47059600000*t^2*v2^4*w1 - 7203000000*t*v2^5*w1 - 245000000*v2^6*w1 - 1383552240000*H^2*w1^2 + 1383552240000*H*t*v2*w1^2 + 141178800000*H*v2^2*w1^2 - 230592040000*t^2*v2^2*w1^2 - 70589400000*t*v2^3*w1^2 - 3601500000*v2^4*w1^2 + 461184080000*H*w1^3 - 230592040000*t*v2*w1^3 - 23529800000*v2^2*w1^3 - 57648010000*w1^4 + t5^4*t6^2*(-7975903336704240*t^2 - 406933843709400*t*v2 + 41523861603000*v2^2 - 406933843709400*w1 - 406933843709400*w2) + t5^2*t6^4*(-7975903336704240*t^2 - 406933843709400*t*v2 + 41523861603000*v2^2 - 406933843709400*w1 - 406933843709400*w2) + t5^6*(-531726889113616*t^2 - 27128922913960*t*v2 + 2768257440200*v2^2 - 27128922913960*w1 - 27128922913960*w2) + t6^6*(-531726889113616*t^2 - 27128922913960*t*v2 + 2768257440200*v2^2 - 27128922913960*w1 - 27128922913960*w2) - 1844736320000*H^3*w2 + 2767104480000*H^2*t*v2*w2 + 282357600000*H^2*v2^2*w2 - 922368160000*H*t^2*v2^2*w2 - 282357600000*H*t*v2^3*w2 - 14406000000*H*v2^4*w2 + 47059600000*t^2*v2^4*w2 + 7203000000*t*v2^5*w2 + 245000000*v2^6*w2 + 2767104480000*H^2*w1*w2 - 2767104480000*H*t*v2*w1*w2 - 282357600000*H*v2^2*w1*w2 + 461184080000*t^2*v2^2*w1*w2 + 141178800000*t*v2^3*w1*w2 + 7203000000*v2^4*w1*w2 - 1383552240000*H*w1^2*w2 + 691776120000*t*v2*w1^2*w2 + 70589400000*v2^2*w1^2*w2 + 230592040000*w1^3*w2 - 1383552240000*H^2*w2^2 + 1383552240000*H*t*v2*w2^2 + 141178800000*H*v2^2*w2^2 - 230592040000*t^2*v2^2*w2^2 - 70589400000*t*v2^3*w2^2 - 3601500000*v2^4*w2^2 + 1383552240000*H*w1*w2^2 - 691776120000*t*v2*w1*w2^2 - 70589400000*v2^2*w1*w2^2 - 345888060000*w1^2*w2^2 - 461184080000*H*w2^3 + 230592040000*t*v2*w2^3 + 23529800000*v2^2*w2^3 + 230592040000*w1*w2^3 - 57648010000*w2^4 + t5^5*t6*(3190361334681696*t^2 + 162773537483760*t*v2 - 16609544641200*v2^2 + 162773537483760*w1 + 162773537483760*w2) + t5*t6^5*(3190361334681696*t^2 + 162773537483760*t*v2 - 16609544641200*v2^2 + 162773537483760*w1 + 162773537483760*w2) + t5^3*t6^3*(10634537782272320*t^2 + 542578458279200*t*v2 - 55365148804000*v2^2 + 542578458279200*w1 + 542578458279200*w2) + t5^2*t6^2*(-66438178564800*H^2 + 66438178564800*H*t*v2 + 6779405976000*H*v2^2 + 99657267847200*t^2*v2^2 + 3389702988000*t*v2^3 - 518832090000*v2^4 + 66438178564800*H*w1 - 1302188299870080*t^2*w1 - 99657267847200*t*v2*w1 + 3389702988000*v2^2*w1 - 49828633923600*w1^2 - 66438178564800*H*w2 - 1302188299870080*t^2*w2 - 33219089282400*t*v2*w2 + 10169108964000*v2^2*w2 - 33219089282400*w1*w2 - 49828633923600*w2^2) + t5^4*(-11073029760800*H^2 + 11073029760800*H*t*v2 + 1129900996000*H*v2^2 + 16609544641200*t^2*v2^2 + 564950498000*t*v2^3 - 86472015000*v2^4 + 11073029760800*H*w1 - 217031383311680*t^2*w1 - 16609544641200*t*v2*w1 + 564950498000*v2^2*w1 - 8304772320600*w1^2 - 11073029760800*H*w2 - 217031383311680*t^2*w2 - 5536514880400*t*v2*w2 + 1694851494000*v2^2*w2 - 5536514880400*w1*w2 - 8304772320600*w2^2) + t6^4*(-11073029760800*H^2 + 11073029760800*H*t*v2 + 1129900996000*H*v2^2 + 16609544641200*t^2*v2^2 + 564950498000*t*v2^3 - 86472015000*v2^4 + 11073029760800*H*w1 - 217031383311680*t^2*w1 - 16609544641200*t*v2*w1 + 564950498000*v2^2*w1 - 8304772320600*w1^2 - 11073029760800*H*w2 - 217031383311680*t^2*w2 - 5536514880400*t*v2*w2 + 1694851494000*v2^2*w2 - 5536514880400*w1*w2 - 8304772320600*w2^2) + t5^3*t6*(44292119043200*H^2 - 44292119043200*H*t*v2 - 4519603984000*H*v2^2 - 66438178564800*t^2*v2^2 - 2259801992000*t*v2^3 + 345888060000*v2^4 - 44292119043200*H*w1 + 868125533246720*t^2*w1 + 66438178564800*t*v2*w1 - 2259801992000*v2^2*w1 + 33219089282400*w1^2 + 44292119043200*H*w2 + 868125533246720*t^2*w2 + 22146059521600*t*v2*w2 - 6779405976000*v2^2*w2 + 22146059521600*w1*w2 + 33219089282400*w2^2) + t5*t6^3*(44292119043200*H^2 - 44292119043200*H*t*v2 - 4519603984000*H*v2^2 - 66438178564800*t^2*v2^2 - 2259801992000*t*v2^3 + 345888060000*v2^4 - 44292119043200*H*w1 + 868125533246720*t^2*w1 + 66438178564800*t*v2*w1 - 2259801992000*v2^2*w1 + 33219089282400*w1^2 + 44292119043200*H*w2 + 868125533246720*t^2*w2 + 22146059521600*t*v2*w2 - 6779405976000*v2^2*w2 + 22146059521600*w1*w2 + 33219089282400*w2^2) + t5^2*(-88584238086400*H^2*t^2 - 4519603984000*H^2*t*v2 + 461184080000*H^2*v2^2 + 9039207968000*H*t^2*v2^2 - 47059600000*H*v2^4 + 11764900000*t*v2^5 + 1200500000*v2^6 - 4519603984000*H^2*w1 + 88584238086400*H*t^2*w1 + 9039207968000*H*t*v2*w1 - 6779405976000*t^2*v2^2*w1 - 230592040000*t*v2^3*w1 + 11764900000*v2^4*w1 + 4519603984000*H*w1^2 - 22146059521600*t^2*w1^2 - 3389702988000*t*v2*w1^2 - 115296020000*v2^2*w1^2 - 1129900996000*w1^3 - 4519603984000*H^2*w2 - 88584238086400*H*t^2*w2 + 922368160000*H*v2^2*w2 + 2259801992000*t^2*v2^2*w2 - 230592040000*t*v2^3*w2 - 35294700000*v2^4*w2 + 44292119043200*t^2*w1*w2 + 2259801992000*t*v2*w1*w2 - 230592040000*v2^2*w1*w2 + 1129900996000*w1^2*w2 - 4519603984000*H*w2^2 - 22146059521600*t^2*w2^2 + 1129900996000*t*v2*w2^2 + 345888060000*v2^2*w2^2 + 1129900996000*w1*w2^2 - 1129900996000*w2^3) + t6^2*(-88584238086400*H^2*t^2 - 4519603984000*H^2*t*v2 + 461184080000*H^2*v2^2 + 9039207968000*H*t^2*v2^2 - 47059600000*H*v2^4 + 11764900000*t*v2^5 + 1200500000*v2^6 - 4519603984000*H^2*w1 + 88584238086400*H*t^2*w1 + 9039207968000*H*t*v2*w1 - 6779405976000*t^2*v2^2*w1 - 230592040000*t*v2^3*w1 + 11764900000*v2^4*w1 + 4519603984000*H*w1^2 - 22146059521600*t^2*w1^2 - 3389702988000*t*v2*w1^2 - 115296020000*v2^2*w1^2 - 1129900996000*w1^3 - 4519603984000*H^2*w2 - 88584238086400*H*t^2*w2 + 922368160000*H*v2^2*w2 + 2259801992000*t^2*v2^2*w2 - 230592040000*t*v2^3*w2 - 35294700000*v2^4*w2 + 44292119043200*t^2*w1*w2 + 2259801992000*t*v2*w1*w2 - 230592040000*v2^2*w1*w2 + 1129900996000*w1^2*w2 - 4519603984000*H*w2^2 - 22146059521600*t^2*w2^2 + 1129900996000*t*v2*w2^2 + 345888060000*v2^2*w2^2 + 1129900996000*w1*w2^2 - 1129900996000*w2^3) + t5*t6*(177168476172800*H^2*t^2 + 9039207968000*H^2*t*v2 - 922368160000*H^2*v2^2 - 18078415936000*H*t^2*v2^2 + 94119200000*H*v2^4 - 23529800000*t*v2^5 - 2401000000*v2^6 + 9039207968000*H^2*w1 - 177168476172800*H*t^2*w1 - 18078415936000*H*t*v2*w1 + 13558811952000*t^2*v2^2*w1 + 461184080000*t*v2^3*w1 - 23529800000*v2^4*w1 - 9039207968000*H*w1^2 + 44292119043200*t^2*w1^2 + 6779405976000*t*v2*w1^2 + 230592040000*v2^2*w1^2 + 2259801992000*w1^3 + 9039207968000*H^2*w2 + 177168476172800*H*t^2*w2 - 1844736320000*H*v2^2*w2 - 4519603984000*t^2*v2^2*w2 + 461184080000*t*v2^3*w2 + 70589400000*v2^4*w2 - 88584238086400*t^2*w1*w2 - 4519603984000*t*v2*w1*w2 + 461184080000*v2^2*w1*w2 - 2259801992000*w1^2*w2 + 9039207968000*H*w2^2 + 44292119043200*t^2*w2^2 - 2259801992000*t*v2*w2^2 - 691776120000*v2^2*w2^2 - 2259801992000*w1*w2^2 + 2259801992000*w2^3), -17716847617280000*H^4*t^2*v2 - 1807841593600000*H^4*t*v2^2 + 17716847617280000*H^3*t^3*v2^2 - 92236816000000*H^4*v2^3 + 5423524780800000*H^3*t^2*v2^3 + 599539304000000*H^3*t*v2^4 - 2711762390400000*H^2*t^3*v2^4 + 23529800000000*H^3*v2^5 - 749424130000000*H^2*t^2*v2^5 - 70589400000000*H^2*t*v2^6 + 196003234000000*H*t^3*v2^6 - 2160900000000*H^2*v2^7 + 45883110000000*H*t^2*v2^7 + 3481450000000*H*t*v2^8 - 5294205000000*t^3*v2^8 + 85750000000*H*v2^9 - 990412500000*t^2*v2^9 - 61250000000*t*v2^10 - 1250000000*v2^11 + 35433695234560000*H^3*t^2*v2*w1 + 2711762390400000*H^3*t*v2^2*w1 - 26575271425920000*H^2*t^3*v2^2*w1 + 138355224000000*H^3*v2^3*w1 - 6779405976000000*H^2*t^2*v2^3*w1 - 691776120000000*H^2*t*v2^4*w1 + 2259801992000000*H*t^3*v2^4*w1 - 28235760000000*H^2*v2^5*w1 + 588009702000000*H*t^2*v2^5*w1 + 56471520000000*H*t*v2^6*w1 - 74942413000000*t^3*v2^6*w1 + 1800750000000*H*v2^7*w1 - 18235595000000*t^2*v2^7*w1 - 1440600000000*t*v2^8*w1 - 36750000000*v2^9*w1 - 26575271425920000*H^2*t^2*v2*w1^2 - 1355881195200000*H^2*t*v2^2*w1^2 + 13287635712960000*H*t^3*v2^2*w1^2 - 69177612000000*H^2*v2^3*w1^2 + 2711762390400000*H*t^2*v2^3*w1^2 + 242121642000000*H*t*v2^4*w1^2 - 451960398400000*t^3*v2^4*w1^2 + 10588410000000*H*v2^5*w1^2 - 106648818500000*t^2*v2^5*w1^2 - 10588410000000*t*v2^6*w1^2 - 360150000000*v2^7*w1^2 + 8858423808640000*H*t^2*v2*w1^3 + 225980199200000*H*t*v2^2*w1^3 - 2214605952160000*t^3*v2^2*w1^3 + 11529602000000*H*v2^3*w1^3 - 338970298800000*t^2*v2^3*w1^3 - 23059204000000*t*v2^4*w1^3 - 1176490000000*v2^5*w1^3 - 1107302976080000*t^2*v2*w1^4 - 35433695234560000*H^3*t^2*v2*w2 - 4519603984000000*H^3*t*v2^2*w2 + 26575271425920000*H^2*t^3*v2^2*w2 - 230592040000000*H^3*v2^3*w2 + 9491168366400000*H^2*t^2*v2^3*w2 + 1106841792000000*H^2*t*v2^4*w2 - 3163722788800000*H*t^3*v2^4*w2 + 42353640000000*H^2*v2^5*w2 - 910838558000000*H*t^2*v2^5*w2 - 84707280000000*H*t*v2^6*w2 + 121060821000000*t^3*v2^6*w2 - 2521050000000*H*v2^7*w2 + 27647515000000*t^2*v2^7*w2 + 2040850000000*t*v2^8*w2 + 49000000000*v2^9*w2 + 53150542851840000*H^2*t^2*v2*w1*w2 + 5423524780800000*H^2*t*v2^2*w1*w2 - 26575271425920000*H*t^3*v2^2*w1*w2 + 276710448000000*H^2*v2^3*w1*w2 - 8135287171200000*H*t^2*v2^3*w1*w2 - 899308956000000*H*t*v2^4*w1*w2 + 1355881195200000*t^3*v2^4*w1*w2 - 35294700000000*H*v2^5*w1*w2 + 374712065000000*t^2*v2^5*w1*w2 + 35294700000000*t*v2^6*w1*w2 + 1080450000000*v2^7*w1*w2 - 26575271425920000*H*t^2*v2*w1^2*w2 - 2033821792800000*H*t*v2^2*w1^2*w2 + 6643817856480000*t^3*v2^2*w1^2*w2 - 103766418000000*H*v2^3*w1^2*w2 + 1694851494000000*t^2*v2^3*w1^2*w2 + 172944030000000*t*v2^4*w1^2*w2 + 7058940000000*v2^5*w1^2*w2 + 4429211904320000*t^2*v2*w1^3*w2 + 225980199200000*t*v2^2*w1^3*w2 + 11529602000000*v2^3*w1^3*w2 - 26575271425920000*H^2*t^2*v2*w2^2 - 4067643585600000*H^2*t*v2^2*w2^2 + 13287635712960000*H*t^3*v2^2*w2^2 - 207532836000000*H^2*v2^3*w2^2 + 5423524780800000*H*t^2*v2^3*w2^2 + 657187314000000*H*t*v2^4*w2^2 - 903920796800000*t^3*v2^4*w2^2 + 24706290000000*H*v2^5*w2^2 - 268063246500000*t^2*v2^5*w2^2 - 24706290000000*t*v2^6*w2^2 - 720300000000*v2^7*w2^2 + 26575271425920000*H*t^2*v2*w1*w2^2 + 3389702988000000*H*t*v2^2*w1*w2^2 - 6643817856480000*t^3*v2^2*w1*w2^2 + 172944030000000*H*v2^3*w1*w2^2 - 2372792091600000*t^2*v2^3*w1*w2^2 - 276710448000000*t*v2^4*w1*w2^2 - 10588410000000*v2^5*w1*w2^2 - 6643817856480000*t^2*v2*w1^2*w2^2 - 677940597600000*t*v2^2*w1^2*w2^2 - 34588806000000*v2^3*w1^2*w2^2 - 8858423808640000*H*t^2*v2*w2^3 - 1581861394400000*H*t*v2^2*w2^3 + 2214605952160000*t^3*v2^2*w2^3 - 80707214000000*H*v2^3*w2^3 + 1016910896400000*t^2*v2^3*w2^3 + 126825622000000*t*v2^4*w2^3 + 4705960000000*v2^5*w2^3 + 4429211904320000*t^2*v2*w1*w2^3 + 677940597600000*t*v2^2*w1*w2^3 + 34588806000000*v2^3*w1*w2^3 - 1107302976080000*t^2*v2*w2^4 - 225980199200000*t*v2^2*w2^4 - 11529602000000*v2^3*w2^4 + t5^4*t6^3*(-44683669126662720560*H*t^2 - 4559558074149257200*H*t*v2 - 174472885490405250*H*v2^2 + 2279779037074628600*t^2*v2^2 + 378024585229211375*t*v2^3 + 14836129718571875*v2^4 + 22341834563331360280*t^2*w1 + 1139889518537314300*t*v2*w1 + 29078814248400875*v2^2*w1 - 22341834563331360280*t^2*w2 - 3419668555611942900*t*v2*w2 - (-26810201475997632336*H*t^2 - 2735734844489554320*H*t*v2 - 104683731294243150*H*v2^2 + 1367867422244777160*t^2*v2^2 + 226814751137526825*t*v2^3 + 8901677831143125*v2^4 + 13405100737998816168*t^2*w1 + 683933711122388580*t*v2*w1 + 17447288549040525*v2^2*w1 - 13405100737998816168*t^2*w2 - 2051801133367165740*t*v2*w2 - 87236442745202625*v2^2*w2) + t5^6*t6*(-8936733825332544112*H*t^2 - 911911614829851440*H*t*v2 - 34894577098081050*H*v2^2 + 455955807414925720*t^2*v2^2 + 75604917045842275*t*v2^3 + 2967225943714375*v2^4 + 4468366912666272056*t^2*w1 + 227977903707462860*t*v2*w1 + 5815762849680175*v2^2*w1 - 4468366912666272056*t^2*w2 - 683933711122388580*t*v2*w2 - 29078814248400875*v2^2*w2) + t6^7*(-1276676260761792016*H*t^2 - 130273087832835920*H*t*v2 - 4984939585440150*H*v2^2 + 65136543916417960*t^2*v2^2 + 10800702435120325*t*v2^3 + 423889420530625*v2^4 + 638338130380896008*t^2*w1 + 32568271958208980*t*v2*w1 + 830823264240025*v2^2*w1 - 638338130380896008*t^2*w2 - 97704815874626940*t*v2*w2 - 4154116321200125*v2^2*w2) + t5^7*(1276676260761792016*H*t^2 + 130273087832835920*H*t*v2 + 4984939585440150*H*v2^2 - 65136543916417960*t^2*v2^2 - 10800702435120325*t*v2^3 - 423889420530625*v2^4 - 638338130380896008*t^2*w1 - 32568271958208980*t*v2*w1 - 830823264240025*v2^2*w1 + 638338130380896008*t^2*w2 + 97704815874626940*t*v2*w2 + 4154116321200125*v2^2*w2) + t5*t6^6*(8936733825332544112*H*t^2 + 911911614829851440*H*t*v2 + 34894577098081050*H*v2^2 - 455955807414925720*t^2*v2^2 - 75604917045842275*t*v2^3 - 2967225943714375*v2^4 - 4468366912666272056*t^2*w1 - 227977903707462860*t*v2*w1 - 5815762849680175*v2^2*w1 + 4468366912666272056*t^2*w2 + 683933711122388580*t*v2*w2 + 29078814248400875*v2^2*w2) + t5^5*t6^2* (26810201475997632336*H*t^2 + 2735734844489554320*H*t*v2 + 104683731294243150*H*v2^2 - 1367867422244777160*t^2*v2^2 - 226814751137526825*t*v2^3 - 8901677831143125*v2^4 - 13405100737998816168*t^2*w1 - 683933711122388580*t*v2*w1 - 17447288549040525*v2^2*w1 + 13405100737998816168*t^2*w2 + 2051801133367165740*t*v2*w2 + 87236442745202625*v2^2*w2) + t5^3*t6^4* (44683669126662720560*H*t^2 + 4559558074149257200*H*t*v2 + 174472885490405250*H*v2^2 - 2279779037074628600*t^2*v2^2 - 378024585229211375*t*v2^3 - 14836129718571875*v2^4 - 22341834563331360280*t^2*w1 - 1139889518537314300*t*v2*w1 - 29078814248400875*v2^2*w1 + 22341834563331360280*t^2*w2 + 3419668555611942900*t*v2*w2 + (-204268201721886722560*H*t^4 - 132931722278404000*H^2*t*v2 - 31265541079880620800*H*t^3*v2 - 6782230728490000*H^2*v2^2 - 664658611392020000*H*t^2*v2^2 + 10421847026626873600*t^4*v2^2 + 88168999470370000*H*t*v2^3 + 2259839278732868000*t^3*v2^3 + 4844450520350000*H*v2^4 + 94951230198860000*t^2*v2^4 - 6228579240450000*t*v2^5 - 370748764312500*v2^6 - 10421847026626873600*H*t^2*w1 + 102134100860943361280*t^4*w1 - 930522055948828000*H*t*v2*w1 + 10421847026626873600*t^3*v2*w1 - 33911153642450000*H*v2^2*w1 + 332329305696010000*t^2*v2^2*w1 + 57648961192165000*t*v2^3*w1 + 2422225260175000*v2^4*w1 + 5210923513313436800*t^2*w1^2 + 232630513987207000*t*v2*w1^2 + 5086673046367500*v2^2*w1^2 - 10421847026626873600*H*t^2*w2 - 102134100860943361280*t^4*w2 - 1196385500505636000*H*t*v2*w2 - 20843694053253747200*t^3*v2*w2 - 47475615099430000*H*v2^2*w2 - 332329305696010000*t^2*v2^2*w2 + 145817960662535000*t*v2^3*w2 + 7266675780525000*v2^4*w2 - 465261027974414000*t*v2*w1*w2 - 23737807549715000*v2^2*w1*w2 - 5210923513313436800*t^2*w2^2 - 830823264240025000*t*v2*w2^2 - 35606711324572500*v2^2*w2^2) + t5^4*t6* (-102134100860943361280*H*t^4 - 66465861139202000*H^2*t*v2 - 15632770539940310400*H*t^3*v2 - 3391115364245000*H^2*v2^2 - 332329305696010000*H*t^2*v2^2 + 5210923513313436800*t^4*v2^2 + 44084499735185000*H*t*v2^3 + 1129919639366434000*t^3*v2^3 + 2422225260175000*H*v2^4 + 47475615099430000*t^2*v2^4 - 3114289620225000*t*v2^5 - 185374382156250*v2^6 - 5210923513313436800*H*t^2*w1 + 51067050430471680640*t^4*w1 - 465261027974414000*H*t*v2*w1 + 5210923513313436800*t^3*v2*w1 - 16955576821225000*H*v2^2*w1 + 166164652848005000*t^2*v2^2*w1 + 28824480596082500*t*v2^3*w1 + 1211112630087500*v2^4*w1 + 2605461756656718400*t^2*w1^2 + 116315256993603500*t*v2*w1^2 + 2543336523183750*v2^2*w1^2 - 5210923513313436800*H*t^2*w2 - 51067050430471680640*t^4*w2 - 598192750252818000*H*t*v2*w2 - 10421847026626873600*t^3*v2*w2 - 23737807549715000*H*v2^2*w2 - 166164652848005000*t^2*v2^2*w2 + 72908980331267500*t*v2^3*w2 + 3633337890262500*v2^4*w2 - 232630513987207000*t*v2*w1*w2 - 11868903774857500*v2^2*w1*w2 - 2605461756656718400*t^2*w2^2 - 415411632120012500*t*v2*w2^2 - 17803355662286250*v2^2*w2^2) + t6^5*(-20426820172188672256*H*t^4 - 13293172227840400*H^2*t*v2 - 3126554107988062080*H*t^3*v2 - 678223072849000*H^2*v2^2 - 66465861139202000*H*t^2*v2^2 + 1042184702662687360*t^4*v2^2 + 8816899947037000*H*t*v2^3 + 225983927873286800*t^3*v2^3 + 484445052035000*H*v2^4 + 9495123019886000*t^2*v2^4 - 622857924045000*t*v2^5 - 37074876431250*v2^6 - 1042184702662687360*H*t^2*w1 + 10213410086094336128*t^4*w1 - 93052205594882800*H*t*v2*w1 + 1042184702662687360*t^3*v2*w1 - 3391115364245000*H*v2^2*w1 + 33232930569601000*t^2*v2^2*w1 + 5764896119216500*t*v2^3*w1 + 242222526017500*v2^4*w1 + 521092351331343680*t^2*w1^2 + 23263051398720700*t*v2*w1^2 + 508667304636750*v2^2*w1^2 - 1042184702662687360*H*t^2*w2 - 10213410086094336128*t^4*w2 - 119638550050563600*H*t*v2*w2 - 2084369405325374720*t^3*v2*w2 - 4747561509943000*H*v2^2*w2 - 33232930569601000*t^2*v2^2*w2 + 14581796066253500*t*v2^3*w2 + 726667578052500*v2^4*w2 - 46526102797441400*t*v2*w1*w2 - 2373780754971500*v2^2*w1*w2 - 521092351331343680*t^2*w2^2 - 83082326424002500*t*v2*w2^2 - 3560671132457250*v2^2*w2^2) + t5^5*(20426820172188672256*H*t^4 + 13293172227840400*H^2*t*v2 + 3126554107988062080*H*t^3*v2 + 678223072849000*H^2*v2^2 + 66465861139202000*H*t^2*v2^2 - 1042184702662687360*t^4*v2^2 - 8816899947037000*H*t*v2^3 - 225983927873286800*t^3*v2^3 - 484445052035000*H*v2^4 - 9495123019886000*t^2*v2^4 + 622857924045000*t*v2^5 + 37074876431250*v2^6 + 1042184702662687360*H*t^2*w1 - 10213410086094336128*t^4*w1 + 93052205594882800*H*t*v2*w1 - 1042184702662687360*t^3*v2*w1 + 3391115364245000*H*v2^2*w1 - 33232930569601000*t^2*v2^2*w1 - 5764896119216500*t*v2^3*w1 - 242222526017500*v2^4*w1 - 521092351331343680*t^2*w1^2 - 23263051398720700*t*v2*w1^2 - 508667304636750*v2^2*w1^2 + 1042184702662687360*H*t^2*w2 + 10213410086094336128*t^4*w2 + 119638550050563600*H*t*v2*w2 + 2084369405325374720*t^3*v2*w2 + 4747561509943000*H*v2^2*w2 + 33232930569601000*t^2*v2^2*w2 - 14581796066253500*t*v2^3*w2 - 726667578052500*v2^4*w2 + 46526102797441400*t*v2*w1*w2 + 2373780754971500*v2^2*w1*w2 + 521092351331343680*t^2*w2^2 + 83082326424002500*t*v2*w2^2 + 3560671132457250*v2^2*w2^2) + t5*t6^4* (102134100860943361280*H*t^4 + 66465861139202000*H^2*t*v2 + 15632770539940310400*H*t^3*v2 + 3391115364245000*H^2*v2^2 + 332329305696010000*H*t^2*v2^2 - 5210923513313436800*t^4*v2^2 - 44084499735185000*H*t*v2^3 - 1129919639366434000*t^3*v2^3 - 2422225260175000*H*v2^4 - 47475615099430000*t^2*v2^4 + 3114289620225000*t*v2^5 + 185374382156250*v2^6 + 5210923513313436800*H*t^2*w1 - 51067050430471680640*t^4*w1 + 465261027974414000*H*t*v2*w1 - 5210923513313436800*t^3*v2*w1 + 16955576821225000*H*v2^2*w1 - 166164652848005000*t^2*v2^2*w1 - 28824480596082500*t*v2^3*w1 - 1211112630087500*v2^4*w1 - 2605461756656718400*t^2*w1^2 - 116315256993603500*t*v2*w1^2 - 2543336523183750*v2^2*w1^2 + 5210923513313436800*H*t^2*w2 + 51067050430471680640*t^4*w2 + 598192750252818000*H*t*v2*w2 + 10421847026626873600*t^3*v2*w2 + 23737807549715000*H*v2^2*w2 + 166164652848005000*t^2*v2^2*w2 - 72908980331267500*t*v2^3*w2 - 3633337890262500*v2^4*w2 + 232630513987207000*t*v2*w1*w2 + 11868903774857500*v2^2*w1*w2 + 2605461756656718400*t^2*w2^2 + 415411632120012500*t*v2*w2^2 + 17803355662286250*v2^2*w2^2) + t5^3*t6^2* (204268201721886722560*H*t^4 + 132931722278404000*H^2*t*v2 + 31265541079880620800*H*t^3*v2 + 6782230728490000*H^2*v2^2 + 664658611392020000*H*t^2*v2^2 - 10421847026626873600*t^4*v2^2 - 88168999470370000*H*t*v2^3 - 2259839278732868000*t^3*v2^3 - 4844450520350000*H*v2^4 - 94951230198860000*t^2*v2^4 + 6228579240450000*t*v2^5 + 370748764312500*v2^6 + 10421847026626873600*H*t^2*w1 - 102134100860943361280*t^4*w1 + 930522055948828000*H*t*v2*w1 - 10421847026626873600*t^3*v2*w1 + 33911153642450000*H*v2^2*w1 - 332329305696010000*t^2*v2^2*w1 - 57648961192165000*t*v2^3*w1 - 2422225260175000*v2^4*w1 - 5210923513313436800*t^2*w1^2 - 232630513987207000*t*v2*w1^2 - 5086673046367500*v2^2*w1^2 + 10421847026626873600*H*t^2*w2 + 102134100860943361280*t^4*w2 + 1196385500505636000*H*t*v2*w2 + 20843694053253747200*t^3*v2*w2 + 47475615099430000*H*v2^2*w2 + 332329305696010000*t^2*v2^2*w2 - 145817960662535000*t*v2^3*w2 - 7266675780525000*v2^4*w2 + 465261027974414000*t*v2*w1*w2 + 23737807549715000*v2^2*w1*w2 + 5210923513313436800*t^2*w2^2 + 830823264240025000*t*v2*w2^2 + 35606711324572500*v2^2*w2^2) + t5^2*t6* (-1276144533872678400*H^3*t^2 - 130218829987008000*H^3*t*v2 + 638072266936339200*H^2*t^3*v2 - 5813340624420000*H^3*v2^2 + 260437659974016000*H^2*t^2*v2^2 + 2552289067745356800*H*t^4*v2^2 + 31973373434310000*H^2*t*v2^3 + 325547074967520000*H*t^3*v2^3 + 1228767333150000*H^2*v2^4 - 8720010936630000*H*t^2*v2^4 - 130218829987008000*t^4*v2^4 - 2754133677750000*H*t*v2^5 - 24499078345770000*t^3*v2^5 - 105928218375000*H*v2^6 - 741497528625000*t^2*v2^6 + 78905713687500*t*v2^7 + 3860357812500*v2^8 + 1914216800809017600*H^2*t^2* w1 - 25012432863904496640*H*t^4*w1 + 130218829987008000*H^2*t*v2*w1 - 4466505868554374400*H*t^3*v2*w1 + 5398102008390000*H^2*v2^2*w1 - 292992367470768000*H*t^2*v2^2*w1 - 13702874328990000*H*t*v2^3*w1 + 162773537483760000*t^3*v2^3*w1 - 381341586150000*H*v2^4*w1 + 19308595645395000*t^2*v2^4*w1 + 360155942475000*t*v2^5*w1 - 7566301312500*v2^6*w1 - 1595180667340848000*H*t^2*w1^2 + 12506216431952248320*t^4*w1^2 - 97664122490256000*H*t*v2*w1^2 + 1435662600606763200*t^3*v2*w1^2 - 3529528236255000*H*v2^2*w1^2 + 48832061245128000*t^2*v2^2*w1^2 + 5917150278427500*t*v2^3*w1^2 + 264820545937500*v2^4*w1^2 + 478554200202254400*t^2*w1^3 + 16277353748376000*t*v2*w1^3 + 311428962022500*v2^2*w1^3 - 1914216800809017600*H^2*t^2*w2 - 25012432863904496640*H*t^4*w2 - 260437659974016000*H^2*t*v2*w2 - 3190361334681696000*H*t^3*v2*w2 - 12041919864870000*H^2*v2^2*w2 + 227882952477264000*H*t^2*v2^2*w2 + 2552289067745356800*t^4*v2^2*w2 + 50243872539630000*H*t*v2^3*w2 + 488320612451280000*t^3*v2^3*w2 + 2076193080150000*H*v2^4*w2 + 10588584708765000*t^2*v2^4*w2 - 2393977735275000*t*v2^5*w2 - 113494519687500*v2^6*w2 + 638072266936339200*H*t^2*w1*w2 + 65109414993504000*H*t*v2*w1*w2 - 1595180667340848000*t^3*v2*w1*w2 + 3737147544270000*H*v2^2*w1*w2 - 195328244980512000*t^2*v2^2*w1*w2 - 1868573772135000*t*v2^3*w1*w2 + 148299505725000*v2^4*w1*w2 - 159518066734084800*t^2*w1^2*w2 - 48832061245128000*t*v2*w1^2*w2 - 2595241350187500*v2^2*w1^2*w2 - 1595180667340848000*H*t^2*w2^2 - 12506216431952248320*t^4*w2^2 - 227882952477264000*H*t*v2*w2^2 - 2392771001011272000*t^3*v2*w2^2 - 10173346092735000*H*v2^2*w2^2 + 16277353748376000*t^2*v2^2*w2^2 + 24187649383747500*t*v2^3*w2^2 + 1112246292937500*v2^4*w2^2 + 159518066734084800*t^2*w1*w2^2 - 16277353748376000*t*v2*w1*w2^2 - 726667578052500*v2^2*w1*w2^2 - 478554200202254400*t^2*w2^3 - 81386768741880000*t*v2*w2^3 - 3633337890262500*v2^2*w2^3) + t6^3*(-425381511290892800*H^3*t^2 - 43406276662336000*H^3*t*v2 + 212690755645446400*H^2*t^3*v2 - 1937780208140000*H^3*v2^2 + 86812553324672000*H^2*t^2*v2^2 + 850763022581785600*H*t^4*v2^2 + 10657791144770000*H^2*t*v2^3 + 108515691655840000*H*t^3*v2^3 + 409589111050000*H^2*v2^4 - 2906670312210000*H*t^2*v2^4 - 43406276662336000*t^4*v2^4 - 918044559250000*H*t*v2^5 - 8166359448590000*t^3*v2^5 - 35309406125000*H*v2^6 - 247165842875000*t^2*v2^6 + 26301904562500*t*v2^7 + 1286785937500*v2^8 + 638072266936339200*H^2*t^2* w1 - 8337477621301498880*H*t^4*w1 + 43406276662336000*H^2*t*v2*w1 - 1488835289518124800*H*t^3*v2*w1 + 1799367336130000*H^2*v2^2*w1 - 97664122490256000*H*t^2*v2^2*w1 - 4567624776330000*H*t*v2^3*w1 + 54257845827920000*t^3*v2^3*w1 - 127113862050000*H*v2^4*w1 + 6436198548465000*t^2*v2^4*w1 + 120051980825000*t*v2^5*w1 - 2522100437500*v2^6*w1 - 531726889113616000*H*t^2*w1^2 + 4168738810650749440*t^4*w1^2 - 32554707496752000*H*t*v2*w1^2 + 478554200202254400*t^3*v2*w1^2 - 1176509412085000*H*v2^2*w1^2 + 16277353748376000*t^2*v2^2*w1^2 + 1972383426142500*t*v2^3*w1^2 + 88273515312500*v2^4*w1^2 + 159518066734084800*t^2*w1^3 + 5425784582792000*t*v2*w1^3 + 103809654007500*v2^2*w1^3 - 638072266936339200*H^2*t^2*w2 - 8337477621301498880*H*t^4*w2 - 86812553324672000*H^2*t*v2*w2 - 1063453778227232000*H*t^3*v2*w2 - 4013973288290000*H^2*v2^2*w2 + 75960984159088000*H*t^2*v2^2*w2 + 850763022581785600*t^4*v2^2*w2 + 16747957513210000*H*t*v2^3*w2 + 162773537483760000*t^3*v2^3*w2 + 692064360050000*H*v2^4*w2 + 3529528236255000*t^2*v2^4*w2 - 797992578425000*t*v2^5*w2 - 37831506562500*v2^6*w2 + 212690755645446400*H*t^2*w1*w2 + 21703138331168000*H*t*v2*w1*w2 - 531726889113616000*t^3*v2*w1*w2 + 1245715848090000*H*v2^2*w1*w2 - 65109414993504000*t^2*v2^2*w1*w2 - 622857924045000*t*v2^3*w1*w2 + 49433168575000*v2^4*w1*w2 - 53172688911361600*t^2*w1^2*w2 - 16277353748376000*t*v2*w1^2*w2 - 865080450062500*v2^2*w1^2*w2 - 531726889113616000*H*t^2*w2^2 - 4168738810650749440*t^4*w2^2 - 75960984159088000*H*t*v2*w2^2 - 797590333670424000*t^3*v2*w2^2 - 3391115364245000*H*v2^2*w2^2 + 5425784582792000*t^2*v2^2*w2^2 + 8062549794582500*t*v2^3*w2^2 + 370748764312500*v2^4*w2^2 + 53172688911361600*t^2*w1*w2^2 - 5425784582792000*t*v2*w1*w2^2 - 242222526017500*v2^2*w1*w2^2 - 159518066734084800*t^2*w2^3 - 27128922913960000*t*v2*w2^3 - 1211112630087500*v2^2*w2^3) + t5^3*(425381511290892800*H^3*t^2 + 43406276662336000*H^3*t*v2 - 212690755645446400*H^2*t^3*v2 + 1937780208140000*H^3*v2^2 - 86812553324672000*H^2*t^2*v2^2 - 850763022581785600*H*t^4*v2^2 - 10657791144770000*H^2*t*v2^3 - 108515691655840000*H*t^3*v2^3 - 409589111050000*H^2*v2^4 + 2906670312210000*H*t^2*v2^4 + 43406276662336000*t^4*v2^4 + 918044559250000*H*t*v2^5 + 8166359448590000*t^3*v2^5 + 35309406125000*H*v2^6 + 247165842875000*t^2*v2^6 - 26301904562500*t*v2^7 - 1286785937500*v2^8 - 638072266936339200*H^2*t^2* w1 + 8337477621301498880*H*t^4*w1 - 43406276662336000*H^2*t*v2*w1 + 1488835289518124800*H*t^3*v2*w1 - 1799367336130000*H^2*v2^2*w1 + 97664122490256000*H*t^2*v2^2*w1 + 4567624776330000*H*t*v2^3*w1 - 54257845827920000*t^3*v2^3*w1 + 127113862050000*H*v2^4*w1 - 6436198548465000*t^2*v2^4*w1 - 120051980825000*t*v2^5*w1 + 2522100437500*v2^6*w1 + 531726889113616000*H*t^2*w1^2 - 4168738810650749440*t^4*w1^2 + 32554707496752000*H*t*v2*w1^2 - 478554200202254400*t^3*v2*w1^2 + 1176509412085000*H*v2^2*w1^2 - 16277353748376000*t^2*v2^2*w1^2 - 1972383426142500*t*v2^3*w1^2 - 88273515312500*v2^4*w1^2 - 159518066734084800*t^2*w1^3 - 5425784582792000*t*v2*w1^3 - 103809654007500*v2^2*w1^3 + 638072266936339200*H^2*t^2*w2 + 8337477621301498880*H*t^4*w2 + 86812553324672000*H^2*t*v2*w2 + 1063453778227232000*H*t^3*v2*w2 + 4013973288290000*H^2*v2^2*w2 - 75960984159088000*H*t^2*v2^2*w2 - 850763022581785600*t^4*v2^2*w2 - 16747957513210000*H*t*v2^3*w2 - 162773537483760000*t^3*v2^3*w2 - 692064360050000*H*v2^4*w2 - 3529528236255000*t^2*v2^4*w2 + 797992578425000*t*v2^5*w2 + 37831506562500*v2^6*w2 - 212690755645446400*H*t^2*w1*w2 - 21703138331168000*H*t*v2*w1*w2 + 531726889113616000*t^3*v2*w1*w2 - 1245715848090000*H*v2^2*w1*w2 + 65109414993504000*t^2*v2^2*w1*w2 + 622857924045000*t*v2^3*w1*w2 - 49433168575000*v2^4*w1*w2 + 53172688911361600*t^2*w1^2*w2 + 16277353748376000*t*v2*w1^2*w2 + 865080450062500*v2^2*w1^2*w2 + 531726889113616000*H*t^2*w2^2 + 4168738810650749440*t^4*w2^2 + 75960984159088000*H*t*v2*w2^2 + 797590333670424000*t^3*v2*w2^2 + 3391115364245000*H*v2^2*w2^2 - 5425784582792000*t^2*v2^2*w2^2 - 8062549794582500*t*v2^3*w2^2 - 370748764312500*v2^4*w2^2 - 53172688911361600*t^2*w1*w2^2 + 5425784582792000*t*v2*w1*w2^2 + 242222526017500*v2^2*w1*w2^2 + 159518066734084800*t^2*w2^3 + 27128922913960000*t*v2*w2^3 + 1211112630087500*v2^2*w2^3) + t5*t6^2* (1276144533872678400*H^3*t^2 + 130218829987008000*H^3*t*v2 - 638072266936339200*H^2*t^3*v2 + 5813340624420000*H^3*v2^2 - 260437659974016000*H^2*t^2*v2^2 - 2552289067745356800*H*t^4*v2^2 - 31973373434310000*H^2*t*v2^3 - 325547074967520000*H*t^3*v2^3 - 1228767333150000*H^2*v2^4 + 8720010936630000*H*t^2*v2^4 + 130218829987008000*t^4*v2^4 + 2754133677750000*H*t*v2^5 + 24499078345770000*t^3*v2^5 + 105928218375000*H*v2^6 + 741497528625000*t^2*v2^6 - 78905713687500*t*v2^7 - 3860357812500*v2^8 - 1914216800809017600*H^2*t^2* w1 + 25012432863904496640*H*t^4*w1 - 130218829987008000*H^2*t*v2*w1 + 4466505868554374400*H*t^3*v2*w1 - 5398102008390000*H^2*v2^2*w1 + 292992367470768000*H*t^2*v2^2*w1 + 13702874328990000*H*t*v2^3*w1 - 162773537483760000*t^3*v2^3*w1 + 381341586150000*H*v2^4*w1 - 19308595645395000*t^2*v2^4*w1 - 360155942475000*t*v2^5*w1 + 7566301312500*v2^6*w1 + 1595180667340848000*H*t^2*w1^2 - 12506216431952248320*t^4*w1^2 + 97664122490256000*H*t*v2*w1^2 - 1435662600606763200*t^3*v2*w1^2 + 3529528236255000*H*v2^2*w1^2 - 48832061245128000*t^2*v2^2*w1^2 - 5917150278427500*t*v2^3*w1^2 - 264820545937500*v2^4*w1^2 - 478554200202254400*t^2*w1^3 - 16277353748376000*t*v2*w1^3 - 311428962022500*v2^2*w1^3 + 1914216800809017600*H^2*t^2*w2 + 25012432863904496640*H*t^4*w2 + 260437659974016000*H^2*t*v2*w2 + 3190361334681696000*H*t^3*v2*w2 + 12041919864870000*H^2*v2^2*w2 - 227882952477264000*H*t^2*v2^2*w2 - 2552289067745356800*t^4*v2^2*w2 - 50243872539630000*H*t*v2^3*w2 - 488320612451280000*t^3*v2^3*w2 - 2076193080150000*H*v2^4*w2 - 10588584708765000*t^2*v2^4*w2 + 2393977735275000*t*v2^5*w2 + 113494519687500*v2^6*w2 - 638072266936339200*H*t^2*w1*w2 - 65109414993504000*H*t*v2*w1*w2 + 1595180667340848000*t^3*v2*w1*w2 - 3737147544270000*H*v2^2*w1*w2 + 195328244980512000*t^2*v2^2*w1*w2 + 1868573772135000*t*v2^3*w1*w2 - 148299505725000*v2^4*w1*w2 + 159518066734084800*t^2*w1^2*w2 + 48832061245128000*t*v2*w1^2*w2 + 2595241350187500*v2^2*w1^2*w2 + 1595180667340848000*H*t^2*w2^2 + 12506216431952248320*t^4*w2^2 + 227882952477264000*H*t*v2*w2^2 + 2392771001011272000*t^3*v2*w2^2 + 10173346092735000*H*v2^2*w2^2 - 16277353748376000*t^2*v2^2*w2^2 - 24187649383747500*t*v2^3*w2^2 - 1112246292937500*v2^4*w2^2 - 159518066734084800*t^2*w1*w2^2 + 16277353748376000*t*v2*w1*w2^2 + 726667578052500*v2^2*w1*w2^2 + 478554200202254400*t^2*w2^3 + 81386768741880000*t*v2*w2^3 + 3633337890262500*v2^2*w2^3) + t6*(86812553324672000*H^4*t^2 - 3403052090327142400*H^3*t^4 + 6643817856480000*H^4*t*v2 - 607687873272704000*H^3*t^3*v2 + 338970298800000*H^4*v2^2 - 37648301186720000*H^3*t^2*v2^2 + 520875319948032000*H^2*t^4*v2^2 - 1242891095600000*H^3*t*v2^3 + 95228055942880000*H^2*t^3*v2^3 - 11529602000000*H^3*v2^4 + 5480019830600000*H^2*t^2*v2^4 - 26575271425920000*H*t^4*v2^4 - 5254039631400000*H*t^3*v2^5 - 7058940000000*H^2*v2^6 - 224827239000000*H*t^2*v2^6 + 451960398400000*t^4*v2^6 + 9706042500000*H*t*v2^7 + 72060012500000*t^3*v2^7 + 630262500000*H*v2^8 + 441183750000*t^2*v2^8 - 375156250000*t*v2^9 - 14546875000*v2^10 - 347250213298688000*H^3*t^2* w1 + 5104578135490713600*H^2*t^4*w1 - 26575271425920000*H^3*t*v2*w1 + 911531809909056000*H^2*t^3*v2*w1 - 1242891095600000*H^3*v2^2*w1 + 76403905349520000*H^2*t^2*v2^2*w1 - 520875319948032000*H*t^4*v2^2*w1 + 5423524780800000*H^2*t*v2^3*w1 - 93013449990720000*H*t^3*v2^3*w1 + 172944030000000*H^2*v2^4*w1 - 7683326772800000*H*t^2*v2^4*w1 + 13287635712960000*t^4*v2^4*w1 - 328593657000000*H*t*v2^5*w1 + 3022485164300000*t^3*v2^5*w1 - 4411837500000*H*v2^6*w1 + 219062438000000*t^2*v2^6*w1 + 4411837500000*t*v2^7*w1 - 60025000000*v2^8*w1 + 390656489961024000*H^2*t^2*w1^2 - 2552289067745356800*H*t^4*w1^2 + 23253362497680000*H^2*t*v2*w1^2 - 455765904954528000*H*t^3*v2*w1^2 + 1016910896400000*H^2*v2^2*w1^2 - 41523861603000000*H*t^2*v2^2*w1^2 + 130218829987008000*t^4*v2^2*w1^2 - 3474445562700000*H*t*v2^3*w1^2 + 20485105057480000*t^3*v2^3*w1^2 - 129708022500000*H*v2^4*w1^2 + 2019698030350000*t^2*v2^4*w1^2 + 129708022500000*t*v2^5*w1^2 + 3088286250000*v2^6*w1^2 - 173625106649344000*H*t^2*w1^3 + 425381511290892800*t^4*w1^3 - 6643817856480000*H*t*v2*w1^3 + 75960984159088000*t^3*v2*w1^3 - 254227724100000*H*v2^2*w1^3 + 6366992112460000*t^2*v2^2*w1^3 + 536702973100000*t*v2^3*w1^3 + 23059204000000*v2^4*w1^3 + 27128922913960000*t^2*w1^4 + 415238616030000*t*v2*w1^4 + 7061881225000*v2^2*w1^4 - 5104578135490713600*H^2*t^4*w2 - 911531809909056000*H^2*t^3*v2*w2 + 112990099600000*H^3*v2^2*w2 - 36540998210640000*H^2*t^2*v2^2*w2 + 520875319948032000*H*t^4*v2^2*w2 + 1694851494000000*H^2*t*v2^3*w2 + 97442661895040000*H*t^3*v2^3*w2 + 138355224000000*H^2*v2^4*w2 + 3276712888400000*H*t^2*v2^4*w2 - 13287635712960000*t^4*v2^4*w2 - 328593657000000*H*t*v2^5*w2 - 2231554467100000*t^3*v2^5*w2 - 18529717500000*H*v2^6*w2 - 5764801000000*t^2*v2^6*w2 + 14117880000000*t*v2^7*w2 + 570237500000*v2^8*w2 - 260437659974016000*H^2*t^2*w1*w2 + 5104578135490713600*H*t^4*w1*w2 - 33219089282400000*H^2*t*v2*w1*w2 + 911531809909056000*H*t^3*v2*w1*w2 - 1694851494000000*H^2*v2^2*w1*w2 + 69760087493040000*H*t^2*v2^2*w1*w2 - 260437659974016000*t^4*v2^2*w1*w2 + 3898158436200000*H*t*v2^3*w1*w2 - 52043239875760000*t^3*v2^3*w1*w2 + 86472015000000*H*v2^4*w1*w2 - 3643930712100000*t^2*v2^4*w1*w2 - 69177612000000*t*v2^5*w1*w2 + 1764735000000*v2^6*w1*w2 + 260437659974016000*H*t^2*w1^2*w2 - 1276144533872678400*t^4*w1^2*w2 + 26575271425920000*H*t*v2*w1^2*w2 - 227882952477264000*t^3*v2*w1^2*w2 + 1271138620500000*H*v2^2*w1^2*w2 - 22422885265620000*t^2*v2^2*w1^2*w2 - 1864336643400000*t*v2^3*w1^2*w2 - 60530410500000*v2^4*w1^2*w2 - 65109414993504000*t^2*w1^3*w2 - 4982863392360000*t*v2*w1^3*w2 - 225980199200000*v2^2*w1^3*w2 - 130218829987008000*H^2*t^2*w2^2 - 2552289067745356800*H*t^4*w2^2 - 16609544641200000*H^2*t*v2*w2^2 - 455765904954528000*H*t^3*v2*w2^2 - 677940597600000*H^2*v2^2*w2^2 - 1660954464120000*H*t^2*v2^2*w2^2 + 130218829987008000*t^4*v2^2*w2^2 + 3643930712100000*H*t*v2^3*w2^2 + 22699711009640000*t^3*v2^3*w2^2 + 181591231500000*H*v2^4*w2^2 - 183608911850000*t^2*v2^4*w2^2 - 198885634500000*t*v2^5*w2^2 - 8382491250000*v2^6*w2^2 + 1276144533872678400*t^4*w1*w2^2 - 6643817856480000*H*t*v2*w1*w2^2 + 227882952477264000*t^3*v2*w1*w2^2 - 423712873500000*H*v2^2*w1*w2^2 + 12457158480900000*t^2*v2^2*w1*w2^2 + 84742574700000*t*v2^3*w1*w2^2 - 17294403000000*v2^4*w1*w2^2 + 32554707496752000*t^2*w1^2*w2^2 + 5813340624420000*t*v2*w1^2*w2^2 + 296599011450000*v2^2*w1^2*w2^2 - 86812553324672000*H*t^2*w2^3 - 425381511290892800*t^4*w2^3 - 13287635712960000*H*t*v2*w2^3 - 75960984159088000*t^3*v2*w2^3 - 593198022900000*H*v2^2*w2^3 + 3598734672260000*t^2*v2^2*w2^3 + 1242891095600000*t*v2^3*w2^3 + 54765609500000*v2^4*w2^3 + 21703138331168000*t^2*w1*w2^3 + 1660954464120000*t*v2*w1*w2^3 + 56495049800000*v2^2*w1*w2^3 - 16277353748376000*t^2*w2^4 - 2906670312210000*t*v2*w2^4 - 134175743275000*v2^2*w2^4) + t4*(-173625106649344000*H^4*t^2 - 17716847617280000*H^4*t*v2 + 173625106649344000*H^3*t^3*v2 - 903920796800000*H^4*v2^2 + 53150542851840000*H^3*t^2*v2^2 + 5875485179200000*H^3*t*v2^3 - 26575271425920000*H^2*t^3*v2^3 + 230592040000000*H^3*v2^4 - 7344356474000000*H^2*t^2*v2^4 - 691776120000000*H^2*t*v2^5 + 1920831693200000*H*t^3*v2^5 - 21176820000000*H^2*v2^6 + 449654478000000*H*t^2*v2^6 + 34118210000000*H*t*v2^7 - 51883209000000*t^3*v2^7 + 840350000000*H*v2^8 - 9706042500000*t^2*v2^8 - 600250000000*t*v2^9 - 12250000000*v2^10 + 347250213298688000*H^3*t^2* w1 + 26575271425920000*H^3*t*v2*w1 - 260437659974016000*H^2*t^3*v2*w1 + 1355881195200000*H^3*v2^2*w1 - 66438178564800000*H^2*t^2*v2^2*w1 - 6779405976000000*H^2*t*v2^3*w1 + 22146059521600000*H*t^3*v2^3*w1 - 276710448000000*H^2*v2^4*w1 + 5762495079600000*H*t^2*v2^4*w1 + 553420896000000*H*t*v2^5*w1 - 734435647400000*t^3*v2^5*w1 + 17647350000000*H*v2^6*w1 - 178708831000000*t^2*v2^6*w1 - 14117880000000*t*v2^7*w1 - 360150000000*v2^8*w1 - 260437659974016000*H^2*t^2*w1^2 - 13287635712960000*H^2*t*v2*w1^2 + 130218829987008000*H*t^3*v2*w1^2 - 677940597600000*H^2*v2^2*w1^2 + 26575271425920000*H*t^2*v2^2*w1^2 + 2372792091600000*H*t*v2^3*w1^2 - 4429211904320000*t^3*v2^3*w1^2 + 103766418000000*H*v2^4*w1^2 - 1045158421300000*t^2*v2^4*w1^2 - 103766418000000*t*v2^5*w1^2 - 3529470000000*v2^6*w1^2 + 86812553324672000*H*t^2*w1^3 + 2214605952160000*H*t*v2*w1^3 - 21703138331168000*t^3*v2*w1^3 + 112990099600000*H*v2^2*w1^3 - 3321908928240000*t^2*v2^2*w1^3 - 225980199200000*t*v2^3*w1^3 - 11529602000000*v2^4*w1^3 - 10851569165584000*t^2*w1^4 - 347250213298688000*H^3*t^2*w2 - 44292119043200000*H^3*t*v2*w2 + 260437659974016000*H^2*t^3*v2*w2 - 2259801992000000*H^3*v2^2*w2 + 93013449990720000*H^2*t^2*v2^2*w2 + 10847049561600000*H^2*t*v2^3*w2 - 31004483330240000*H*t^3*v2^3*w2 + 415065672000000*H^2*v2^4*w2 - 8926217868400000*H*t^2*v2^4*w2 - 830131344000000*H*t*v2^5*w2 + 1186396045800000*t^3*v2^5*w2 - 24706290000000*H*v2^6*w2 + 270945647000000*t^2*v2^6*w2 + 20000330000000*t*v2^7*w2 + 480200000000*v2^8*w2 + 520875319948032000*H^2*t^2*w1*w2 + 53150542851840000*H^2*t*v2*w1*w2 - 260437659974016000*H*t^3*v2*w1*w2 + 2711762390400000*H^2*v2^2*w1*w2 - 79725814277760000*H*t^2*v2^2*w1*w2 - 8813227768800000*H*t*v2^3*w1*w2 + 13287635712960000*t^3*v2^3*w1*w2 - 345888060000000*H*v2^4*w1*w2 + 3672178237000000*t^2*v2^4*w1*w2 + 345888060000000*t*v2^5*w1*w2 + 10588410000000*v2^6*w1*w2 - 260437659974016000*H*t^2*w1^2*w2 - 19931453569440000*H*t*v2*w1^2*w2 + 65109414993504000*t^3*v2*w1^2*w2 - 1016910896400000*H*v2^2*w1^2*w2 + 16609544641200000*t^2*v2^2*w1^2*w2 + 1694851494000000*t*v2^3*w1^2*w2 + 69177612000000*v2^4*w1^2*w2 + 43406276662336000*t^2*w1^3*w2 + 2214605952160000*t*v2*w1^3*w2 + 112990099600000*v2^2*w1^3*w2 - 260437659974016000*H^2*t^2*w2^2 - 39862907138880000*H^2*t*v2*w2^2 + 130218829987008000*H*t^3*v2*w2^2 - 2033821792800000*H^2*v2^2*w2^2 + 53150542851840000*H*t^2*v2^2*w2^2 + 6440435677200000*H*t*v2^3*w2^2 - 8858423808640000*t^3*v2^3*w2^2 + 242121642000000*H*v2^4*w2^2 - 2627019815700000*t^2*v2^4*w2^2 - 242121642000000*t*v2^5*w2^2 - 7058940000000*v2^6*w2^2 + 260437659974016000*H*t^2*w1*w2^2 + 33219089282400000*H*t*v2*w1*w2^2 - 65109414993504000*t^3*v2*w1*w2^2 + 1694851494000000*H*v2^2*w1*w2^2 - 23253362497680000*t^2*v2^2*w1*w2^2 - 2711762390400000*t*v2^3*w1*w2^2 - 103766418000000*v2^4*w1*w2^2 - 65109414993504000*t^2*w1^2*w2^2 - 6643817856480000*t*v2*w1^2*w2^2 - 338970298800000*v2^2*w1^2*w2^2 - 86812553324672000*H*t^2*w2^3 - 15502241665120000*H*t*v2*w2^3 + 21703138331168000*t^3*v2*w2^3 - 790930697200000*H*v2^2*w2^3 + 9965726784720000*t^2*v2^2*w2^3 + 1242891095600000*t*v2^3*w2^3 + 46118408000000*v2^4*w2^3 + 43406276662336000*t^2*w1*w2^3 + 6643817856480000*t*v2*w1*w2^3 + 338970298800000*v2^2*w1*w2^3 - 10851569165584000*t^2*w2^4 - 2214605952160000*t*v2*w2^4 - 112990099600000*v2^2*w2^4) + t5*(86812553324672000*H^4*t^2 + 3403052090327142400*H^3*t^4 + 11073029760800000*H^4*t*v2 + 434062766623360000*H^3*t^3*v2 + 564950498000000*H^4*v2^2 - 15502241665120000*H^3*t^2*v2^2 - 520875319948032000*H^2*t^4*v2^2 - 4632594083600000*H^3*t*v2^3 - 68652784516960000*H^2*t^3*v2^3 - 219062438000000*H^3*v2^4 + 1864336643400000*H^2*t^2*v2^4 + 26575271425920000*H*t^4*v2^4 + 691776120000000*H^2*t*v2^5 + 3333207938200000*H*t^3*v2^5 + 28235760000000*H^2*v2^6 - 224827239000000*H*t^2*v2^6 - 451960398400000*t^4*v2^6 - 43824252500000*H*t*v2^7 - 20176803500000*t^3*v2^7 - 1470612500000*H*v2^8 + 9264858750000*t^2*v2^8 + 975406250000*t*v2^9 + 26796875000*v2^10 - 5104578135490713600*H^2*t^4*w1 - 651094149935040000*H^2*t^3*v2*w1 - 112990099600000*H^3*v2^2*w1 - 9965726784720000*H^2*t^2*v2^2*w1 + 520875319948032000*H*t^4*v2^2*w1 + 1355881195200000*H^2*t*v2^3*w1 + 70867390469120000*H*t^3*v2^3*w1 + 103766418000000*H^2*v2^4*w1 + 1920831693200000*H*t^2*v2^4*w1 - 13287635712960000*t^4*v2^4*w1 - 224827239000000*H*t*v2^5*w1 - 2288049516900000*t^3*v2^5*w1 - 13235512500000*H*v2^6*w1 - 40353607000000*t^2*v2^6*w1 + 9706042500000*t*v2^7*w1 + 420175000000*v2^8*w1 - 130218829987008000*H^2*t^2*w1^2 + 2552289067745356800*H*t^4*w1^2 - 9965726784720000*H^2*t*v2*w1^2 + 325547074967520000*H*t^3*v2*w1^2 - 338970298800000*H^2*v2^2*w1^2 + 14948590177080000*H*t^2*v2^2*w1^2 - 130218829987008000*t^4*v2^2*w1^2 + 1101653471100000*H*t*v2^3*w1^2 - 16055893153160000*t^3*v2^3*w1^2 + 25941604500000*H*v2^4*w1^2 - 974539609050000*t^2*v2^4*w1^2 - 25941604500000*t*v2^5*w1^2 + 441183750000*v2^6*w1^2 + 86812553324672000*H*t^2*w1^3 - 425381511290892800*t^4*w1^3 + 4429211904320000*H*t*v2*w1^3 - 54257845827920000*t^3*v2*w1^3 + 141237624500000*H*v2^2*w1^3 - 3045083184220000*t^2*v2^2*w1^3 - 310722773900000*t*v2^3*w1^3 - 11529602000000*v2^4*w1^3 - 16277353748376000*t^2*w1^4 - 415238616030000*t*v2*w1^4 - 7061881225000*v2^2*w1^4 + 347250213298688000*H^3*t^2*w2 + 5104578135490713600*H^2*t^4*w2 + 44292119043200000*H^3*t*v2*w2 + 651094149935040000*H^2*t^3*v2*w2 + 2146811892400000*H^3*v2^2*w2 - 56472451780080000*H^2*t^2*v2^2*w2 - 520875319948032000*H*t^4*v2^2*w2 - 12541901055600000*H^2*t*v2^3*w2 - 66438178564800000*H*t^3*v2^3*w2 - 553420896000000*H^2*v2^4*w2 + 5649504980000000*H*t^2*v2^4*w2 + 13287635712960000*t^4*v2^4*w2 + 1158725001000000*H*t*v2^5*w2 + 1045158421300000*t^3*v2^5*w2 + 43236007500000*H*v2^6*w2 - 265180846000000*t^2*v2^6*w2 - 34118210000000*t*v2^7*w2 - 1050437500000*v2^8*w2 - 260437659974016000*H^2*t^2*w1*w2 - 5104578135490713600*H*t^4*w1*w2 - 19931453569440000*H^2*t*v2*w1*w2 - 651094149935040000*H*t^3*v2*w1*w2 - 1016910896400000*H^2*v2^2*w1*w2 + 9965726784720000*H*t^2*v2^2*w1*w2 + 260437659974016000*t^4*v2^2*w1*w2 + 4915069332600000*H*t*v2^3*w1*w2 + 38755604162800000*t^3*v2^3*w1*w2 + 259416045000000*H*v2^4*w1*w2 - 28247524900000*t^2*v2^4*w1*w2 - 276710448000000*t*v2^5*w1*w2 - 12353145000000*v2^6*w1*w2 + 1276144533872678400*t^4*w1^2*w2 - 6643817856480000*H*t*v2*w1^2*w2 + 162773537483760000*t^3*v2*w1^2*w2 - 254227724100000*H*v2^2*w1^2*w2 + 5813340624420000*t^2*v2^2*w1^2*w2 + 169485149400000*t*v2^3*w1^2*w2 - 8647201500000*v2^4*w1^2*w2 + 21703138331168000*t^2*w1^3*w2 + 2768257440200000*t*v2*w1^3*w2 + 112990099600000*v2^2*w1^3*w2 + 390656489961024000*H^2*t^2*w2^2 + 2552289067745356800*H*t^4*w2^2 + 56472451780080000*H^2*t*v2*w2^2 + 325547074967520000*H*t^3*v2*w2^2 + 2711762390400000*H^2*v2^2*w2^2 - 51489588387720000*H*t^2*v2^2*w2^2 - 130218829987008000*t^4*v2^2*w2^2 - 10084366389300000*H*t*v2^3*w2^2 - 13841287201000000*t^3*v2^3*w2^2 - 423712873500000*H*v2^4*w2^2 + 2810628727550000*t^2*v2^4*w2^2 + 441007276500000*t*v2^5*w2^2 + 15441431250000*v2^6*w2^2 - 260437659974016000*H*t^2*w1*w2^2 - 1276144533872678400*t^4*w1*w2^2 - 26575271425920000*H*t*v2*w1*w2^2 - 162773537483760000*t^3*v2*w1*w2^2 - 1271138620500000*H*v2^2*w1*w2^2 + 10796204016780000*t^2*v2^2*w1*w2^2 + 2627019815700000*t*v2^3*w1*w2^2 + 121060821000000*v2^4*w1*w2^2 + 32554707496752000*t^2*w1^2*w2^2 + 830477232060000*t*v2*w1^2*w2^2 + 42371287350000*v2^2*w1^2*w2^2 + 173625106649344000*H*t^2*w2^3 + 425381511290892800*t^4*w2^3 + 28789877378080000*H*t*v2*w2^3 + 54257845827920000*t^3*v2*w2^3 + 1384128720100000*H*v2^2*w2^3 - 13564461456980000*t^2*v2^2*w2^3 - 2485782191200000*t*v2^3*w2^3 - 100884017500000*v2^4*w2^3 - 65109414993504000*t^2*w1*w2^3 - 8304772320600000*t*v2*w1*w2^3 - 395465348600000*v2^2*w1*w2^3 + 27128922913960000*t^2*w2^4 + 5121276264370000*t*v2*w2^4 + 247165842875000*v2^2*w2^4), 3615683187200*H^2*t^3 + t5^3*t6^3*(-27128922913960*t - 1384128720100*v2) + t5^5*t6*(-8138676874188*t - 415238616030*v2) + t5*t6^5*(-8138676874188*t - 415238616030*v2) + 4705960000*H^3*v2 + 553420896000*H^2*t^2*v2 + 16470860000*H^2*t*v2^2 - 368947264000*H*t^3*v2^2 - 240100000*H^2*v2^3 - 56471520000*H*t^2*v2^3 - 3121300000*H*t*v2^4 + 9411920000*t^3*v2^4 - 61250000*H*v2^5 + 2040850000*t^2*v2^5 + 140875000*t*v2^6 + 3125000*v2^7 + t5^6*(1356446145698*t + 69206436005*v2) + t6^6*(1356446145698*t + 69206436005*v2) + t5^4*t6^2*(20346692185470*t + 1038096540075*v2) + t5^2*t6^4*(20346692185470*t + 1038096540075*v2) + 92236816000*H^2*t*w1 - 3615683187200*H*t^3*w1 - 2352980000*H^2*v2*w1 - 553420896000*H*t^2*v2*w1 - 16470860000*H*t*v2^2*w1 + 184473632000*t^3*v2^2*w1 + 240100000*H*v2^3*w1 + 23529800000*t^2*v2^3*w1 + 1080450000*t*v2^4*w1 + 18375000*v2^5*w1 - 92236816000*H*t*w1^2 + 903920796800*t^3*w1^2 - 1176490000*H*v2*w1^2 + 138355224000*t^2*v2*w1^2 + 4117715000*t*v2^2*w1^2 - 60025000*v2^3*w1^2 + 23059204000*t*w1^3 + 588245000*v2*w1^3 + 92236816000*H^2*t*w2 + 3615683187200*H*t^3*w2 + 11764900000*H^2*v2*w2 + 553420896000*H*t^2*v2*w2 + 16470860000*H*t*v2^2*w2 - 184473632000*t^3*v2^2*w2 - 240100000*H*v2^3*w2 - 32941720000*t^2*v2^3*w2 - 2040850000*t*v2^4*w2 - 42875000*v2^5*w2 - 1807841593600*t^3*w1*w2 - 7058940000*H*v2*w1*w2 - 276710448000*t^2*v2*w1*w2 - 8235430000*t*v2^2*w1*w2 + 120050000*v2^3*w1*w2 - 23059204000*t*w1^2*w2 + 588245000*v2*w1^2*w2 + 92236816000*H*t*w2^2 + 903920796800*t^3*w2^2 + 8235430000*H*v2*w2^2 + 138355224000*t^2*v2*w2^2 + 4117715000*t*v2^2*w2^2 - 60025000*v2^3*w2^2 - 23059204000*t*w1*w2^2 - 2941225000*v2*w1*w2^2 + 23059204000*t*w2^3 + 1764735000*v2*w2^3 + t5^3*t6*(-86812553324672*t^3 - 112990099600*H*v2 - 8858423808640*t^2*v2 + 282475249000*t*v2^2 + 28824005000*v2^3 - 4429211904320*t*w1 - 169485149400*v2*w1 - 4429211904320*t*w2 - 282475249000*v2*w2) + t5*t6^3*(-86812553324672*t^3 - 112990099600*H*v2 - 8858423808640*t^2*v2 + 282475249000*t*v2^2 + 28824005000*v2^3 - 4429211904320*t*w1 - 169485149400*v2*w1 - 4429211904320*t*w2 - 282475249000*v2*w2) + t5^4*(21703138331168*t^3 + 28247524900*H*v2 + 2214605952160*t^2*v2 - 70618812250*t*v2^2 - 7206001250*v2^3 + 1107302976080*t*w1 + 42371287350*v2*w1 + 1107302976080*t*w2 + 70618812250*v2*w2) + t6^4*(21703138331168*t^3 + 28247524900*H*v2 + 2214605952160*t^2*v2 - 70618812250*t*v2^2 - 7206001250*v2^3 + 1107302976080*t*w1 + 42371287350*v2*w1 + 1107302976080*t*w2 + 70618812250*v2*w2) + t5^2*t6^2*(130218829987008*t^3 + 169485149400*H*v2 + 13287635712960*t^2*v2 - 423712873500*t*v2^2 - 43236007500*v2^3 + 6643817856480*t*w1 + 254227724100*v2*w1 + 6643817856480*t*w2 + 423712873500*v2*w2) + t5*t6*(-451960398400*H^2*t - 23059204000*H^2*v2 + 46118408000*H*t*v2^2 + 1807841593600*t^3*v2^2 + 4705960000*H*v2^3 + 184473632000*t^2*v2^3 - 2352980000*t*v2^4 - 420175000*v2^5 + 451960398400*H*t*w1 - 17716847617280*t^3*w1 - 1807841593600*t^2*v2*w1 + 34588806000*t*v2^2*w1 + 3529470000*v2^3*w1 - 564950498000*t*w1^2 - 17294403000*v2*w1^2 - 451960398400*H*t*w2 - 17716847617280*t^3*w2 - 46118408000*H*v2*w2 - 1807841593600*t^2*v2*w2 + 80707214000*t*v2^2*w2 + 8235430000*v2^3*w2 - 677940597600*t*w1*w2 - 34588806000*v2*w1*w2 - 564950498000*t*w2^2 - 40353607000*v2*w2^2) + t5^2*(225980199200*H^2*t + 11529602000*H^2*v2 - 23059204000*H*t*v2^2 - 903920796800*t^3*v2^2 - 2352980000*H*v2^3 - 92236816000*t^2*v2^3 + 1176490000*t*v2^4 + 210087500*v2^5 - 225980199200*H*t*w1 + 8858423808640*t^3*w1 + 903920796800*t^2*v2*w1 - 17294403000*t*v2^2*w1 - 1764735000*v2^3*w1 + 282475249000*t*w1^2 + 8647201500*v2*w1^2 + 225980199200*H*t*w2 + 8858423808640*t^3*w2 + 23059204000*H*v2*w2 + 903920796800*t^2*v2*w2 - 40353607000*t*v2^2*w2 - 4117715000*v2^3*w2 + 338970298800*t*w1*w2 + 17294403000*v2*w1*w2 + 282475249000*t*w2^2 + 20176803500*v2*w2^2) + t6^2*(225980199200*H^2*t + 11529602000*H^2*v2 - 23059204000*H*t*v2^2 - 903920796800*t^3*v2^2 - 2352980000*H*v2^3 - 92236816000*t^2*v2^3 + 1176490000*t*v2^4 + 210087500*v2^5 - 225980199200*H*t*w1 + 8858423808640*t^3*w1 + 903920796800*t^2*v2*w1 - 17294403000*t*v2^2*w1 - 1764735000*v2^3*w1 + 282475249000*t*w1^2 + 8647201500*v2*w1^2 + 225980199200*H*t*w2 + 8858423808640*t^3*w2 + 23059204000*H*v2*w2 + 903920796800*t^2*v2*w2 - 40353607000*t*v2^2*w2 - 4117715000*v2^3*w2 + 338970298800*t*w1*w2 + 17294403000*v2*w1*w2 + 282475249000*t*w2^2 + 20176803500*v2*w2^2) + t3*(-1807841593600*H^2*t^2 - 184473632000*H^2*t*v2 - 9411920000*H^2*v2^2 + 184473632000*H*t^2*v2^2 + 32941720000*H*t*v2^3 + 1440600000*H*v2^4 - 10588410000*t^2*v2^4 - 1440600000*t*v2^5 - 49000000*v2^6 + 1807841593600*H*t^2*w1 + 92236816000*H*t*v2*w1 + 4705960000*H*v2^2*w1 - 46118408000*t^2*v2^2*w1 - 9411920000*t*v2^3*w1 - 480200000*v2^4*w1 - 451960398400*t^2*w1^2 - 1807841593600*H*t^2*w2 - 276710448000*H*t*v2*w2 - 14117880000*H*v2^2*w2 + 138355224000*t^2*v2^2*w2 + 23529800000*t*v2^3*w2 + 960400000*v2^4*w2 + 903920796800*t^2*w1*w2 + 92236816000*t*v2*w1*w2 + 4705960000*v2^2*w1*w2 - 451960398400*t^2*w2^2 - 92236816000*t*v2*w2^2 - 4705960000*v2^2*w2^2), 960400*H^2*t + 5764801*t*t5^4 - 5764801*t2*t5^4 - 23059204*t*t5^3*t6 + 23059204*t2*t5^3*t6 + 34588806*t*t5^2*t6^2 - 34588806*t2*t5^2*t6^2 - 23059204*t*t5*t6^3 + 23059204*t2*t5*t6^3 + 5764801*t*t6^4 - 5764801*t2*t6^4 - 98000*H*t*v2^2 + 2500*t*v2^4 - 960400*H*t*w1 + 49000*t*v2^2*w1 + 240100*t*w1^2 + t2*t5^2*(240100*v2^2 - 2352980*w1 - 2352980*w2) + t2*t6^2*(240100*v2^2 - 2352980*w1 - 2352980*w2) + 960400*H*t*w2 - 49000*t*v2^2*w2 - 480200*t*w1*w2 + 240100*t*w2^2 + t2*t5*t6*(-480200*v2^2 + 4705960*w1 + 4705960*w2) + t5*t6*(480200*t*v2^2 - 4705960*t*w1 - 4705960*t*w2) + t5^2*(-240100*t*v2^2 + 2352980*t*w1 + 2352980*t*w2) + t6^2*(-240100*t*v2^2 + 2352980*t*w1 + 2352980*t*w2) + t2*(-960400*H^2 + 98000*H*v2^2 - 2500*v2^4 + 960400*H*w1 - 49000*v2^2*w1 - 240100*w1^2 - 960400*H*w2 + 49000*v2^2*w2 + 480200*w1*w2 - 240100*w2^2), -960400*H^2*t - 5764801*t*t5^4 + 5764801*t1*t5^4 + 23059204*t*t5^3*t6 - 23059204*t1*t5^3*t6 - 34588806*t*t5^2*t6^2 + 34588806*t1*t5^2*t6^2 + 23059204*t*t5*t6^3 - 23059204*t1*t5*t6^3 - 5764801*t*t6^4 + 5764801*t1*t6^4 + 98000*H*t*v2^2 - 2500*t*v2^4 + 960400*H*t*w1 - 49000*t*v2^2*w1 - 240100*t*w1^2 + t1*t5*t6*(480200*v2^2 - 4705960*w1 - 4705960*w2) - 960400*H*t*w2 + 49000*t*v2^2*w2 + 480200*t*w1*w2 - 240100*t*w2^2 + t1*t5^2*(-240100*v2^2 + 2352980*w1 + 2352980*w2) + t1*t6^2*(-240100*v2^2 + 2352980*w1 + 2352980*w2) + t5^2*(240100*t*v2^2 - 2352980*t*w1 - 2352980*t*w2) + t6^2*(240100*t*v2^2 - 2352980*t*w1 - 2352980*t*w2) + t5*t6*(-480200*t*v2^2 + 4705960*t*w1 + 4705960*t*w2) + t1*(960400*H^2 - 98000*H*v2^2 + 2500*v2^4 - 960400*H*w1 + 49000*v2^2*w1 + 240100*w1^2 + 960400*H*w2 - 49000*v2^2*w2 - 480200*w1*w2 + 240100*w2^2)}} Daniel Lichtblau Wolfram Research === Subject: Re: Please answer to my questions,thank you. (yP - xP)^2 is not so much different from |yP-xP|. Note that I have changed epsilon in your test Abs[yP - xP] <= epsilon in epsilon2, with which I meant the square of epsilon, epsilon^2 All real yP and xP that pass the Abs[yP - xP] <= epsilon test also pass the (yP - xP)^2 <= epsilon^2 test and vice versa. The latter can be handled easier by Mathematica, though. With respect to your Nest[ ] question. I don't think it's mathematically possible. Take for instance the case that f is defined as f[x_]:= - x. Your equation would have infinite solutions, not only the i-j one you mention. Same with f = Sin and x= n Pi. Anyway, I don't think mathematica could solve this if you don't specify al least the Nesting depth. > On 6 jan, 10:10, Sjoerd C. de Vries > > > > Hi Olfa, > > [comments between your text lines] > > > 1-reduce: f(f(f(...(v) i times=f(f(f(...(w) j times. I've tried ne= st = > like this: > Nest[f,v,i]=C5 Nest[f,w,j] > , but I have this error: > Nest::intnm: Non-negative machine-size integer expected at position 3= in = > Nest[f,v,i] and > Nest::intnm: Non-negative machine-size integer expected at position 3= in = > Nest[f,w,j] > =C2 > > Well, Mathematica is really gung-ho to get to work for you. It really > wants to Nest so badly, but then you give it nothing to chew on. Quite > naturally, it complains. You didn't tell it how often to Nest. > > I'm not sure what you want to achieve here. Solve this equation for > the unknown f,v,i,w, and j? Impossible. But even if it would be > possible you're using the wrong syntax. Should be something like Solve > [Nest[f, v, i] == Nest[v, w, j], {v}] or so. > > 2-I want to use lists symbollically like this: m, mP,l,lP are lists, = j,jP= > > ,i,iP are variables.By symbolically I mean without specifying the concr= ete > > elements and the concrete length of these lists > i<=iP,j-Length[m]=C5 jP-Length[mP], > Join[l,m]=C5 Join[lP,mP], > Nest[Rest,m,i]=C5 Nest[Rest,mP,iP] > > There are some weird codes in there that I'm trying to interpret. Not > really sure whether I get it all. > You can't really have abstract lists in Mathematica. You can say > something like d = Array[c, i] and e=Array[b,j], but you'll get the > same complaints as above. The assignments have been made and replacing > i with a number yields a real list for d: > > In[55]:= d /. i -> 5 > > Out[55]= {c[1], c[2], c[3], c[4], c[5]} > > so far so good, but if you try to Join d and e you get nonsense: > > In[58]:= Join[d, e] > > During evaluation of In[58]:= Array::ilsmn: Single or list of non- > negative machine-size integers expected at position 2 of Array > [c,i,b,j]. >> > > Out[58]= Array[c, i, b, j] > > I guess you could make some functions yourself that operate on > abstract lists but that would be hard work. > > 3-when I have j a= > s result. > > I'm sorry, but this doesn't make sense at all. Why would i have to > equal N? This is only true if j equals N-1, but you claim that j j==N-2 or N-3 would also fit the inequality. > > And what do you mean by 'result'? Result of what? > > 4-solve this system of equations: xP = 1 + a/yP=C2 and |yP-xP|= <= > = > = epsilon > > Since this involves an inequality Solve can't be used. If a and > epsilon are symbolic FindInstance can also not be used. Reduce should > work, but it doesn't get me an answer within a couple of minutes, so > with a small rewrite it becomes: > > Reduce[{xP == 1 + a/yP, (yP - xP)^2 <= epsilon2}, {xP, yP}] > > and now Reduce seems to be able to solve the system. > > > Yours faithfully, > Olfa MRAIHI - Masquer le texte des messages pr=E9c=E9d= ents - > > - Afficher le texte des messages pr=E9c=E9dents - > > Hi Mr Sjoerd, > thank you for your reply.Here some clarifications and corrections: > >I'm not sure what you want to achieve here. Solve this equation for > > the unknown f,v,i,w, and j? Impossible. But even if it would be > possible you're using the wrong syntax. Should be something like > Solve > [Nest[f, v, i] == Nest[f, w, j], {v}] or so. > > well I explain exactly what I hope mathematica to do for me: > when I have f(f(f(...(x) i times == f(f(f(...(y) j times and i>=j t= hen > i want to have y in terms of the others which is y=f(f(f(...(x) i-j > times. So with mathematica syntaxe I will have :Reduce[i>=j,Nest[f,i,x] > ==Nest[f,j,y],{y},Backsubstitution->True] and I want the solution to > be:y=Nest[f,i-j,x], is it possible? do you know how could i deal with > this? > >Reduce should work, but it doesn't get me an answer within a couple of m= inutes, so > with a small rewrite it becomes: > Reduce[{xP == 1 + a/yP, (yP - xP)^2 <= epsilon2}, {xP, yP}] > and now Reduce seems to be able to solve the system. > > But (yP - xP)^2 is different from |yP-xP| what I want is: > Reduce[{xP == 1 + a/yP, Abs[yP - xP] <= epsilon}, {xP, yP}, > Backsubstitution -> True] or Reduce[{xP == 1 + a/yP, Abs[yP - xP] = <= > 10^-6]}, {xP, yP}, > Backsubstitution -> True] > it doesn't get me an answer within a couple of minutes!! how you can > explain that and what i have to do? > > thank you! === Subject: Re: Please answer to my questions,thank you. On 6 jan, 10:10, Sjoerd C. de Vries > Hi Olfa, > > [comments between your text lines] > > > > > 1-reduce: f(f(f(...(v) i times=f(f(f(...(w) j times. I've tried nest= = > like this: > Nest[f,v,i]=C5 Nest[f,w,j] > , but I have this error: > Nest::intnm: Non-negative machine-size integer expected at position 3 i= n = > Nest[f,v,i] and > Nest::intnm: Non-negative machine-size integer expected at position 3 i= n = > Nest[f,w,j] > =C2 > > Well, Mathematica is really gung-ho to get to work for you. It really > wants to Nest so badly, but then you give it nothing to chew on. Quite > naturally, it complains. You didn't tell it how often to Nest. > > I'm not sure what you want to achieve here. Solve this equation for > the unknown f,v,i,w, and j? Impossible. But even if it would be > possible you're using the wrong syntax. Should be something like Solve > [Nest[f, v, i] == Nest[v, w, j], {v}] or so. > > 2-I want to use lists symbollically like this: m, mP,l,lP are lists, j,= jP= > > ,i,iP are variables.By symbolically I mean without specifying the concret= e > > elements and the concrete length of these lists > i<=iP,j-Length[m]=C5 jP-Length[mP], > Join[l,m]=C5 Join[lP,mP], > Nest[Rest,m,i]=C5 Nest[Rest,mP,iP] > > There are some weird codes in there that I'm trying to interpret. Not > really sure whether I get it all. > You can't really have abstract lists in Mathematica. You can say > something like d = Array[c, i] and e=Array[b,j], but you'll get the > same complaints as above. The assignments have been made and replacing > i with a number yields a real list for d: > > In[55]:= d /. i -> 5 > > Out[55]= {c[1], c[2], c[3], c[4], c[5]} > > so far so good, but if you try to Join d and e you get nonsense: > > In[58]:= Join[d, e] > > During evaluation of In[58]:= Array::ilsmn: Single or list of non- > negative machine-size integers expected at position 2 of Array > [c,i,b,j]. >> > > Out[58]= Array[c, i, b, j] > > I guess you could make some functions yourself that operate on > abstract lists but that would be hard work. > > > > 3-when I have j s result. > > I'm sorry, but this doesn't make sense at all. Why would i have to > equal N? This is only true if j equals N-1, but you claim that j j==N-2 or N-3 would also fit the inequality. > > And what do you mean by 'result'? Result of what? > > > > 4-solve this system of equations: xP = 1 + a/yP=C2 and |yP-xP| <= = > = epsilon > > Since this involves an inequality Solve can't be used. If a and > epsilon are symbolic FindInstance can also not be used. Reduce should > work, but it doesn't get me an answer within a couple of minutes, so > with a small rewrite it becomes: > > Reduce[{xP == 1 + a/yP, (yP - xP)^2 <= epsilon2}, {xP, yP}] > > and now Reduce seems to be able to solve the system. > > > > > Yours faithfully, > Olfa MRAIHI - Masquer le texte des messages pr=E9c=E9dents - > > - Afficher le texte des messages pr=E9c=E9dents - Hi Mr Sjoerd, have you seen my reply? === Subject: Re: Please answer to my questions,thank you. On 6 jan, 10:10, Sjoerd C. de Vries > Hi Olfa, > > [comments between your text lines] > > > > > 1-reduce: f(f(f(...(v) i times=f(f(f(...(w) j times. I've tried nest = > like this: > Nest[f,v,i]=C5 Nest[f,w,j] > , but I have this error: > Nest::intnm: Non-negative machine-size integer expected at position 3 in = > Nest[f,v,i] and > Nest::intnm: Non-negative machine-size integer expected at position 3 in = > Nest[f,w,j] > =C2 > > Well, Mathematica is really gung-ho to get to work for you. It really > wants to Nest so badly, but then you give it nothing to chew on. Quite > naturally, it complains. You didn't tell it how often to Nest. > > I'm not sure what you want to achieve here. Solve this equation for > the unknown f,v,i,w, and j? Impossible. But even if it would be > possible you're using the wrong syntax. Should be something like Solve > [Nest[f, v, i] == Nest[v, w, j], {v}] or so. > > 2-I want to use lists symbollically like this: m, mP,l,lP are lists, j,jP= > > ,i,iP are variables.By symbolically I mean without specifying the concrete > > elements and the concrete length of these lists > i<=iP,j-Length[m]=C5 jP-Length[mP], > Join[l,m]=C5 Join[lP,mP], > Nest[Rest,m,i]=C5 Nest[Rest,mP,iP] > > There are some weird codes in there that I'm trying to interpret. Not > really sure whether I get it all. > You can't really have abstract lists in Mathematica. You can say > something like d = Array[c, i] and e=Array[b,j], but you'll get the > same complaints as above. The assignments have been made and replacing > i with a number yields a real list for d: > > In[55]:= d /. i -> 5 > > Out[55]= {c[1], c[2], c[3], c[4], c[5]} > > so far so good, but if you try to Join d and e you get nonsense: > > In[58]:= Join[d, e] > > During evaluation of In[58]:= Array::ilsmn: Single or list of non- > negative machine-size integers expected at position 2 of Array > [c,i,b,j]. >> > > Out[58]= Array[c, i, b, j] > > I guess you could make some functions yourself that operate on > abstract lists but that would be hard work. > > > > 3-when I have j s result. > > I'm sorry, but this doesn't make sense at all. Why would i have to > equal N? This is only true if j equals N-1, but you claim that j j==N-2 or N-3 would also fit the inequality. > > And what do you mean by 'result'? Result of what? > > > > 4-solve this system of equations: xP = 1 + a/yP=C2 and |yP-xP| <= = > = epsilon > > Since this involves an inequality Solve can't be used. If a and > epsilon are symbolic FindInstance can also not be used. Reduce should > work, but it doesn't get me an answer within a couple of minutes, so > with a small rewrite it becomes: > > Reduce[{xP == 1 + a/yP, (yP - xP)^2 <= epsilon2}, {xP, yP}] > > and now Reduce seems to be able to solve the system. > > > > > Yours faithfully, > Olfa MRAIHI - Masquer le texte des messages pr=E9c=E9dents - > > - Afficher le texte des messages pr=E9c=E9dents - Hi Mr Sjoerd, thank you for your reply.Here some clarifications and corrections: >I'm not sure what you want to achieve here. Solve this equation for the unknown f,v,i,w, and j? Impossible. But even if it would be possible you're using the wrong syntax. Should be something like Solve [Nest[f, v, i] == Nest[f, w, j], {v}] or so. well I explain exactly what I hope mathematica to do for me: when I have f(f(f(...(x) i times == f(f(f(...(y) j times and i>=j then i want to have y in terms of the others which is y=f(f(f(...(x) i-j times. So with mathematica syntaxe I will have :Reduce[i>=j,Nest[f,i,x] ==Nest[f,j,y],{y},Backsubstitution->True] and I want the solution to be:y=Nest[f,i-j,x], is it possible? do you know how could i deal with this? >Reduce should work, but it doesn't get me an answer within a couple of minutes, so > with a small rewrite it becomes: > Reduce[{xP == 1 + a/yP, (yP - xP)^2 <= epsilon2}, {xP, yP}] > and now Reduce seems to be able to solve the system. But (yP - xP)^2 is different from |yP-xP| what I want is: Reduce[{xP == 1 + a/yP, Abs[yP - xP] <= epsilon}, {xP, yP}, Backsubstitution -> True] or Reduce[{xP == 1 + a/yP, Abs[yP - xP] <= 10^-6]}, {xP, yP}, Backsubstitution -> True] it doesn't get me an answer within a couple of minutes!! how you can explain that and what i have to do? thank you! === Subject: Re: Please answer to my questions,thank you. > Hello Mathematica community, > First, wish you happy new year. > I want to know how to do these points with mathematica: > > 1-reduce: f(f(f(...(v) i times=f(f(f(...(w) j times. I've tried nest like this: > Nest[f,v,i]=C5 Nest[f,w,j] > , but I have this error: > Nest::intnm: Non-negative machine-size integer expected at position 3 in Nest[f,v,i] and > Nest::intnm: Non-negative machine-size integer expected at position 3 in Nest[f,w,j] > =C2 > 2-I want to use lists symbollically like this: m, mP,l,lP are lists, j,jP,i,iP are variables.By symbolically I mean without specifying the concrete > elements and the concrete length of these lists > i<=iP,j-Length[m]=C5 jP-Length[mP], > Join[l,m]=C5 Join[lP,mP], > Nest[Rest,m,i]=C5 Nest[Rest,mP,iP] 3-when I have j > 4-solve this system of equations: xP = 1 + a/yP=C2 and |yP-xP| <= epsilon Yours faithfully, > Olfa MRAIHI > To take just one of your requests: The built-in lists in Mathematica are of fixed length, although the elements themselves can be variables: {a,b,c} However, you can write patterns that describe lists of unknown length: {a,b,c,___} More generally, I suggest you step back a bit, and describe the actual problem you are trying to solve. David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Re: Problems combining new v7.0 Image command with other graphics just the function for 2) MaskImageOperation::invmdim = Image and mask must have the same dimensions.; MaskImageOperation::invrdim = Image and transformed image must have the same dimensions. Will padd the transformed image.; MaskImageOperation[op_, (* the function applied to the image *) img_?Image`PossibleImageQ, (* the image and the mask *) mask_?Image`PossibleImageQ] /; Module[{oimg, typ, idim, padlst}, typ = ImageType[img]; oimg = op[img]; idim = ImageDimensions[img]; If[idim =!= ImageDimensions[mask], Message[MaskImageOperation::invmdim]; Return[oimg]; ]; If[idim =!= ImageDimensions[oimg], Message[MaskImageOperation::invrdim]; padlst = ImageDimensions[oimg] - idim; padlst = If[EvenQ[#], {#, #}/2, Floor[{#, #}/2] + {0, 1}] & /@ padlst; oimg = ImagePad[oimg, padlst] ]; Image[ Map[If[#[[1]] == 1, #[[2]], #[[3]]] &, Transpose[{ImageData[mask, Bit], ImageData[oimg, typ], ImageData[img, typ]}, {3, 1, 2}], {2}], typ] ] and img = Import[lena.png]; bimg = Binarize[ColorConvert[img, Graylevel]] MaskImageOperation[ GaussianFilter[#, {6, 6}] &, img, bimg] will work. However apply the function not to the whole image will not work, because many operations (like the Gauss filter here) would get problems with the irregular boundaries. The interactive image processing programs like PhotoPaint or PhotoShop also process the full image (in the most cases) and combine it with the original using the mask. Jens > The new image processing features of Mathematica are very useful and > very much needed at least for my work. There are, however, three key > features that are missing in my opinion or are implemented in an > inconsistent fashion: 1) The ability to manipulate image data that is not scaled between 0 > and 1. In many cases image data represent useful physical information > (e.g. brightness of stars, temperature etc...) which are usually > encoded in reals. Scaling everything between 0 and 1 to be able apply > the image processing routines like ImageCrop[], ImageTake[] and > ImagePartition[] seems clumsy and unnecessary. My previous experience > with the IDL language didn't require jumping through these kind of > hoops. Note that the Raster[] command does give the possibility of > scaling data on the fly for display. 2) The ability to apply image processing to user defined regions. It > would be very useful to be able to define regions of interest (say > with polygons) and apply image processing or information extraction > techniques to this region only instead of treating the whole image. 3) Inconsistent behaviour with respect to combined graphics. An > example is given below illustrating how difficult it is to combine > Image data with other Mathematica graphics. The fact that the Show[] > command works with a single image but not with multiple image + > graphic combinations seems to be inconsistent with the syntax and > purpose of the Show[] command. Using Raster[] we get the expected > behaviour but cannot use the new image processing routines of v. 7.0. If you have any work arounds for the above problems or comments I > would be interested in hearing these. Mac Example: Generate an small test image img = RandomReal[{0, 1}, {100, 200}]; This works and produces a graphic in the notebook Image[img] This also works Show[Image[img]] However, although show works with a single image, showing several > graphics combined produces the error Image is not a Graphics > primitive even though the Show[] syntax is respected. Show[Image[img, ImageSize -> 200], Graphics@Circle[]] This also produces a the same error Graphics@Image[img] whereas graphics can be combined using the old-fashioned Raster > command without problem Show[Graphics@Raster[img], Graphics[{Red, Circle[{100, 50}, 40]}]] > === Subject: Re: Problems combining new v7.0 Image command with other graphics Hi Mac, 1. What use would it have to use those image processing commands if not for displaying? If you are going to display then some kind of finite range is necessary. So, why not rescale right away? It's easy, just Image[img // Rescale] or so and your done 2. I agree that would be nice, but it doesn't seem to be there. At least you can fake it. Look, for instance, at this demonstration: http://demonstrations.wolfram.com/ProcessingVariousPartsOfAnImageDifferently / 3. You can combine bitmapped Images with vector based Graphics using ImageCompose: ImageCompose[Image[img], Graphics@Circle[]] I agree with you that it would be nice if Show could be used for that, but I guess it probably leans too much in the direction of vector based Graphics to be a good host for bitmaps. > The new image processing features of Mathematica are very useful and > very much needed at least for my work. There are, however, three key > features that are missing in my opinion or are implemented in an > inconsistent fashion: > > 1) The ability to manipulate image data that is not scaled between 0 > and 1. In many cases image data represent useful physical information > (e.g. brightness of stars, temperature etc...) which are usually > encoded in reals. Scaling everything between 0 and 1 to be able apply > the image processing routines like ImageCrop[], ImageTake[] and > ImagePartition[] seems clumsy and unnecessary. My previous experience > with the IDL language didn't require jumping through these kind of > hoops. Note that the Raster[] command does give the possibility of > scaling data on the fly for display. > > 2) The ability to apply image processing to user defined regions. It > would be very useful to be able to define regions of interest (say > with polygons) and apply image processing or information extraction > techniques to this region only instead of treating the whole image. > > 3) Inconsistent behaviour with respect to combined graphics. An > example is given below illustrating how difficult it is to combine > Image data with other Mathematica graphics. The fact that the Show[] > command works with a single image but not with multiple image + > graphic combinations seems to be inconsistent with the syntax and > purpose of the Show[] command. Using Raster[] we get the expected > behaviour but cannot use the new image processing routines of v. 7.0. > > If you have any work arounds for the above problems or comments I > would be interested in hearing these. > > Mac > > Example: > > Generate an small test image > > img = RandomReal[{0, 1}, {100, 200}]; > > This works and produces a graphic in the notebook > > Image[img] > > This also works > > Show[Image[img]] > > However, although show works with a single image, showing several > graphics combined produces the error Image is not a Graphics > primitive even though the Show[] syntax is respected. > > Show[Image[img, ImageSize -> 200], Graphics@Circle[]] > > This also produces a the same error > > Graphics@Image[img] > > whereas graphics can be combined using the old-fashioned Raster > command without problem > > Show[Graphics@Raster[img], Graphics[{Red, Circle[{100, 50}, 40]}]] === Subject: Re: Problems combining new v7.0 Image command with other graphics summarise the outcome of the discussion as I see it (and hopefully in a correct fashion - let me know otherwise) 1) Image data that is not scaled between 0 and 1. Working with Image data outside the range of 0 to 1 is no problem. All the new image processing commands in v7.0 (e.g. ImageCrop[], ImageApply [] etc...) will work with real values images. I've tested this with ImageApply and it works. For display, scaling of image data on the fly can be done by applying ImageAdjust[] with the range to be rescaled defined, using Rescale[] within the Image[] command or using the ImageData[Graphics[Raster[img]]] construction with the rescaling done by Raster[]. 2) Applying image processing to regions of interest only May appear in future releases of Mathematica. A workaround is to use binary images with values 0 and 1 which define the regions to be treated. 3) Combining images with graphics Use ImageCompose[]. This is not ideal in the sense that it rasterises the line graphics loosing the original information but until Show[] supports image data and graphics it probably does the job well enough. Mac === Subject: Re: Problems combining new v7.0 Image command with other graphics > Hi Mac, 1. What use would it have to use those image processing commands if > not for displaying? Oh let me give you an example, you have found an object in your image, but you want increase the outline of the object by say 10 pixels. You would use a distance transform of the object and binarize the distance map with a threshold <=10. Clearly the distance is a floating point value, it is *not* in the range [0,1], in the application above you will never see the distance map and you *not* display it. Moreover display it with ImageAdjust[] will rescale the distance values and destroy all useful information, because after the rescaling you can't set the threshold for the binarization. 2. I agree that would be nice, but it doesn't seem to be there. At > least you can fake it. Look, for instance, at this demonstration: > http://demonstrations.wolfram.com/ProcessingVariousPartsOfAnImageDifferently/ 3. You can combine bitmapped Images with vector based Graphics using > ImageCompose: ImageCompose[Image[img], Graphics@Circle[]] > That destroy the vector information and work with the full image. Try to move a Locator[] object on the image in that way, and not with Graphics[{Image`ToGraphicsRaster[img][[1]],Locator[p]}] BTW Image`ToGraphicsRaster[] seems to be the most useful function of the image processing, because it restore the old bitmap format. Jens === Subject: Re: Problems combining new v7.0 Image command with other graphics Graphics[Raster[]] ist still working in V 7.0 and it is used by Mathematica 7.0 in the LineIntegralConvolutionPlot[], all Image*[] functions accept Graphics[Raster[]], so ImageData[Graphics[Raster[bm_,___],___]] will return bm. This should solve 1) and 3) To store arbitrary values, you can use Image[] with floating point values. As long as you don't use ImageAdjust[] everything (except the display) will work. In the distance transform Mathematica make exact this, it return the distance map as an image, with the correct distance values and suggest if you wish to see the distance map use ImageAdjust[]. For 2) the normal way is to use masks, i.e. binary images that indicate the region where the operation should be done. You can do that with WorkOnlyOnMask[mask*image]*mask+ Invert[mask]*image That is common in more interactive applications like Corel PhotoPaint or Photoshop. In scientific image processing is is less often used because nobody need to keep the background intact. Jens > The new image processing features of Mathematica are very useful and > very much needed at least for my work. There are, however, three key > features that are missing in my opinion or are implemented in an > inconsistent fashion: 1) The ability to manipulate image data that is not scaled between 0 > and 1. In many cases image data represent useful physical information > (e.g. brightness of stars, temperature etc...) which are usually > encoded in reals. Scaling everything between 0 and 1 to be able apply > the image processing routines like ImageCrop[], ImageTake[] and > ImagePartition[] seems clumsy and unnecessary. My previous experience > with the IDL language didn't require jumping through these kind of > hoops. Note that the Raster[] command does give the possibility of > scaling data on the fly for display. 2) The ability to apply image processing to user defined regions. It > would be very useful to be able to define regions of interest (say > with polygons) and apply image processing or information extraction > techniques to this region only instead of treating the whole image. 3) Inconsistent behaviour with respect to combined graphics. An > example is given below illustrating how difficult it is to combine > Image data with other Mathematica graphics. The fact that the Show[] > command works with a single image but not with multiple image + > graphic combinations seems to be inconsistent with the syntax and > purpose of the Show[] command. Using Raster[] we get the expected > behaviour but cannot use the new image processing routines of v. 7.0. If you have any work arounds for the above problems or comments I > would be interested in hearing these. Mac Example: Generate an small test image img = RandomReal[{0, 1}, {100, 200}]; This works and produces a graphic in the notebook Image[img] This also works Show[Image[img]] However, although show works with a single image, showing several > graphics combined produces the error Image is not a Graphics > primitive even though the Show[] syntax is respected. Show[Image[img, ImageSize -> 200], Graphics@Circle[]] This also produces a the same error Graphics@Image[img] whereas graphics can be combined using the old-fashioned Raster > command without problem Show[Graphics@Raster[img], Graphics[{Red, Circle[{100, 50}, 40]}]] > === Subject: Re: Problems combining new v7.0 Image command with other graphics Hi Mac, Here are some comments regarding your three concerns. 1) Image[ ] does not scale data under any circumstances. It clips data values if DataType is Bit, Byte, or Bit16, due to the nature of these types, but keeps data unchanged when DataType is Real, which is the default for Image constructor. Try: i = Image[ { {0, 2, 1} , {2, 3, 0} } ]; ImageData[ i ] Once you try to visualize such an image, though, the values greater than 1 are shown as white, and values below 0 as black. You can use ImageAdjust[ image ] to scale the values between 0 and 1. 2) We are working on region of interest processing for future releases. 3) I can see that using Show[ ] with combination of Image and Graphics primitives can be really useful. For now, if you want to combine two images or an image with a graphics, you can use ImageCompose. For instance, instead of the last Show expression you have provided, you can use: ImageCompose[ img, Graphics[{Red, Circle[{100, 50}, 40]}] ] Shadi Ashnai Wolfram Research > The new image processing features of Mathematica are very useful and > very much needed at least for my work. There are, however, three key > features that are missing in my opinion or are implemented in an > inconsistent fashion: > > 1) The ability to manipulate image data that is not scaled between 0 > and 1. In many cases image data represent useful physical information > (e.g. brightness of stars, temperature etc...) which are usually > encoded in reals. Scaling everything between 0 and 1 to be able apply > the image processing routines like ImageCrop[], ImageTake[] and > ImagePartition[] seems clumsy and unnecessary. My previous experience > with the IDL language didn't require jumping through these kind of > hoops. Note that the Raster[] command does give the possibility of > scaling data on the fly for display. > > 2) The ability to apply image processing to user defined regions. It > would be very useful to be able to define regions of interest (say > with polygons) and apply image processing or information extraction > techniques to this region only instead of treating the whole image. > > 3) Inconsistent behaviour with respect to combined graphics. An > example is given below illustrating how difficult it is to combine > Image data with other Mathematica graphics. The fact that the Show[] > command works with a single image but not with multiple image + > graphic combinations seems to be inconsistent with the syntax and > purpose of the Show[] command. Using Raster[] we get the expected > behaviour but cannot use the new image processing routines of v. 7.0. > > If you have any work arounds for the above problems or comments I > would be interested in hearing these. > > Mac > > Example: > > Generate an small test image > > img = RandomReal[{0, 1}, {100, 200}]; > > This works and produces a graphic in the notebook > > Image[img] > > This also works > > Show[Image[img]] > > However, although show works with a single image, showing several > graphics combined produces the error Image is not a Graphics > primitive even though the Show[] syntax is respected. > > Show[Image[img, ImageSize -> 200], Graphics@Circle[]] > > This also produces a the same error > > Graphics@Image[img] > > whereas graphics can be combined using the old-fashioned Raster > command without problem > > Show[Graphics@Raster[img], Graphics[{Red, Circle[{100, 50}, 40]}]] === Subject: Re: Problems combining new v7.0 Image command with other graphics tried GraphicsGrid ? > The new image processing features of Mathematica are very useful and > very much needed at least for my work. There are, however, three key > features that are missing in my opinion or are implemented in an > inconsistent fashion: > > 1) The ability to manipulate image data that is not scaled between 0 > and 1. In many cases image data represent useful physical information > (e.g. brightness of stars, temperature etc...) which are usually > encoded in reals. Scaling everything between 0 and 1 to be able apply > the image processing routines like ImageCrop[], ImageTake[] and > ImagePartition[] seems clumsy and unnecessary. My previous experience > with the IDL language didn't require jumping through these kind of > hoops. Note that the Raster[] command does give the possibility of > scaling data on the fly for display. > > 2) The ability to apply image processing to user defined regions. It > would be very useful to be able to define regions of interest (say > with polygons) and apply image processing or information extraction > techniques to this region only instead of treating the whole image. > > 3) Inconsistent behaviour with respect to combined graphics. An > example is given below illustrating how difficult it is to combine > Image data with other Mathematica graphics. The fact that the Show[] > command works with a single image but not with multiple image + > graphic combinations seems to be inconsistent with the syntax and > purpose of the Show[] command. Using Raster[] we get the expected > behaviour but cannot use the new image processing routines of v. 7.0. > > If you have any work arounds for the above problems or comments I > would be interested in hearing these. > > Mac > > Example: > > Generate an small test image > > img = RandomReal[{0, 1}, {100, 200}]; > > This works and produces a graphic in the notebook > > Image[img] > > This also works > > Show[Image[img]] > > However, although show works with a single image, showing several > graphics combined produces the error Image is not a Graphics > primitive even though the Show[] syntax is respected. > > Show[Image[img, ImageSize -> 200], Graphics@Circle[]] > > This also produces a the same error > > Graphics@Image[img] > > whereas graphics can be combined using the old-fashioned Raster > command without problem > > Show[Graphics@Raster[img], Graphics[{Red, Circle[{100, 50}, 40]}]] > > === Subject: Re: Problems combining new v7.0 Image command with other graphics > The new image processing features of Mathematica are very useful and > very much needed at least for my work. There are, however, three key > features that are missing in my opinion or are implemented in an > inconsistent fashion: > > 1) The ability to manipulate image data that is not scaled between 0 > and 1. In many cases image data represent useful physical information > (e.g. brightness of stars, temperature etc...) which are usually > encoded in reals. Scaling everything between 0 and 1 to be able apply > the image processing routines like ImageCrop[], ImageTake[] and > ImagePartition[] seems clumsy and unnecessary. My previous experience > with the IDL language didn't require jumping through these kind of > hoops. Note that the Raster[] command does give the possibility of > scaling data on the fly for display. > > 2) The ability to apply image processing to user defined regions. It > would be very useful to be able to define regions of interest (say > with polygons) and apply image processing or information extraction > techniques to this region only instead of treating the whole image. > > 3) Inconsistent behaviour with respect to combined graphics. An > example is given below illustrating how difficult it is to combine > Image data with other Mathematica graphics. The fact that the Show[] > command works with a single image but not with multiple image + > graphic combinations seems to be inconsistent with the syntax and > purpose of the Show[] command. Using Raster[] we get the expected > behaviour but cannot use the new image processing routines of v. 7.0. > > If you have any work arounds for the above problems or comments I > would be interested in hearing these. > > Mac > > Example: > > Generate an small test image > > img = RandomReal[{0, 1}, {100, 200}]; > > This works and produces a graphic in the notebook > > Image[img] > > This also works > > Show[Image[img]] > > However, although show works with a single image, showing several > graphics combined produces the error Image is not a Graphics > primitive even though the Show[] syntax is respected. > > Show[Image[img, ImageSize -> 200], Graphics@Circle[]] > > This also produces a the same error > > Graphics@Image[img] > > whereas graphics can be combined using the old-fashioned Raster > command without problem > > Show[Graphics@Raster[img], Graphics[{Red, Circle[{100, 50}, 40]}]] I have found that the ImageCompose function is necessary in this case: ImageCompose[Image[img], Graphics[{Red, Circle[{100, 50}, 40]}]] It retains the exact size of the image, though. In my case, that's what I wanted. === Subject: Re: sector-based analysis using FInancialData[] > Does Mathematica 7 have sector index data available via the FinancialData[] function? I can get a list of sectors with this: FinancialData[Sectors] and I can get prices on the iShares funds which track sector indexes i.e: Dow Jones U.S. Consumer Goods Index (IYK), > Dow Jones U.S. Consumer Services Index (IYC), > Dow Jones U.S. Select Home Construction Index (ITB), > S&P Global Consumer Discretionary Index (RXI), > S&P Global Consumer Staples Index (KXI), > Dow Jones U.S. Energy Sector Index Fund (IYE), > Dow Jones U.S. Oil & Gas Exploration & Production Index Fund (IEO), > Dow Jones U.S. Oil Equipment & Services Index Fund (IEZ) > ... but these only give data back (at best) to 2000. Can I get data for the indexes themselves? If so where do I find the symbol names? Not sure whether this is exactly what you are looking for but one can get a list of the companies by sectors by using FinancialData[name_of_a_sector, Members] For instance, In[1]:= FinancialData[Sectors] Out[1]= {AccidentHealthInsurance, Advertising, Aircraft, AirportsFlyingFieldsAndAirportTerminal, AirTerminalMaintenance, [...] WatchesClocksClockworkOperatedDevices, WaterSupply, WomensClothingStores} In[3]:= FinancialData[Aircraft, Members] DE:RWC, F:BCO, F:LM1, F:RWC, NASDAQ:AAII, NASDAQ:ATRO, NASDAQ:AVAV, NASDAQ:EDAC, NASDAQ:ESLT, NASDAQ:KRSL, NASDAQ:LMIA, NASDAQ:TATTF, NYSE:BA, NYSE:COL, NYSE:DCO, NYSE:ERJ, NYSE:HEI, NYSE:MFW, NYSE:TDG, NYSE:UTX, OB:AIRI, OB:ASIQ, OB:ATROB, OB:BUKS, OB:LGSL, OB:UITA, PK:KELLQ, TO:NAS} HTH, --Jean-Marc === Subject: syntax coloring for package function Some names in the Mathematica 7 (and 6) package Combinatorica shadow System` names. One such is Star. Hence after loading Combinatorica, when you type, e.g., Star[5] in an input cell, the 'Star' is colored red - the red used to indicate Shadowing in multiple contexts. Is there some way to avoid that, WITHOUT unchecking the Shadowing in multiple contexts syntax coloring (from the Edit > Preferences dialog, e.g.) and WITHOUT editing the Combinatorica package itself. (I'm afraid that when my students see the red, they will be confused, thinking that they typed the wrong thing.) -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: Hash function of strings I don't think it's possible. Hash works on Mathematica expressions and there is no way that a string expression can be converted to an expression consisting of its binary equivalent only. If there would be a structure binary sequence or so, it must have a Head in Mathematica designating it as such and then we're back at something like the string problem. > Hello all. > > I'm trying to calculate the MD5 Hash function of a series of strings > and I'm getting different results from the true MD5. > > I have searched the group and I have found that the Hash[] function is > including the of the strings. A solution is proposed, creating a > temporary file and then using FileHash. > > My problem is that I want to calculate the Hash of about one million > strings, so creating temporary files is impossible. > > Can you think in a method to calculate the Hash very quickly, without > the ? > === Subject: Re: Hash function of strings Couldn't you use a ramdisk and then apply FileHash? Windows has one hidden in the system. Look at: http://www.picobay.com/projects/2006/06/how-to-make-windows-xp-ram-disk-dri= ve.html http://support.microsoft.com/kb/257405 > I don't think it's possible. Hash works on Mathematica expressions and > there is no way that a string expression can be converted to an > expression consisting of its binary equivalent only. If there would be > a structure binary sequence or so, it must have a Head in > Mathematica designating it as such and then we're back at something > like the string problem. > > > > Hello all. > > I'm trying to calculate the MD5 Hash function of a series of strings > and I'm getting different results from the true MD5. > > I have searched the group and I have found that the Hash[] function is > including the of the strings. A solution is proposed, creating a > temporary file and then using FileHash. > > My problem is that I want to calculate the Hash of about one million > strings, so creating temporary files is impossible. > > Can you think in a method to calculate the Hash very quickly, without > the ? > === Subject: Re: Hash function of strings > I don't think it's possible. Hash works on Mathematica expressions and > there is no way that a string expression can be converted to an > expression consisting of its binary equivalent only. If there would be > a structure binary sequence or so, it must have a Head in > Mathematica designating it as such and then we're back at something > like the string problem. > Hello all. > > I'm trying to calculate the MD5 Hash function of a series of strings > and I'm getting different results from the true MD5. > > I have searched the group and I have found that the Hash[] function is > including the of the strings. A solution is proposed, creating a > temporary file and then using FileHash. > > My problem is that I want to calculate the Hash of about one million > strings, so creating temporary files is impossible. > > Can you think in a method to calculate the Hash very quickly, without > the ? > A million hashes? Performance will also be an issue. Use MathLink to access one of the standard C-coded MD5 functions via some C glue code that will strip the quotes, et al. Joe Gwinn === Subject: Re: CreatePalette question > > I've just started using CreatePalette. It works fine, but I'd like to > fine tune it a bit. (FYI, I'm using V7 for XP Pro 32.) In particular, > I'd like the created palette to just close without asking if one wants > to save it (after one uses it or moves it). > > The help page says that CreatePalette can take any notebook option. > And Options[Notebook] returns a list that contains > > ClosingSaveDialog -> True > > which sounds like it might be what I'm looking for. I say sounds > like because I can't find any documentation for it. (When I cut it > from the list and paste it into an input cell it turns blue.) > Moreover, when I add it as an option to CreatePalette it turns red. > And (not surprisingly) it doesn't seem to work. > > So, is there a way to do what I want? > > > Mark In a private communication, Maxim Rytin gave me the answer: Saveable -> False I thank him. --Mark === Subject: Re: PasteButton question > > I'm just starting to use PasteButton. (I'm using V7 for XP Pro.) It > works fine but I'd like to fine tune it. A toy example illustrates the > issue: > > PasteButton[press, > Panel[Labeled[Grid[{{1, 2}, {3, 4}}], Label, Top]]] > > When the button is pressed, the panel is returned and the label is > highlighted (selected?). I'd rather have the point set just after > the panel. Is that possible? > > > Mark I have stumbled across the answer: use Deploy. PasteButton[press, Deploy @ Panel[Labeled[Grid[{{1, 2}, {3, 4}}], Label, Top]]] --Mark === Subject: Re: Graph of some built-in functions blows up Mathematica V7 To All, The same happens when producing graphics from large data sets. Formatting Notebook appears a number of times along with a windows notice of Windows Not Responding and a white screen. If I wait long enough everything comes back. -----Original Message----- === Subject: Re: Graph of some built-in functions blows up Mathematica V7 Roger, The same happens on my system which is the same as yours. A complete crash of Mathematica 7 and Mathematica 6 runs just fine. I'd suggest you contact the Wolfram support guys on this (http://support.wolfram.com/ if they haven't read this already) as it seems a serious issue. > Hello Mathematica UG: > > $Version = 7.0 for Microsoft Windows (32-bit) (November 10, 2008) > > The following commands are from a notebook downloaded from this > Mathworld page:http://mathworld.wolfram.com/DeltaFunction.html > > (f0 = {1/Pi [Epsilon]/(x^2 + [Epsilon]^2), [Epsilon] Abs[ > x]^([Epsilon] - 1), > 1/2/Sqrt[Pi [Epsilon]] Exp[-x^2/4/[Epsilon]], > 1/Pi/x Sin[x/[Epsilon]], 1/[Epsilon] AiryAi[x/[Epsilon]], > 1/[Epsilon] Re[BesselJ[1/[Epsilon], (x + 1)/[Epsilon]]], > Abs[1/[Epsilon] Exp[-x^2/[Epsilon]] > LaguerreL[n, 2 x/[Epsilon]]]}) // > ColumnForm // TraditionalForm > > << Graphics`Colors` (* gets deprecation errors in V7 *) > > Show[GraphicsArray[ > Block[{$DisplayFunction = Identity}, > Partition[ > Plot[Evaluate[ > Table[# /. {[Epsilon] -> e, > n -> 1}, {e, .1, .2, .02}]], {x, -3, 3}, > PlotRange -> atic, {0, > 3}}, {Automatic, All}], > AxesLabel -> TraditionalForm /@ {x, HoldForm[#] /. n -> 1}= , > PlotStyle -> {Red, Orange, Yellow, Green, Blue, Violet}] &= /@ > f0, 3, 3, {1, 1}, {}]]] (*,GraphicsSpacing->{-.15,.2} *)] > > It runs for a while then a box comes up titled Formatting Notebook > contents. Then Mathematica blows up. > > This same code does run in Mathematica V6. > > Since it does not issue an error message, I am not sure how to isolate > what is wrong other than removing the functions from f0, one-by-one. > > If anyone has another approach to take, I would appreciate any advice. > > TIA. > > > Roger Williams > Franklin Laboratory === Subject: Re: Graph of some built-in functions blows up Mathematica V7 The same happens when producing graphics from large data sets. > Formatting Notebook appears a number of times along with a windows notice > of Windows Not Responding and a white screen. > If I wait long enough everything comes back. A colleague and I maintain the computers in two math classrooms (31 per room). Last week, we installed Mathematica 7 before re-imaging the machines for the upcoming semester. We noticed that the first time a user logs in and starts Mathematica, there is a brief Formatting Notebook pop-up before Mathematica starts. It only lasts a moment, and does not seem to recur if the same user logs back onto the same machine (we keep user profiles until the end of the semester), so we're going to worry about it. Still, we are curious as to what causes it. We never saw this with previous versions of Mathematica. -- Helen Read University of Vermont === Subject: Re: Fourier Transform Graph Coordinates data = Abs[Fourier[{-1, -1, -1, -1, 1, 1, 1, 1}]] {0.,1.84776,0.,0.765367,0.,0.765367,0.,1.84776} Prepend[Thread[{Range[Length[data]], data}], {x, y}] // Grid Prepend[Transpose[{Range[Length[data]], data}], {x, y}] // Grid p = ListLinePlot[data] Prepend[p[[1, 1, 3, 2, 1]], {x, y}] // Grid Prepend[Cases[p, Line[{pts__}] :> pts, Infinity], {x, y}] // Grid Bob Hanlon > Hi all, > > I am wanting to compare Fourier Transform graphs in a Java Program. > For thi= > s I need the coordinates, or graph points of the created Fourier > Transform = > graph. > > For example using the Mathematica example: > > In[]:= Fourier[{-1,-1,-1,-1,1,1,1,1}] > Out[]:= {0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 - > 1.70= > 711 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 - > 0.29= > 2893 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 + > 0.29= > 2893 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 > + 1.7= > 0711 [ImaginaryI]} > > In[]:= ListPlot[Abs[Fourier[{-1, -1, -1, -1, 1, 1, 1, 1}]], > Out[]:= A zig zag graph. > > > I want the coordinates of this graph. I have tried exporting it as a > table = > but it is indecipherable. Idealy the graph would be in the style: > X Y > 1 10 > 2 23 > 3 24 > 4 27 > 5 31 > > Etc > > The style is not the concern though it is just getting the data which > gener= > ates the graph. > > Yours > > > > David Fourie BSc Computer Science > David.fourie@ncl.ac.uk > MPhil Computational Neuroscience > D809 > ext - 8593 === Subject: Re: How to plot strings s_i at point {x_i,y_i} ? data = Table[{RandomInteger[{0, 100}], RandomInteger[{0, 100}], RandomChoice[CharacterRange[a, z]]}, {10}]; Graphics[Text[Last[#], Most[#]] & /@ data, Axes -> True, AxesOrigin -> {0, 0}] To use ListPlot and PlotMarkers, convert each data point into a separate list ListPlot[List /@ Most /@ data, PlotMarkers -> Last /@ data, AxesOrigin -> {0, 0}, AspectRatio -> 1] Bob Hanlon > Hello! > > I have a set of triplets {{x1,y1,s1},{x2,y2,s2},...}. I would like to > make a plot where the third element of each triplet, a string, is > plotted at the coordinate given by the the first two elements of the > triplet. How can I acheive this? Of course I don't mind reorganizing > the format of the data. It seems to me that PlotMarkers is not willing > to help me, since I want different markes within the same data set. > > John === Subject: Re: sector-based analysis using FInancialData[] FinancialData[^DJI, Name] Dow Jones Industrial Average I Length[djusIndices = Select[FinancialData[Indices], StringMatchQ[#, ^DJUS*] &]] 191 FinancialData[#, Name] & /@ Take[djusIndices, 10] {Dow Jones U S Total Market Ind,Dow Jones Islamic MKT Us Titans,Dow Jones Islamic Market U S T,Dow Jones U S Aerospace And Defe,Dow Jones U S Delivery Service,Dow Jones U S Asset Managers I,Dow Jones U S Electronic Equip,Dow Jones Us Aluminum,Dow Jones U S Medical Equipmen,Dow Jones U S Automobiles And Pa} Selecting subset of indices for which financial data is available: djusIndices2 = Select[djusIndices, Length[FinancialData[#, All]] > 1 &] {^DJUS,^DJUSBT,^DJUSCH,^DJUSEN,^DJUSL,^DJUSM,^DJUSS} FinancialData[#, Name] & /@ djusIndices2 {Dow Jones U S Total Market Ind,Dow Jones Us Biotechnology Inde,Dow Jones Us Chemicals Index,Dow Jones U S Oil And Gas Index,Dow Jones Us Large Cap Index,Dow Jones Us Mid Cap Index,Dow Jones Us Small Cap Index} The data only goes back to 2000 Bob Hanlon > Does Mathematica 7 have sector index data available via the > FinancialData[] function? > I can get a list of sectors with this: > > FinancialData[Sectors] > > and I can get prices on the iShares funds which track sector indexes > i.e: > > Dow Jones U.S. Consumer Goods Index (IYK), Dow Jones U.S. > Consumer Services Index (IYC), > Dow Jones U.S. Select Home Construction Index (ITB), > S&P Global Consumer Discretionary Index (RXI), > S&P Global Consumer Staples Index (KXI), > Dow Jones U.S. Energy Sector Index Fund (IYE), > Dow Jones U.S. Oil & Gas Exploration & Production Index Fund (IEO), > Dow Jones U.S. Oil Equipment & Services Index Fund (IEZ) > .. > > but these only give data back (at best) to 2000. > > Can I get data for the indexes themselves? If so where do I find the > symbol names? > > Thx. === Subject: Module and call or others I have a table contains 4 column of data and other 2 column to be filled after calculation. Supposed my data set is: 'in[1]:=' yabc = {{5, 1, 12, 3, 1, 1}, {6, 1, 12, 3, 1, 1}, {7, 2, 10, 4, 1, 1}, {8, 2, 10, 4, 1, 1}}; I create a Module as: 'in[2]:=' yx1x2[y_, a_, b_, c_] := Module[{del, ai, bi, ci, x1, x2}, ai = a; bi = b; ci = c - y; del = bi*bi - 4*ai*ci; x1 = (-ai + Sqrt[del])/2/bi, x2 = (-ai - Sqrt[del])/2/bi]; Now I can calculate x1, x2 in the Module yx1x2 with first 4 data of 1st row of yabc as: 'in[3]:=' yx1x2[yabc[[1, 1]], yabc[[1, 2]], yabc[[1, 3]], yabc[[1, 4]]][[-2]] 'in[4]:=' yx1x2[yabc[[1, 1]], yabc[[1, 2]], yabc[[1, 3]], yabc[[1, 4]]][[-1]] I get correct value of x1 and x2 but I receive error message as: Module::argrx: Module called with 3 arguments; 2 arguments are expected. more... 'out[3]:='(-1+2*Sqrt(38))/24 'out[4]:='(-1-2*Sqrt(38))/24 Now I replace column 5 and 6 of table yabc by x1 and x2 of yx1x2 as: yabc[[All, 5]] = yx1x2[yabc[[All,1]], yabc[[All, 2]], yabc[[All, 3]], yabc[[All, 4]]][[-1]]; yabc[[All, 6]] = yx1x2[yabc[[All, 1]], yabc[[All, 2]], yabc[[All, 3]], yabc[[All, 4]]][[-2]]; I get wrong results of column 5 as all the values are equal to (-1-2*Sqrt(38))/24. I really don't know what is wrong!! I want to have a function or a procedure to calculate both x1 and x2 basing on 4 input data and then apply to yabc table with 4 input and 2 output column. I don't know whether the module is suitable for this problem or other one is suitable. Is there any problem with my module yx1x2 and the calling for column 5? Could you please tell me how to solve the problem? Lai Ngoc Anh === Subject: Re: Module and call or others I have a table contains 4 column of data and other 2 column to be filled after calculation. Supposed my data set is: > 'in[1]:=' yabc = {{5, 1, 12, 3, 1, 1}, {6, 1, 12, 3, 1, 1}, {7, 2, 10, 4, 1, 1}, {8, 2, 10, 4, 1, 1}}; I create a Module as: > 'in[2]:=' yx1x2[y_, a_, b_, c_] := Module[{del, ai, bi, ci, x1, x2}, > ai = a; bi = b; ci = c - y; > del = bi*bi - 4*ai*ci; x1 = (-ai + Sqrt[del])/2/bi, x2 = (-ai - Sqrt[del])/2/bi]; A pair of curly brackets are missing around x1 and x2 if you want to return this pair of values (a *list* of values in Mathematica jargon). Otherwise --- if you wanted the last value only, i.e. x2 --- you must write a semicolon rather than a comma (but I think you want a pair of values). > Now I can calculate x1, x2 in the Module yx1x2 with first 4 data of 1st row of yabc as: > 'in[3]:=' yx1x2[yabc[[1, 1]], yabc[[1, 2]], yabc[[1, 3]], yabc[[1, 4]]][[-2]] > 'in[4]:=' yx1x2[yabc[[1, 1]], yabc[[1, 2]], yabc[[1, 3]], yabc[[1, 4]]][[-1]] I get correct value of x1 and x2 but I receive error message as: > Module::argrx: Module called with 3 arguments; 2 arguments are expected. more... > 'out[3]:='(-1+2*Sqrt(38))/24 > 'out[4]:='(-1-2*Sqrt(38))/24 Now I replace column 5 and 6 of table yabc by x1 and x2 of yx1x2 as: > yabc[[All, 5]] = yx1x2[yabc[[All,1]], yabc[[All, 2]], yabc[[All, 3]], yabc[[All, 4]]][[-1]]; > yabc[[All, 6]] = yx1x2[yabc[[All, 1]], yabc[[All, 2]], yabc[[All, 3]], yabc[[All, 4]]][[-2]]; I get wrong results of column 5 as all the values are equal to (-1-2*Sqrt(38))/24. I really don't know what is wrong!! I want to have a function or a procedure to calculate both x1 and x2 basing on 4 input data and then apply to yabc table with 4 input and 2 output column. I don't know whether the module is suitable for this problem or other one is suitable. Is there any problem with my module yx1x2 and the calling for column 5? Could you please tell me how to solve the problem? Below is a working code with some 'optimizations' avoiding the use of too many useless local/temporary variables and also speeding things up by memorizing previous calculations (memoization in CS jargon, i.e. functions that remember their values). In[1]:= yabc = {{5, 1, 12, 3, 1, 1}, {6, 1, 12, 3, 1, 1}, {7, 2, 10, 4, 1, 1}, {8, 2, 10, 4, 1, 1}} Out[1]= {{5, 1, 12, 3, 1, 1}, {6, 1, 12, 3, 1, 1}, {7, 2, 10, 4, 1, 1}, {8, 2, 10, 4, 1, 1}} In[2]:= yx1x2[y_, a_, b_, c_] := yx1x2[y, a, b, c] = Module[{del}, del = b^2 - 4*a*(c - y); {(-a + Sqrt[del])/2/b, (-a - Sqrt[del])/2/b} ]; In[3]:= yx1x2[yabc[[1, 1]], yabc[[1, 2]], yabc[[1, 3]], yabc[[1, 4]]][[-2]] Out[3]= 1/24 (-1 + 2 Sqrt[38]) In[4]:= yx1x2[yabc[[1, 1]], yabc[[1, 2]], yabc[[1, 3]], yabc[[1, 4]]][[-1]] Out[4]= 1/24 (-1 - 2 Sqrt[38]) In[5]:= yabc[[All, 5]] = yx1x2[yabc[[All, 1]], yabc[[All, 2]], yabc[[All, 3]], yabc[[All, 4]]][[-1]]; yabc[[All, 6]] = yx1x2[yabc[[All, 1]], yabc[[All, 2]], yabc[[All, 3]], yabc[[All, 4]]][[-2]]; In[7]:= yabc Out[7]= {{5, 1, 12, 3, 1/24 (-1 - 2 Sqrt[38]), 1/24 (-1 + 2 Sqrt[38])}, {6, 1, 12, 3, 1/24 (-1 - 2 Sqrt[39]), 1/24 (-1 + 2 Sqrt[39])}, {7, 2, 10, 4, 1/20 (-2 - 2 Sqrt[31]), 1/20 (-2 + 2 Sqrt[31])}, {8, 2, 10, 4, 1/20 (-2 - 2 Sqrt[33]), 1/20 (-2 + 2 Sqrt[33])}} --Jean-Marc === Subject: Re: Module and call or others a) yx1x2[y_, a_, b_, c_] := Module[{del, ai, bi, ci, x1, x2}, ai = a; bi = b; ci = c - y; del = bi*bi - 4*ai*ci; x1 = (-ai + Sqrt[del])/2/bi; (* <- here you have a , instead of a ; *) x2 = (-ai - Sqrt[del])/2/bi ] and , separate function arguments, ; glue statements together. b) sure that you don't mean yx1x2 @@@ (Take[#, 4] & /@ yabc) Jens I have a table contains 4 column of data and other 2 column to be filled after calculation. Supposed my data set is: > 'in[1]:=' yabc = {{5, 1, 12, 3, 1, 1}, {6, 1, 12, 3, 1, 1}, {7, 2, 10, 4, 1, 1}, {8, 2, 10, 4, 1, 1}}; I create a Module as: > 'in[2]:=' yx1x2[y_, a_, b_, c_] := Module[{del, ai, bi, ci, x1, x2}, ai = a; bi = b; ci = c - y; del = bi*bi - 4*ai*ci; x1 = (-ai + Sqrt[del])/2/bi, x2 = (-ai - Sqrt[del])/2/bi]; Now I can calculate x1, x2 in the Module yx1x2 with first 4 data of 1st row of yabc as: > 'in[3]:=' yx1x2[yabc[[1, 1]], yabc[[1, 2]], yabc[[1, 3]], yabc[[1, 4]]][[-2]] > 'in[4]:=' yx1x2[yabc[[1, 1]], yabc[[1, 2]], yabc[[1, 3]], yabc[[1, 4]]][[-1]] I get correct value of x1 and x2 but I receive error message as: > Module::argrx: Module called with 3 arguments; 2 arguments are expected. more... > 'out[3]:='(-1+2*Sqrt(38))/24 > 'out[4]:='(-1-2*Sqrt(38))/24 Now I replace column 5 and 6 of table yabc by x1 and x2 of yx1x2 as: > yabc[[All, 5]] = yx1x2[yabc[[All,1]], yabc[[All, 2]], yabc[[All, 3]], yabc[[All, 4]]][[-1]]; > yabc[[All, 6]] = yx1x2[yabc[[All, 1]], yabc[[All, 2]], yabc[[All, 3]], yabc[[All, 4]]][[-2]]; I get wrong results of column 5 as all the values are equal to (-1-2*Sqrt(38))/24. I really don't know what is wrong!! I want to have a function or a procedure to calculate both x1 and x2 basing on 4 input data and then apply to yabc table with 4 input and 2 output column. I don't know whether the module is suitable for this problem or other one is suitable. Is there any problem with my module yx1x2 and the calling for column 5? Could you please tell me how to solve the problem? > Lai Ngoc Anh > > === Subject: Re: Module and call or others There's an error in your Module definition. x1 = (-ai + Sqrt[del])/2/bi, x2 = (-ai - Sqrt[del])/2/bi]; The comma here should be a semicolon (;). BTW: x1 does not seem to be returned and isn't used in later calulations. That seems an error as well. You could just as well remove that line. > > I have a table contains 4 column of data and other 2 column to be filled = after calculation. > > Supposed my data set is: > 'in[1]:=' yabc = {{5, 1, 12, 3, 1, 1}, {6, 1, 12, 3, 1, 1}, {7, 2, 10= , 4, 1, 1}, {8, 2, 10, 4, 1, 1}}; > > I create a Module as: > 'in[2]:=' yx1x2[y_, a_, b_, c_] := Module[{del, ai, bi, ci, x1, x2}, = ai = a; bi = b; ci = c - y; del = bi*bi - 4*ai*ci; x1 = (-ai + Sq= rt[del])/2/bi, x2 = (-ai - Sqrt[del])/2/bi]; > > Now I can calculate x1, x2 in the Module yx1x2 with first 4 data of 1st r= ow of yabc as: > 'in[3]:=' yx1x2[yabc[[1, 1]], yabc[[1, 2]], yabc[[1, 3]], yabc[[1, 4]]]= [[-2]] > 'in[4]:=' yx1x2[yabc[[1, 1]], yabc[[1, 2]], yabc[[1, 3]], yabc[[1, 4]]]= [[-1]] > > I get correct value of x1 and x2 but I receive error message as: > Module::argrx: Module called with 3 arguments; 2 arguments are expected. = more... > 'out[3]:='(-1+2*Sqrt(38))/24 > 'out[4]:='(-1-2*Sqrt(38))/24 > > Now I replace column 5 and 6 of table yabc by x1 and x2 of yx1x2 as: > yabc[[All, 5]] = yx1x2[yabc[[All,1]], yabc[[All, 2]], yabc[[All, 3]], y= abc[[All, 4]]][[-1]]; > yabc[[All, 6]] = yx1x2[yabc[[All, 1]], yabc[[All, 2]], yabc[[All, 3]], = yabc[[All, 4]]][[-2]]; > > I get wrong results of column 5 as all the values are equal to (-1-2*Sqrt= (38))/24. I really don't know what is wrong!! > > I want to have a function or a procedure to calculate both x1 and x2 basi= ng on 4 input data and then apply to yabc table with 4 input and 2 output c= olumn. I don't know whether the module is suitable for this problem or othe= r one is suitable. Is there any problem with my module yx1x2 and the callin= g for column 5? > > Could you please tell me how to solve the problem? > > Lai Ngoc Anh === Subject: Re: Aspect Ratio Nathan This message and any attachments, may contain confidential and/or legally privileged information. If you are not the intended recipient of the message by the original sender, please destroy it. Message and attachments copyright =A9 2008, all rights reserved. Any unauthorized dissemination, distribution or copying is strictly forbidden -----Original Message----- Cc: mathgroup@smc.vnet.net === Subject: Re: Aspect Ratio > including Text[] in various fonts. I will try it. > > My goal here is that I want to use Inset[] to compose various 2D and > 3D > graphics together. > You can (in V7, at least) also use Rasterize[.., RasterSize], although you have to be careful about the various XXXPadding options to Graphics. In[130]:= r1 = Graphics[Rectangle[{0, 0}, {1, 10}]]; In[131]:= r2 = Graphics[Rectangle[{0, 0}, {1, 2}]]; In[132]:= Rasterize[r1, RasterSize] Out[132]= {46, 432} In[133]:= Rasterize[Show[r1, ImagePadding -> 0, PlotRangePadding -> 0], RasterSize] Out[133]= {43, 432} In[134]:= Rasterize[Show[r2, ImagePadding -> 0, PlotRangePadding -> 0], RasterSize] Out[134]= {216, 432} This should generally be more robust than most other methods I can think of, though a bit slower than some other methods, since it has to ask the frontend for information about the rendered result instead of using information available to the kernel. The kernel has no idea about things like font metrics and so this is probably a better approach if you're interested in (styled) text. Brett Champion Wolfram Research === Subject: Re: a LOT of Mathematica bugs (some very old) control error Plot[2^-s LerchPhi[-1, s, 1/2], {s, -6.75, -7}] Same expression not FullSimplify (ing) - not bug? {E^(-(((1 + E) (E + E^(-(1 + E) [Pi])))/E)), E^((-1 - E) (1 + E^(-1 - (1 + E) [Pi])))} // FullSimplify ********************************************** Terrible Performance x = IE; Timing[Do[x = x /. IE -> E^(IE/E), {12}]; x] {4.687, E^E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + IE/E)))))))))))} mathematica 2.2 do it in a flash : x=IE; Timing[Do[x=x/.IE->E^(IE/E),{12}];x] {0. Second, Power[E, Power[E, -1 + Power[E, -1 + Power[E, -1 + Power[E, -1 + Power[E, -1 + IE/E -1 + E -1 + E -1 + E -1 + E -1 + E -1 + E ]]]]]]} try this to hang the system x = IE; Timing[Do[x = x /. IE -> E^(IE/E), {15}]; x] SparseArray ss = SparseArray[{i_, j_, 1} -> 1, {4, 4, 4}] ss // MatrixForm Map[Sin, ss] // MatrixForm (*Fails*) ss // FullForm Map[Sin, ss] // FullForm ******* Mathematica eats a lot system memory when this sparseArray is (eg 300 x 300 x300) - Is it needed/by design ? gg = SparseArray[{i_, j_, 1} -> 1, {300, 300, 300}]; ********* generated output does not mach the display ReplaceAll[ Plus[Times[-1, Power[E, Times[1, Power[x, -1]]]], Power[E, Plus[Times[1, Power[x, -1]], Power[x, Times[-1, x]]]]], Rule[x, DirectedInfinity[-1]]] ******************* Sum[(-x k)^k, {k, 0, Infinity}] ******************* Function tends to Log[2] f[k2_] = N[-1 Sum[(1/k) (-1)^k, {k, 1, k2}]] // FullSimplify But this series diverges NSum[ (-1)^k (f[k]/k), {k, 1, Infinity}] ********************** version 6 (ok) - 7 results differs InverseLaplaceTransform[E^((1 - Sqrt[1 + 4*s])/2), s, t] **************** === Subject: Re: Writing Assistant/Stylesheet Chooser problem Open the Stylesheet Chooser palette from either the Writing Assistant or Format->Stylesheet->Stylesheet Chooser menu item. Open the Option Inspector from the Format menu and select Stylesheet from the first drop down list in the upper left area of the Option Inspector. Open the Notebook Options area and then open Notebook Properties and select Editable. Now open Window Properties in the Notebook Options area and select All for WindowSize. You may want to select MagnificationPopUp in the WindowElements group to display the magnification popup in the lower frame of the Stylesheets palette. The vertical height of the Stylesheet Chooser palette will now depend on the number of thumbnails being displayed. The horizontal dimension of the palette will respond to the magnification value used for the palette. Eric === Subject: Mathematica Special Interest Group (Washington DC Area) The Washington D.C. area Mathematica Special Interest Group will meet Friday, 9 January, 7:30 to 9:30 a.m. at the SAIC Enterprise Center building in Tysons Corner (see directions below). Early risers meet before 7:00 in the morning for admission at the front desk, then we have a Dutch treat breakfast downstairs. By about 7:30 we have moved to one of the classrooms. Meetings consist of prepared talks, informal discussion about Mathematica programming and applications, general questions, and new business. 1. Prepared Talks: A. Hopfield Networks and the Memory Capacity Problem, by Joe Marr Abstract. Hopfield networks have been intensively studied in the past as models of brain function -- in particular, of associative memories. This short presentation will survey the basics of Hopfield Networks and demonstrate how Mathematica was used to study them. I'll also discuss a technique to increase the memory capacity of Hopfield networks under the assumption of perfect recall, provide a rigorous proof of its limiting performance, and demonstrate how the technique might be extended. B. Initial Impressions of Version 7, by Dave Vasholz Abstract. In this talk I will discuss comparisons between versions 6 and 7. My approach is to compare performances in the execution of a fairly elaborate hydrodynamics notebook that I discussed at the recent International Mathematica Users Conference 2008. In addition, I hope to have some interesting material on image processing. C. Using FindInstance for Fun and Profit, by Dan Martinez This short talk describes Dan's greatest Yuletide accomplishment with Mathematica. And they said it couldn't be done! A new business item will be to collect a voluntary $10 per head to maintain the SIG site for another year. To inquire about attending, e-mail Dan Martinez (dmartinez@sprintmail.com) or Bruce Colletti (bcolletti@compuserve.com). In your e-mail subject line, please include 'Mathematica SIG.' The SIG-site is http://web.mac.com/hrbishop.pmsi/DCSIG.m/DCSIG.html A SIG representative will meet you in the lobby. Please arrive no later than ten minutes to seven if you wish to join us for breakfast, and no later than twenty after seven to attend the meeting only. The desk officer will ask for a driver's license before issuing a visitor's badge. === Subject: Changing default meaning of ImageSize -> Automatic I like the default behavior of the option ImageSize -> Automatic in Graphics[] that results in automatic resizing of graphics according to the option ImageSizeMultipliers. But the default size of any graphics produced with this option is too small (360 pixels width) for me and I am coerced to resize it by hand any time it is produced for making it visible in detail. Is there a way to change this behavior and to force Graphics[] with the option ImageSize -> Automatic produce an image with (for example) 500 pixels width? In[1]:= Plot[Sin[x], {x, 0, 6 Pi}] // ImageDimensions Out[1]= {360, 213} === Subject: Re: Changing default meaning of ImageSize -> Automatic Are you looking for SetOptions[Plot,ImageSize-> xx] ? > I like the default behavior of the option ImageSize -> Automatic in > Graphics[] that results in automatic resizing of graphics according to > the option ImageSizeMultipliers. But the default size of any graphics > produced with this option is too small (360 pixels width) for me and I > am coerced to resize it by hand any time it is produced for making it > visible in detail. Is there a way to change this behavior and to force > Graphics[] with the option ImageSize -> Automatic produce an image > with (for example) 500 pixels width? > > In[1]:= Plot[Sin[x], {x, 0, 6 Pi}] // ImageDimensions > > Out[1]= {360, 213} > > === Subject: Re: Changing default meaning of ImageSize -> Automatic try SetOptions[Plot, ImageSize -> 1000] In[5]:= Plot[Sin[x], {x, 0, 6 Pi}] // ImageDimensions Out[5]= {1000, 617} Jens > I like the default behavior of the option ImageSize -> Automatic in > Graphics[] that results in automatic resizing of graphics according to > the option ImageSizeMultipliers. But the default size of any graphics > produced with this option is too small (360 pixels width) for me and I > am coerced to resize it by hand any time it is produced for making it > visible in detail. Is there a way to change this behavior and to force > Graphics[] with the option ImageSize -> Automatic produce an image > with (for example) 500 pixels width? In[1]:= Plot[Sin[x], {x, 0, 6 Pi}] // ImageDimensions Out[1]= {360, 213} > === Subject: Re: Changing default meaning of ImageSize -> Automatic With the Option Inspector in the Format menu you can change this option setting The ImageSize default is in Graphics Options/Image Bounding Box. Make sure you to have Global Preferences in the inspector's drop down menu at the top if you want this as your system wide default. > I like the default behavior of the option ImageSize -> Automatic in > Graphics[] that results in automatic resizing of graphics according to > the option ImageSizeMultipliers. But the default size of any graphics > produced with this option is too small (360 pixels width) for me and I > am coerced to resize it by hand any time it is produced for making it > visible in detail. Is there a way to change this behavior and to force > Graphics[] with the option ImageSize -> Automatic produce an image > with (for example) 500 pixels width? > > In[1]:= Plot[Sin[x], {x, 0, 6 Pi}] // ImageDimensions > > Out[1]= {360, 213} === Subject: Re: How to plot strings s_i at point {x_i,y_i} ? > Hello! I have a set of triplets {{x1,y1,s1},{x2,y2,s2},...}. I would like to > make a plot where the third element of each triplet, a string, is > plotted at the coordinate given by the the first two elements of the > triplet. How can I acheive this? Of course I don't mind reorganizing > the format of the data. It seems to me that PlotMarkers is not willing > to help me, since I want different markes within the same data set. Well, you *could* do something like the following, treating each set of coordinates as a separate list so that each one gets its own PlotMarker. coords = {{{-5, 5}}, {{8, -3}}, {{6, 8}}}; strings = {String 1, String 2, String 3}; ListPlot[coords, PlotMarkers -> strings, PlotStyle -> Black, PlotRange -> {{-10, 10}, {-10, 10}}] But why not construct your own Text graphics primitives? For example: list = {{-5, 5, String 1}, {8, -3, String 2}, {6, 8, String 3}}; f[x_List] := Graphics[Text[x[[3]], {x[[1]], x[[2]]}]]; Show[Map[f, list], Axes -> True] -- Helen Read University of Vermont === Subject: Re: How to plot strings s_i at point {x_i,y_i} ? Try using Text[s1,{x1,y1}] within Graphics[]. Graphics[Text[#3, {#1, #2}] & @@@ {{x1, y1, s1}, {x2, y2, s2}}] > Hello! > > I have a set of triplets {{x1,y1,s1},{x2,y2,s2},...}. I would like to > make a plot where the third element of each triplet, a string, is > plotted at the coordinate given by the the first two elements of the > triplet. How can I acheive this? Of course I don't mind reorganizing > the format of the data. It seems to me that PlotMarkers is not willing > to help me, since I want different markes within the same data set. > > John > > === Subject: Re: How to plot strings s_i at point {x_i,y_i} ? John, To display the string as the marker, try: num = 30; pts = Table[{Random[], Random[], RandomInteger[100]}, {i, 1, num}]; ptset = Table[pts[[i, 1 ;; 2]], {i, 1, num}]; ptlabel = Table[pts[[i, 3]], {i, 1, num}]; pts; Graphics[ {Table[Text[ptlabel[[i]], ptset[[i]]], {i, 1, num}]}, PlotRange -> {{0, 1.1}, {0, 1.1}}, Axes -> True ] Jamie > Hello! > > I have a set of triplets {{x1,y1,s1},{x2,y2,s2},...}. I would like to > make a plot where the third element of each triplet, a string, is > plotted at the coordinate given by the the first two elements of the > triplet. How can I acheive this? Of course I don't mind reorganizing > the format of the data. It seems to me that PlotMarkers is not willing > to help me, since I want different markes within the same data set. > > John > > === Subject: Re: How to plot strings s_i at point {x_i,y_i} ? Hi John, Not the most elegant solution I'm sure, but it works: num = 30; pts = Table[{Random[], Random[], RandomInteger[100]}, {i, 1, num}]; ptset = Table[pts[[i, 1 ;; 2]], {i, 1, num}]; ptlabel = Table[pts[[i, 3]], {i, 1, num}]; pts; ListPlot[Table[Tooltip[ptset[[i]], ptlabel[[i]]], {i, 1, num}], PlotStyle -> {Thick, PointSize[Large]}, PlotRange -> {{0, 1.1}, {0, 1.1}} ] Jamie > Hello! > > I have a set of triplets {{x1,y1,s1},{x2,y2,s2},...}. I would like to > make a plot where the third element of each triplet, a string, is > plotted at the coordinate given by the the first two elements of the > triplet. How can I acheive this? Of course I don't mind reorganizing > the format of the data. It seems to me that PlotMarkers is not willing > to help me, since I want different markes within the same data set. > > John > > === Subject: Re: How to plot strings s_i at point {x_i,y_i} ? data = Sort[Table[RandomReal[], {10}, {2}], First[#1] < First[#2] &]; labels = StringJoin @@@ Table[RandomInteger[{32, 96}], {10}, {8}], {2}]; and Graphics[{Point[#[[1]]], Text[#[[2]], #[[1]], {-1, -1}] } & /@ Transpose[{data, labels}], Frame -> True] Jens > Hello! I have a set of triplets {{x1,y1,s1},{x2,y2,s2},...}. I would like to > make a plot where the third element of each triplet, a string, is > plotted at the coordinate given by the the first two elements of the > triplet. How can I acheive this? Of course I don't mind reorganizing > the format of the data. It seems to me that PlotMarkers is not willing > to help me, since I want different markes within the same data set. John > === Subject: Re: Fourier Transform Graph Coordinates what is with lst=MapIndexed[{#2[[1]], #1} & , Abs[Fourier[{-1, -1, -1, -1, 1, 1, 1, 1}]]] Grid[Prepend[lst, {X, Y}]] ?? Jens > Hi all, I am wanting to compare Fourier Transform graphs in a Java Program. For thi= > s I need the coordinates, or graph points of the created Fourier Transform = > graph. For example using the Mathematica example: In[]:= Fourier[{-1,-1,-1,-1,1,1,1,1}] > Out[]:= {0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 - 1.70= > 711 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 - 0.29= > 2893 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 + 0.29= > 2893 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 + 1.7= > 0711 [ImaginaryI]} In[]:= ListPlot[Abs[Fourier[{-1, -1, -1, -1, 1, 1, 1, 1}]], > Out[]:= A zig zag graph. > I want the coordinates of this graph. I have tried exporting it as a table = > but it is indecipherable. Idealy the graph would be in the style: > X Y > 1 10 > 2 23 > 3 24 > 4 27 > 5 31 Etc The style is not the concern though it is just getting the data which gener= > ates the graph. Yours David Fourie BSc Computer Science > David.fourie@ncl.ac.uk > MPhil Computational Neuroscience > D809 > ext - 8593 > === Subject: Re: Fourier Transform Graph Coordinates > I am wanting to compare Fourier Transform graphs in a Java Program. For thi= > s I need the coordinates, or graph points of the created Fourier Transform = > graph. For example using the Mathematica example: In[]:= Fourier[{-1,-1,-1,-1,1,1,1,1}] > Out[]:= {0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 - 1.70= > 711 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 - 0.29= > 2893 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 + 0.29= > 2893 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 + 1.7= > 0711 [ImaginaryI]} In[]:= ListPlot[Abs[Fourier[{-1, -1, -1, -1, 1, 1, 1, 1}]], > Out[]:= A zig zag graph. > I want the coordinates of this graph. I have tried exporting it as a table = > but it is indecipherable. Idealy the graph would be in the style: > X Y > 1 10 > 2 23 > 3 24 > 4 27 > 5 31 Etc The style is not the concern though it is just getting the data which gener= > ates the graph. Looking at the FullForm of the plot, say g, we can see that Cases[g, Point[x_] :> Sequence @@ x, Infinity] extracts the desired information and returns them as a list of pairs. For instance, In[1]:= g = ListPlot[Abs[Fourier[{-1, -1, -1, -1, 1, 1, 1, 1}]]] g // FullForm pts = Cases[g, Point[x_] :> Sequence @@ x, Infinity] pts[[All, 2] ](* if you want only the y-axis points *) Out[2]//FullForm= Graphics[List[Hue[0.67`, 0.6`, 0.6`], Point[List[List[1.`, 0.`], List[2.`, 1.8477590650225733`], List[3.`, 0.`], List[4.`, 0.7653668647301796`], List[5.`, 0.`], List[6.`, 0.7653668647301796`], List[7.`, 0.`], List[8.`, 1.8477590650225733`]]]], List[Rule[AspectRatio, Power[GoldenRatio, -1]], Rule[Axes, True], Rule[AxesOrigin, List[0, Automatic]], Rule[PlotRange, Automatic], Rule[PlotRangeClipping, True]]] Out[3]= {{1., 0.}, {2., 1.84776}, {3., 0.}, {4., 0.765367}, {5., 0.}, {6., 0.765367}, {7., 0.}, {8., 1.84776}} Out[4]= {0., 1.84776, 0., 0.765367, 0., 0.765367, 0., 1.84776} --Jean-Marc === Subject: Re: Fourier Transform Graph Coordinates Errrhmm...., the data that made the graph with is stuff you yourself put in the ListPlot command to start with. You don't have to get it FROM the graph, do you? Anyway, the following code will export the original data. Look up Export for possible formats. I have used the tab-separated-values (TSV) format. f = Abs[Fourier[{-1, -1, -1, -1, 1, 1, 1, 1}]]; Export[c://test.tsv, Transpose[{Range[Length[f]], f}]] If you have only the graph and not the original data (but why wouldn't you have that?) you'd have to look at the structure of the graph using FullForm: ListPlot[Abs[Fourier[{-1, -1, -1, -1, 1, 1, 1, 1}]]] // FullForm In the result you'll notice a list with point coordinates. Using pattern matching and ReplaceAll (/.) it is easy to get them out: f=(ListPlot[Abs[Fourier[{-1, -1, -1, -1, 1, 1, 1, 1}]]] /. Graphics [{___, Point[x_]}, ___] -> x) With the resulting list you can proceed as above. > Hi all, > > I am wanting to compare Fourier Transform graphs in a Java Program. For t= hi= > s I need the coordinates, or graph points of the created Fourier Transfor= m = > graph. > > For example using the Mathematica example: > > In[]:= Fourier[{-1,-1,-1,-1,1,1,1,1}] > Out[]:= {0.[InvisibleSpace] + 0. [ImaginaryI], -0.707= 107 - 1.70= > 711 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 - 0.= 29= > 2893 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 + 0.= 29= > 2893 [ImaginaryI], 0.[InvisibleSpace] + 0. [ImaginaryI], -0.707107 + 1= .7= > 0711 [ImaginaryI]} > > In[]:= ListPlot[Abs[Fourier[{-1, -1, -1, -1, 1, 1, 1= , 1}]], > Out[]:= A zig zag graph. > > I want the coordinates of this graph. I have tried exporting it as a tabl= e = > but it is indecipherable. Idealy the graph would be in the style: > X Y > 1 10 > 2 23 > 3 24 > 4 27 > 5 31 > > Etc > > The style is not the concern though it is just getting the data which gen= er= > ates the graph. > > Yours > > David Fourie BSc Computer Science > David.fou...@ncl.ac.uk > MPhil Computational Neuroscience > D809 > ext - 8593 === Subject: Re: Sound Spectrogram over time, in 3D, using Fourier? Hi Justin, ad 1 The list returned is a one-dimensional list of coefficients. You could turn this into a two-dimensional list of (frequency, coefficient) pairs. If you have the results of the DFT in a list called, for instance, DFTres then you could attach a list of frequencies in a couple of ways such as: DFTres = Transpose[{Table[(s - 1)/T, {s, Length[DFTres]}], DFTres}] this combines the lists of frequencies (you specify T) and of DFT coefficients in a 2-row matrix, the Transpose changes this into a 2- column matrix, i.e. a list of pairs. Of course, you could also do this like this: DFTres = Table[{(s - 1)/T, DFTres[[s]]}, {s, Length[DFTres]}] or even as weird as: Partition[Riffle[Table[(s - 1)/T, {s, Length[DFTres]}], DFTres], 2] and MapIndexed[{(#2[[1]] - 1)/T, #1} &, DFTres] if you like to do things overly complex (Riffle intertwines the two lists into a single one, which then is cut into pairs by Partition). There must be hundreds of other funny, confusing, and/or mind altering ways. Note 1: T is indeed the length of your sample in seconds. Note 2: ListPlot3D needs its data in triples. The above representation is only suitable for a 2D plot of a single spectrum using ListPlot or ListLinePlot. See below how to do a 3D plot. ad 5 For the plot you have to define what you want to do as a function of time. For instance, do you cut the sample in equal pieces and do you want to show the separate DFTs of those pieces? Or do you want to define a window of a specific size and move this through your sample, and plot the DFT of this moving window through time? If you do the latter, there will be a strong dependence between the successive steps, of course. Anyway, you have to consider that the smaller the pieces you use are, the higher the lowest frequency in the result will be (because of the inverse proportionality with T, and T is now the length of your window and not that of the original sample). With a sample of 0.5 s the lowest frequency present in the DFT is 2 Hz. Cut the sample in 10 pieces and the lowest frequency in each of these pieces will be 20 Hz. As this is about the lowest audible frequency you probably should not cut your sample into smaller pieces. Well, let's try an example: (* The cello sound is the only Mathematica example sound sampled at 44.1kHz *) s = ExampleData[{Sound, Cello}]; (* Take 0.5 s worth of samples from the surrounding wrappers Sound and SampledSoundList and put it in p *) p = Take[s[[1, 1, 1]], 44100/2]; (* 1D list of amplitude values *) (* Show it in a series of 2D plots taking 10 successive windows of 22050/10 samples. Note that I don't include the DC term (the first position in the list) and stop plotting at the Nyquist frequency. For 2205 samples that's 1102 [perhaps I should have taken 1103] samples *) ListAnimate[ Table[ DFTres = Fourier[Take[p, {1 + (i - 1) 2205, i 2205}]]; DFTres = Transpose[{Table[(s - 1)/(Length[DFTres]/44100), {s, Length [DFTres]}], DFTres}]; ListLinePlot[ Take[DFTres, {2, 1102}] // Abs, PlotRange -> {0, 1}, Frame -> True, ImagePadding -> {{40, 10}, {40, 20}}, FrameLabel -> {Frequency (Hz), , ToString[i/44100.] <> s, }, PlotRange -> {0, 1}], {i, 1, 10} ] ] (* Now the windows partially overlap by chosing a smaller stepsize [200] *) ListAnimate[ Table[ DFTres = Fourier[Take[p, {i, i + 2205}]]; DFTres = Transpose[{Table[(s - 1)/(Length[DFTres]/44100), {s, Length [DFTres]}], DFTres}]; ListLinePlot[ Take[DFTres, {2, 1102}] // Abs, PlotRange -> {0, 1}, Frame -> True, ImagePadding -> {{40, 10}, {40, 20}}, FrameLabel -> {Frequency (Hz), , ToString[i/44100.] <> s, }, PlotRange -> {0, 1} ], {i, 1, 22050 - 2205, 200} ] ] (* And now a real 3D Plot. Most of the action is clumsy massaging of the data in a format ListPlot3D accepts. Note that the cello sound only contains relatively low frequencies, so I restricted plotting to 2 kHz (using PlotRange) to get the most interesting part *) ListPlot3D[ Flatten[ Transpose[ Table[ { Table[i/44100., {1101}],(*time*) Table[s/(2205/44100), {s, 1101}],(*frequency*) Take[ Fourier[Take[p, {i, i + 2205}]] // Abs, {2, 1102}] (*amplitudes*) }, {i, 1, 22050 - 2205, 1000} ], {1, 3, 2} ], 1 ], PlotRange -> {All, {0, 2000}, All}, AxesLabel -> {Time (s), Freq (Hz), A} ] As you can see, in this example I only took about 20 DFTs and the plot is still pretty smooth. So no hundreds of them are needed. Hope this helps. > Hi Sjoerd, > ay, I'm doing my best to understand! If I could trouble you for a little= explanation (sorry if this is really simple): > > 1. I see that a returned Fourier number at position s corresponds to a= frequency (s-1)/T Hz. What is the best way to get a frequency value (x)= for every number in the list fourier returned (y=intensity)? I'd like to= plot the data so that the x-axis values correspond to frequency. Dealing i= n Hertz, is T the sample duration in seconds? > > 5. What is the best way to collect a large number of DFTs and add them= to a list? I'm guessing I need hundreds of DFTs in order to get a smoot= h 3D plot. > > Again, thank you. > > Justin === Subject: Re: Non-deterministic numerical inaccuracies in Mathematica 7 > > I believe I can tell you exactly why this is happening. > > But why this happens only with Mathematica 7 but not with Mathematica > 5.2 and not with Mathematica 6? A newer compiler was used for 7 === Subject: Re: Non-deterministic numerical inaccuracies in Mathematica 7 Well, the explanation given by fiaminamor raises more questions than it solves. Consider this: The test fails only on Mathematica V 7.0, not on V. 6.0.3 tested). The test fails only if the localized p variable is present. So it is hard to believe this is exclusively Intel's fault. Mathematica 7.0 must be doing something different than in V. 6.0.3 related to the localized variables in Module. It is good that WRI is investigating this. === Subject: Re: Quit[] command shuts down frontend, too Update: It just happened to me WinXP/M7. I made a mistake in a calculation causing Mathematica to run for ages (it was probably transferring a humongous amount of data from kernel to frontend, as the CPU load itself was low) and I decided to use the Quit kernel command from the Evaluation menu. After some seconds, all of Mathematica (frontend and kernel) disappeared. > > The Quit[] command isn't supposed to shut down the front-end (thus= losing new entries since the last Save), so far as i can tell. However, if= I have had a session running for several hours, typing Quit[] and evaluati= ng it shuts down Mathematica completely, both the Kernel and Frontend. The = same command evaluated just a few minutes into a running session does what = it's supposed to (just terminate the Kernel). > Has anyone some hints about this? > > This is on Version 7.0 for Linux x86 (32-bit) (November 11, 2008= ); however, I know it happened with 6.0 for Linux, too (can't remember abo= ut the Windows versions). > > -- > Curtis Osterhoudt > cfo@remove_this.lanl.and_this.gov > PGP Key ID: 0x4DCA2A10 > Please avoid sending me Word or PowerPoint attachments > Seehttp://www.gnu.org/philosophy/no-word-attachments.html === Subject: Re: Shorthand for MapThread First: you can write any two-arguments command in infix notation using arg1~command~arg2 For example, evaluate: a~foo~b And you will obtain foo[a,b] Therefore, you can evaluate: f[#1, #2] & ~MapThread~ {{a, b, c}, {d, e, f}} And you will obtain the same result as MapThread[f[#1, #2] &,{{a, b, c}, = {d, e, f}}] Second: In order to make it really convenient, you can evaluate at the beginning of your document: mt=MapThread After the evaluation above, every time you write mt Mathematica will = replace it with MapThread, therefore you will be able to write: f[#1, #2] & ~mt~ {{a, b, c}, {d, e, f}} which might be short enough and fast enough for your purposes. On the = other hand, something like /@@ might be too complex to implement, because Mathematica separates /@ from @ even before trying the evaluation. Hope that helps. Jose Mexico -----Mensaje original----- De: Schettler, Martin [mailto:MSchettler@scitor.com] Enviado el: S=E1bado, 03 de Enero de 2009 04:55 Para: mathgroup@smc.vnet.net Asunto: Shorthand for MapThread All - I frequently use Map and MapThread, and find Map's shorthand: f /@ {a,b,c} to be very convenient. As far as I can tell, MapThread has no corresponding infix notation. Can anyone tell me if it's possible (and if so, how) to make my own? E.g. f[#1,#2]& /@@ {{a,b,c},{d,e,f}} Marty === Subject: Re: Shorthand for MapThread Marty, Look into the Notation/tutorial/NotationSymbolizeAndInfixNotation documentation section. Basically, use the Notation package << Notation` and then you can say something like: Notation[NotationTemplateTag[ RowBox[{x_, , mt, , y_}]] [DoubleLongLeftRightArrow] NotationTemplateTag[RowBox[{MapThread, [, RowBox[{x_, ,, y_}], ]}]]] and then you can use mt as the infix operator of MapThread: In[49]:= f[#1, #2] & mt {{a, b, c}, {d, e, f}} Out[49]= {f[a, d], f[b, e], f[c, f]} I didn't succeed in defining /@@ as an operator because it gets interpreted as /@ + @. Of course, you can use unused symbols other than mt. > All - > > I frequently use Map and MapThread, and find Map's shorthand: > > f /@ {a,b,c} > > to be very convenient. > > As far as I can tell, MapThread has no corresponding infix notation. > Can anyone tell me if it's possible (and if so, how) to make my own? > E.g. > > f[#1,#2]& /@@ {{a,b,c},{d,e,f}} > > Marty === Subject: Re: Shorthand for MapThread A correction: pasting as plain text didn't work. Here is the cell expression that should work IF you have included the Notation package. Cell[BoxData[ RowBox[{Notation, [, RowBox[{ TemplateBox[{RowBox[{x_, , mt, , y_}]}, NotationTemplateTag], , [DoubleLongLeftRightArrow], , TemplateBox[{RowBox[{MapThread, [, RowBox[{x_, ,, y_}], ]}]}, NotationTemplateTag]}], ]}]], Input, CellChangeTimes->{{3.4400722323306537`*^9, 3.440072271065028*^9}, { 3.4400723754244037`*^9, 3.4400723835494037`*^9}}] > Marty, > > Look into the Notation/tutorial/NotationSymbolizeAndInfixNotation > documentation section. > > Basically, use the Notation package > > << Notation` > > and then you can say something like: > > Notation[NotationTemplateTag[ > RowBox[{x_, , mt, , y_}]] [DoubleLongLeftRightArrow] > NotationTemplateTag[RowBox[{MapThread, [, > RowBox[{x_, ,, y_}], ]}]]] > > and then you can use mt as the infix operator of MapThread: > > In[49]:= f[#1, #2] & mt {{a, b, c}, {d, e, f}} > > Out[49]= {f[a, d], f[b, e], f[c, f]} > > I didn't succeed in defining /@@ as an operator because it gets > interpreted as /@ + @. Of course, you can use unused symbols other > than mt. > > > > All - > > I frequently use Map and MapThread, and find Map's shorthand: > > f /@ {a,b,c} > > to be very convenient. > > As far as I can tell, MapThread has no corresponding infix notation. > Can anyone tell me if it's possible (and if so, how) to make my own? > E.g. > > f[#1,#2]& /@@ {{a,b,c},{d,e,f}} > > Marty === Subject: Re: Shorthand for MapThread I don't believe there is one, other than f~MapThread~{{a,b,c}, {d,e,f}}, but I often use the following instead: f@@@Thread[{{a,b,c}, {d,e,f}} or f@@@Transpose[{{a,b,c},{d,e,f}}]. f@@@exp is shorthand for Apply[f,exp,{1}]. Sometimes your data is naturally already in the right format and so you can use f@@@data without the Thread or Transpose. Derek === Subject: mathematica 7.0 Linux Whenever I have to use a combinations of keys involving alt gr mathematica also generates a blank space. Some guy suggested this workaround in a forum but the problem was with a belgian keyboard layout. function mathematica { xmodmap -e 'keycode 113=Alt_R' /usr/local/bin/mathematica } It does not work for me as it is. Can anybody suggest how to adapt it to my case or tell me how to set another key instead of alt gr to produce a [,] ? === Subject: how to solve this problem? Hi: I want to define the variables x and y are real at first,then: z=x+I*y; Re[z]=x Im[z]=y Using Assumptions Assuming? But i don not know how to use it. Is there other ways to get that? I know in another system, it is easy, as in assume(x,real,y,real); So what is in Mathematica? === Subject: Re: Locators with complete graph, Kn Now how might one make such code make use of, or produce as output, the kind of Graph object as is handled by Combinatorica` ? makelines[from_, to_] := Line[{from, #}] & /@ to completeGraph[pnts_] := Module[{lst = pnts, tmp = pnts}, > (tmp = DeleteCases[tmp, #]; makelines[#, tmp]) & /@ lst] Manipulate[ > DynamicModule[{pnts, vars, lgraph}, > pnts = Table[{Cos[t], Sin[t]}, {t, 0., 2 Pi - 0.00001, 2 Pi/n}]; > vars = Table[Unique[p], {n}]; > lgraph = completeGraph[vars]; > Manipulate @@ {Graphics[lgraph, PlotRange -> 1.2], > Sequence @@ ({#, Locator} & /@ Transpose[{vars, pnts}]), > Paneled -> False} > ] > , {{n, 3}, 2, 16, 1}] ?? Jens >> Hi All, >> >> I'm trying to create a complete graph with n vertices, with each >> vertex having a locator, so that I can drag the vertices to show >> isomorphic graphs to Kn. I'm able to create locators at specific >> locations (p1, p2 etc...), but am going round in circles trying to >> improve the code so that can dynamically generate locators at p1, >> p2, ..., pn. I've tried working with DynamicModule, but the code below >> seems like the closest to a solution. >> >> Manipulate[ >> ptpairs = Tuples[Table[{Cos[t], Sin[t]}, {t, 0, 2 Pi, 2 Pi/n}], 2]; >> pts = Tuples[Table[{Cos[t], Sin[t]}, {t, 0, 2 Pi, 2 Pi/n}], 1]; >> >> Graphics[ >> Line[{p1, p2}], >> PlotRange -> 2 >> ], >> >> {{p1, pts[[1]][[1]]}, Locator}, >> {{p2, pts[[2]][[1]]}, Locator}, >> {n, 2, 10, 1}] >> >> Any ideas or thoughts would be appreciated. >> >> >> Jamie >> > -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: Locators with complete graph, Kn makelines[from_, to_] := Line[{from, #}] & /@ to completeGraph[pnts_] := Module[{lst = pnts, tmp = pnts}, (tmp = DeleteCases[tmp, #]; makelines[#, tmp]) & /@ lst] Manipulate[ DynamicModule[{pnts, vars, lgraph}, pnts = Table[{Cos[t], Sin[t]}, {t, 0., 2 Pi - 0.00001, 2 Pi/n}]; vars = Table[Unique[p], {n}]; lgraph = completeGraph[vars]; Manipulate @@ {Graphics[lgraph, PlotRange -> 1.2], Sequence @@ ({#, Locator} & /@ Transpose[{vars, pnts}]), Paneled -> False} ] , {{n, 3}, 2, 16, 1}] ?? Jens > Hi All, I'm trying to create a complete graph with n vertices, with each > vertex having a locator, so that I can drag the vertices to show > isomorphic graphs to Kn. I'm able to create locators at specific > locations (p1, p2 etc...), but am going round in circles trying to > improve the code so that can dynamically generate locators at p1, > p2, ..., pn. I've tried working with DynamicModule, but the code below > seems like the closest to a solution. Manipulate[ > ptpairs = Tuples[Table[{Cos[t], Sin[t]}, {t, 0, 2 Pi, 2 Pi/n}], 2]; > pts = Tuples[Table[{Cos[t], Sin[t]}, {t, 0, 2 Pi, 2 Pi/n}], 1]; Graphics[ > Line[{p1, p2}], > PlotRange -> 2 > ], {{p1, pts[[1]][[1]]}, Locator}, > {{p2, pts[[2]][[1]]}, Locator}, > {n, 2, 10, 1}] Any ideas or thoughts would be appreciated. > Jamie > === Subject: Please answer to my questions,thank you. Hello Mathematica community, First, wish you happy new year. I want to know how to do these points with mathematica: 1-reduce: f(f(f(...(v) i times=f(f(f(...(w) j times. I've tried nest like this: Nest[f,v,i]=C5 Nest[f,w,j] , but I have this error: Nest::intnm: Non-negative machine-size integer expected at position 3 in Nest[f,v,i] and Nest::intnm: Non-negative machine-size integer expected at position 3 in Nest[f,w,j] =C2 2-I want to use lists symbollically like this: m, mP,l,lP are lists, j,jP,i,iP are variables.By symbolically I mean without specifying the concrete elements and the concrete length of these lists i<=iP,j-Length[m]=C5 jP-Length[mP], Join[l,m]=C5 Join[lP,mP], Nest[Rest,m,i]=C5 Nest[Rest,mP,iP] 3-when I have j> Out[1]= .02 Is there available the missing CP850.m Package that I would install in Mathematica for working with such encoding? If not, I would be very pleasant for any guidance how I can create such Package by myself. === Subject: What Am I Doing Wrong? I just move my Mathematica 6.0 to a new machine and informed Wolfram about it. Just recently I found the 6.0.3.0 disk and upgraded the v6.0. I used to be able to use Copy As freely but after the upgrade, which also went through Wolfram approval, all options in Copy As are grayed out except LateX and MathML. What do I need to do? 'Kale === Subject: Azimuth in Mathematica Is there a function in Mathematica that would return the azimuth between two points with known coordinates, 0 being North? For example having A(0,0), B(1,0) - the azimuth should be 90 degrees its like ArcTan[dx/dy], but I need the quadrant taken into account as well and I need it to handle 90 and 270 degrees properly too /it doesn't need to convert the angles to degrees, rads is ok/ === Subject: Problem with Rasterize[] on Strings I am trying to use Rasterize[] on strings, and I am running into some strange behavior. This line works fine s1 = Style[A medium length string, FontSize-> 10, FontFamily -> Times]; Rasterize[s1, ImageResolution -> 100] However, as I increase either the font size, or the image resolution, the text will wrap into two or more lines: s2 = Style[A medium length string, FontSize-> 100, FontFamily -> Times]; Rasterize[s2, ImageResolution -> 300] The strange thing is that this depends on the window size! If you make the window very narrow (or have a low resolution screen) then it will start wrapping sooner that it will with. So depending on your monitor and graphics card, and what size window you use, you can find a combination that will wrap. So if I stretch a Mathematica window across my dual-monitor set up, I can take the string s2 up to ImageResolution-> 192 before it wraps. With a small window it wraps at ImageResolution-> 90. I think what is going on here is that the Mathematica front end is doing the rasterizing and it first lays out the string for the window. If it needs to wrap, then it formats the string into two lines before it rasterizes. The weird part is that the decision to format depends on the resolution even though the display does not. So, even if s2 above displays correctly, and even if the result of Rasterize[s2,ImageResolution->300] is displayed correctly (at 100 point font size) the intermediate calculation of whether there is enough space to rasterize somehow is done depending on window size. I think this is a rather serious bug, because it defeats the purpose of using ImageResolution higher than screen resolution. Note that the same occurs for RasterSize->num when num is bigger than your window, it wraps. My question is this - how can I avoid this word wrapping? There must be some way to do this! One approach I have tried is to use Graphics inside Rasterize, i.e. Rasterize[Graphics[Text[s2,{0,0},{-1,0}],ImageSize->{All, 200}] , ImageResolution -> 300] This has a couple problems: - I get lots of padding on both sides of the text. I can't seem to control it with ImagePadding-> 0, PlotRangePadding-> 0 - Yet if I don't make ImageSize very large, I have my string cut off. Perhaps I am not making the right incantations to Graphics[] to get this to work properly. Here is an additional question. I am using Rasterize because I need to send documents to computers that don't have the same fonts I have. Normally I would use a PDF file. However Mathematica does not seem to support the font embedding feature of PDF files. If there was a way to enable font embedding do that I wouldn't need to Rasterize the text. Nathan This message and any attachments, may contain confidential and/or legally privileged information. If you are not the intended recipient of the message by the original sender, please destroy it. Message and attachments copyright (c) 2008, all rights reserved. Any unauthorized dissemination, distribution or copying is strictly forbidden === Subject: how to wait for command completion? Hello MathGroup: I am automating the execution of a notebook. I use the following commands (in a single cell). t0 = NotebookOpen[<>]; SetSelectedNotebook[t0]; FrontEndExecute@FrontEndToken[SelectAll]; FrontEndExecute@FrontEndToken[EvaluateCells]; NotebookSave[t0,<>]; NotebookClose[t0]; These commands work correctly but the NotebookSave[] command executes before the completion of the EvaluateCells invocation. If I re- invoke the NotebookSave[], after the evaluation completes, it all works fine. Is there a way to make the NotebookSave[] wait for completion of EvaluateCells? TIA. Roger Williams Franklin Laboratory === Subject: Re: a LOT of Mathematica bugs (some very old) In your first example just increase the working precision Plot[2^-s LerchPhi[-1, s, 1/2], {s, -6.75, -7}, WorkingPrecision -> 20] Bob Hanlon > control error > Plot[2^-s LerchPhi[-1, s, 1/2], {s, -6.75, -7}] > > > Same expression not FullSimplify (ing) - not bug? > {E^(-(((1 + E) (E + E^(-(1 + E) [Pi])))/E)), > E^((-1 - E) (1 + E^(-1 - (1 + E) [Pi])))} // FullSimplify > > ********************************************** > Terrible Performance > > x = IE; > Timing[Do[x = x /. IE -> E^(IE/E), {12}]; x] > > {4.687, E^E^(-1 + > E^(-1 + E^(-1 + > E^(-1 + E^(-1 + > E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + IE/E)))))))))))} > > mathematica 2.2 do it in a flash : > > x=IE; > Timing[Do[x=x/.IE->E^(IE/E),{12}];x] > > {0. Second, Power[E, Power[E, > > -1 + Power[E, -1 + Power[E, > > -1 + Power[E, -1 + Power[E, > > -1 + IE/E > -1 + E > -1 + E > -1 + E > -1 + E > -1 + E > -1 + E ]]]]]]} > > try this to hang the system > > x = IE; > Timing[Do[x = x /. IE -> E^(IE/E), {15}]; x] > > > > SparseArray > > ss = SparseArray[{i_, j_, 1} -> 1, {4, 4, 4}] > ss // MatrixForm > Map[Sin, ss] // MatrixForm (*Fails*) > ss // FullForm > Map[Sin, ss] // FullForm > > > > ******* > Mathematica eats a lot system memory when this sparseArray > is (eg 300 x 300 x300) - Is it needed/by design ? > > gg = SparseArray[{i_, j_, 1} -> 1, {300, 300, 300}]; > ********* > generated output does not mach the display > > ReplaceAll[ > Plus[Times[-1, Power[E, Times[1, Power[x, -1]]]], > Power[E, Plus[Times[1, Power[x, -1]], Power[x, Times[-1, x]]]]], > Rule[x, DirectedInfinity[-1]]] > > ******************* > Sum[(-x k)^k, {k, 0, Infinity}] > ******************* > Function tends to Log[2] > f[k2_] = N[-1 Sum[(1/k) (-1)^k, {k, 1, k2}]] // FullSimplify > > But this series diverges > NSum[ (-1)^k (f[k]/k), {k, 1, Infinity}] > > ********************** > version 6 (ok) - 7 results differs > > InverseLaplaceTransform[E^((1 - Sqrt[1 + 4*s])/2), s, t] > **************** === Subject: Re: How to solve an equation with Gamma function in it? > I've been trying to solve this equations set below with Gamma function > in it. > However, instead of the solutions, I got The expression ((545-o)/(a- > o))^b involves unknowns in more than one argument, so inverse > functions cannot be used. > Is there a way that Mathematica can get it solved? Could anyone by > kindly enough to give me some advice? f[o_, a_, b_] := o + (a - o)*Gamma[1 + 1/b] > g[o_, a_, b_] := e^(-(((545 - o)/(a - o))^b)) > h[o_, a_, b_] := (a - o)^2 * (Gamma[1 + 2/b] - (Gamma[1 + 1/b])^2) > Solve[{f[o, a, b] == 557, g[o, a, b] == 0.5, h[o, a, b] == 131.9^2}, > {o, a, b}] Though the following remarks might not solve completely your problem, they may direct you towards a better approach. 1. If lowercase 'e' is for you the symbol for the exponential function, for Mathematica it is not. Use uppercase 'E' or Exp[] instead. Keep in mind that every Mathematica built-in functions and symbols are capitalized. 2. Solve and related *symbolic* solvers work better when fed with exact arguments only. Therefore, you should either write 1/2 in place of 0.5 or use Rationalize[] (see below for an example). 3. Solve handles mainly polynomial(s). 4. When inverse functions are involved, Reduce[] usually does a better job than Solve[]. In addition, one can add conditions on the arguments as well as domain specification. 5. If you have any additional knowledge about the variables o, a, and b, say b is an integer, it might be useful to pass the assumption to Reduce[]. 6. Finally, you may want to try some of the *numeric* solvers such as FindRoot[]. f[o_, a_, b_] := o + (a - o)*Gamma[1 + 1/b] g[o_, a_, b_] := E^(-(((545 - o)/(a - o))^b)) h[o_, a_, b_] := (a - o)^2*(Gamma[1 + 2/b] - (Gamma[1 + 1/b])^2) Reduce[Rationalize[{f[o, a, b] == 557, g[o, a, b] == 1/2, h[o, a, b] == 131.9^2}], {o, a, b}] FindRoot[{f[o, a, b] == 557, g[o, a, b] == 1/2, h[o, a, b] == 131.9^2}, {{o, 0.5}, {a, 3.4}, {b, 2}}] Hope this helps, --Jean-Marc === Subject: MeijerG Can I trust the following result? In[29]:= Limit[-Log[x^2] - Sqrt[Pi]*MeijerG[{{0}, {}}, {{0, 0}, {1/2}}, x^2/(4*c)], x -> 0] (*c>0*) Out[29]= 2*EulerGamma + Log[1/c] Another well known CAS gave >limit(-ln(x^2)-sqrt(Pi)*MeijerG([[0], []],[[0, 0], [1/2]],1/4*x^2/c),x = 0); > infinity Dimitris === Subject: Re: Viewpoint selector for Mac in 6.0? > Hello friends, > > It appears that the viewpoint selector for 3D graphics is absent in 6.0 > (Mac version). Is there an alternate way to manually choose a view > (other than trying different viewpoints repeatedly)? Suggestions > appreciated. > > Ravi > University of Washington This 3D ViewPoint Selector closely resembles the one that was part of the Mathematica Front End in versions 3,4 and 5. The ViewVertical is held fixed at the default setting and the ViewPoint can be changed using the mouse, Cartesian coordinate sliders, Spherical parameter sliders (theta tilt angle, phi rotation angle about the z-axis, and the r distance), and by typing in the various settings (click the + at the end of the sliders). All the controls including the mouse input are linked so that any change in one setting updates all the rest. The axes are labeled in color for easy reference. Note that the symbol Global`g is used. Change the graphic to whatever you wish. To free up ViewVertical, change vv from None to InputField, change to Method -> {RotationControl -> ArcBall} and change to ViewVertical -> Dynamic[vv]. Then the rotate rotate control (dot with a counter-clockwize arrow) will appear in the corners of the graphic and a ViewVertical field will appear and change as the mouse moves the graphics. No sliders are linked to the ViewVertical setting. Q.E.D. Manipulate[ Show[g, TicksStyle -> {Red, Green, Blue}, Ticks -> None, Axes -> True, AxesStyle -> Thread[List[{Red, Green, Blue}, Thick]], BaseStyle -> {FontWeight -> Bold, FontFamily -> sans-serif, 28}, LabelStyle -> 14, AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}}, AxesLabel -> {X, Y, Z}, SphericalRegion -> True, Method -> {RotationControl -> Globe}, ViewPoint -> Dynamic[vp, Function[{v, e}, [Theta] = Mod[ArcTan[v[[3]], Norm[v[[1 ;; 2]]]] 180/[Pi], 180]; [Phi] = Mod[ArcTan[v[[1]], v[[2]]] 180/[Pi], 360]; r = Norm[v]; {x, y, z} = e = v, HoldRest]], ViewVertical -> Dynamic[vv, Function[{v, e}, e = {0., 0., 1.}(*v*), HoldRest]]], {{x, 1.3, x}, -4, 4, Manipulator[ Dynamic[x, ([Theta] = Mod[ArcTan[z, Norm[{#, y}]] 180/[Pi], 180]; [Phi] = Mod[ArcTan[#, y] 180/[Pi], 360]; r = Norm[{#, y, z}]; vp = {#, y, z}; x = #) &], #2, Appearance -> Labeled] &}, {{y, -2.4, y}, -4, 4, Manipulator[ Dynamic[y, ([Theta] = Mod[ArcTan[z, Norm[{x, #}]] 180/[Pi], 180]; [Phi] = Mod[ArcTan[x, #] 180/[Pi], 360]; r = Norm[{x, #, z}]; vp = {x, #, z}; y = #) &], #2, Appearance -> Labeled] &}, {{z, 2.0, z}, -4, 4, Manipulator[ Dynamic[z, ([Theta] = Mod[ArcTan[#, Norm[{x, y}]] 180/[Pi], 180]; r = Norm[{x, y, #}]; vp = {x, y, #}; z = #) &], #2, Appearance -> Labeled] &}, {{[Theta], Mod[ArcTan[2., Norm[{1.3, -2.4}]] 180/[Pi], 180], [Theta]}, 0, 180, Manipulator[ Dynamic[[Theta], ({x, y, z} = vp = r {Sequence @@ ({Cos[[Phi] [Pi]/180], Sin[[Phi] [Pi]/180]} Sin[# [Pi]/180]), Cos[# [Pi]/180]}; [Theta] = #) &], #2, Appearance -> Labeled] &}, {{[Phi], Mod[ArcTan[1.3, -2.4] 180/[Pi], 360], [Phi]}, 0, 360, Manipulator[ Dynamic[[Phi], ({x, y} = vp[[1 ;; 2]] = r { Cos[# [Pi]/180], Sin[# [Pi]/180]} Sin[[Theta] [Pi]/180]; [Phi] = #) &], #2, Appearance -> Labeled] &}, {{r, Norm[{1.3, -2.4, 2.0}], r}, 0, 9, Manipulator[ Dynamic[ r, ({x, y, z} = vp = # {Sequence @@ ({Cos[[Phi] [Pi]/180], Sin[[Phi] [Pi]/180]} Sin[[Theta] [Pi]/180]), Cos[[Theta] [Pi]/180]}; r = #) &], #2, Appearance -> Labeled] &}, {{vp, {1.3, -2.4, 2.0}, ViewPoint}, InputField[ Dynamic[vp, ([Theta] = Mod[ArcTan[#[[3]], Norm[#[[1 ;; 2]]]] 180/[Pi], 180]; [Phi] = Mod[ArcTan[#[[1]], #[[2]]] 180/[Pi], 360]; r = Norm[#]; {x, y, z} = vp = #) &]] &}, {{vv, {0., 0., 1.}, ViewVertical}, None}, Initialization :> (g = Plot3D[Cos[x + Cos[y]], {x, -Pi, Pi}, {y, -Pi, Pi}])] (*END*) === Subject: Re: Series question: limiting total derivative order > Is it possible to directly tell Series to truncate a > multivariate Taylor series beyond a total derivative order? > Example, for f(x,y) and total derivative order 2, I want > > f(0,0) + x*Derivative[1,0][f][0,0] + y*Derivative[0,1][f][0= ,0] + > x^2*Derivative[2,0][f][0,0]/2 + x*y*Derivative[1,1][f][0,0]= + > y^2*Derivative[0,2][f][0,0]/2 > > whereas > > Normal[Series[f[x,y],{x,0,2},{y,0,2}]] > > returns also derivative terms (2,1), (1,2) and (2,2) of total > orders 3, 3 and 4. These I have to get rid of a posteriori with > some complicated logic to build a replacement list. This might do what you want: TaylorSeries[expr_, args : {_, _} .., order_] := Module[{f, x, x0, args1, ser}, {x, x0} = Transpose[{args}]; args1 = Append[#, order] & /@ {args}; ser = Normal[Series[f @@ x, Sequence @@ args1]]; ser /. Derivative[m__][f][Sequence @@ x0] /; Total[{m}] > order -> 0 /. f -> Function @@ {x, expr} ] For example, TaylorSeries[Sin[x]Cos[y], {x, 0}, {y, 0}, 10] --Mark === Subject: Re: Problems combining new v7.0 Image command with other graphics Easy: LocatorPane[{50, 50}, ImageCompose[Image[img], Graphics@Circle[]] > 3. You can combine bitmapped Images with vector based Graphics using > ImageCompose: > > ImageCompose[Image[img], Graphics@Circle[]] > > That destroy the vector information and work with the > full image. Try to move a Locator[] object on the image > in that way, and not with > Graphics[{Image`ToGraphicsRaster[img][[1]],Locator[p]}] > === Subject: Re: CP850 or CP858 character encoding in Mathematica > I think that the 850 code is in the IBM-850.m file. The Euro > character that is the only difference in the 858 encoding (compared to > the 850 font) is in the ISO8859-15 or ISO8859-16 encodings (and others > too I would guess). A handy thing to look at a range of the characters > in a particular file is > > > but each of these encoding files have varying number of characters. On > my Mac version of Mathematica 7.0 these files are located in the / > Applications/Mathematica/SystemFiles/CharacterEncodings folder, but on > Windows, not sure where they are. You can get a list of all the > installed encodings by looking at the variable > > $CharacterEncodings > > -Bob I meant exactly fully-printable Extended ASCII representation. This means that characters with numbers 0-31 are represented by visible symbols as it happened in Norton Commander's View function under DOS operating system (see the bottom of the page http://en.wikipedia.org/wiki/C= ode_page_850 for the following): The C0 control range (0x00-0x1F hex) is mapped to graphics characters. The codes can assume their original function as controls <...> but in display, for example in a screen editor like MS- DOS edit, they show as graphics. The graphics are various, such as smiling faces, card suits and musical notes. Code 0x7F, DEL, similarly shows as a graphic (a house). I have tried to implement by myself the function that generates such encoding (with additional requirement that all symbols are to be different). This is what I have accomplished (sorry about the length, just copy the following and paste in a notebook and press Yes): Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{table, , =, , RowBox[{{, RowBox[{ RowBox[{{, RowBox[{ <[DottedSquare]>, ,, , <[HappySmiley]>, ,, , <:263b>, ,, , <:2665>, ,, , <:2666>, ,, , <[ClubSuit]>, ,, , <[SpadeSuit]>, ,, , <[Bullet]>, ,, , <:25d8>, ,, , <[EmptyCircle]>, ,, , <:25d9>, ,, , <[Mars]>, ,, , <[Venus]>, ,, , <[EighthNote]>, ,, , <[BeamedEighthNote]>, ,, , <:263c>}], }}], ,, , n, , RowBox[{{, RowBox[{ <:25ba>, ,, , <:25c4>, ,, , <[UpDownArrow]>, ,, , <:203c>, ,, , <[Paragraph]>, ,, , <[Section]>, ,, , <:25ac>, ,, , <:21a8>, ,, , <[UpArrow]>, ,, , <[DownArrow]>, ,, , <[RightArrow]>, ,, , <[LeftArrow]>, ,, , <[RightAngle]>, ,, , <[LeftRightArrow]>, ,, , <[FilledUpTriangle]>, ,, , <[FilledDownTriangle]>}], }}], ,, , n, , RowBox[{{, RowBox[{ <[SpaceIndicator]>, ,, , , ,, , <>, ,, , <#>, ,, , <$>, ,, , <%>, ,, , <&>, ,, , <'>, ,, , <(>, ,, , <)>, ,, , <*>, ,, , <+>, ,, , <,>, ,, , <->, ,, , <.>, ,, , }], }}], ,, , RowBox[{{, RowBox[{ <0>, ,, , <1>, ,, , <2>, ,, , <3>, ,, , <4>, ,, , <5>, ,, , <6>, ,, , <7>, ,, , <8>, ,, , <9>, ,, , <:>, ,, , <;>, ,, , <<>, ,, , <=>, ,, , <>>, ,, , n, , }], }}], ,, , RowBox[{{, RowBox[{ <@>, ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , }], }}], ,, , RowBox[{{, RowBox[{

, ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , <{>, ,, , <|>, ,, , n, , <}>, ,, , <~>, ,, , <:2302>}], }}], ,, , RowBox[{{, RowBox[{ <[CapitalCCedilla]>, ,, , <[UDoubleDot]>, ,, , <[EAcute]>, ,, , <[AHat]>, ,, , <[ADoubleDot]>, ,, , <[AGrave]>, ,, , <[ARing]>, ,, , <[CCedilla]>, ,, , <[EHat]>, ,, , <[EDoubleDot]>, ,, , <[EGrave]>, ,, , <[IDoubleDot]>, ,, , <[IHat]>, ,, , <[IGrave]>, ,, , <[CapitalADoubleDot]>, ,, , <[CapitalARing]>}], }}], ,, , RowBox[{{, RowBox[{ <[CapitalEAcute]>, ,, , <[AE]>, ,, , <[CapitalAE]>, ,, , <[OHat]>, ,, , <[ODoubleDot]>, ,, , <[OGrave]>, ,, , <[UHat]>, ,, , <[UGrave]>, ,, , <[YDoubleDot]>, ,, , <[CapitalODoubleDot]>, ,, , <[CapitalUDoubleDot]>, ,, , n, , <[OSlash]>, ,, , <[Sterling]>, ,, , <[CapitalOSlash]>, ,, , <[Times]>, ,, , <[Florin]>}], }}], ,, , RowBox[{{, RowBox[{ <[AAcute]>, ,, , <[IAcute]>, ,, , <[OAcute]>, ,, , <[UAcute]>, ,, , <[NTilde]>, ,, , <[CapitalNTilde]>, ,, , <.aa>, ,, , <.ba>, ,, , <[DownQuestion]>, ,, , <[RegisteredTrademark]>, ,, , <[Not]>, ,, , <.bd>, ,, , <.bc>, ,, , <[DownExclamation]>, ,, , <[LeftGuillemet]>, ,, , <[RightGuillemet]>}], }}], ,, , n, , RowBox[{{, RowBox[{ <:2591>, ,, , <:2592>, ,, , <:2593>, ,, , <:2503>, ,, , <:2524>, ,, , <[CapitalAAcute]>, ,, , <[CapitalAHat]>, ,, , <[CapitalAGrave]>, ,, , <[Copyright]>, ,, , <:2563>, ,, , <:2551>, ,, , <:2557>, ,, , <:255d>, ,, , <[Cent]>, ,, , <[Yen]>, ,, , <:2510>}], }}], ,, , RowBox[{{, RowBox[{ <:2514>, ,, , <:2534>, ,, , <:252c>, ,, , <:251c>, ,, , <:2015>, ,, , <:253c>, ,, , <[ATilde]>, ,, , <[CapitalATilde]>, ,, , <:255a>, ,, , n, , <:2554>, ,, , <:2569>, ,, , <:2566>, ,, , <:2560>, ,, , <:2550>, ,, , <:256c>, ,, , <[Currency]>}], }}], ,, , RowBox[{{, RowBox[{ <[Eth]>, ,, , <[CapitalEth]>, ,, , <[CapitalEHat]>, ,, , <[CapitalEDoubleDot]>, ,, , <[CapitalEGrave]>, ,, , <[DotlessI]>, ,, , <[CapitalIAcute]>, ,, , <[CapitalIHat]>, ,, , <[CapitalIDoubleDot]>, ,, , <:2518>, ,, , <:250c>, ,, , <:2588>, ,, , <:2584>, ,, , <.a6>, ,, , <[CapitalIGrave]>, ,, , <:2580>}], }}], ,, , n, , RowBox[{{, RowBox[{ <[CapitalOAcute]>, ,, , <[SZ]>, ,, , <[CapitalOHat]>, ,, , <[CapitalOGrave]>, ,, , <[OTilde]>, ,, , <[CapitalOTilde]>, ,, , <[Micro]>, ,, , <[Thorn]>, ,, , <[CapitalThorn]>, ,, , <[CapitalUAcute]>, ,, , <[CapitalUHat]>, ,, , <[CapitalUGrave]>, ,, , <[YAcute]>, ,, , <[CapitalYAcute]>, ,, , <.af>, ,, , <.b4>}], }}], ,, , RowBox[{{, RowBox[{ <[Hyphen]>, ,, , <[PlusMinus]>, ,, , <:2017>, ,, , <.be>, ,, , <[Flat]>, ,, , <[CircleTimes]>, ,, , <[Divide]>, ,, , <.b8>, ,, , <[Degree]>, ,, , <.a8>, ,, , <[CenterDot]>, ,, , <.b9>, ,, , <.b3>, ,, , <.b2>, ,, , n, , <[FilledSquare]>, ,, , <[LetterSpace]>}], }}]}], }}]}], ;}], }], n, RowBox[{Style, [, RowBox[{TableForm, [, RowBox[{ RowBox[{MapIndexed, [, RowBox[{ RowBox[{ RowBox[{Tooltip, [, RowBox[{ RowBox[{Style, [, RowBox[{#1, ,, , RowBox[{FontSize, , ->, , 24}], ,, , RowBox[{ FontFamily, , ->, , }], ,, , n, , RowBox[{PrivateFontOptions, , ->, , RowBox[{{, RowBox[{ RowBox[{ , , ->, , False}], ,, , RowBox[{ , , ->, , False}]}], }}]}]}], ]}], ,, , n, , RowBox[{Magnify, [, RowBox[{ RowBox[{Column, [, RowBox[{ RowBox[{{, RowBox[{ RowBox[{Style, [, RowBox[{#1, ,, , RowBox[{FontSize, , ->, , 60}], ,, , RowBox[{ FontFamily, , ->, , }]}], ]}], ,, , RowBox[{StringDrop, [, RowBox[{ RowBox[{StringDrop, [, RowBox[{ RowBox[{ToString, [, RowBox[{FullForm, [, #1, ]}], ]}], ,, , RowBox[{-, 1}]}], ]}], ,, , 1}], ]}], ,, , n, , RowBox[{ RowBox[{(, RowBox[{ RowBox[{Row, [, RowBox[{{, RowBox[{#1, ,, , <=>, ,, , RowBox[{BaseForm, [, RowBox[{#1, ,, , 16}], ]}]}], }}], ]}], , &}], , )}], [, RowBox[{ RowBox[{16, *, RowBox[{ RowBox[{(, RowBox[{#2, , -, , 1}], )}], [, RowBox[{[, 1, ]}], ]}]}], , +, , RowBox[{ RowBox[{(, RowBox[{#2, , -, , 1}], )}], [, RowBox[{[, 2, ]}], ]}]}], ]}], ,, , RowBox[{ToCharacterCode, [, #1, ]}]}], }}], ,, , RowBox[{BaseStyle, , ->, , RowBox[{{, RowBox[{ FontFamily, , ->, , }], }}]}]}], ]}], ,, , 4}], ]}]}], ]}], , &}], , ,, , table, ,, , RowBox[{{, 2, }}]}], ]}], ,, , n, , RowBox[{TableSpacing, , ->, , RowBox[{{, RowBox[{0.5, ,, , 0}], }}]}], ,, , RowBox[{TableAlignments, , ->, , Center}], ,, , RowBox[{TableHeadings, , ->, , RowBox[{{, RowBox[{ RowBox[{ RowBox[{(, RowBox[{ RowBox[{Row, [, RowBox[{{, RowBox[{ RowBox[{BaseForm, [, RowBox[{#1, ,, , 16}], ]}], ,, , [Hyphen]}], }}], ]}], , &}], , )}], , /@, , RowBox[{Range, [, RowBox[{0, ,, , 15}], ]}]}], ,, , n, , RowBox[{ RowBox[{(, RowBox[{ RowBox[{Row, [, RowBox[{{, RowBox[{[Hyphen], ,, , RowBox[{BaseForm, [, RowBox[{#1, ,, , 16}], ]}]}], }}], ]}], , &}], , )}], , /@, , RowBox[{Range, [, RowBox[{0, ,, , 15}], ]}]}]}], }}]}]}], ]}], ]}]}], Input, CellChangeTimes->{{3.4403315018917503`*^9, 3.4403315432355003`*^9}}, FormatType->InputForm] === Subject: Transformation matrix Hello! I use Show[] and Graphics3D[] to display graphics. I quite remember that there is an option or smth like to specify there a transformation matrix (homogeneous coordinates), but I don't remember how. Anyone can help? P.S. Mathematica 5.2 === Subject: Re: GroebnerBasis never finishes Just a small addition to the good answers already written: If you use MonomialOrder -> DegreeReverseLexicographic you often get more compact bases. === Subject: Re: Front end tokens and window maximization Best, Jason > Hi Jason, > > At the bottom ofhttp://reference.wolfram.com/mathematica/ref/FrontEndToke= nExecute.html > you'll find plenty of references to tokens. I haven't checked whether > these are the same as you were referring to. I couldn't find a > maximize token, though. > > The following approaches its functionality fairly well. > > SetOptions[EvaluationNotebook[], WindowMargins -> {{0, 0}, {0, 0}}, > WindowSize -> Automatic] > > > > > I was wondering if there is anywhere to get a list of all of the front > end tokens? I know you can see the key mappings and menu mappings in > the MenuSetup.tr and KeyEventTranslations.tr files, but there are many > front end tokens not listed in these files. > > Also, does anyone know the front end token for window maximization? > > FrontEndTokenExecute[nb, WindowMiniaturize] > > Does anyone know a similar one for maximization? Of course, having a > list of all tokens would make life much easier! > > > Jason === Subject: Re: Animation = Translation + Vibration, But How? > Hi Gidi, > > here is a very simple aproach: > > lever[x_, y_, phi_?NumericQ] := Module[{length = 1}, > > p1 = {x, y, 0}; > > p2 = p1 + length { Cos[phi], 0, Sin[phi]}; > > Line[{p1, p2}] > > ]; > > Do[ > > x = 0.01 t; > > y = 0.01 t; > > phi = 0.2 Sin[0.2 t]; > > Show[Graphics3D[{Thickness[0.1], lever[x, y, phi]}], > > PlotRange -> {{0, 2}, {0, 2}, {-1, 1}}] // Print; > > , {t, 0, 100}] > > hope that this get you started, Daniel > > > > > I created a cantilever in Mathematica (nothing fancy, a Graphics 3D > object created with Polygon). > The only thing that I want now is to simulate its movement. I thought > it would be easy, but it's proving to be diabolically difficult. > Boundary conditions: the cantilever should be fixed in one end, and > allowed to oscillate in the other (the oscillations are predetermined > by some simple trigonometric function). > This system should be allowed to translate in space (a moving beam, so > to speak). > So it should be allowed to move in the X-Y plane and oscillate along > the Z- axis. > > Moving it in the X-Y plane is accomplished with the Translate > function. But how can I make it oscillate in a specific manner? How > can I combine in one animation both movements? > > Any help would be greatly apprerciated, > > Gideon- Hide quoted text - > > - Show quoted text - Daniel, Your suggestion spurred another question: would you happen to know how I could combine the different frames into a single frame, which could then be made into a QuickTime movie? Gideon === Subject: Re: Series question: limiting total derivative order Normal[Series[f[x, y], {x, 0, 2}, {y, 0, 2}]] /. Derivative[m_, n_][f][__] /; m + n > 2 :> 0 (1/2)*x^2*Derivative[2, 0][f][0, 0] + y*(x*Derivative[1, 1][f][ 0, 0] + Derivative[0, 1][f][ 0, 0]) + x*Derivative[1, 0][f][ 0, 0] + (1/2)*y^2* Derivative[0, 2][f][0, 0] + f[0, 0] Bob Hanlon Is it possible to directly tell Series to truncate a multivariate Taylor series beyond a total derivative order? Example, for f(x,y) and total derivative order 2, I want f(0,0) + x*Derivative[1,0][f][0,0] + y*Derivative[0,1][f][0,0] + x^2*Derivative[2,0][f][0,0]/2 + x*y*Derivative[1,1][f][0,0] + y^2*Derivative[0,2][f][0,0]/2 whereas Normal[Series[f[x,y],{x,0,2},{y,0,2}]] returns also derivative terms (2,1), (1,2) and (2,2) of total orders 3, 3 and 4. These I have to get rid of a posteriori with some complicated logic to build a replacement list. === Subject: File Corrupted I have a long notebook, which I intended to use in my class starting next week. Today the machine hung up, and I got the following message: There was a syntax error on line 14997 in the file temp1.nb nherited, {10,5} The highlighted error is a number in CellChangeTimes. Is it possible to discard the error by discarding the file from the highlighted error to the end of the file? John === Subject: Re: inverting Laplace transforms > > I need to invert a few expressions representing Laplace transforms. I hav= e heard that MATHEMATICA can be used > for this purpose. Can anybody tell me how to do this? > > For example, I need to find a function f(t) for which the > Laplace transform F(s) is > > F(s) = Sqrt[s + a]/(Sqrt[s] * (s - b)) > > where a > 0 and b > 0 are constants. > > Leslaw Usually, when you want a built-in function, that you don't know it's actual name, most of the cases will have a resemblance with the requested task (for example Integrate, NIntegrate, TrigExpand etc). There are a few exceptions like D for derivative Det for determinant etc. In[23]:= InverseLaplaceTransform[Sqrt[s + a]/(Sqrt[s]*(s - b)), s, t] Out[23]= Integrate[-((E^((-a)*s + b*(-s + t))*Erf[Sqrt[b]*Sqrt[-s + t]])/(2*Sqrt [b]*Sqrt[Pi]*s^(3/2))), {s, 0, t}, Assumptions -> True, GenerateConditions -> False] No big deal! For b=0 In[24]:= InverseLaplaceTransform[Sqrt[s + a]/(Sqrt[s]*s), s, t] Out[24]= ((1 + a*t)*BesselI[0, (a*t)/2] + a*t*BesselI[1, (a*t)/2])/E^((a*t)/2) Much better! For other combination of a and b I failed to obtain a closed form solution. I think you should consult to some of the well known treatises for tables of integrals transforms. Dimitris === Subject: Re: inverting Laplace transforms Yes, the InverseLaplaceTransform command is available, but when I tried InverseLaplaceTransform[Sqrt[s + a]/(Sqrt[s] (s - b)), s, t] in Mathematica 7.0, after a couple of minutes it just returns the expression unevaluated. Note that, unlike the case with LaplaceTransform, InverseLaplaceTransform does not seem to allow an Assumptions option. I'll assume you don't have a copy of Mathematica with you, otherwise I > fail to understand why you haven't looked this up yourself in the > excellent electronic documentation. Actually, there isn't an excuse at all because it's online as well: > http://reference.wolfram.com/mathematica/guide/Mathematica.html Found in 2 seconds: > http://reference.wolfram.com/mathematica/ref/InverseLaplaceTransform.html > >> >> I need to invert a few expressions representing Laplace transforms. I hav= > e heard that MATHEMATICA can be used >> for this purpose. Can anybody tell me how to do this? >> >> For example, I need to find a function f(t) for which the >> Laplace transform F(s) is >> >> F(s) = Sqrt[s + a]/(Sqrt[s] * (s - b)) >> >> where a > 0 and b > 0 are constants. >> >> Leslaw -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Components of InterpolatingFunction How does one see (print, display) the piecewise polynomials that are inside an InterpolatingFunction object? I.e. both the domains and the polynomials themselves that InterpolatingFunction is broken into. === Subject: Re: Mathematica 7 much slower than Mathematica 6 on Limit I was originally looking for the limit as d->Infinity but it refuses to do it. I can't get it to deal with d > 4E7. === Subject: Re: Mathematica 7 much slower than Mathematica 6 on Limit I was originally looking for the limit as d->Infinity but it refuses to do it. I can't get it to deal with d > 4E7. === Subject: Re: Animation = Translation + Vibration, But How? Hi Gidi, e.g. look up Animate or: http://www.math.northwestern.edu/~wphooper/code/latex/mathematica_movie/ Daniel >> Hi Gidi, >> >> here is a very simple aproach: >> >> lever[x_, y_, phi_?NumericQ] := Module[{length = 1}, >> >> p1 = {x, y, 0}; >> >> p2 = p1 + length { Cos[phi], 0, Sin[phi]}; >> >> Line[{p1, p2}] >> >> ]; >> >> Do[ >> >> x = 0.01 t; >> >> y = 0.01 t; >> >> phi = 0.2 Sin[0.2 t]; >> >> Show[Graphics3D[{Thickness[0.1], lever[x, y, phi]}], >> >> PlotRange -> {{0, 2}, {0, 2}, {-1, 1}}] // Print; >> >> , {t, 0, 100}] >> >> hope that this get you started, Daniel >> >> >> >>> I created a cantilever in Mathematica (nothing fancy, a Graphics 3D >>> object created with Polygon). >>> The only thing that I want now is to simulate its movement. I thought >>> it would be easy, but it's proving to be diabolically difficult. >>> Boundary conditions: the cantilever should be fixed in one end, and >>> allowed to oscillate in the other (the oscillations are predetermined >>> by some simple trigonometric function). >>> This system should be allowed to translate in space (a moving beam, so >>> to speak). >>> So it should be allowed to move in the X-Y plane and oscillate along >>> the Z- axis. >>> Moving it in the X-Y plane is accomplished with the Translate >>> function. But how can I make it oscillate in a specific manner? How >>> can I combine in one animation both movements? >>> Any help would be greatly apprerciated, >>> Gideon- Hide quoted text - >> - Show quoted text - Daniel, Your suggestion spurred another question: would you happen to know how > I could combine the different frames into a single frame, which could > then be made into a QuickTime movie? Gideon > === Subject: Re: Animation = Translation + Vibration, But How? > > > > Hi Gidi, > > here is a very simple aproach: > > lever[x_, y_, phi_?NumericQ] := Module[{length = 1}, > > p1 = {x, y, 0}; > > p2 = p1 + length { Cos[phi], 0, Sin[phi]}; > > Line[{p1, p2}] > > ]; > > Do[ > > x = 0.01 t; > > y = 0.01 t; > > phi = 0.2 Sin[0.2 t]; > > Show[Graphics3D[{Thickness[0.1], lever[x, y, phi]}], > > PlotRange -> {{0, 2}, {0, 2}, {-1, 1}}] // Print; > > , {t, 0, 100}] > > hope that this get you started, Daniel > > > I created a cantilever in Mathematica (nothing fancy, a Graphics 3D > object created with Polygon). > The only thing that I want now is to simulate its movement. I thought > it would be easy, but it's proving to be diabolically difficult. > Boundary conditions: the cantilever should be fixed in one end, and > allowed to oscillate in the other (the oscillations are predetermined > by some simple trigonometric function). > This system should be allowed to translate in space (a moving beam, s= o > to speak). > So it should be allowed to move in the X-Y plane and oscillate along > the Z- axis. > > Moving it in the X-Y plane is accomplished with the Translate > function. But how can I make it oscillate in a specific manner? How > can I combine in one animation both movements? > > Any help would be greatly apprerciated, > > Gideon- Hide quoted text - > > - Show quoted text - > > Daniel, > > Your suggestion spurred another question: would you happen to know how > I could combine the different frames into a single frame, which could > then be made into a QuickTime movie? > > Gideon Do[Show[Graphics3D[{Thickness[0.1], lever[x, y, phi]}], PlotRange -> {{ 0, 2}, {0, 2}, {-1, 1}}], {t, 0, 100}] SelectionMove[EvaluationNotebook[], All, GeneratedCell]; FrontEndTokenExecute[CellGroup] FrontEndTokenExecute[OpenCloseGroup] Dimitris === Subject: Re: Animation = Translation + Vibration, But How? > > > > Hi Gidi, > > here is a very simple aproach: > > lever[x_, y_, phi_?NumericQ] := Module[{length = 1}, > > p1 = {x, y, 0}; > > p2 = p1 + length { Cos[phi], 0, Sin[phi]}; > > Line[{p1, p2}] > > ]; > > Do[ > > x = 0.01 t; > > y = 0.01 t; > > phi = 0.2 Sin[0.2 t]; > > Show[Graphics3D[{Thickness[0.1], lever[x, y, phi]}], > > PlotRange -> {{0, 2}, {0, 2}, {-1, 1}}] // Print; > > , {t, 0, 100}] > > hope that this get you started, Daniel > > > I created a cantilever in Mathematica (nothing fancy, a Graphics 3D > object created with Polygon). > The only thing that I want now is to simulate its movement. I thought > it would be easy, but it's proving to be diabolically difficult. > Boundary conditions: the cantilever should be fixed in one end, and > allowed to oscillate in the other (the oscillations are predetermined > by some simple trigonometric function). > This system should be allowed to translate in space (a moving beam, s= o > to speak). > So it should be allowed to move in the X-Y plane and oscillate along > the Z- axis. > > Moving it in the X-Y plane is accomplished with the Translate > function. But how can I make it oscillate in a specific manner? How > can I combine in one animation both movements? > > Any help would be greatly apprerciated, > > Gideon- Hide quoted text - > > - Show quoted text - > > Daniel, > > Your suggestion spurred another question: would you happen to know how > I could combine the different frames into a single frame, which could > then be made into a QuickTime movie? > > Gideon Do[Show[Graphics3D[{Thickness[0.1], lever[x, y, phi]}], PlotRange -> {{ 0, 2}, {0, 2}, {-1, 1}}], {t, 0, 100}] SelectionMove[EvaluationNotebook[], All, GeneratedCell]; FrontEndTokenExecute[CellGroup] FrontEndTokenExecute[OpenCloseGroup] Dimitris === Subject: Re: Problems combining new v7.0 Image command with other graphics you have not understood the problem. Your example does just this what the OP wishes, it draw the Locator[] over the image, and keep the vector structure of the Locator[]. But there is no LinePane[]/ CirclePane[]/ PolygonPane[], to do that. And something like raster = Image`ToGraphicsRaster[img][[1]] /. Raster[bm_, dim_, args___] :> Raster[bm, {{0, 0}, Reverse[Take[Dimensions[bm], 2]]}, args]; dim = ImageDimensions[img]; Graphics[{raster, Locator[Dynamic[p]], Text[Dynamic[p /. ImageScaled[a_] :> Round[a*dim]], Dynamic[p], {-1, -1}]}] is not possible with LocatorPane[]. It is a principle error of the Image[], that Image[] itself is no Graphics-object (very logic). And it would take only a little work to display and Image[] alone as well as to allow that Graphics[{Image[..],..}] work correct. The problem is, that Image[] has not the position/size information that Raster[] has. However a position and size information is necessary for several image processing algorithms, like all forms of image registration. Jens > Easy: LocatorPane[{50, 50}, ImageCompose[Image[img], Graphics@Circle[]] > >>> 3. You can combine bitmapped Images with vector based Graphics using >>> ImageCompose: >>> ImageCompose[Image[img], Graphics@Circle[]] >> That destroy the vector information and work with the >> full image. Try to move a Locator[] object on the image >> in that way, and not with >> Graphics[{Image`ToGraphicsRaster[img][[1]],Locator[p]}] >> > === Subject: pregesApplication for use in public I want to write an application to be used on a public pc (XP) with touch screen and without a keyboard. Requirements are: 1. No visible code 2. No cell brackets 3. If possible, no window margins with default buttons by which users could close the window 4. Menu based operation, i.e. a main window from which other windows can be opened. 5. The program should come up ready-to-go, that is with no need to evaluate the notebook before use. What I know so far: -how to open and close windows by buttons -there is no need to start the kernel if I use manipulate with option SaveDefinitions -> True about the rest I am not sure. Please help Axel === Subject: two integrals Do the following integrals converge (even in the Hadamard sense) Integrate[(-((=EE*(3 + 2*c*=EE*(3*=EE + Sqrt[1/c + =EE^2])))/ ((1 + c*=EE^2)*(3 + 2*c*=EE*(3*Sqrt[1/c + =EE^2] + 2*=EE*(5 + c*=EE*(5*=EE + 3*Sqrt[1/c + =EE^2])))))))*Cos[=EE*x= ], {=EE, 0, Infinity}, Assumptions -> x > 0 && c > 0] Integrate[((I*=EE*(5 + 2*c*=EE*(3*=EE + Sqrt[1/c + =EE^2])))/ ((1 + c*=EE^2)*(3 + 2*c*=EE*(3*Sqrt[1/c + =EE^2] + 2*=EE*(5 + c*=EE*(5*=EE + 3*Sqrt[1/c + =EE^2]))))))*Sin[=EE*x], {=EE, 0, Infinity}, Assumptions -> x > 0 && c > 0] Dimitris === Subject: Moving $UserBaseDirectory makes all paclets do not working I just have moved $UserBaseDirectory to D:MATHEMATICA_USERBASE (by using the MATHEMATICA_USERBASE operating system environment variable) and, of course, I have copied all content of original $UserBaseDirectory to new location: In[1]:= $UserBaseDirectory Out[1]= D:MATHEMATICA_USERBASE But as a result all paclets does not work: In[2]:= ExampleData[{TestImage, Lena}] Import::nffil: File not found during Import. >> Set::shape: Lists {DataPaclets`ExampleDataDump`Keys [TestImage],DataPaclets`ExampleDataDump`Properties[TestImage]} and $Failed are not the same shape. >> Import::nffil: File not found during Import. >> Set::shape: Lists {DataPaclets`ExampleDataDump`Keys [TestImage],DataPaclets`ExampleDataDump`Properties[TestImage]} and $Failed are not the same shape. >> Import::nffil: File not found during Import. >> General::stop: Further output of Import::nffil will be suppressed during this calculation. >> Set::shape: Lists {DataPaclets`ExampleDataDump`Keys [TestImage],DataPaclets`ExampleDataDump`Properties[TestImage]} and $Failed are not the same shape. >> General::stop: Further output of Set::shape will be suppressed during this calculation. >> (Mathematica takes 100% CPU for a long time) How to solve this issue? === Subject: user-defined function templates in Mathematica 7.0 Mathematica 7.0 allows user-defined function templates to be easily created! .....To define a function template for a user-defined function, make the template the first statement in the usage message for the function. For example, to define the template f[a,b] for the function f, you could use the following command: f::usage=f[a,b] is an example of a function. It works very well. Happy templating! === Subject: status line in Manipulate I want to write a Manipulate based program with Controls (eg sliders and checkboxes) on the right and a status indicator line at the bottom. Such a line can be inserted using Style or Dynamic (anything with either of these Heads will be recognized as a control element by manipulate). But in contrast to the standard control elements like sliders etc, there is not such option like ControlPlacement->Bottom for an individual placing of the element. What can I do? Axel === Subject: MeijerG Seems consistent with its series and plots f[c_, x_] := -Log[x^2] - Sqrt[Pi]* MeijerG[{{0}, {}}, {{0, 0}, {1/2}}, x^2/(4*c)]; Limit[f[c, x], x -> 0] Log[1/c] + 2*EulerGamma Series[f[c, x], {x, 0, 1}] // Normal // FullSimplify[#, Element[{c, x}, Reals]] & Piecewise[{{Log[1/c] + 2*EulerGamma, c != 0 && x >= 0}}, Log[1/c] - 2*I*Pi + 2*EulerGamma] func = Table[f[c, x], {c, 1/2, 3/2, 1/2}]; Plot[Tooltip[func], {x, 0, 1}, Epilog -> {Red, AbsolutePointSize[4], Point[Table[{0, Log[1/c] + 2*EulerGamma}, {c, 1/2, 3/2, 1/2}]]}, Frame -> True, Axes -> False] Bob Hanlon > Can I trust the following result? > > In[29]:= Limit[-Log[x^2] - > Sqrt[Pi]*MeijerG[{{0}, {}}, {{0, 0}, {1/2}}, x^2/(4*c)], x -> 0] > (*c>0*) > > Out[29]= 2*EulerGamma + Log[1/c] > > Another well known CAS gave > >> limit(-ln(x^2)-sqrt(Pi)*MeijerG([[0], []],[[0, 0], >> [1/2]],1/4*x^2/c),x = 0); > >> infinity > > > Dimitris === Subject: Bugs in Mathematica v7 Moderator Note - I asked the author to provide more detailed information related to the emails below. The notebook mentioned can be found at http://smc.vnet.net/testing.nb. ------- Attached please find the Mathematica code I am running. The bugs I mentioned arise sometimes and not necessarily in one run. I use Math v7. Tugrul Here is an example of a so called bug. I write a variable name as var1 > but when I run the code, the variable name becomes var 1. There is a space > between var and 1 and hence Mathematica understands it as a > multiplication. A second and more serious problem is that I give an equation > like x1==x^2 + (y1 + y2) and after running the code the same quation turns > out to be: x1==x^2*y1 + x^2*y2). Namely, the (+) sign becomes a > multiplication. These problems do occur sometimes not all the time. I hope the problem now is clear. Tugrul >> >> >> I just started to use Math v7 to run an economic model. I face a lot of > bugs >> in the program each time I run the model. Sometimes it is an invisible >> change in signs (like + or -) or in the form of incorrect expansion of >> simple equations. I am tired of looking for the bugs and correcting them. >> Some other times, the variable names are changed by putting space in > between >> letters that appear in the variable name. >> >> Please help... Do I do a mistake? Or is it a problem of the Math v7? >> >> Temel >> >> >> === Subject: New kind of Weierstrass fractal scaling: Eulerian scales,MacMahon This idea is a consequence of the Bernoulli types using the general Pascal row sum products. The Pascal row sum is 2^n which is a regular Self-Similar Weierstrass or Bescovitch-Ursell function. Using n! or Gamma[1+n] or (n+1)! or Gamma[2+n] scales are like scales 2^n and 3^n. 3=2^s gives ( Sierpinski gasket self-similar dimension): s=Log[3]/Log[2] That kind of calculation/ conversion isn't as easy in this new type of scales: FindRoot[Gamma[3] - Gamma[1 + s] == 0, {s, 5/3}] s=2 FindRoot[3*Gamma[3] - 2^s*Gamma[1 + s] == 0, {s, 5/3}] {s -> 1.81782} Traditional Weierstrass fractal scale 2: Clear[c, s, s0, x] s0 = 3/5; c[x_] = Sum[Cos[2^n*x]/2^(s0*n), {n, 0, 20}]; s[x_] = Sum[Sin[2^n*x]/2^(s0*n), {n, 0, 20}]; ParametricPlot[{c[x], s[x]}, {x, -Pi, Pi}, PlotPoints -> 1000, Axes -> False] http://www.geocities.com/rlbagulatftn/2weier.gif Eulerian scale Weierstrass fractal with n! scale: Clear[c, s, s0, x] s0 = 3/5; c[x_] = Sum[Cos[Gamma[1 + n]*x]/Gamma[1 + s0*n], {n, 0, 20}]; s[x_] = Sum[Sin[Gamma[1 + n]*x]/Gamma[1 + s0*n], {n, 0, 20}]; ParametricPlot[{c[x], s[x]}, {x, -Pi, Pi}, PlotPoints -> 1000, Axes -> False] http://www.geocities.com/rlbagulatftn/2eulerian_weier.gif MacMahon type scaling: Clear[c, s, s0, x] s0 = 3/5; c[x_] = Sum[Cos[2^n*Gamma[1 + n]*x]/(2^(s0*n)*Gamma[1 + s0*n]), {n, 0, 20}]; s[x_] = Sum[Sin[2^n*Gamma[1 + n]*x]/(2^(s0*n)*Gamma[1 + s0*n]), {n, 0, 20}]; ParametricPlot[{c[x], s[x]}, {x, -Pi, Pi}, PlotPoints -> 1000, Axes -> False] http://www.geocities.com/rlbagulatftn/2weier_macmahon.gif Mew kind of Bescovitch-Ursell fractal as Eulerian: Clear[f, g, h, k, ff, kk, ll] f[x_] := 0 /; 0 <= x <= 1/3 f[x_] := 6*x - 2 /; 1/3 < x <= 1/2 f[x_] := -6*x + 4 /; 1/2 < x <= 2/3 f[x_] := 0 /; 2/3 < x <= 1 ff[x_] = f[Mod[Abs[x], 1]]; s0 = Log[2]/Log[3]; kk[x_] = Sum[ff[(k + 1)!*x]/Gamma[2 + s0*k], {k, 0, 20}]; ll[x_] = Sum[ff[(k + 1)!*(x + 1/2)]/Gamma[2 + s0*k], {k, 0, 20}]; ga = Table[{kk[n/10000], ll[n/10000]}, {n, 1, 10000}]; ListPlot[ga, Axes -> False, PlotRange -> All] http://www.geocities.com/rlbagulatftn/biscuit_eulerianvonkoch.gif The implication of this type of result is that there are more types of fractal scaling than just the straight integers scales of traditional fractal theory. These ideas are a result of the application of Pascal type Modulo two Sierpinski resyults to higher symmetries of combinatorial triangles and the scaling that the row sums ( products) provide. Respectfully, Roger L. Bagula 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :http://www.geocities.com/rlbagulatftn/Index.html alternative email: rlbagula@sbcglobal.net === Subject: Re: Animation = Translation + Vibration, But How? there was a nice joke (though I would not take a risk of repeating it here) ending up with a dialog: But why? But how?. Did you mean it? :-) To be serious, why not to take a well-known solution of a cantilever and animate it? It will then at least behave as it should. See for instance, Landau, L. D. & Lifz, E. M. Theory of Elasticity (Pergamon Press, Oxford, 1986) the chapter on bending of rods. Take the one with one end clumped, another loaded by a point force. You will easily find it in problems to the chapter on small bending. Just to give an example: (* Begin of the example 1 *) (* This is the solution I mean for a cantilever, length 1, clumped at its left end and *) (* loaded by a force 0.1*Sin[t] at its another end *) z[x_, t_] := x^2*(3 - x)*0.1*Sin[t]; (* This shows vibration of its free end. Play here with the option Thickness[n] *) (* to display the rod as a rod, rather than a line *) Animate[Plot[z[x, t], {x, 0, 1}, PlotStyle -> Thickness[0.02], PlotRange -> {-1, 1}, Frame -> False, Ticks -> None, Axes -> None], {t, 0, 10 Pi, 0.1}, Paneled -> False] (* End of the example 1 *) Try this. If you need to show a more complex motion you may again play with equation of motion of its left end for which you can give any function. For example, try this: (* Begin of example 2 *) (* this is the law of motion of the left end *) x0[t_] := Cos[t/5]; (* This we already had in the previous example, but now the left end moves *) z[x_, t_] := (x - x0[t])^2*(3 - (x - x0[t]))*0.1*Sin[t]; Animate[Plot[z[x, t], {x, x0[t], 1 + x0[t]}, PlotStyle -> Thickness[0.02], PlotRange -> {{-1, 2}, {-1, 1}}, Frame -> False, Ticks -> None, Axes -> None], {t, 0, 10 Pi, 0.1}, Paneled -> False] (* End of Example 2 *) You may want to attach any object to the oscillating cantilever end. Try this: (* Begin of the example 3 *) x0[t_] := Cos[t/5]; z[x_, t_] := (x - x0[t])^2*(3 - (x - x0[t]))*0.1*Sin[t]; Animate[Show[{Plot[z[x, t], {x, x0[t], 1 + x0[t]}, PlotStyle -> Thickness[0.02], PlotRange -> {{-1, 2.3}, {-1, 1}}, Frame -> False, Ticks -> None, Axes -> None], Graphics[Disk[{x0[t] + 1, z[x0[t] + 1, t]}, 0.1]]}], {t, 0, 10 Pi, 0.1}, Paneled -> False] (* End of the example 3 *) .... and so on. Finally, if you need to to have a self-standing movie, have a look into the today-posted discussion Re: Manipulate, Export, .avi, forward run without the slider in the... Have fun :-) , Alexei I created a cantilever in Mathematica (nothing fancy, a Graphics 3D > object created with Polygon). > The only thing that I want now is to simulate its movement. I thought > it would be easy, but it's proving to be diabolically difficult. > Boundary conditions: the cantilever should be fixed in one end, and > allowed to oscillate in the other (the oscillations are predetermined > by some simple trigonometric function). > This system should be allowed to translate in space (a moving beam, so > to speak). > So it should be allowed to move in the X-Y plane and oscillate along > the Z- axis. Moving it in the X-Y plane is accomplished with the Translate > function. But how can I make it oscillate in a specific manner? How > can I combine in one animation both movements? Any help would be greatly apprerciated, Gideon -- Alexei Boulbitch, Dr., Habil. Senior Scientist IEE S.A. ZAE Weiergewan 11, rue Edmond Reuter L-5326 Contern Luxembourg Phone: +352 2454 2566 Fax: +352 2454 3566 Website: www.iee.lu === Subject: Set of ODE's I have a large set of vector/matrix ODE's I want to solve numerically. But I am having some problems with the notation. For example something like that works very well A = RandomReal[{1, -1}, {3, 3}]; NDSolve[{x'[t] == A.x[t], x[0] == RandomReal[1, {3, 3}]}, x, {t, 0, 20}] but it doesn't work if I add a constant term to the right hand side of the equation: NDSolve[{x'[t] == A.x[t] + IdentityMatrix[3], x[0] == RandomReal[1, {3, 3}]}, x, {t, 0, 20}] I guess the problem is that Mathematica adds A.x[t] to all the components of the IdentityMatrix[3] as if it is a scalar quantity. I defined the identity matrix to be a matrix function with zero derivative etc, so that it doesn't get evaluated immediately and that works but there should be a better way of doing it with the Hold function I guess. Do you have any idea how to do this in a more elegant way? thank you, Baris Altunkaynak === Subject: Re: Set of ODE's Hi Barris, mathematica evaluates the arguments of a function before calling it. alone, it is not defined if x is a scalar, vector or matrix. Mathematica leaves it unevaluated. Next we have A.x + IdentityMatrix[3]. This time mathematica treats A.x[t] obviously as a scalar (I have no clue why). What can we do? A solution to this is, to declare x as a matrix like e.g.: x[t_] = Table[ToExpression[x <> ToString[i] <> ToString[j]][t], {i, 3}, {j, 3}] Next problem we face is, that == does not thread over matrixes. We therefore have to flatten our equations before thtreading. We may define an operator for this purpose: toEq[x_] := x /. {a__List} :> Flatten[{a}] // Thread; Note further that we need to specify the functions to calculate by vars=Flatten@x[t], not only by x because this would not be expanded. Finally we may now write: A = RandomReal[{1, -1}, {3, 3}]; toEq[x_] := x /. {a__List} :> Flatten[{a}] // Thread; x[t_] = Table[ ToExpression[x <> ToString[i] <> ToString[j]][t], {i, 3}, {j, 3}] eq = toEq[x'[t] == A.x[t] + IdentityMatrix[3]]; eq = Join[eq, toEq[x[0] == RandomReal[1, {3, 3}]]]; vars = Flatten@x[t]; NDSolve[eq, vars, {t, 0, 20}] hope this helps, Daniel > I have a large set of vector/matrix ODE's I want to solve numerically. But I am having some problems with the notation. For example something like that works very well A = RandomReal[{1, -1}, {3, 3}]; > NDSolve[{x'[t] == A.x[t], x[0] == RandomReal[1, {3, 3}]}, x, {t, 0, 20}] but it doesn't work if I add a constant term to the right hand side of the equation: NDSolve[{x'[t] == A.x[t] + IdentityMatrix[3], x[0] == RandomReal[1, {3, 3}]}, x, {t, 0, 20}] I guess the problem is that Mathematica adds A.x[t] to all the components of the IdentityMatrix[3] as if it is a scalar quantity. I defined the identity matrix to be a matrix function with zero derivative etc, so that it doesn't get evaluated immediately and that works but there should be a better way of doing it with the Hold function I guess. Do you have any idea how to do this in a more elegant way? thank you, > Baris Altunkaynak > > === Subject: Re: a LOT of Mathematica bugs (some very old) > > I can respond to a few of these. > > > > [...] > Terrible Performance > > x = IE; > Timing[Do[x = x /. IE -> E^(IE/E), {12}]; x] > > {4.687, E^E^(-1 + > E^(-1 + E^(-1 + > E^(-1 + E^(-1 + > E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + E^(-1 + IE/E)))))))= ))= > ))} > > mathematica 2.2 do it in a flash : > [...] > > Here is a more direct example: > > Timing[Im[-1 - E^ > (-1 - E^(-1 - E^(-1 - E^(-1 - E^(-1 - E^(-1 - E^(-1 - E^(-1 - e^ > (-1)))))))))]] > > This slowdown is currently under investigation. My hope is to restore > something closer to the old behavior. Though the code is sufficiently > complex that I make no guarantees in this regard. > > I should mention that there are similar examples where the speed > improves significantly between versions 2.2 and later. Here is one > such. > Timing[(-1/5 + (47*I)/20) ^ (1/10000)] > > SparseArray > [...] > ******* > Mathematica eats a lot system memory when this sparseArray > is (eg 300 x 300 x300) - Is it needed/by design ? > > gg = SparseArray[{i_, j_, 1} -> 1, {300, 300, 300}]; > > Using rules with patterns causes level recursion and substantial index > iteration in the process of constructing the sparse array. This in > turn seems to require considerable memory. One can generally improve > on this situation by giving explicit pattern-free rules. I'd love to see the code that handles SparseArray (maybe with the appropriate goggles...) What is the call gg = SparseArray[{i_, j_, 1} -> 1, {300, 300, 300}] doing during all that time and with all that space? -- m === Subject: Re: Please answer to my questions,thank you. On 7 jan, 13:11, Sjoerd C. de Vries > (yP - xP)^2 is not so much different from |yP-xP|. Note that I have > changed epsilon in your test > > Abs[yP - xP] <= epsilon > > in epsilon2, with which I meant the square of epsilon, epsilon^2 > > All real yP and xP that pass the Abs[yP - xP] <= epsilon test also > pass the (yP - xP)^2 <= epsilon^2 test and vice versa. The latter can > be handled easier by Mathematica, though. > > With respect to your Nest[ ] question. I don't think it's > mathematically possible. Take for instance the case that f is defined > as f[x_]:= - x. Your equation would have infinite solutions, not only > the i-j one you mention. Same with f = Sin and x= n Pi. Anyway, I > don't think mathematica could solve this if you don't specify al least > the Nesting depth. > > > > > > On 6 jan, 10:10, Sjoerd C. de Vries > > Hi Olfa, > > [comments between your text lines] > > > 1-reduce: f(f(f(...(v) i times=f(f(f(...(w) j times. I've tried = ne= > st = > like this: > Nest[f,v,i]=C5 Nest[f,w,j] > , but I have this error: > Nest::intnm: Non-negative machine-size integer expected at position= 3= > in = > Nest[f,v,i] and > Nest::intnm: Non-negative machine-size integer expected at position= 3= > in = > Nest[f,w,j] > =C2 > > Well, Mathematica is really gung-ho to get to work for you. It really > wants to Nest so badly, but then you give it nothing to chew on. Quit= e > naturally, it complains. You didn't tell it how often to Nest. > > I'm not sure what you want to achieve here. Solve this equation for > the unknown f,v,i,w, and j? Impossible. But even if it would be > possible you're using the wrong syntax. Should be something like Solv= e > [Nest[f, v, i] == Nest[v, w, j], {v}] or so. > > 2-I want to use lists symbollically like this: m, mP,l,lP are lists= , = > j,jP= > > ,i,iP are variables.By symbolically I mean without specifying the con= cr= > ete > > elements and the concrete length of these lists > i<=iP,j-Length[m]=C5 jP-Length[mP], > Join[l,m]=C5 Join[lP,mP], > Nest[Rest,m,i]=C5 Nest[Rest,mP,iP] > > There are some weird codes in there that I'm trying to interpret. Not > really sure whether I get it all. > You can't really have abstract lists in Mathematica. You can say > something like d = Array[c, i] and e=Array[b,j], but you'll get t= he > same complaints as above. The assignments have been made and replacin= g > i with a number yields a real list for d: > > In[55]:= d /. i -> 5 > > Out[55]= {c[1], c[2], c[3], c[4], c[5]} > > so far so good, but if you try to Join d and e you get nonsense: > > In[58]:= Join[d, e] > > During evaluation of In[58]:= Array::ilsmn: Single or list of non- > negative machine-size integers expected at position 2 of Array > [c,i,b,j]. >> > > Out[58]= Array[c, i, b, j] > > I guess you could make some functions yourself that operate on > abstract lists but that would be hard work. > > 3-when I have j =N= > a= > s result. > > I'm sorry, but this doesn't make sense at all. Why would i have to > equal N? This is only true if j equals N-1, but you claim that j j==N-2 or N-3 would also fit the inequality. > > And what do you mean by 'result'? Result of what? > > 4-solve this system of equations: xP = 1 + a/yP=C2 and |yP-x= P|= > <= > = > = epsilon > > Since this involves an inequality Solve can't be used. If a and > epsilon are symbolic FindInstance can also not be used. Reduce should > work, but it doesn't get me an answer within a couple of minutes, so > with a small rewrite it becomes: > > Reduce[{xP == 1 + a/yP, (yP - xP)^2 <= epsilon2}, {xP, yP}] > > and now Reduce seems to be able to solve the system. > > > Yours faithfully, > Olfa MRAIHI - Masquer le texte des messages pr=E9c=E= 9d= > ents - > > - Afficher le texte des messages pr=E9c=E9dents - > > Hi Mr Sjoerd, > thank you for your reply.Here some clarifications and corrections: > >I'm not sure what you want to achieve here. Solve this equation for > > the unknown f,v,i,w, and j? Impossible. But even if it would be > possible you're using the wrong syntax. Should be something like > Solve > [Nest[f, v, i] == Nest[f, w, j], {v}] or so. > > well I explain exactly what I hope mathematica to do for me: > when I have f(f(f(...(x) i times == f(f(f(...(y) j times and i>=j= t= > hen > i want to have y in terms of the others which is y=f(f(f(...(x) i-j > times. So with mathematica syntaxe I will have :Reduce[i>=j,Nest[f,i,= x] > ==Nest[f,j,y],{y},Backsubstitution->True] and I want the solution t= o > be:y=Nest[f,i-j,x], is it possible? do you know how could i deal with > this? > >Reduce should work, but it doesn't get me an answer within a couple of= m= > inutes, so > with a small rewrite it becomes: > Reduce[{xP == 1 + a/yP, (yP - xP)^2 <= epsilon2}, {xP, yP}] > and now Reduce seems to be able to solve the system. > > But (yP - xP)^2 is different from |yP-xP| what I want is: > Reduce[{xP == 1 + a/yP, Abs[yP - xP] <= epsilon}, {xP, yP}, > Backsubstitution -> True] or Reduce[{xP == 1 + a/yP, Abs[yP - xP= ] = > <= > 10^-6]}, {xP, yP}, > Backsubstitution -> True] > it doesn't get me an answer within a couple of minutes!! how you can > explain that and what i have to do? > > thank you!- Masquer le texte des messages pr=E9c=E9dents - > > - Afficher le texte des messages pr=E9c=E9dents - >3-when I have jI'm sorry, but this doesn't make sense at all. Why would i have to >equal N? This is only true if j equals N-1, but you claim that jj==N-2 or N-3 would also fit the inequality. you're right! but when I add the condition that Not(i Normal[Series[f[x, y], {x, 0, 2}, {y, 0, 2}]] /. > Derivative[m_, n_][f][__] /; m + n > 2 :> 0 > > (1/2)*x^2*Derivative[2, 0][f][0, > 0] + y*(x*Derivative[1, 1][f][ > 0, 0] + Derivative[0, 1][f][ > 0, 0]) + x*Derivative[1, 0][f][ > 0, 0] + (1/2)*y^2* > Derivative[0, 2][f][0, 0] + > f[0, 0] > > Bob Hanlon > > > Is it possible to directly tell Series to truncate a > multivariate Taylor series beyond a total derivative order? > Example, for f(x,y) and total derivative order 2, I want > > f(0,0) + x*Derivative[1,0][f][0,0] + y*Derivative[0,1][f][0= ,0] + > x^2*Derivative[2,0][f][0,0]/2 + x*y*Derivative[1,1][f][0,0]= + > y^2*Derivative[0,2][f][0,0]/2 > > whereas > > Normal[Series[f[x,y],{x,0,2},{y,0,2}]] > > returns also derivative terms (2,1), (1,2) and (2,2) of total > orders 3, 3 and 4. These I have to get rid of a posteriori with > some complicated logic to build a replacement list. deals with expanding second-order tensors in 3D (max total derivative order of 6) but this rule can be applied component-wise. === Subject: Re: Transformation matrix Could you be a little more specific? What is this matrix supposed to do? > Hello! > I use Show[] and Graphics3D[] to display graphics. I quite remember > that there is an option or smth like to specify there a transformation > matrix (homogeneous coordinates), but I don't remember how. Anyone can > help? > P.S. Mathematica 5.2 === Subject: Re: Transformation matrix Graphics3D[{Line[{{0, 0, 0}, {1, 1, 1}}]}, ViewMatrix -> {{{1, 1, 0, 0}, {0, 1, 1, 0}, {0, 0, 1, 1}, {1, 0, 0, 0}}, {{1, 1, 0, 0}, {1, 1, 0, 0}, {0, 0, 1, 1}, {1, 0, 0, 0}}}] Jens > Hello! > I use Show[] and Graphics3D[] to display graphics. I quite remember > that there is an option or smth like to specify there a transformation > matrix (homogeneous coordinates), but I don't remember how. Anyone can > help? > P.S. Mathematica 5.2 > === Subject: Re: File Corrupted > I have a long notebook, which I intended to use in my class starting > next week. Today the machine hung up, and I got the following message: There was a syntax error on line 14997 in the file temp1.nb nherited, {10,5} The highlighted error is a number in CellChangeTimes. Is it possible to discard the error by discarding the file from the > highlighted error to the end of the file? John > The entire contents of a notebook is one large Mathematica expression. Typically in a situation such as you describe, a notebook gets partially written over an earlier version, so there is one broken bit. One way to proceed is to take a copy of the original file, and edit it with a text editor. It is usually possible to cut out one cell's worth of data (hopefully an output cell!) and create a file that will load. It may give a warning about the cache being corrupt, but you can ignore that. If it loads, save it somewhere else, and invest in a good backup mechanism! David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Re: File Corrupted Apparently the file Corruption.m on http://www.bluffton.edu/~nesterd/MathematicaFix.html is not there... but perhaps you can locate it elsewhere (possibly in the Wolfram archives) and give it a go... --David > I have a long notebook, which I intended to use in my class starting > next week. > > Today the machine hung up, and I got the following message: > > There was a syntax error on line 14997 in the file temp1.nb > > nherited, {10,5} > > The highlighted error is a number in CellChangeTimes. > > Is it possible to discard the error by discarding the file from the > highlighted error to the end of the file? > > John === Subject: Re: File Corrupted The quick answer to your question is no. A notebook needs to be a syntactically correct Notebook expression and deleting the material from a point internal t the notebook will render it syntactically incorrect. But, several points: ** Even though Mathematica pointed to a particular point in the notebook expression where it suggests the corruption problem is, it is likely that that is just the place where the problem (which may occur earlier or later in the notebook) shows itself to Mathematica's syntax checker. So that may not be the correct place to start a repair. ** If you can find a point prior to the location that Mathematica pointed out, and which is the end of a Cell expression, you might be able to reconstruct the Notebook expression (by closing appropriate brackets to complete the hierarchy of Cell and CellGroup expressions) and then save the associated text as a .nb file. This generally is not easy. ** Take a look at http://www.bluffton.edu/~nesterd/MathematicaFix.html and see whether this code works for you. ** Back things up! (I know you're kicking yourself for this and don't need any other reminders... it happens to us all at some point or other....) ** If all else fails let someone like me take a look at the problematic notebook to see if they can do a quick fix... I wish you luck. --David > I have a long notebook, which I intended to use in my class starting > next week. > > Today the machine hung up, and I got the following message: > > There was a syntax error on line 14997 in the file temp1.nb > > nherited, {10,5} > > The highlighted error is a number in CellChangeTimes. > > Is it possible to discard the error by discarding the file from the > highlighted error to the end of the file? > > John === Subject: Excel as a Front End for Mathematica? I've heard that Excel can be used as a front end for Mathematica. I have no idea how to do this. I would appreciate it if someone could please enlighten me. Patrick (email: stpatryck@gmail.com) === Subject: Thanx Guys, Inner[] did the job. Thomas === Subject: What do such expression like (0->1), (0->0) in solutions mean? Solving a system of equations I've got answer in a usual form variable1->solution1, variable2->solution2,.., but in the bodies of solutions there are terms like (0->0), (0->1). What does it mean? === Subject: Re: What do such expression like (0->1), (0->0) in solutions mean? Give an example code please === Subject: still ignores special cases of functions > Hello > The Sum[] seems to ignore special cases of a function. Try the > following: > > c[n_] := k cc^n; > c[1] := cc; > Sum[c[m], {m, 1, Infinity, 1}] // FullSimplify > c[1] + Sum[c[m], {m, 2, Infinity, 1}] // FullSimplify > Sum[k cc^n, {n, 1, Infinity, 1}] // FullSimplify > c[1] > > Obviously the special case > c[1] := cc > is completely ignored by Sum[]. > As I understand this is a bug in the Sum[] or in internal work with > function definitions. > The corresponding pages of the Documentation are: > tutorial/MakingDefinitionsForFunctions > and > tutorial/TheOrderingOfDefinitions I can add that in v.7.0.0 the bug is still here: In[1]:= c[n_] := k cc^n; c[1] := cc; Sum[c[m], {m, 1, Infinity, 1}] // FullSimplify Out[3]= False Out[4]= True === Subject: Manipulate, Export, .avi, forward run without the I propose that you export Animate, rather than Manipulate. In this case you get several options controlling your movie. In particular, I would recommend to use the following options: AnimationRate -> M, DisplayAllSteps -> True, AnimationDirection ->Forward, AnimationRunning -> True in the operator Animate. If the animation parameter runs from 1 to K with step 1, you determine M as K/M=30. The panel may be removed by the option Paneled->False. Mathematica does not like this option and often marks it in red, but obeys though. How to remove a slider when using Animate or Manipulate - is a good question. I do not know. There is an alternative possibility, which I prefer. You may create a table of graphics and then directly export it as say, avi file. In this case you may use the option FrameRate->P of the operator Export which then creates a movie with P frames per second. Then you may easily calculate P to make the movie duration equal to 30 seconds by knowing the total number of the graphs in your table. Just to illustrate: (* Begin of an example *) (* This is a function to show: *) z2[x_, y_] := (1 - 0.62*y/Power[x^2 + y^2, (4)^-1])* Exp[-0.15*Sqrt[x^2 + y^2]]; (* This is the definition of an image. Here v is a parameter both changing and enumerating different images *) image[v_] := Plot3D[3*z2[x, y]*(1 - v^2)*Exp[-0.15*x*v], {x, -10, 4}, {y, -4, 4}, PlotStyle -> {Opacity[0.9]}, PlotRange -> {{-10, 4}, {-4, 4}, {0, 5}}, AspectRatio -> 0.8, ColorFunction -> Rainbow, Mesh -> None, Boxed -> False, Ticks -> None, AxesLabel -> {x, y, [Eta]}, AxesStyle -> Directive[Large], ViewPoint -> {15*Sin[1.4]*Cos[-2.5 Pi/4], 15 Sin[1.4]*Sin[-2.5 Pi/4], 15*Cos[1.4]}, ImageSize -> 500]; (* This creates a table of 40 images. Here you play with its length *) a3 = Table[image[v], {v, 0, 1, 0.025}]; (* This exports the table as an avi file which theoretically should play 40/3=13 seconds *) (* Play with the FrameRate here *) Export[Full_path_to_your_target_foldera3.avi, a3, FrameRate -> 3] (* End of the example *) As the result you will get in your target folder a stay-alone a3.avi file without any panel or slider. Just copy and try up. Another such example has been already discussed concerning rotation of a 3D graphics. You may find it here: http://forums.wolfram.com/mathgroup/archive/2008/Nov/msg00197.html Have fun :-) , Alexei I successfully created a movie using_ Export[=E2=80=9Cmovie.avi=E2=80=9D,data,=E2=80=9D AnimationDuration=E2=80= =9D->30] data is actually a Manipulate command; data=Manipulate[GraphicsColumn[ {A[[i]],B[[i]]} ,{i,1,dim,1}] However, I haven't figured out; 1) showing only the forward loop of the movie in 30 sec (AnimationDuration). Export automatically creates forward and backward sequences and 2) I don't want to include any Sliders in the movie for presentatio n purposes (like in the Hide Controls option). Do you know which commands I should add to reach my goal in the Export or Manipulate command? I searched the Documentation Center and MathGroupArchive but I couldn't come up with the answer. I am currently using V6.0 although my institution has all the licenses including V7. I am waiting for a new machine to separately run V7 if it has the necessary options. -- Alexei Boulbitch, Dr., Habil. Senior Scientist IEE S.A. ZAE Weiergewan 11, rue Edmond Reuter L-5326 Contern Luxembourg Phone: +352 2454 2566 Fax: +352 2454 3566 Website: www.iee.lu === Subject: =?ISO-8859-1?Q?Re:__Perch=E8_non_parli=3F?= me too - I can't get it to work either. I use OS X. I've posted a help request to wolfram. Peter 2009/1/9 Chris Pemberton : >> A popular story tells that Michelangelo, having just finished his >> Moses, stepped back to admire his latest creation and, overwhelmed by >> its beauty and perfection, threw his hammer at its right knee >> exclaiming Perch=E8 non parli? (why don't you speak?). >> >> Well, if you are thinking of throwing your hammer at Mathematica >> 7.0 ...hold on for a second....because Mathematica 7.0 can actually >> SPEAK! And rather fluently too! >> In fact not only it can read aloud any text you throw at it, but it >> can articulate complex math formulae too. In other words it has the >> capability to orally communicate with the user for mesages, help, >> warnings, ect. >> >> Have you tried the speech capabilities of Mathematica 7.0 yet? >> Well, if you have, chances are that you have been disappointed by the >> poor quality of the default MS voices present on Windows XP machines >> (I do not know about Vista). Never mind, because excellent and low >> cost voices exist that can replace the default Windows voices. >> Excellent voices from Neospeech or Acapela cost between 30$ and 50 $, >> often in association with low cost TTS (text to speech) software. >> > I have been unable to get any speech output from Mathematica 7 in > Linux. I hope it is supported soon. > I conclude from your sales pitch that Mathematica uses the OS's native > TTS capabilities, not some form of built-in TTS engine? > If so, I suppose Wolfram could utilize the festival TTS engine in > Linux. Not sure about the licensing. > > Chris > > === Subject: =?ISO-8859-1?Q?Perch=E8_non_parli=3F?= > A popular story tells that Michelangelo, having just finished his > Moses, stepped back to admire his latest creation and, overwhelmed by > its beauty and perfection, threw his hammer at its right knee > exclaiming Perch=E8 non parli? (why don't you speak?). > > Well, if you are thinking of throwing your hammer at Mathematica > 7.0 ...hold on for a second....because Mathematica 7.0 can actually > SPEAK! And rather fluently too! > In fact not only it can read aloud any text you throw at it, but it > can articulate complex math formulae too. In other words it has the > capability to orally communicate with the user for mesages, help, > warnings, ect. > > Have you tried the speech capabilities of Mathematica 7.0 yet? > Well, if you have, chances are that you have been disappointed by the > poor quality of the default MS voices present on Windows XP machines > (I do not know about Vista). Never mind, because excellent and low > cost voices exist that can replace the default Windows voices. > Excellent voices from Neospeech or Acapela cost between 30$ and 50 $, > often in association with low cost TTS (text to speech) software. > I have been unable to get any speech output from Mathematica 7 in Linux. I hope it is supported soon. I conclude from your sales pitch that Mathematica uses the OS's native TTS capabilities, not some form of built-in TTS engine? If so, I suppose Wolfram could utilize the festival TTS engine in Linux. Not sure about the licensing. Chris === Subject: =?ISO-8859-1?Q?Perch=E8_non_parli=3F?= What does one do, exactly, to substitute such a voice for the Windows built-in default voice that Mathematica 7 now uses? > A popular story tells that Michelangelo, having just finished his > Moses, stepped back to admire his latest creation and, overwhelmed by > its beauty and perfection, threw his hammer at its right knee > exclaiming Perch=E8 non parli? (why don't you speak?). Well, if you are thinking of throwing your hammer at Mathematica > 7.0 ...hold on for a second....because Mathematica 7.0 can actually > SPEAK! And rather fluently too! > In fact not only it can read aloud any text you throw at it, but it > can articulate complex math formulae too. In other words it has the > capability to orally communicate with the user for mesages, help, > warnings, ect. Have you tried the speech capabilities of Mathematica 7.0 yet? > Well, if you have, chances are that you have been disappointed by the > poor quality of the default MS voices present on Windows XP machines > (I do not know about Vista). Never mind, because excellent and low > cost voices exist that can replace the default Windows voices. > Excellent voices from Neospeech or Acapela cost between 30$ and 50 $, > often in association with low cost TTS (text to speech) software. -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: =?ISO-8859-1?Q?Re=3A_Perch=E8_non_parli=3F?= FOR WINDOWS PC 1- make sure your PC can speak (just use the speak command in Mathematica). If it does not speak, you must load the latest Sapi (Vers. 5). But very likely it will speak, though with an horrible default voice. 2-The voices that you can buy are installed just like regular programs (i.e. with an installer) 3- once you have installed a new voice, go in the control panel and click the icon Speech synthesis and recognition (or something similar), then select (and click APPLY) the default voice you wish to use. Now Mathematica should be able to use the new voice. You might need to restart Mathematica A few links 1 - http://www.microsoft.com/speech/evaluation/thirdparty/engines.mspx 2- This is a good low cost alternative: http://www.naturalreaders.com/?gclid=CPej1_PEhJgCFYST3wodLkN8EA Check out the Mike and Crystal voices. They are good in my opinion. Then click on the upper menu item pricing and order and you will see that the personal version has 2 voices included and you can select Mike and Crystal or Neospeech Kate and Paul (last item). Neospeech Kate and Paul are my favourite voices. The professional version gives you 4 voices to choose, if you want more power. Neospeech and Acapela are my favourite voice makers. === Subject: =?ISO-8859-1?Q?Perch=E8_non_parli=3F?= A popular story tells that Michelangelo, having just finished his Moses, stepped back to admire his latest creation and, overwhelmed by its beauty and perfection, threw his hammer at its right knee exclaiming Perch=E8 non parli? (why don't you speak?). Well, if you are thinking of throwing your hammer at Mathematica 7.0 ...hold on for a second....because Mathematica 7.0 can actually SPEAK! And rather fluently too! In fact not only it can read aloud any text you throw at it, but it can articulate complex math formulae too. In other words it has the capability to orally communicate with the user for mesages, help, warnings, ect. Have you tried the speech capabilities of Mathematica 7.0 yet? Well, if you have, chances are that you have been disappointed by the poor quality of the default MS voices present on Windows XP machines (I do not know about Vista). Never mind, because excellent and low cost voices exist that can replace the default Windows voices. Excellent voices from Neospeech or Acapela cost between 30$ and 50 $, often in association with low cost TTS (text to speech) software. === Subject: Re: inverting Laplace transforms > > I need to invert a few expressions representing Laplace transforms. I have heard that MATHEMATICA can be used > for this purpose. Can anybody tell me how to do this? > > For example, I need to find a function f(t) for which the > Laplace transform F(s) is > > F(s) = Sqrt[s + a]/(Sqrt[s] * (s - b)) > > where a > 0 and b > 0 are constants. > > Leslaw See http://eqworld.ipmnet.ru/en/auxiliary/aux-inttrans.htm and the references therein. Dimitris === Subject: Re: inverting Laplace transforms Hi Dimitris, I have checked the Abramowitz and Stegun tables, but I do not see there any example that could be related to my expression. I'd love to know which are the other well known treatises for tables of integrals transforms in which you expect my expression to be present. Leslaw === Subject: Re: inverting Laplace transforms > Hi Dimitris, > > I have checked the Abramowitz and Stegun tables, but > I do not see there any example that could be related > to my expression. > I'd love to know which are the other well known treatises for tables of = integrals transforms > in which you expect my expression to be present. > > Leslaw See http://eqworld.ipmnet.ru/en/auxiliary/aux-inttrans.htm and the references therein. Dimitris === Subject: set of ODE's I think my e-mail didn't go through so I am sending it again. Sorry if you have already received it. Here is my question: I have a large set of vector/matrix ODE's I want to solve numerically. But I am having some problems with the notation. For example something like that works very well A = RandomReal[{1, -1}, {3, 3}]; NDSolve[{x'[t] == A.x[t], x[0] == RandomReal[1, {3, 3}]}, x, {t, 0, 20}] but it doesn't work if I add a constant term to the right hand side of the equation: NDSolve[{x'[t] == A.x[t] + IdentityMatrix[3], x[0] == RandomReal[1, {3, 3}]}, x, {t, 0, 20}] I guess the problem is that Mathematica adds A.x[t] to all the components of the IdentityMatrix[3] as if it is a scalar quantity. I defined the identity matrix to be a matrix function with zero derivative etc, so that it doesn't get evaluated immediately and that works but there should be a better way of doing it with the Hold function I guess. Do you have any idea how to do this in a more elegant way? thank you, Baris Altunkaynak === Subject: Need to calculate daily risk free rate from Fed data The St. Louis Federal Reserve makes a great set of data available for financial analysis at their FRED (Federal Reserve Economic Data) site at http://research.stlouisfed.org/fred2/. I've downloaded treasury bill rates from 1984 to the present (they have lots of rates available at: http://research.stlouisfed.org/fred2/categories/116). The data set gives me the yearly interest rate on 3-Month T-Bills for each day i.e: 1984-12-31, 0.008120 1985-01-01, 0.008120 1985-01-02, 0.008100 1985-01-03, 0.008070 1985-01-04, 0.008080 1985-01-07, 0.008060 1985-01-08, 0.008060 1985-01-09, 0.007950 .. 2008-12-30, 0.000100 2008-12-31, 0.000110 2009-01-01, 0.000110 2009-01-02, 0.000080 2009-01-05, 0.000140 2009-01-06, 0.000140 I need to calculate the daily risk free rate for each interval in the data set based on the yearly rate give for each day. I've gotten as far as this: 1 + yearlyRate == (1 + dailyRate)^360 Does this make sense? If so, how do I implement this in Mathematica? If not, how would I do it? A couple of related questions: Can one use FinancialData[] to access Treasury or Libor rate information or access a risk free rate directly? Thx. === Subject: passing initial point to LinearProgramming I have to solve a series of nearby Linear Programming problems (a few hundreds to a few thousand constraints and variables). It is known that for nearby problems using the solution of one problem as a starting point for the other can get a considerable speedup for Symplex Method. However, as far as I can see, LinearProgramming[] function does not allow specification of a starting point. Is there (perhaps a non-documented) workaround? -- Vyacheslav Rychkov https://mail.sns.it/~rychkov Scuola Normale Superiore Tel: +39-050-509068 (office) Classe di Scienze +39-050-3820086 (home) Piazza dei Cavalieri, 7 +39-3403925168 (mobile) 56100 Pisa Fax: +39-050-509045 Italy E-mail: Rychkov@sns.it === Subject: floating point comparison In the code shown below, the result of iterFixedPointList[Cos,0.0] in 94 iterations is equal to FixedPointList[Cos,0.0]. The while loop comparison happens as newV - oldV != 0.0. However if the comparison is written as newV != oldV, then the there are only 82 iterations and the result is not the final one. Why are these 2 comparisons not equal? Remark: machine precision numbers are best shown in 16 digits precision: Global Mathematica definition in Edit / Preferences : Appearance / Numbers / Formatting / Displayed Precision = 16 in Mathematica 7.0.0 x86_64 on Linux Clear[iterFixedPointList]; iterFixedPointList[function_, initValue_] := Module[{i, oldV, newV, listV}, i = 1; oldV = initValue; newV = function[initValue]; listV = {oldV, newV}; While[newV - oldV != 0.0, i++; oldV = newV; newV = function[newV]; listV = Append[listV, newV]; (* Appending newV here already before it is tested makes that the last 2 values in listV will be equal *) ]; Print[Number of iterations is , i]; listV ] === Subject: Re: floating point comparison Hi Bert, due to finite precision, it is not a good idea to accurately compare machine numbers. Therefore, some grey zone is usually defined. In Mathematica , from the manual: Approximate numbers are considered unequal if they differ beyond their last two decimal digit Now, what are the last 2 digits? Consider: 1.0 != 1.00000000000001 this gives False, both nu numbers are in agreement for digit 1..14, they differ in the 15. digit. Now consider: 1.0 - 1.00000000000001 != 0 this gives True because the numbers 1.0 - 1.00000000000001 and 0 already differ in the first digit. hope this helps, Daniel > In the code shown below, the result of iterFixedPointList[Cos,0.0] in 94 > iterations is equal to FixedPointList[Cos,0.0]. The while loop comparison > happens as newV - oldV != 0.0. However if the comparison is written as > newV != oldV, then the there are only 82 iterations and the result is not > the final one. Why are these 2 comparisons not equal? Remark: machine precision numbers are best shown in 16 digits precision: > Global Mathematica definition in Edit / Preferences : Appearance / > Numbers / Formatting / Displayed Precision = 16 in Mathematica 7.0.0 x86_64 > on Linux Clear[iterFixedPointList]; > iterFixedPointList[function_, initValue_] := > Module[{i, oldV, newV, listV}, > i = 1; > oldV = initValue; > newV = function[initValue]; > listV = {oldV, newV}; > While[newV - oldV != 0.0, > i++; > oldV = newV; > newV = function[newV]; > listV = Append[listV, newV]; > (* > Appending newV here already before it is tested > makes that the last 2 values in listV will be equal > *) > ]; > Print[Number of iterations is , i]; > listV > ] > === Subject: The use of Piecewise function Hi all, How can I to use the Piecewise function for symbolic calculations. For example, let the equation of ellastic line of a beam In[]: M[x_]:=Piecewise[{{Subscript[V, A]x,0<=x=0[And]-a>0 1/4 (2 b (a+b)^2-1/3 b (3 a^2+6 b a+2 b^2)) P -a<=0 + etc, etc I have proved with Assumptions, Assuming, but it does'nt work. === Subject: Re: Solve / NSolve Sorry for that. derData is a function computing the derivative of a list. It's defined as follows: derData = Function[{data, h}, (Drop[data, 2] - Drop[data, -2])/(2 h)]; The function is taken from Heikki Ruskep=E4=E4's Mathematica Navigator. /Sigmund > The code below can't succeed at all, as posted, since derData is undefine= d > in the huygTemp function. > > Without the missing pieces, we're not likely to reproduce your problem. > > Bobby > > >> >> Well, as the subject tells you I have an issue with Solve / NSolve. >> Instead of describing more in words I will ask you to evaluate the >> cells below. The plot you see there is what I expect to get; it is >> also correct. Now change NSolve to Solve in the line huygTemp. Don't >> you see a different plot now? Also the solution takes less time to >> compute, right? Could anyone explain to me this behaviour? Or at least >> try to explain it? Why does NSolve take so much more time to find a >> solution? And why is Solve finding the wrong one? Any suggestions on >> how to improve the huygTemp function (speedwise) are also welcome. >> Perhaps I should say that I'm using the following version of >> Mathematica: 6.0 for Sun Solaris SPARC (64-bit) (April 20, 2007). >> >> Sigmund >> >> >> huygTemp = Function[{a, b, c, t0, t, r0, dphi}, >> Module[{x0 = r0[[1]], y0 = r0[[2]], x1, y1, dx0, dy0, eq1, eq2, >> sol, pos, drop, x2, y2}, >> dx0 = derData[x0, dphi]; dy0 = derData[y0, dphi]; >> x0 = Delete[x0, {{1}, {-1}}]; y0 = Delete[y0, {{1}, {-1}}]; >> eq1 = Equal[#, 1] & /@ ((x - x0)^2/(a t)^2 + (y - y0 - c t)^2/(b t) >> ^2); >> eq2 = Equal[#, 0] & /@ (-2 dx0 (x - x0)/(a t)^2 - 2 dy0 (y - y0 - >> c t)/(b t)^2); >> sol = NSolve[#, {x, y}] & /@ (Transpose[{eq1, eq2}]); >> x1 = x /. sol; >> drop = Flatten@Position[Flatten[Differences /@ x1], x_ /; x == = 0]; >> y1 = y /. sol; >> pos = Ordering[Abs[#], -1] & /@ x1; >> x2 = MapThread[Extract, {x1, pos}]; >> y2 = MapThread[Extract, {y1, pos}]; >> If[ >> drop != {}, >> y2[[drop]] = MapThread[Extract, {y1[[drop]], Ordering[Abs[#], -1] >> & /@ (Transpose@y1[[drop]])}] >> ]; >> {x2, y2} = Join[{#[[-2]]}, #, {#[[2]]}] & /@ {x2, y2} >> ] >> ]; >> >> Module[{a = 1, b = 2, c = 1, t0 = 1/100, t = 1/10, r0, phi, >> dphi = 2 [Pi]/50, front, fun, x1, y1, drop, pos, x2, y2}, >> phi = N@Range[-dphi, 2 [Pi] + dphi, dphi]; >> r0 = {a t0 Cos[phi], b t0 Sin[phi] + c t0}; >> fun = huygTemp[a, b, c, t0, t, #, dphi] &; >> front = Nest[fun, r0, 10] // Timing; >> {First@front, ListPlot[Transpose@Last@front]} >> ] >> >> > > > -- > DrMajorBob@longhorns.com > -- Sigmund Vestergaard, M.Sc.Eng. student R=E6veh=F8jvej 36, 1., -611 DK-2800 Kongens Lyngby Denmark === Subject: Re: Solve / NSolve The code below can't succeed at all, as posted, since derData is undefined in the huygTemp function. Without the missing pieces, we're not likely to reproduce your problem. Bobby > > Well, as the subject tells you I have an issue with Solve / NSolve. > Instead of describing more in words I will ask you to evaluate the > cells below. The plot you see there is what I expect to get; it is > also correct. Now change NSolve to Solve in the line huygTemp. Don't > you see a different plot now? Also the solution takes less time to > compute, right? Could anyone explain to me this behaviour? Or at least > try to explain it? Why does NSolve take so much more time to find a > solution? And why is Solve finding the wrong one? Any suggestions on > how to improve the huygTemp function (speedwise) are also welcome. > Perhaps I should say that I'm using the following version of > Mathematica: 6.0 for Sun Solaris SPARC (64-bit) (April 20, 2007). > > Sigmund > > > huygTemp = Function[{a, b, c, t0, t, r0, dphi}, > Module[{x0 = r0[[1]], y0 = r0[[2]], x1, y1, dx0, dy0, eq1, eq2, > sol, pos, drop, x2, y2}, > dx0 = derData[x0, dphi]; dy0 = derData[y0, dphi]; > x0 = Delete[x0, {{1}, {-1}}]; y0 = Delete[y0, {{1}, {-1}}]; > eq1 = Equal[#, 1] & /@ ((x - x0)^2/(a t)^2 + (y - y0 - c t)^2/(b t) > ^2); > eq2 = Equal[#, 0] & /@ (-2 dx0 (x - x0)/(a t)^2 - 2 dy0 (y - y0 - > c t)/(b t)^2); > sol = NSolve[#, {x, y}] & /@ (Transpose[{eq1, eq2}]); > x1 = x /. sol; > drop = Flatten@Position[Flatten[Differences /@ x1], x_ /; x == 0]; > y1 = y /. sol; > pos = Ordering[Abs[#], -1] & /@ x1; > x2 = MapThread[Extract, {x1, pos}]; > y2 = MapThread[Extract, {y1, pos}]; > If[ > drop != {}, > y2[[drop]] = MapThread[Extract, {y1[[drop]], Ordering[Abs[#], -1] > & /@ (Transpose@y1[[drop]])}] > ]; > {x2, y2} = Join[{#[[-2]]}, #, {#[[2]]}] & /@ {x2, y2} > ] > ]; > > Module[{a = 1, b = 2, c = 1, t0 = 1/100, t = 1/10, r0, phi, > dphi = 2 [Pi]/50, front, fun, x1, y1, drop, pos, x2, y2}, > phi = N@Range[-dphi, 2 [Pi] + dphi, dphi]; > r0 = {a t0 Cos[phi], b t0 Sin[phi] + c t0}; > fun = huygTemp[a, b, c, t0, t, #, dphi] &; > front = Nest[fun, r0, 10] // Timing; > {First@front, ListPlot[Transpose@Last@front]} > ] > -- DrMajorBob@longhorns.com === Subject: Solve / NSolve Well, as the subject tells you I have an issue with Solve / NSolve. Instead of describing more in words I will ask you to evaluate the cells below. The plot you see there is what I expect to get; it is also correct. Now change NSolve to Solve in the line huygTemp. Don't you see a different plot now? Also the solution takes less time to compute, right? Could anyone explain to me this behaviour? Or at least try to explain it? Why does NSolve take so much more time to find a solution? And why is Solve finding the wrong one? Any suggestions on how to improve the huygTemp function (speedwise) are also welcome. Perhaps I should say that I'm using the following version of Mathematica: 6.0 for Sun Solaris SPARC (64-bit) (April 20, 2007). Sigmund huygTemp = Function[{a, b, c, t0, t, r0, dphi}, Module[{x0 = r0[[1]], y0 = r0[[2]], x1, y1, dx0, dy0, eq1, eq2, sol, pos, drop, x2, y2}, dx0 = derData[x0, dphi]; dy0 = derData[y0, dphi]; x0 = Delete[x0, {{1}, {-1}}]; y0 = Delete[y0, {{1}, {-1}}]; eq1 = Equal[#, 1] & /@ ((x - x0)^2/(a t)^2 + (y - y0 - c t)^2/(b t) ^2); eq2 = Equal[#, 0] & /@ (-2 dx0 (x - x0)/(a t)^2 - 2 dy0 (y - y0 - c t)/(b t)^2); sol = NSolve[#, {x, y}] & /@ (Transpose[{eq1, eq2}]); x1 = x /. sol; drop = Flatten@Position[Flatten[Differences /@ x1], x_ /; x == 0]; y1 = y /. sol; pos = Ordering[Abs[#], -1] & /@ x1; x2 = MapThread[Extract, {x1, pos}]; y2 = MapThread[Extract, {y1, pos}]; If[ drop != {}, y2[[drop]] = MapThread[Extract, {y1[[drop]], Ordering[Abs[#], -1] & /@ (Transpose@y1[[drop]])}] ]; {x2, y2} = Join[{#[[-2]]}, #, {#[[2]]}] & /@ {x2, y2} ] ]; Module[{a = 1, b = 2, c = 1, t0 = 1/100, t = 1/10, r0, phi, dphi = 2 [Pi]/50, front, fun, x1, y1, drop, pos, x2, y2}, phi = N@Range[-dphi, 2 [Pi] + dphi, dphi]; r0 = {a t0 Cos[phi], b t0 Sin[phi] + c t0}; fun = huygTemp[a, b, c, t0, t, #, dphi] &; front = Nest[fun, r0, 10] // Timing; {First@front, ListPlot[Transpose@Last@front]} ] === Subject: Re: How to import raw Comsol Multiphysics results into Mathematica Hi Alexi, You might try IMTEK. AKAIR, that has an interface to COMSOL. Dave. > -----Original Message----- === > Subject: How to import raw Comsol Multiphysics > results into Mathematica My question is on the boundary between COMSOL Multiphysics > and Mathematica. I am solving some partial differential equations using COMSOL > Multiphysics. The results are represented in a form of a 3D > graphs - such as z=z(x,y) - or their 2D cross-sections - such > as z=z(x,0). > I need however, not these graphs themselves, but I need them > post-processed, the post-processing being more complex that > is offered by the COMSOL. Such a post-processing on the other > hand may be easily done in Mathematica, if only I could have > the COMSOL data imported into it in a form of tables. Now comes my question: Could you give me a hint of how to export these data from > COMSOL in a form of tables (say, Excel table or .dat file > or whatever), so that I can then import them into Mathematica? > Or otherwise, would it be possible to directly import COMSOL > graphics into Mathematica? > Or import such a data from the FEMLAB (the predecessor of > COMSOL) into Mathematica? I have the 6.0 platform. > -- > Alexei Boulbitch, Dr., Habil. > Senior Scientist IEE S.A. > ZAE Weiergewan > 11, rue Edmond Reuter > L-5326 Contern > Luxembourg Phone: +352 2454 2566 > Fax: +352 2454 3566 Website: www.iee.lu This e-mail may contain trade secrets or privileged, > undisclosed or otherwise confidential information. If you are > not the intended recipient and have received this e-mail in > error, you are hereby notified that any review, copying or > distribution of it is strictly prohibited. Please inform us > immediately and destroy the original transmittal from your No virus found in this incoming message. > Checked by AVG - http://www.avg.com > Version: 8.0.176 / Virus Database: 270.10.5/1882 - Release > === Subject: How to import raw Comsol Multiphysics results into Mathematica My question is on the boundary between COMSOL Multiphysics and Mathematica. I am solving some partial differential equations using COMSOL Multiphysics. The results are represented in a form of a 3D graphs - such as z=z(x,y) - or their 2D cross-sections - such as z=z(x,0). I need however, not these graphs themselves, but I need them post-processed, the post-processing being more complex that is offered by the COMSOL. Such a post-processing on the other hand may be easily done in Mathematica, if only I could have the COMSOL data imported into it in a form of tables. Now comes my question: Could you give me a hint of how to export these data from COMSOL in a form of tables (say, Excel table or .dat file or whatever), so that I can then import them into Mathematica? Or otherwise, would it be possible to directly import COMSOL graphics into Mathematica? Or import such a data from the FEMLAB (the predecessor of COMSOL) into Mathematica? I have the 6.0 platform. -- Alexei Boulbitch, Dr., Habil. Senior Scientist IEE S.A. ZAE Weiergewan 11, rue Edmond Reuter L-5326 Contern Luxembourg Phone: +352 2454 2566 Fax: +352 2454 3566 Website: www.iee.lu === Subject: Re: Excel as a Front End for Mathematica? > I've heard that Excel can be used as a front end for Mathematica. I > have no idea how to do this. I would appreciate it if someone could > please enlighten me. > > > > Patrick (email: stpatryck@gmail.com) > > > I've never tried this product; but an interface exists between OpenOffice Calc and Mathematica: http://216.80.120.13/LauschkeConsulting//calclink.html They offer a trail version and you can download a reference manual, so it may be something to look into. As for Excel, Excel Link is a choice (I've never tried it either): http://www.wolfram.com/products/applications/excel_link/ You can download a copy of the manual. Chris === Subject: Re: Excel as a Front End for Mathematica? >I've heard that Excel can be used as a front end for Mathematica. I >have no idea how to do this. I would appreciate it if someone could >please enlighten me. Wolfram has a plug-in module for Excel that allows access to Mathematica functions. Details can be found at: === Subject: Translate Hello all! Could someone please explain what the difference is between a Graphics/ Graphics3D object and a GraphicsComplex object? Both seem to produce graphics, and yet translating objects, in the forms of Translate[object, {new coordinates}] only works with GraphicsComplex. Gideon === Subject: Re: Translate Hi Gidi, Graphics is the head of 2D graphics, Graphics3D that of 3D graphics. GraphicsComplex can be used inside 2 or 3D graphics to indicate points by integers for simplicity. Translate works for Graphics and Graphics3D as well, as the following examples show: Graphics[Translate[Circle[], {1, 1}], Axes -> True] Graphics3D[Translate[Sphere[], {1, 1, 1}], Axes -> True] hope this helps, Daniel > Hello all! Could someone please explain what the difference is between a Graphics/ > Graphics3D object and a GraphicsComplex object? Both seem to produce graphics, and yet translating objects, in the > forms of Translate[object, {new coordinates}] only works with > GraphicsComplex. > Gideon > === Subject: Re: Combining Plots with Different Ordinate Axes in Mathematica I came across a solution a long time ago, that I believe someone posted on the Mathematica Student forum. What I have follows, if anyone can provide the original reference, I'd appreciate it. ____________ Is there a way of making Mathematica include multiple x-or y-axes? It seems that when one combines several graphs,the axes are always adjusted accordingly. Remove[Global`*] << Statistics`ContinuousDistributions` mu = 2.; sigma = 4.; dist = NormalDistribution[mu, sigma] Plot[{PDF[dist, x], CDF[dist, x]}, {x, mu - 3 sigma, mu + 3 sigma}]; To put the plots on the same size scale,the PDF values will be scaled by scale = Round[CDF[dist, mu + 3 sigma]/PDF[dist, mu]] and the second y-axis will have its Ticks labeled accordingly.Simultaneously,the second y-axis will be scaled in standard deviations about the mean. red = RGBColor[1, 0, 0]; blue = RGBColor[0, 0, 1]; pdfTicks = Join[Table[{y, StyleForm[y/scale, FontColor -> red]}, {y, 0, 1, 0.2}], minorTicks = Table[{y, }, {y, 0.1, 0.9, 0.2}]]; cdfTicks = Join[Table[{y, StyleForm[y, FontColor -> blue]}, {y, 0, 1, 0.2}], minorTicks]; sigmaTicks = Join[{{mu - 3 sigma, [Mu]-3[Sigma]}, {mu - 2 sigma, [Mu]-2[Sigma]}, {mu - sigma, [Mu]-[Sigma]}, {mu, [Mu]}, {mu + sigma, [Mu]+[Sigma]}, {mu + 2 sigma, [Mu]+2[Sigma]}, {mu + 3 sigma, [Mu]+3[Sigma]}}, Table[{mu + k*sigma, }, {k, -2.5, 2.5}]]; Plot[{scale*PDF[dist, x], CDF[dist, x]}, {x, mu - 3.1 sigma, mu + 3.1 sigma}, ImageSize -> {420, 260}, PlotStyle -> {red, blue}, Axes -> False, Frame -> True, PlotLabel -> StyleForm[Normal Distributionn, FontWeight -> Bold, FontSize -> 12], FrameLabel -> {x, PDFn, None, CDF}, FrameTicks -> {Automatic, pdfTicks, sigmaTicks, cdfTicks}]; ____________________ This code comes from a very early version but the Automated Compatibility Tool should give you something workable. Good luck. === Subject: How to Display An Array of Vertex Colored Graphs Is there an 'easy' way to display an array of vertex colored graphs (e.g. for a 3-colored Cycle 4 graph) in Mathematica? It's easy to determine the chromatic number but not so obvious how to display the various coloring permutations as an array of graphs with the vertices colored accordingly. Any help appreciated. === Subject: Re: GroebnerBasis never finishes Daniel suggested that since I have only 5 polynomials can some of the 11 variables be regarded as parameters? Unfortunately I can't; this GroebnerBasis is being computed as part of another procedure. The input is automatically generated, so I have no chance of manually intervening in the variable set. I tried Jean-Marc Gulliet's suggestion of adding t to the variable set, and like he indicated, it did complete in around 1 second! This is something I can definitely do in my progam. If I do not specify any variables at all and do like this, GroebnerBasis[{2401*t1*t3 + 2401*t2*t3 - 2401*t3^2 - 245*t1*v2 - 245*t2*v2 + 490*t3*v2 - 25*v2^2, 4802*t1*t3 - 2401*t3^2 - 490*t1*v2 + 490*t3*v2 - 25*v2^2, -49*t*t3 + 49*t1*t3 + 5*t*v2 - 5*t1*v2, 10*H - 49*t3^2 - 49*t4^2 + 98*t4*t5 - 49*t5^2 - 10*t4*v2 + 10*t5*v2 - 10*w1, -10*H - 49*t3^2 - 49*t4^2 + 98*t4*t6 - 49*t6^2 + 10*t3*v2 - 10*t4*v2 + 10*t6*v2 - 10*w2}] I can still get a result in a couple of seconds. ------------------------ I guess for now, I will just add t to the variable set and move on. If any one could throw some other ideas, I will appreciate it. === Subject: About solution of complex system of DEs - to administrator -this is am using Mathematica 7 and It is solved successfully only if SolveDealyed is set to True .If it is set to False, i don't receive any solution. I would like to use different integration methods, especially Runge-Kutta 4 which is not active when SolveDealyed is set to True. What can i do in this case? Apply[Clear, Names[Global`*]]; A01 = {{Cos[q1[t]], -Sin[q1[t]], 0, 0}, {Sin[q1[t]], Cos[q1[t]], 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}; A12 = {{Cos[q2[t]], 0, Sin[q2[t]], 0}, {0, 1, 0, 0}, {-Sin[q2[t]], 0, Cos[q2[t]], L1}, {0, 0, 0, 1}}; A23 = {{Cos[q3[t]], 0, Sin[q3[t]], L2}, {0, 1, 0, 0}, {-Sin[q3[t]], 0, Cos[q3[t]], 0}, {0, 0, 0, 1}}; A34 = {{Cos[q4[t]], 0, Sin[q4[t]], L3}, {0, 1, 0, 0}, {-Sin[q4[t]], 0, Cos[q4[t]], 0}, {0, 0, 0, 1}}; A45 = {{Cos[q5[t]], -Sin[q5[t]], 0, 0}, {Sin[q5[t]], Cos[q5[t]], 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}; A02 = A01.A12; A03 = A01.A12.A23; A05 = A01.A12.A23.A34.A45; r22 = {L2/2, 0, L2/7, 1}; rB2 = {L2, 0, 0, 1}; r33 = {L3/2, 0, L3/7, 1}; rC3 = {L3, 0, 0, 1}; r55 = {L4, 0, 0, 1}; r20 = A02.r22; rB0 = A02.rB2; r30 = A03.r33; rC0 = A03.rC3; r50 = A05.r55; V20X = D[r20[[1]], t]; V20Y = D[r20[[2]], t]; V20Z = D[r20[[3]], t]; V20 = Sqrt[V20X^2 + V20Y^2 + V20Z^2]; V30X = D[r30[[1]], t]; V30Y = D[r30[[2]], t]; V30Z = D[r30[[3]], t]; V30 = Sqrt[V30X^2 + V30Y^2 + V30Z^2]; V50X = D[r50[[1]], t]; V50Y = D[r50[[2]], t]; V50Z = D[r50[[3]], t]; V50 = Sqrt[V50X^2 + V50Y^2 + V50Z^2]; Omega011 = {0, 0, q1'[t], 0}; Omega122 = {0, q2'[t], 0, 0}; Omega233 = {0, q3'[t], 0, 0}; Omega010 = A01.Omega011; Omega120 = A02.Omega122; Omega230 = A03.Omega233; OmegaA010 = Omega010; OmegaA120 = Omega010 + Omega120; OmegaA230 = Omega120 + Omega230; OmegaA011 = Inverse[A01].OmegaA010; OmegaA122 = Inverse[A02].OmegaA120; OmegaA233 = Inverse[A03].OmegaA230; !(* TagBox[ RowBox[{ TagBox[ RowBox[{J1, =, RowBox[{(, , GridBox[{ {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, J1zz, 0}, {0, 0, 0, 0} }], , )}]}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]], ;, RowBox[{J2, =, RowBox[{(, , GridBox[{ {J2xx, J2yx, J2zx, 0}, {J2xy, J2yy, J2zy, 0}, {J2xz, J2yz, J2zz, 0}, {0, 0, 0, 0} }], , )}]}]}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]); !(* TagBox[ RowBox[{J3, =, RowBox[{(, , GridBox[{ {J3xx, J3yx, J3zx, 0}, {J3xy, J3yy, J3zy, 0}, {J3xz, J3yz, J3zz, 0}, {0, 0, 0, 0} }], , )}]}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]); J1zz = 0.92; J2xx = 2.04; J2yy = 34.8; J2zz = 34.4; J2xy = J2yx = 0; J2xz = J2zx = 0.13; J2yz = J2zy = 0; J3xx = 0.43; J3yy = 39.6; J3zz = 39.6; J3xy = J3yx = 0; J3xz = J3zx = 0.15; J3yz = J3zy = 0; Mtheta2 = Fhc*H1*H2* Sin[q2[t] + 1.46]/Sqrt[H1^2 + H2^2 - 2*H1*H2*Cos[q2[t] + 1.46]]; KR = 1/2*OmegaA011.J1.OmegaA011 + 1/2*OmegaA122.J2.OmegaA122 + 1/2*OmegaA233.J3.OmegaA233; KT = 1/2*m2*V20^2 + 1/2*m3*V30^2 + 1/2*m5*V50^2; K = KT + KR; P = m2*g*r20[[3]] + m3*g*r30[[3]] + m5*g*r50[[3]] + c1*(q1[t]^2)/2 + c2*(-q2[t] + q2n)^2/2 + c3*(-q3[t] + q3n)^2/2; F = K - P; eq1 = D[D[F, q1'[t]], t] - D[F, q1[t]] + b1*q1'[t]; eq2 = D[D[F, q2'[t]], t] - D[F, q2[t]] + b2*q2'[t]; eq3 = D[D[F, q3'[t]], t] - D[F, q3[t]] + b3*q3'[t]; eq4 = D[D[F, q4'[t]], t] - D[F, q4[t]]; eq5 = D[D[F, q5'[t]], t] - D[F, q5[t]]; H1 = 1.725; H2 = 0.53; Fhc = 42500; Te = 10; m2 = 120.; m3 = 35.; m5 = 300; L1 = 0.6; L2 = 1.7; L3 = 1.65; L4 = 2; g = 9.81; c1 = 1.2*10^6; c2 = 1.2*10^6; c3 = 1.2*10^6; b1 = 1.4*10^5; b2 = 1.4*10^5; b3 = 1.4*10^5; q2n = -40*Pi/180; q3n = 60*Pi/180; ShowStatus[status_] := LinkWrite[$ParentLink, SetNotebookStatusLine[FrontEnd`EvaluationNotebook[], ToString[status]]]; Timing[sol = NDSolve[{eq1 == 0, eq2 == 0, eq3 == 0, eq4 == 0, eq5 == 0, q1[0] == 0., q2[0] == q2n, q3[0] == q3n, q4[0] == Pi/3 - q2n - q3n, q5[0] == 1, q1'[0] == 0., q2'[0] == 0., q3'[0] == 0, q4'[0] == 0, q5'[0] == 0}, {q1, q2, q3, q4, q5}, {t, 0, Te}, SolveDelayed -> True, StepMonitor :> ShowStatus[t]]]; {Plot[Evaluate[q1[t]] /. sol, {t, 0, Te}, AxesLabel -> {t, q1}], Plot[Evaluate[q1'[t]] /. sol, {t, 0, Te}, AxesLabel -> {t, q1'}], Plot[Evaluate[q1''[t]] /. sol, {t, 0, Te}, AxesLabel -> {t, q1''}]} === Subject: Experimental Mathematics Book All: Several of you expressed interest in the book I brought along to this morning's Mathematica SIG meeting. Here's the info from Amazon: Title: The Computer as Crucible: An Introduction to Experimental Mathematics (Paperback) Authors: Jonathan Borwein (Author), Keith Devlin (Author) Price: $23.96 Description: Keith Devlin and Jonathan Borwein, two well-known mathematicians with expertise in different mathematical specialties but with a common interest in experimentation in mathematics, have joined forces to create this introduction to experimental mathematics. They cover a variety of topics and examples to give the reader a good sense of the current state of play in the rapidly growing new field of experimental mathematics. The writing is clear and the explanations are enhanced by relevant historical facts and stories of mathematicians and their encounters with the field over time. About the Authors: Jonathan Borwein received his PhD from Oxford University as a Rhodes Scholar and is a professor of mathematics and computer science at Dalhousie University in Canada. He is the author of seminal works in the growing field of experimental mathematics, including Mathematics by Experiment and Experimental Mathematics in Action . Joe === Subject: Experimental Mathematics -- The Journal All: Given the interest in and comments about experimental mathematics, surfaced during this morning's meeting, I'd like to offer all of you a link to the journal Experimental Mathematics: http://www.expmath.org/ . Experimental Mathematics publishes original papers featuring formal results inspired by experimentation, conjectures suggested by experiments, and data supporting significant hypotheses. Experiment has always been, and increasingly is, an important method of mathematical discovery. (Gauss declared that his way of arriving at mathematical truths was through systematic experimentation.) Yet this tends to be concealed by the tradition of presenting only elegant, fully developed, and rigorous results. Experimental Mathematics was founded in the belief that theory and experiment feed on each other, and that the mathematical community stands to benefit from a more complete exposure to the experimental process. The early sharing of insights increases the possibility that they will lead to theorems: An interesting conjecture is often formulated by a researcher who lacks the techniques to formalize a proof, while those who have the techniques at their fingertips have been looking elsewhere. Even when the person who had the initial insight goes on to find a proof, a discussion of the heuristic process can be of help, or at least of interest, to other researchers. There is value not only in the discovery itself, but also in the road that leads to it. Enjoy! Joe === Subject: Re: Plot in Background of Manipulate The following is a solution using the Presentations package. I hardly ever use Manipulate to make dynamic displays. It is too baroque and it is much easier to format and construct a presentation directly. You did not give actual information about his data and model so here I have used a rather simple example of matching a variable Sin curve to one that is randomly generated. Needs[Presentations`Master`] Module[ {amplitude = 1, phase = 0, ampexp = RandomReal[{-5, 5}], phaseexp = RandomReal[{0, 2 [Pi]}]}, panelpage[ pagelet[ phrase[Amplitude: , Slider[Dynamic[amplitude], {0, 4}], Spacer[10], InputField[Dynamic[amplitude], FieldSize -> {5, 1}]], phrase[Phase: , Slider[Dynamic[phase], {0, 2 [Pi]}], Spacer[10], InputField[Dynamic[phase], FieldSize -> {5, 1}]], Draw2D[ {(* Experimental curve *) Gray, Draw[ampexp Sin[t + phaseexp], {t, 0, 2 [Pi]}], (* Adjustable theoretical curve *) Black, Dynamic@Draw[amplitude Sin[t + phase], {t, 0, 2 [Pi]}]}, AspectRatio -> 1, PlotRange -> {{-.1, 2 [Pi] + .1}, {-6.1, 6.1}}, Frame -> True, ImageSize -> 400] ](* pagelet *), Style[Dynamic Matching of Experimental Curve, 16] ](* panelpage *) ] The gray curve is the hypothetical experimental curve, generated randomly each time the input is evaluated. The sliders can be used to adjust the black theoretical curve to the experimental curve. Peter Lindsay at the Mathematical Institute in the University of St Andrews [ www.mcs.st-and.ac.uk ] has kindly undertaken to maintain an archive that provides downloadable notebooks and PDF files for various Presentations solutions that have appeared on MathGroup. http://blackbook.mcs.st-and.ac.uk/~Peter/djmpark/html/ David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ If someone could please help with the following, I would really appreciate. I am plotting of some logarithmic scattering curves based on theoretical modes and am using manipulate to change a few paramaters. In the same notebook, I have plotted experimental results using ListLogLogPlot (on the exact same scale as I have using the manipulate command). I would like to have my experimental plots, plotted in the background of the manipulate window, so that I can adjust the parameters in manipulate to the point that my theoretical curve matches my experimental curve. So far I have only been able to plot the experimental plots side by side with the manipulate generated plots by simply making each plot an elements of a list. How do I combine them? Mike === Subject: Plot in Background of Manipulate If someone could please help with the following, I would really appreciate. I am plotting of some logarithmic scattering curves based on theoretical modes and am using manipulate to change a few paramaters. In the same notebook, I have plotted experimental results using ListLogLogPlot (on the exact same scale as I have using the manipulate command). I would like to have my experimental plots, plotted in the background of the manipulate window, so that I can adjust the parameters in manipulate to the point that my theoretical curve matches my experimental curve. So far I have only been able to plot the experimental plots side by side with the manipulate generated plots by simply making each plot an elements of a list. How do I combine them? Mike === Subject: Re: Experimental Mathematics -- The Journal All: I just realized that this is a subscription journal, and not a freely available electronic journal. Sorry about that! But having said that, if you or your home institution have online access to Project Euclid, then you'll find that the journal is available there. Joe All: Given the interest in and comments about experimental mathematics, surfaced during this morning's meeting, I'd like to offer all of you a link to the journal Experimental Mathematics: http://www.expmath.org/ . Experimental Mathematics publishes original papers featuring formal results inspired by experimentation, conjectures suggested by experiments, and data supporting significant hypotheses. Experiment has always been, and increasingly is, an important method of mathematical discovery. (Gauss declared that his way of arriving at mathematical truths was through systematic experimentation.) Yet this tends to be concealed by the tradition of presenting only elegant, fully developed, and rigorous results. Experimental Mathematics was founded in the belief that theory and experiment feed on each other, and that the mathematical community stands to benefit from a more complete exposure to the experimental process. The early sharing of insights increases the possibility that they will lead to theorems: An interesting conjecture is often formulated by a researcher who lacks the techniques to formalize a proof, while those who have the techniques at their fingertips have been looking elsewhere. Even when the person who had the initial insight goes on to find a proof, a discussion of the heuristic process can be of help, or at least of interest, to other researchers. There is value not only in the discovery itself, but also in the road that leads to it. Enjoy! Joe === Subject: Re: MeijerG If you plot the function for various values of c it appears that the Mathematica result is correct... ...or at elaast self-consistent... -_David > Can I trust the following result? > > In[29]:= Limit[-Log[x^2] - > Sqrt[Pi]*MeijerG[{{0}, {}}, {{0, 0}, {1/2}}, x^2/(4*c)], x -> 0] > (*c>0*) > > Out[29]= 2*EulerGamma + Log[1/c] > > Another well known CAS gave > >limit(-ln(x^2)-sqrt(Pi)*MeijerG([[0], []],[[0, 0], [1/2]],1/4*x^2/c),x = = 0); > infinity > > Dimitris === Subject: Re: MeijerG > Can I trust the following result? > > In[29]:= Limit[-Log[x^2] - > Sqrt[Pi]*MeijerG[{{0}, {}}, {{0, 0}, {1/2}}, x^2/(4*c)], x -> 0] > (*c>0*) > > Out[29]= 2*EulerGamma + Log[1/c] > > Another well known CAS gave > >limit(-ln(x^2)-sqrt(Pi)*MeijerG([[0], []],[[0, 0], [1/2]],1/4*x^2/c),x = = 0); > infinity > > Dimitris Dimitris === Subject: Re: MeijerG > Can I trust the following result? > > In[29]:= Limit[-Log[x^2] - > Sqrt[Pi]*MeijerG[{{0}, {}}, {{0, 0}, {1/2}}, x^2/(4*c)], x -> 0] > (*c>0*) > > Out[29]= 2*EulerGamma + Log[1/c] > > Another well known CAS gave > >>limit(-ln(x^2)-sqrt(Pi)*MeijerG([[0], []],[[0, 0], [1/2]],1/4*x^2/c),x = 0); > >> infinity > Trust the result. You can plot the function around x=0 (with c for example equal to 1) with other well-known CAS. Fabian === Subject: Re: MeijerG Dimitris , it appears that the other well known CAS should be put in the hazardous materials bin :-) It's no wonder many astronauts bring Mathematica (not the other well known CAS) on the ISS You can check the limit in various ways: Using Manipulate[ Plot[-Log[x^2] - Sqrt[Pi]*MeijerG[{{0}, {}}, {{0, 0}, {1/2}}, x^2/(4*c)] - 2 EulerGamma - Log[1/c], {x, 1/10^10, 1/10^9}], {c, 1/10, 2}] you can see that the difference between the function near 0 and the Mathematica limit is within the 10^-15 range of numerical accuracy You can also check for example with c-> 1/2 that In[16]:= Limit[-Log[x^2] - Sqrt[Pi]*MeijerG[{{0}, {}}, {{0, 0}, {1/2}}, x^2/(4*1/2)], x -> 1/10^10] (*c>0*) Out[16]= 2 Log[10000000000] - Sqrt[[Pi]] MeijerG[{{0}, {}}, {{0, 0}, {1/2}}, 1/200000000000000000000] In[17]:= % // N Out[17]= 1.84758 and that In[10]:= 2 EulerGamma + Log[1/(1/2)] // N Out[10]= 1.84758 You can also simply plot the function and see that it is continuous and finite near 0 and not going to infinity Check or plot with the other CAS the numerical values of the function near 0, say at 1/10^5 and see if it increases. the value should stabilize pretty soon. hth === Subject: Re: MeijerG Hi Dimitris, simply try it out numerically. E.g. setting c->1 you can use NLimit. This is in agreement with Limit. Therefore, it is certainly not Infinity. Or you could numerically calculate the value for different x and c. This also agrees well with the solution from Limit. Daniel > Can I trust the following result? In[29]:= Limit[-Log[x^2] - > Sqrt[Pi]*MeijerG[{{0}, {}}, {{0, 0}, {1/2}}, x^2/(4*c)], x -> 0] > (*c>0*) Out[29]= 2*EulerGamma + Log[1/c] Another well known CAS gave > >> limit(-ln(x^2)-sqrt(Pi)*MeijerG([[0], []],[[0, 0], [1/2]],1/4*x^2/c),x = 0); > >> infinity > Dimitris > === Subject: bug in LinearProgramming? Here is a simple linear programming problem: c = {1, 1}; m = {{1, 0}, {1, -2}, {-1, 1}}; b = {{1, 0}, {0, 1}, {0, 1}}; lu = {{0, 1}, {0, 1}}; d = {Reals, Reals}; sol = LinearProgramming[c, m, b, lu, d] Mathematica 6 returns: LinearProgramming::lpsnf : No solution can be found that satisfies the constraints. which is obviously correct. But if I change the domain of the second variable, d = {Reals, Integers}; then Mathematica gives the solution sol = {1., 1}. The problem is that m.sol = {1., -1., 0.} violates the bound vector b (second component should be greater than 0). Is there a bug, or am I getting the syntax wrong? Veit Elser === Subject: Re: Keeping plot annotations after regenerating a plot Sjoerd, As appealing as the drawing tools may seem, I must disagree that they are a solution to producing professional custom graphics and displays. My reason for saying this is that they do not provide a precise written description of the graphics, which can then be modified. The drawing tools might be suitable for quick sketches but I don't believe they are suitable for graphics that undergo a process of development and modification. What happened is that you found the problem with using drawing tools, and then found a fix and way around it. But how many times might a custom plot need to be modified in the process of development? How many times will it be necessary to go through the fix? Does this work with dynamics, or within a Manipulate statement? (I don't actually know.) It is much better to have a SINGLE explicit specification statement for a generated graphic, or combined dynamic graphic and page display. Making a good custom graphic generally takes a fair amount of work because there is much detail to specify. The Presentations package makes it much easier to construct custom graphics, and now also dynamic page displays combining graphics with other expressions. One can just specify one thing after another, with primitives from any of the standard plot types. I just finished a dynamic presentation that contains movable line segments, step by step construction of a geometric diagram with checkboxes, several sliders built intoa textual display, an action button, a graduated ruler that can be moved. The calculations for the last operation are time consuming in a dynamic display and are triggered only when the ruler is moved. The entire presentation took several days to develop and ended up much longer and different than the initial design. Trying to do this with drawing tools or within a Manipulate statement would have been extremely difficult, and frustrating - if it was even possible. Developing professional displays takes a lot of work because of all the essential detail. Working without explicit written specifications, or trying to twist something like the baroque Manipulate statement to specific needs is simply impossible. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ I really like the possibility to manually add graphics and text to a plot using the Mathematica 6/7 drawing tools palette. It's often much quicker than having to program them. However, more often than not, just after I finish making those annotations I discover that I used the wrong parameter value for the plotted model or want larger axes label fonts or so. Problem is, when I regenerate the plot I'll erase my own annotations and I have to redo them. I found some sort of solution that I'd like to share. Perhaps you folks know of a better solution? * Assign your first plot with annotations to a variable, say y. * Re-generate the first plot (without annotations) and with essential font change; call it x * Execute: x[[1]] = {x[[1]], y[[1, 2 ;; -1]]}; and x now has your old annotations. Seems to work for most 2D plots. I tried Plot, ListPlot, DensityPlot and ContourPlot and a few of their options. Not sure whether it is really robust. === Subject: Keeping plot annotations after regenerating a plot I really like the possibility to manually add graphics and text to a plot using the Mathematica 6/7 drawing tools palette. It's often much quicker than having to program them. However, more often than not, just after I finish making those annotations I discover that I used the wrong parameter value for the plotted model or want larger axes label fonts or so. Problem is, when I regenerate the plot I'll erase my own annotations and I have to redo them. I found some sort of solution that I'd like to share. Perhaps you folks know of a better solution? * Assign your first plot with annotations to a variable, say y. * Re-generate the first plot (without annotations) and with essential font change; call it x * Execute: x[[1]] = {x[[1]], y[[1, 2 ;; -1]]}; and x now has your old annotations. Seems to work for most 2D plots. I tried Plot, ListPlot, DensityPlot and ContourPlot and a few of their options. Not sure whether it is really robust. === Subject: Re: The use of Piecewise function M[x_] := Piecewise[{{Subscript[V, A] x, 0 <= x < b}, {Subscript[V, A] x - P (x - b), b <= x <= a + b}}]; soln = y[x] /. DSolve[{y''[x] == M[x], y[a + b] == 0, y'[a + b] == 0}, y[x], x][[1]]; Y[x_] = FullSimplify[PiecewiseExpand[soln], {a >= 0, b > 0, x >= 0}] Piecewise[{{(1/6)*(Subscript[V, A]*(a + b - x)^2*(2*(a + b) + x) - P*(a + b)*(2*a^2 + a*(b - 3*x) - b*(b - 3*x))), b > x}, {(1/6)*(a + b - x)^2*(Subscript[V, A]*(2*(a + b) + x) + P*(-(2*a) + b - x)), a + b >= x && b <= x}}, (1/6)*(a + b)*(P*(-(2*a^2) - a*b + 3*a*x + b^2 - 3*b*x) + (a + b)*Subscript[V, A]*(2*(a + b) - 3*x))] Bob Hanlon Hi all, How can I to use the Piecewise function for symbolic calculations. For example, let the equation of ellastic line of a beam In[]: M[x_]:=Piecewise[{{Subscript[V, A]x,0<=x=0[And]-a>0 1/4 (2 b (a+b)^2-1/3 b (3 a^2+6 b a+2 b^2)) P -a<=0 + etc, etc I have proved with Assumptions, Assuming, but it does'nt work. === Subject: Re: Problem in Dot Product of 4x4 Matrices with Transcendental thank you all, for spending your time on my question and helping me :) === Subject: Automatic Numbering in Mathematica Is there any kind of user control over how the automatic numbering in Mathematica works? For example I figured out how to set a cell to have a formula auto numbered, however I couldn't figure out how to tweak whats actually displayed there - for instance I'd like to prepend the section number and replace the default brackets with square ones: default in Mathematica (1) (2) ... etc I'd like: [4.1] [4.2a] [4.2b] [4.3] ... etc === Subject: Solving nonlinear coupled differential equations in Mathematica 7.0 Here is a set of equations I would like to solve y''[x]==y+z'[x] z[x]^3=y'[x]+3 With boundary conditions of y[1]==2 and y[0]==3 Using NDSolve on these equations, Mathematica says the order of the equations is 3 and it has only 2 initial conditions. But the order of this system of equations is 2 as far as I see (since order is defined as the highest derivative) When I do try to put another boundary condition in like z[0]==0 Mathematica spits out that it cant solve for the derivatives and is using a mass matrix method (error:ntdvmm) and then it says that it has significant errors (error:berr) and will return the best solution found. Any help on this matter will be greatly appreciated. === Subject: Re: Components of InterpolatingFunction it may help to look up tutorial/NDSolvePackages in the Documentation Center. John Jowett > How does one see (print, display) the piecewise polynomials that are > inside an InterpolatingFunction object? I.e. both the domains and the > polynomials themselves that InterpolatingFunction is broken into. > > === Subject: Re: Components of InterpolatingFunction Hi Scott, You can use FullForm. Generally, you'll see a bunch of points. > How does one see (print, display) the piecewise polynomials that are > inside an InterpolatingFunction object? I.e. both the domains and the > polynomials themselves that InterpolatingFunction is broken into. > > === Subject: Re: Components of InterpolatingFunction Try: InputForm[FunctionInterpolation[Sin[x], {x, 0, 2 Pi}]] > How does one see (print, display) the piecewise polynomials that are > inside an InterpolatingFunction object? I.e. both the domains and the > polynomials themselves that InterpolatingFunction is broken into. > > > > === Subject: Problems using MathLink I'm trying to write a subroutine in C++ that passes a rotation matrix to Mathematica through MathLink. The code compiles fine, but when I try to run the compiled program, I get a segfault at the point in the program where the subroutine is called. As far as I can tell, the fault occurs whenever the program calls MLPutRealArray or MLPutReal32Array. Here is my code for the subroutine: void rot(MLINK link, double theta) { char **heads, **HEAD; heads = new char*[3]; heads[0] = List; heads[1] = List; heads[2] = List; double a[3][3], *b; a[0][0] = cos(theta); a[0][1] = sin(theta); a[0][2] = 0; a[1][0] = - sin(theta); a[1][1] = cos(theta); a[1][2] = 0; a[2][0] = 0; a[2][1] = 0; a[2][2] = 1; long *dims, *D, depth; dims = new long[3]; dims[0] = 3; dims[1] = 3; dims[2] = 3; MLPutRealArray(link, *a, dims, heads, 3); } Is there something in this code that I'm missing that causes the fault? Or is this a but in the ml32i3.dll file? Yours, Johnathan Yik === Subject: Re: Problems using MathLink > > I'm trying to write a subroutine in C++ that passes a rotation matrix to > Mathematica through MathLink. The code compiles fine, but when I try t= o run > the compiled program, I get a segfault at the point in the program where = the > subroutine is called. As far as I can tell, the fault occurs whenever = the > program calls MLPutRealArray or MLPutReal32Array. > > Here is my code for the subroutine: > > void rot(MLINK link, double theta) > { > char **heads, **HEAD; > heads = new char*[3]; > heads[0] = List; > heads[1] = List; > heads[2] = List; > double a[3][3], *b; > a[0][0] = cos(theta); > a[0][1] = sin(theta); > a[0][2] = 0; > a[1][0] = - sin(theta); > a[1][1] = cos(theta); > a[1][2] = 0; > a[2][0] = 0; > a[2][1] = 0; > a[2][2] = 1; > long *dims, *D, depth; > dims = new long[3]; > dims[0] = 3; > dims[1] = 3; > dims[2] = 3; > MLPutRealArray(link, *a, dims, heads, 3); > > } > > Is there something in this code that I'm missing that causes the fault? = Or > is this a but in the ml32i3.dll file? You have a 2-dimensional (3x3) array of real numbers, yet you're telling MathLink that you have a 3-dimensional (3x3x3) array of real numbers. MathLink attempts to read 27 real numbers when you only have 9 allocated and the program crashes. -Rob === Subject: Re: Plot in Background of Manipulate to add a bit to what David Park has written, I often use a simple approach like that you are looking for. But I do this not in order to fit experiment, but to fit a theoretical result which admits only numeric calculation, but which I need to use later in further analytical transformations. Find the example below. It is straightforward to apply the same approach to fit your experimental data, if you have an idea, of what the fitting function should look like. (* This is the data to be fitted and its plot *) dataToBeFitted = Table[{z, NIntegrate[x^z*Exp[-z*x^2], {x, 0, 2}]}, {z, 0, 2, 0.1}]; plotOfDataToBeFitted = ListPlot[expdata, PlotStyle -> {Red, PointSize[0.015]}]; (* This is a necessary plot of the fitting function manipulated by 3 parameters *) (* a, b and c with the data to be fitted on the background. Try this *) Manipulate[ Show[{plotOfDataToBeFitted, Plot[(a + b*Exp[-x^c]), {x, 0, 2}]}], {{a, -1.8}, -3, 3}, {{b, 6.3}, 0, 10}, {{c, 0.3}, 0.1, 3}] (* End of the example *) Like this I find sometimes pretty good analytic approximations to functions obtainable only in a numeric form. Good luck, :-) , Alexei The following is a solution using the Presentations package. I hardly ever use Manipulate to make dynamic displays. It is too baroque and it is much easier to format and construct a presentation directly. You did not give actual information about his data and model so here I have used a rather simple example of matching a variable Sin curve to one that is randomly generated. Needs[Presentations`Master`] Module[ {amplitude = 1, phase = 0, ampexp = RandomReal[{-5, 5}], phaseexp = RandomReal[{0, 2 [Pi]}]}, panelpage[ pagelet[ phrase[Amplitude: , Slider[Dynamic[amplitude], {0, 4}], Spacer[10], InputField[Dynamic[amplitude], FieldSize -> {5, 1}]], phrase[Phase: , Slider[Dynamic[phase], {0, 2 [Pi]}], Spacer[10], InputField[Dynamic[phase], FieldSize -> {5, 1}]], Draw2D[ {(* Experimental curve *) Gray, Draw[ampexp Sin[t + phaseexp], {t, 0, 2 [Pi]}], (* Adjustable theoretical curve *) Black, Dynamic@Draw[amplitude Sin[t + phase], {t, 0, 2 [Pi]}]}, AspectRatio -> 1, PlotRange -> {{-.1, 2 [Pi] + .1}, {-6.1, 6.1}}, Frame -> True, ImageSize -> 400] ](* pagelet *), Style[Dynamic Matching of Experimental Curve, 16] ](* panelpage *) ] The gray curve is the hypothetical experimental curve, generated randomly each time the input is evaluated. The sliders can be used to adjust the black theoretical curve to the experimental curve. Peter Lindsay at the Mathematical Institute in the University of St Andrews [ www.mcs.st-and.ac.uk ] has kindly undertaken to maintain an archive that provides downloadable notebooks and PDF files for various Presentations solutions that have appeared on MathGroup. http://blackbook.mcs.st-and.ac.uk/~Peter/djmpark/html/ David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ If someone could please help with the following, I would really appreciate. I am plotting of some logarithmic scattering curves based on theoretical modes and am using manipulate to change a few paramaters. In the same notebook, I have plotted experimental results using ListLogLogPlot (on the exact same scale as I have using the manipulate command). I would like to have my experimental plots, plotted in the background of the manipulate window, so that I can adjust the parameters in manipulate to the point that my theoretical curve matches my experimental curve. So far I have only been able to plot the experimental plots side by side with the manipulate generated plots by simply making each plot an elements of a list. How do I combine them? Mike -- Alexei Boulbitch, Dr., Habil. Senior Scientist IEE S.A. ZAE Weiergewan 11, rue Edmond Reuter L-5326 Contern Luxembourg Phone: +352 2454 2566 Fax: +352 2454 3566 Website: www.iee.lu === Subject: solving nonlinear integral equations numerically with mathematica? is it possible to solve nonlinear integral equations numerically with mathematica? i'm trying to solve the following integral equation for the function p[x]: (1 + x^2/5)^(-5) Exp[ArcTan[x]] == p[x] Integrate[p[s] Exp[.5 x s], {s, -Infinity, Infinity}] note this integral equation is nonlinear, ie. not of fredholm or volterra type, due to multiplicative p[x] in front of the integral. i've looked around the documentation for dsolve, ndsolve, ..., but i couln't find any mention of integral equations in the mathematica documentation. searching this list didn't yield much either. any ideas/suggestions? Mitch === Subject: Re: Web question My understanding is that these features will be part of webMathematica V3. So far as I know, no release data for this product is announced. I'd be very pleased if others in this forum have a better answer. > I'm fairly familiar with the basics of Mathematica 7 and I've created = > several notebooks that contain manipuations. I'd like to get these up on = > my website so students can actually move the sliders and so on. How do I = > do this? > > S Jonak > Maintain an even strain. > NOTICE TO RECIPIENTS: This e-mail, together with any attachments, is = > intended for the named recipient(s) only. If you have received this = > e-mail by mistake, inform the sender immediately and delete and destroy = > the message and any copies of this message from your computer system = > network. > This e-mail may contain information which is confidential, of a private = > nature which is subject to legal professional privilege or copyright. = > Accordingly, any form of disclosure, modification, distribution and/or = > publication of this email message is prohibited. > > === Subject: Web question I'm fairly familiar with the basics of Mathematica 7 and I've created = several notebooks that contain manipuations. I'd like to get these up on = my website so students can actually move the sliders and so on. How do I = do this? S Jonak Maintain an even strain. NOTICE TO RECIPIENTS: This e-mail, together with any attachments, is = intended for the named recipient(s) only. If you have received this = e-mail by mistake, inform the sender immediately and delete and destroy = the message and any copies of this message from your computer system = network. This e-mail may contain information which is confidential, of a private = nature which is subject to legal professional privilege or copyright. = Accordingly, any form of disclosure, modification, distribution and/or = publication of this email message is prohibited. === Subject: Re: Need to calculate daily risk free rate from Fed data > The St. Louis Federal Reserve makes a great set of data available for financial analysis at their FRED (Federal Reserve Economic Data) site at http://research.stlouisfed.org/fred2/. > > I've downloaded treasury bill rates from 1984 to the present (they have lots of rates available at: http://research.stlouisfed.org/fred2/categories/116). > > The data set gives me the yearly interest rate on 3-Month T-Bills for each day i.e: > > 1984-12-31, 0.008120 > 1985-01-01, 0.008120 > 1985-01-02, 0.008100 > 1985-01-03, 0.008070 > 1985-01-04, 0.008080 > 1985-01-07, 0.008060 > 1985-01-08, 0.008060 > 1985-01-09, 0.007950 > .. > 2008-12-30, 0.000100 > 2008-12-31, 0.000110 > 2009-01-01, 0.000110 > 2009-01-02, 0.000080 > 2009-01-05, 0.000140 > 2009-01-06, 0.000140 > > I need to calculate the daily risk free rate for each interval in the data set based on the yearly rate give for each day. > > I've gotten as far as this: > > 1 + yearlyRate == (1 + dailyRate)^360 > > Does this make sense? > If so, how do I implement this in Mathematica? > If not, how would I do it? > > A couple of related questions: > > Can one use FinancialData[] to access Treasury or Libor rate information or access a risk free rate directly? > > Thx. > > > This may point you in the right direction: INPUT: data = Flatten[Take[Import[http://research.stlouisfed.org/fred2/data/DTB3.txt, Table], -1]] rate = Last[data] OUTPUT: {2009-01-07, 0.11} <- from the downloaded text file {2009, 1, 7, 0, 0, 0} <- the date portion converted to Mathematica's internal time format 0.11 <- the rate Not sure if that is the rate you're looking for, but you should be able to get whatever you need somewhere. It would be faster if you download the text file and save it locally if you're going to need multiple table values. Chris === Subject: Re: Need to calculate daily risk free rate from Fed data It is not entirely clear to me whether you are asking a finance question, a math question, or a Mathematica question. I will try to address all three. Your use of the 360 day convention is correct for Treasury bills, so you can convert a single yearly rate by solving the equation you posted in your original question. No need to use Mathematica for that; it's rudimentary. dailyrate = (1+yearlyrate)^(1/360) - 1 in Mathematica terms, you might express this as a function, which would look like this: yearlyToDailyrate[yearlyrate_] := (1 + yearlyrate)^(1/360) - 1 If your risk free data is in the format {{date1,yearlyRate1},{date2,yearlyRate2}....{dateN,yearlyRateN}}, as would be natural, you can convert the entire list by using the Map command together with the conversion above. Assuming your starting datalist has the name yearlyRiskFreeSeries, dailyRiskFreeSeries =Map[{#[[1]], yearlyToDailyrate [#[[2]]]}&, yearlyRiskFreeSeries] If you choose some risk free series other than the three month T-bill, check the date convention. Many do not use the 360 day convention, and you should adjust your math as needed. Sorry, I have no advice on FinancialData[]; I pull my risk free rates from Bloomberg, and generally use LIBOR rather than bills, though it changes depending on the instrument I'm working with. [For anybody else out there using Bloomberg, I have an application that can be called directly from Mathematica to import any Bloomberg data series. It saves a lot of time.] Michael Stern > The St. Louis Federal Reserve makes a great set of data available for > financial analysis at their FRED (Federal Reserve Economic Data) site at > http://research.stlouisfed.org/fred2/. > > I've downloaded treasury bill rates from 1984 to the present (they have > lots of rates available at: > http://research.stlouisfed.org/fred2/categories/116). > > The data set gives me the yearly interest rate on 3-Month T-Bills for each > day i.e: > > 1984-12-31, 0.008120 > 1985-01-01, 0.008120 > 1985-01-02, 0.008100 > 1985-01-03, 0.008070 > 1985-01-04, 0.008080 > 1985-01-07, 0.008060 > 1985-01-08, 0.008060 > 1985-01-09, 0.007950 > .. > 2008-12-30, 0.000100 > 2008-12-31, 0.000110 > 2009-01-01, 0.000110 > 2009-01-02, 0.000080 > 2009-01-05, 0.000140 > 2009-01-06, 0.000140 > > I need to calculate the daily risk free rate for each interval in the data > set based on the yearly rate give for each day. > > I've gotten as far as this: > > 1 + yearlyRate == (1 + dailyRate)^360 > > Does this make sense? > If so, how do I implement this in Mathematica? > If not, how would I do it? > > A couple of related questions: > > Can one use FinancialData[] to access Treasury or Libor rate information or > access a risk free rate directly? > > Thx. > === Subject: Re: Need to calculate daily risk free rate from Fed data Module[{dr, days}, dr /. FindRoot[1 + yearlyRate == (1 + dr)^days, {dr, yearlyRate/366}][[1]]] year defaults to current year dailyRate[0.008120] 0.000022157 For the same yearly rate, the daily rate during a leap year would be slightly lower since there is an additional day to arrive at the same yearly rate dailyRate[0.008120, 2008] 0.0000220964 Bob Hanlon The St. Louis Federal Reserve makes a great set of data available for financial analysis at their FRED (Federal Reserve Economic Data) site at http://research.stlouisfed.org/fred2/. I've downloaded treasury bill rates from 1984 to the present (they have lots of rates available at: http://research.stlouisfed.org/fred2/categories/116). The data set gives me the yearly interest rate on 3-Month T-Bills for each day i.e: 1984-12-31, 0.008120 1985-01-01, 0.008120 1985-01-02, 0.008100 1985-01-03, 0.008070 1985-01-04, 0.008080 1985-01-07, 0.008060 1985-01-08, 0.008060 1985-01-09, 0.007950 .. 2008-12-30, 0.000100 2008-12-31, 0.000110 2009-01-01, 0.000110 2009-01-02, 0.000080 2009-01-05, 0.000140 2009-01-06, 0.000140 I need to calculate the daily risk free rate for each interval in the data set based on the yearly rate give for each day. I've gotten as far as this: 1 + yearlyRate == (1 + dailyRate)^360 Does this make sense? If so, how do I implement this in Mathematica? If not, how would I do it? A couple of related questions: Can one use FinancialData[] to access Treasury or Libor rate information or access a risk free rate directly? Thx. === Subject: Re: printing symbols at as a table Perhaps something like this to set up things: varNames = {r, g, s, somethingElse}; vars = ToExpression /@ varNames; Next, calculate the values; here I just assign them: Finally, create your table. Here are two ways, the second with an embellishment: Transpose[{varNames, vars}] // TableForm Grid[Transpose[{varNames, vars}], Frame -> All] If you prefer to start with the symbols for the variables instead of the names, then just reverse, essentially, the first two lines of code: Clear[r, g, s, somethingElse] vars = {r, g, s, somethingElse}; varNames = ToString /@ vars; > HiI have done a long calculation. But now I want to print some > variables and their values. eg: r 20 > g 2.34 > s m^2 + D and so on .... > as a summary. The In /Out makes me crazy. I want to create a table of > all values. with the symbol on the left ath value on the right. some > are numeric ei i have assigned a r. Now i want to get the symbol > 'r'. I hope i am not confusing here. > -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: printing symbols at as a table > HiI have done a long calculation. But now I want to print some > variables and their values. eg: > > r 20 > g 2.34 > s m^2 + D > > and so on .... > as a summary. The In /Out makes me crazy. I want to create a table of > all values. with the symbol on the left ath value on the right. some > are numeric ei i have assigned a r. Now i want to get the symbol > 'r'. I hope i am not confusing here. > > > r = 20; g = 2.34; s = m^2 + D; Print[r , r] Print[g , g] Print[s , s] {{r, r}, {g, g}, {s, s}}//TableForm === Subject: printing symbols at as a table HiI have done a long calculation. But now I want to print some variables and their values. eg: r 20 g 2.34 s m^2 + D and so on .... as a summary. The In /Out makes me crazy. I want to create a table of all values. with the symbol on the left ath value on the right. some are numeric ei i have assigned a r. Now i want to get the symbol 'r'. I hope i am not confusing here. === Subject: Re: Is this so hard? You didn't want another initial (or boundary) condition for this 2nd order ODE? > Hey all, I gave DSolve this thing: DSolve[{x''[t] == 1/x[t]^2, x[0] == -1}, x, t] It made it think and think until it crashed. > Is this DE so hard? I figured it was something basic. Ram. > -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: Is this so hard? > You didn't want another initial (or boundary) condition for this 2nd > order ODE? > You're right. DSolve[{x''[t] == 1/x[t]^2, x[0] == -1, x'[0] == 0}, x, t] This still gives no answer. Any ideas? === Subject: Is this so hard? Hey all, I gave DSolve this thing: DSolve[{x''[t] == 1/x[t]^2, x[0] == -1}, x, t] It made it think and think until it crashed. Is this DE so hard? I figured it was something basic. Ram. === Subject: Mathematica 7 on an Asus Eee PC Laptop? Has anyone tried running Mathematica 7 on an Asus Eee PC Laptop under Linux? === Subject: Re: Graphics in PlotMarkers buggy in Mathematica 7 Jens, The workaround you suggested has a problem if the PlotMarker Circle[] is altered to a different radius. ListPlot[{{{1, 1}}, {{1, 2}}}, PlotMarkers -> {HoldForm@Graphics[{Hue[0.5], Circle[{1, 1}, 0.01]}], HoldForm@Graphics[{Hue[0.96], Circle[{1, 2}, 2]}]}] Does not change the PlotMarker circle radius at all in either case. This seems like a bug and I have reported it to WRI. Syd Geraghty B.Sc, M.Sc. sydgeraghty@mac.com Mathematica 7.0.0 for Mac OS X x86 (64 - bit) (21st November, 2008) MacOS X V 10.5.6 > in Mathematica 7 on Mac OS X, try to execute this simple example: > > ListPlot[{{{1, 1}}, {{1, 2}}}, PlotMarkers -> {Graphics[{Hue[0.5], > Circle[]}], Graphics[{Hue[0.96],Circle[]}]}] > > Whereas this works in Mathematica 6.03, there is now the error > An improperly formatted option was encountered while reading a > GraphicsBox. The option was not in the form of a rule. > > This is apparently caused by any graphics directive (such as Hue, > Opacity, Thickness), but I was able to reliably work around it by > replacing Graphics with HoldForm@Graphics. > > There seems to be no problem with Graphics3D markers, and according to > the documentation there should be no problem with arbitrary Graphics > as plot markers, either. I'm guessing there has been some subtle > change in Graphics' inner workings that conflicts with its use in > PlotMarkers - but who knows. > > Anyway, HoldForm is the cure, in case anyone else stumbles over this > issue. === Subject: Re: Graphics in PlotMarkers buggy in Mathematica 7 > Jens, > > The workaround you suggested has a problem if the PlotMarker Circle[] > is altered to a different radius. > > ListPlot[{{{1, 1}}, {{1, 2}}}, > PlotMarkers -> {HoldForm@Graphics[{Hue[0.5], Circle[{1, 1}, 0.01]}], > HoldForm@Graphics[{Hue[0.96], Circle[{1, 2}, 2]}]}] > > Does not change the PlotMarker circle radius at all in either case. > > Syd, although your example isn't quite correct, you do have a point! Your example doesn't work even in Mathematica 6 where the bug is absent: the documentation says we should be able to set the scale s of a graphics object g by specifying {g, s} in PlotMarkers. But if I try this in my example with HoldForm applied to Graphics, it doesn't work. What does work, though, is to specify the size s of the circle as Circle[{0,0}, Scaled[s]]. This works in Mathematica 6 and 7, with or without HoldForm. For text, you can also put in things like Style [A,Larger] etc. I did report the bug, too. A working ListPlot would be nice, wouldn't it? Jens === Subject: Graphics in PlotMarkers buggy in Mathematica 7 in Mathematica 7 on Mac OS X, try to execute this simple example: ListPlot[{{{1, 1}}, {{1, 2}}}, PlotMarkers -> {Graphics[{Hue[0.5], Circle[]}], Graphics[{Hue[0.96],Circle[]}]}] Whereas this works in Mathematica 6.03, there is now the error An improperly formatted option was encountered while reading a GraphicsBox. The option was not in the form of a rule. This is apparently caused by any graphics directive (such as Hue, Opacity, Thickness), but I was able to reliably work around it by replacing Graphics with HoldForm@Graphics. There seems to be no problem with Graphics3D markers, and according to the documentation there should be no problem with arbitrary Graphics as plot markers, either. I'm guessing there has been some subtle change in Graphics' inner workings that conflicts with its use in PlotMarkers - but who knows. Anyway, HoldForm is the cure, in case anyone else stumbles over this issue. Jens === Subject: Re: Question on making a piecewise function periodic tia sal2 I see three ways of creating periodic functions. Let the period be : periode = Pi; and the starting value for your period be : borneInf = 0; 1) using recurrence : fper1[t_] := Piecewise[{{f[t], borneInf <= t <= periode + borneInf},{fper1[t - periode], t > borneInf + periode},{fper1[t + periode], t < borneInf}}] It works fine, but takes a lot of time : Timing[Plot[fper1[x], {x, -2*Pi, 3*Pi}]] Takes 0.235 second on my computer! 2) using Mod : fper2[t_] := f[Mod[t - borneInf, periode] + borneInf] Timing[Plot[fper2[x], {x, -2*Pi, 3*Pi}]] Takes 0.078 second on my computer. 3) using Floor : fper3[x_] := f[(1 + Floor[(borneInf - x)/periode])*periode + x] Timing[Plot[fper3[x], {x, -2*Pi, 3*Pi}]] Takes also 0.078 second Manipulate[test = choice[fperi[a*t] + c, {t, 0, 2*Pi}], {a, 1, 5}, {c, 0, 2}, {choice, {Plot, Expand}}] Works fine for i=1, 2 or 3... But if you want to make Calculus, for example Integrate[fperi[x], {x, 0, 3*Pi}], it won't work with i=1, but will work fine with i=2 or 3! Florian Jaccard -----Message d'origine----- DeåÊ: ratulloch@gmail.com [mailto:ratulloch@gmail.com] EnvoyÌ©åÊ: mardi, 13. janvier 2009 04:15 Ì¥åÊ: mathgroup@smc.vnet.net ObjetåÊ: Question on making a piecewise function periodic tia sal2 Question on making a piecewise function periodic tia sal2 I'm trying to make a piecewise function look periodic. example (shows the positive humps of the sin wave from 0 to 2Pi) Manipulate[test=choice[ Piecewise[{{Sin[a*t],tPi}}],{t,0,2 Pi}],{a,1,5},{C,0,2},{choice,{Plot,Expand}}] This command will work if t is 0 to 2 Pi but the sin wave goes negative after that I think If I use the Mod command example: Manipulate[test=choice[ Piecewise[{{Sin[a*t],tMod[Pi,4]}}],{t,0,2 Pi}],{a,1,5},{C,0,2},{choice,{Plot,Expand}}] It could work so it would never go negative but I'm not sure how to implement mod command so the sin wave won=92t go negative. I'm also open to other suggestions. The reason why I'm doing this is that when I do periodic interpolation the formula Breaks down due to the Gibbs Phenomenon. The signals I'm creating have about 200 separate values that=92s why it breaks down. But I'm using a simple example to see if it can be done. So I can basically stitch multiple simple wave signals together to create one big complex one and still have the ability to make the complex signal periodic over time. Tia sal2 === Subject: Question on making a piecewise function periodic tia sal2 Question on making a piecewise function periodic tia sal2 I'm trying to make a piecewise function look periodic. example (shows the positive humps of the sin wave from 0 to 2Pi) Manipulate[test=choice[ Piecewise[{{Sin[a*t],tPi}}],{t,0,2 Pi}],{a,1,5},{C,0,2},{choice,{Plot,Expand}}] This command will work if t is 0 to 2 Pi but the sin wave goes negative after that I think If I use the Mod command example: Manipulate[test=choice[ Piecewise[{{Sin[a*t],tMod[Pi,4]}}],{t,0,2 Pi}],{a,1,5},{C,0,2},{choice,{Plot,Expand}}] It could work so it would never go negative but I'm not sure how to implement mod command so the sin wave won=92t go negative. I'm also open to other suggestions. The reason why I'm doing this is that when I do periodic interpolation the formula Breaks down due to the Gibbs Phenomenon. The signals I'm creating have about 200 separate values that=92s why it breaks down. But I'm using a simple example to see if it can be done. So I can basically stitch multiple simple wave signals together to create one big complex one and still have the ability to make the complex signal periodic over time. Tia sal2 === Subject: How to stop the latest Mathematica hijacking the .nb extension in Has anyone had a similar problem: The latest (V7 in this case) Mathematica installation seems to hijack the file association to .nb files to itself. This is usually what the user wants, but in some cases (if the latest version has severe bugs etc.) it would be nice to open the notebooks with previous version (in V6 in this case) when double-clicking in Explorer. Usually one could just edit or remove the file association in Tools->Folder Options->File Types with Windows Explorer, but Mathematica seems to use some trick that always opens with the latest, even if you try to change the association. Has anybody found a workaround to this? The problem seems to exists at least with XP and Vista. Antti

, ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , <[>, ,, , <>, ,, , <]>, ,, , n, , <^>, ,, , <_>}], }}], ,, , RowBox[{{, RowBox[{ <`>, ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , , ,, , }], }}], ,, , RowBox[{{, RowBox[{