mm-1459 === Subject: Re: Output to a file >I want to write the following list in a file, (and below is what I did) >testList = {{1, 8}, {2, 9}, {3, 10}, {4, 11}, {5, 12}, {6, 13}, {7, 14}}; >str = OpenWrite[test.dat]; >Write [str, testList]; Close[str]; >test.dat looks like >{{1, 8}, {2, 9}, {3, 10}, {4, 11}, {5, 12}, {6, 13}, {7, 14}} >But, I want the test.dat to look like: >1 8 >2 9 >3 10 >4 11 >and so on... try this : str=OpenWrite[test.dat,FormatType>OutputForm]; For[j=1,j<=Length[testList],j++, st=ToString[testList[[j,1]]]<> <>ToString[testList[[j,2]]]; Write[str.st]; ]; Close[str]; This file can be easily read by Excel. Bye, Roberto Brambilla CESI Spa Engineering Department Renewable Energies & Superconductivity Via Rubattino 54, 20134 Milano Italy ph. +39 02 2125.5875 fax +39 02 2125.5626 CESI SpA ha adottato il Modello Organizzativo ai sensi del D.Lgs.231/2001, in forza del quale l'assunzione di obbligazioni da parte della Societ.88 avviene con firma di un procuratore, munito di idonei poteri. CESI adopts a Compliance Programme under the Italian Law (D.Lgs.231/2001). According to this CESI Compliance Programme, any commitment of CESI is taken by the signature of one Representative granted by a proper Power of Attorney. Le informazioni contenute in questo messaggio di posta elettronica sono riservate e confidenziali e ne e' vietata la diffusione in qualsiasi modo o forma. Qualora Lei non fosse la persona destinataria del presente messaggio, La invitiamo a non diffonderlo e ad eliminarlo, dandone gentilmente comunicazione al mittente. The information included in this e-mail and any attachments are confidential and may also be privileged. If you are not the correct recipient, you are disclose the contents to any other person. === Subject: Exporting xhtml+mathml Hello everyone, I'm trying to read a Mathematica notebook using Internet Explorer and Mathplayer. I exported it as XHTML+mathml, but it doesn't work. Do you suggest any technique to be mathplayer compliant when exporting a notebook? bye Cristian === Subject: InterpolatingFunctionAnatomy.m Can anyone possible send me the interpolatingfunctionanatomy .m file. I have Mathematica 5.0 only. I am running a simulation of chemical kinetics, and need the volume to be changed at each timestep which then scales the concentrations. This means as far as I am aware that I will have to use the EventLocator controller. In my system of dif equations I have X'[t] = (bla bla ... ) V'[t] = (k X[t] ) At each timestep I need to scale X[t] by the ratio of (V[t]/V[t+1]) because V is the volume of the cell that the chemical X is in, and X increases this volume. Therefore, X[t] has to be reduced by a ratio of the previous volume to the current volume. I can only think of doing this by having an event detect when the volume increases by a fixed amount, and catching that event,. and then rescaling X'[t] and restaring NDSolve from there. I think the EventLocator can do this automatically. Is there a better way to do this? Yours ever, Chrisantha Fernando === Subject: Re: Remote Kernel Guy, Since you are a BGU student, there are some strong servers in the computation center that you may connect to, for that purpose. Look at the BGU site (computation center section) to get some information on that matter. yehuda > hi, > are there any public powerful computers which I can use for intense > calculations? > and if not, is there a way to run a kernel on a different computer and to > use it remotely? if so, how? > Guy === Subject: Re: MapThread states={1,2,3,4,5,6,7,8,9,10,11,12,13,14}; stim={33,44,55,66,77}; MapThread[(states[[#1]]=#2)&, {Range[3,11,2],stim}]; states {1,2,33,4,44,6,55,8,66,10,77,12,13,14} Bob Hanlon === > Subject: MapThread > Hi Everyone, > I have been working on the following problem: > states = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14} > stim = {33, 44, 55, 66, 77} > The locations of state 3,5,7,9,11 to be equal 33,44,55,66,77 > MapThread[{#1 = #2} &, {Take [states, {3, 12, 2}], stim}] > I tried to the above but it gives me errors: > Set::setraw: Cannot assign to raw object 3 > However these work individually: > MapThread[#1 &, {Take [states, {3, 12, 2}], stim}] > MapThread[ #2 &, {Take [states, {3, 12, 2}], stim}] > Any ideas? === Subject: Re: bode diagram >I'm fairly certain it could be done with Mathematica if you would only tell >us what a bode diagram is and give us some sample data of function that you >want to plot in the diagram. >David Park >djmp@earthlink.net >http://home.earthlink.net/~djmp/ >hi, like plotting simple bode diagrams of systems. could you give me some >information about it? i can do it with another program, but i'd like to see >how mathematica works >thank you Here is a nice example from a website I found. *http://www.swarthmore.edu/NatSci/echeeve1/Ref/Bode/Bode.html* -- Pratik Desai Graduate Student UMBC Department of Mechanical Engineering Phone: 410 455 8134 === Subject: Re: another image problem What I forgot to mention is that the image is cropped between the 400 and 650 graph ticks and the image rescaled so that the width is 250 pixels. This removes any requirement for rescaling after data extraction. > >Let's say you have a picture of two overlapping graphs. > >You don't have the equations that generated them. but you know the > >graphs is relatively accurate. for example, >http://pg.photos.yahoo.com/ph/sean_incali/detail?.dir=/9264&.dnm=191b.jpg&. src=ph > >Now... let's say you wanted to find the area under curve for both > >curves (blue and green) between certain x values... > >for example, 425nm <= x <= 475nm , and then 500nm <= x <= 550nm, and > >then 525nm <= x <= 575nm. > >is this doable in Mathematica? > >sean > Hi Sean, > I'm a relative novice with Mathematica, so this may be complete rubbish! > Apologies if it is. > What I have done is to crop the graph in Adobe Photoshop at the origin > {400,0}. Then I have thresholded each channel (RGB) to give pure green and > cyan on a white background and save as a TIFF file (graph.tif). Then I run > the following code: > graph = Import[C:Documents and SettingsMarkDesktopgraph.tif]; > Show[graph, Frame -> True] > data = Position[graph[[1, 1]], {0, 255, 0}]; (*{0, 255, 0} for green; {0, > 255, 255} for cyan*) > maxy = Max[data /. {x_, y_} -> y]; > maxx = Max[data /. {x_, y_} -> x]; > fit = Cases[Mean /@ Table[Cases[data, {x_, i}], {i, maxy}], {x_, y_}]; > int = ListInterpolation[fit, {{1, maxy}, {1, maxx}}]; > datafit = Table[int[i, 1], {i, maxy}] // N; > ListPlot[datafit] > origin = 400; > Plus @@ Take[datafit, {500 - origin, 550 - origin}] > I hope this is what you are after. > Best wishes, > Mark === Subject: Re: another image problem What I forgot to mention is that the image is cropped between the 400 and 650 graph ticks and the image rescaled so that the width is 250 pixels. This removes any requirement for rescaling after data extraction. > >Let's say you have a picture of two overlapping graphs. > >You don't have the equations that generated them. but you know the > >graphs is relatively accurate. for example, >http://pg.photos.yahoo.com/ph/sean_incali/detail?.dir=/9264&.dnm=191b.jpg&. src=ph > >Now... let's say you wanted to find the area under curve for both > >curves (blue and green) between certain x values... > >for example, 425nm <= x <= 475nm , and then 500nm <= x <= 550nm, and > >then 525nm <= x <= 575nm. > >is this doable in Mathematica? > >sean > Hi Sean, > I'm a relative novice with Mathematica, so this may be complete rubbish! > Apologies if it is. > What I have done is to crop the graph in Adobe Photoshop at the origin > {400,0}. Then I have thresholded each channel (RGB) to give pure green and > cyan on a white background and save as a TIFF file (graph.tif). Then I run > the following code: > graph = Import[C:Documents and SettingsMarkDesktopgraph.tif]; > Show[graph, Frame -> True] > data = Position[graph[[1, 1]], {0, 255, 0}]; (*{0, 255, 0} for green; {0, > 255, 255} for cyan*) > maxy = Max[data /. {x_, y_} -> y]; > maxx = Max[data /. {x_, y_} -> x]; > fit = Cases[Mean /@ Table[Cases[data, {x_, i}], {i, maxy}], {x_, y_}]; > int = ListInterpolation[fit, {{1, maxy}, {1, maxx}}]; > datafit = Table[int[i, 1], {i, maxy}] // N; > ListPlot[datafit] > origin = 400; > Plus @@ Take[datafit, {500 - origin, 550 - origin}] > I hope this is what you are after. > Best wishes, > Mark === Subject: FindRoot::nlnum error message for non-linear system of equations I have recently started using Mathematica and I've been using it to solve non-linear systems of equations via the FindRoot command. I am using it to solve approximations of building airflow and when I had a relatively small system of 6 equations and 6 unknowns I had no problem getting it to solve for the unknowns. More recently though I have been trying to solve a system of 39 equations with 39 unknowns and I've been running into error messages. I've tried changing the format of the start values to include a range but I still get a FindRoot::nlnum error message. Any help would be appreciated. -Daniel Chung, daniel.chung@yale.edu Here is the text for the input followed by the generated error message: Clear[ (* Variables - 39 unknowns *) m14, m23, m33, m11, m24, m21, m42,m31, m44, m83, m51, m61, m64, m54, m63, m53, v1,v2,v3,v4,v5,v6, v7, p1,p2,p3,p4,p41, p42, p43, p44, p45, p46, p5, p54, p57, p6, p66, p67 ]; (* Constants *) ro = 1.2; A1= 0.0099; A2 = 0.0300; A3 = 0.0200; A4 = 0.0250; A5 =0.0300; A6 =0.0300; A7 = 0.0250; ev1 = 2.4; ev2 = 2.4; ev3 =2.4; ev5 =2.4; ev6 =2.4; ev7 = 2.4; K14 = 0.00373; K23 = 0.00328; K33 = 0.00319; K53 = 0.00310; K63 = 0.00152; K83 = 0.00190; K11 = 0.00389; K21 = 0.00562; K24 = 0.0000472; K31 = 0.00415; K42 = 0.000825; K44 = 0.00157; K51 = 0.00418; K54 = 0.00175; K61 = 0.000344; K64 = 0.000553; n14 = 0.58; n23 = 0.60; n33 = 0.58; n53 = 0.54; n63 = 0.56; n83 = 0.59; n11 = 0.90; n21 = 0.78; n24 = 0.87; n31 = 0.59; n42 = 0.65; n44 = 0.51; n51 = 0.76; n54 = 0.64; n61 = 0.81; n64 = 0.69; (* Boundary Conditions *) pow = 16; pol = -81; pos = -2.8; results=FindRoot [ { m14-m11-ro*v3*A3 ==0, m11+m23-m21-m24-ro*v1*A1==0, m24+m33+m42-m31-ro*v2*A2==0, m21+m31-m14-m44-m51-m61+ro*v1*A1+ro*v2*A2+ro*v3*A3-ro*v4*A4- ro*v5*A5-ro*v6*A6==0, m44+m51+m54-m53+ro*v4*A4+ro*v7*A7==0, m61+m64-m54-m63+ro*v6*A6-ro*v7*A7==0, m14-ro*K14*(pow-p1)^n14 == 0, m23-ro*K23*(pow-p2)^n23 == 0, m33-ro*K33*(pow-p3)^n33 == 0, m11-ro*K11*(p1-p2)^n11 == 0, m24-ro*K24*(p2-p3)^n24 == 0, m21-ro*K21*(p2-p4)^n21 == 0, m42-ro*K42*(p4-p3)^n42 == 0, m31-ro*K31*(p3-p4)^n31 == 0, m44-ro*K44*(p4-p5)^n44 == 0, m83-ro*K83*(p4-pos)^n83 == 0, m51-ro*K51*(p4-p5)^n51 == 0, m61-ro*K61*(p4-p6)^n61 == 0, m64-ro*K64*(pos-p6)^n64 == 0, m54-ro*K54*(p6-p5)^n54 == 0, m63-ro*K63*(p6-pol)^n63 == 0, m53-ro*K53*(p5-pol)^n53 == 0, p2*v1*A1-0.5*ro*(v1^3)*A1*ev1-p41*v1*A1 == 0, p3*v2*A2-0.5*ro*(v2^3)*A2*ev2-p42*v2*A2 == 0, p1*v3*A3-0.5*ro*(v3^3)*A3*ev3-p43*v3*A3 == 0, p44*v4*A4-0.5*ro*(v4^3)*A4*ev4-p54*v4*A4 == 0, p45*v5*A5-0.5*ro*(v5^3)*A5*ev5-pos*v5*A5 == 0, p46*v6*A6-0.5*ro*(v6^3)*A6*ev6-p66*v6*A6 == 0, p67*v7*A7-0.5*ro*(v7^3)*A7*ev7-p57*v7*A7 == 0, (p41*v1*A1+0.5*ro*(v1^3)*A1)+(p42*v2*A2+0.5*ro*(v2^3)*A2)+ (p43*v3*A3+0.5*ro*(v3^3)*A3) - (p45*v5*A5+0.5*ro*(v5^3)*A5) - (p46*v6*A6+0.5*ro*(v6^3)*A6) - (p44*v4*A4+0.5*ro*(v4^3)*A4) == 0, p41-p42 == 0, p41-p43 == 0, p41-p44 ==0, p41-p45 == 0, p4-p41 == 0, p5-p54 == 0, p5-p57 == 0, p6-p66 == 0, p6-p67 == 0 }, (* Initial Guesses *) {m14,0.0125}, {m23,0.0106}, {m33,0.0233}, {m11,0.001}, {m24,0.002}, {m21,0.003}, {m42,0.004}, {m31,0.005}, {m44,0.006}, {m83,0.007}, {m51,0.008}, {m61,0.009}, {m64,0.01}, {m54,0.011}, {m63,0.0103}, {m53,0.0186}, {v1,0.90},{v2,0.63},{v3,0.60}, {v4,0.33},{v5,0.54},{v6,0.52}, {v7,0.22},{p1,14.},{p2,12.}, {p3,10.},{p4,0.},{p41,0.1},{p42,0.2},{p43,0.3},{p44,0.4}, {p45,0.5},{p46,0.6},{p5,-20.},{p54,-20.1},{p57,-20.2},{p6,-30.}, {p66,-30.1},{p67,-30.2} ]; ColumnForm[results] FindRoot::nlnum: The function value {-0.0029, -0.004092, 0.00162, - 0.027788, 0.0229, 0.00982, 0.00580905, <<28>>, 0.1, 0.2, 0.1, 0.2} is not a list of numbers with dimensions {39} at {m14, m23, m33, m11, m24, m21, m42, m31, m44, m83, m51, m61, <<21>>, p5, p54, p57, p6, p66, p67} = {0.0125, 0.0106, 0.0233, 0.001, 0.002, 0.003, 0.004, 0.005, <<27>>, - 20.2, -30., -30.1, -30.2}. More.. === Subject: Re: GramSchmidt problem > Does anyone know if there are any know problems with GramSchmidt > crashing Mathematica? When I run it on these 4 25-dimensional vectors it > crashes on my system: Tt works perfectly with floating point vectors so I expect that it crashes because it is not simplifying the intermediate radical expressions. Here is functional code for computing GramSchmidt: GramSchmidt := Fold[Append[#1, FullSimplify[ (#/Norm[#]&)[Fold[Projection, #2, #1]]]] & , {}, #1] & ; where the projection operator is Projection[f_, g_] := FullSimplify[f - (f.g) g] FullSimplify has been used in both routines so that expressions involving radicals are completely simplified. Calling your set of 4 vectors mat, one computes the orthonormal vectors using GramSchmidt[mat] As a check, Simplify[% . Transpose[%]] Paul -- Paul Abbott Phone: +61 8 6488 2734 School of Physics, M013 Fax: +61 8 6488 1014 The University of Western Australia (CRICOS Provider No 00126G) AUSTRALIA http://physics.uwa.edu.au/~paul http://InternationalMathematicaSymposium.org/IMS2005/ === Subject: Re: GramSchmidt problem The kernel runs out of memory at my machine (Mathematica 5.1.1, WinXP). Bobby > Does anyone know if there are any know problems with GramSchmidt > crashing Mathematica? When I run it on these 4 25-dimensional vectors it > crashes on my system: > !({1/2 ((3 + @5)), 1/2 (((-3) - @5)), 1/2 ((1 + @5)), 0, > 1/2 (((-1) - @5)), 1/2 (((-3) - @5)), 1/2 ((3 + @5)), > 1/2 (((-1) - @5)), 0, 1/2 ((1 + @5)), 1/2 ((1 + @5)), > 1/2 (((-1) - @5)), 1, 0, (-1), 0, 0, 0, 0, 0, > 1/2 (((-1) - @5)), 1/2 ((1 + @5)), (-1), 0, 1}) > !({1/2 ((1 + @5)), 1/2 (((-3) - @5)), 1/2 ((3 + @5)), > 1/2 (((-1) - @5)), 0, 1/2 (((-1) - @5)), > 1/2 ((3 + @5)), 1/2 (((-3) - @5)), 1/2 ((1 + @5)), 0, > 1, > 1/2 (((-1) - @5)), 1/2 ((1 + @5)), (-1), 0, 0, 0, 0, 0, > 0, (-1), 1/2 ((1 + @5)), 1/2 (((-1) - @5)), 1, 0}) > !({1/2 ((1 + @5)), 1/2 (((-1) - @5)), 1, 0, (-1), > 1/2 (((-3) - @5)), 1/2 ((3 + @5)), 1/2 (((-1) - @5)), > 0, 1/2 ((1 + @5)), 1/2 ((3 + @5)), 1/2 (((-3) - @5)), > 1/2 ((1 + @5)), 0, 1/2 (((-1) - @5)), > 1/2 (((-1) - @5)), 1/2 ((1 + @5)), (-1), 0, 1, 0, 0, 0, 0, > 0}) > !({1, 1/2 (((-1) - @5)), 1/2 ((1 + @5)), (-1), 0, > 1/2 (((-1) - @5)), 1/2 ((3 + @5)), 1/2 (((-3) - @5)), > 1/2 ((1 + @5)), 0, 1/2 ((1 + @5)), 1/2 (((-3) - @5)), > 1/2 ((3 + @5)), 1/2 (((-1) - @5)), 0, (-1), > 1/2 ((1 + @5)), 1/2 (((-1) - @5)), 1, 0, 0, 0, 0, 0, 0}) > Heath -- DrBob@bigfoot.com === Subject: Re: GramSchmidt problem > Does anyone know if there are any know problems with GramSchmidt > crashing Mathematica? When I run it on these 4 25-dimensional vectors it > crashes on my system: > !({1/2 ((3 + @5)), 1/2 (((-3) - @5)), 1/2 ((1 + @5)), 0, > 1/2 (((-1) - @5)), 1/2 (((-3) - @5)), 1/2 ((3 + @5)), > 1/2 (((-1) - @5)), 0, 1/2 ((1 + @5)), 1/2 ((1 + @5)), > 1/2 (((-1) - @5)), 1, 0, (-1), 0, 0, 0, 0, 0, > 1/2 (((-1) - @5)), 1/2 ((1 + @5)), (-1), 0, 1}) > !({1/2 ((1 + @5)), 1/2 (((-3) - @5)), 1/2 ((3 + @5)), > 1/2 (((-1) - @5)), 0, 1/2 (((-1) - @5)), > 1/2 ((3 + @5)), 1/2 (((-3) - @5)), 1/2 ((1 + @5)), 0, > 1, > 1/2 (((-1) - @5)), 1/2 ((1 + @5)), (-1), 0, 0, 0, 0, 0, > 0, (-1), 1/2 ((1 + @5)), 1/2 (((-1) - @5)), 1, 0}) > !({1/2 ((1 + @5)), 1/2 (((-1) - @5)), 1, 0, (-1), > 1/2 (((-3) - @5)), 1/2 ((3 + @5)), 1/2 (((-1) - @5)), > 0, 1/2 ((1 + @5)), 1/2 ((3 + @5)), 1/2 (((-3) - @5)), > 1/2 ((1 + @5)), 0, 1/2 (((-1) - @5)), > 1/2 (((-1) - @5)), 1/2 ((1 + @5)), (-1), 0, 1, 0, 0, 0, 0, > 0}) > !({1, 1/2 (((-1) - @5)), 1/2 ((1 + @5)), (-1), 0, > 1/2 (((-1) - @5)), 1/2 ((3 + @5)), 1/2 (((-3) - @5)), > 1/2 ((1 + @5)), 0, 1/2 ((1 + @5)), 1/2 (((-3) - @5)), > 1/2 ((3 + @5)), 1/2 (((-1) - @5)), 0, (-1), > 1/2 ((1 + @5)), 1/2 (((-1) - @5)), 1, 0, 0, 0, 0, 0, 0}) > Heath Like many Mathematica operations, GramSchmidt can operate with exact quantities (Integers, Fractions, Roots, etc.) yielding an exact result, or with real numbers yielding a real (inexact) result. All Your numbers are exact, so it will try to give you an exact answer. Unfortunately, the size of the numerators/denominators of the terms will explode. Just apply N to your vectors before you start, and you will obtain an answer easily. BTW, please use InputForm when submitting examples - reading box form is a bit like reading punched paper tape! David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Re: Reading in a file > Hi everyone, > I have the following file named temp.txt > with the following format: > ; Restart file created by make.m > NYTOT 140 > STTOT 30 > TIME 0.00000000000000 > 3.1 4.1 > 2.3 4.5 > 3.3 2.5 > 1.1 4.1 > I want to read this file in, but store the value of NYTOT which is 140 > in a variable nytot, sttot in another variable named sttot > At the end, I would like the get > nytot = 140 > sttot = 30 > time = 0.0 > and the rest of the values in another list: > tmpLst = {3.1,4.1,2.3,4.5,3.3,2.5,1.1,4.1} > I have done the following so far: > tmpLst=Flatten[Select[Import[temp.txt, Table], NumericQ[First > [#]] &]]; > Which gives the tmpLst values but am not sure how I can get the sttot, > nytot and time values? > Any ideas? One idea: In[1]:= SetDirectory[ ~/Documents/Own solutions] Out[1]= /Volumes/Data/janos/Document s/Own solutions In[2]:= files = FileNames[*.txt] Out[2]= {Reading from file.txt, StringToNumbers.txt, swati.txt, usgs.txt} In[3]:= fl = ReadList[files[[3]], Record] Out[3]= {; Restart file created by make.m, ;, NYTOT 140, STTOT 30, ;, TIME 0.00000000000000, 3.1 4.1, 2.3 4.5, 3.3 2.5, 1.1 4.1} In[4]:= mapfl = (StringSplit[ #1] & ) /@ fl Out[4]= {{;, Restart, file, created, by, make.m}, {;}, {NYTOT, 140}, {STTOT, 30}, {;}, {TIME, 0.00000000000000}, {3.1, 4.1}, {2.3, 4.5}, {3.3, 2.5}, {1.1, 4.1}} In[5]:= nytot = ToExpression[ Select[mapfl, #1[[1]] == NYTOT & ][[ 1,2]]] Out[5]= 140 In[6]:= sttot = ToExpression[ Select[mapfl, #1[[1]] == STTOT & ][[ 1,2]]] Out[6]= 30 In[7]:= time = nytot = ToExpression[ Select[mapfl, #1[[1]] == TIME & ][[ 1,2]]] Out[7]= 0. J.87nos ---------------------------------------------- Trying to argue with a politician is like lifting up the head of a corpse. (S. Lem: His Master Voice) === Subject: Re: Reading in a file >Hi everyone, I have the following file named temp.txt with the >following format: >; Restart file created by make.m >NYTOT 140 >STTOT 30 >TIME 0.00000000000000 >3.1 4.1 >2.3 4.5 >3.3 2.5 >1.1 4.1 >I want to read this file in, but store the value of NYTOT which is >140 in a variable nytot, sttot in another variable named sttot >At the end, I would like the get nytot = 140 sttot = 30 time = 0.0 >and the rest of the values in another list: tmpLst = >{3.1,4.1,2.3,4.5,3.3,2.5,1.1,4.1} >I have done the following so far: >tmpLst=Flatten[Select[Import[temp.txt, Table], >NumericQ[First[#]] &]]; Which gives the tmpLst values but am not >sure how I can get the sttot, nytot and time values? Assuming the variables sttot, nytot and time don't exist the following will do the trick Set[Evaluate[ToExpression@ToLowerCase@First@#], Last@#]&/@Cases[data, {_String, _Real | _Integer}] where data = Import[temp.txt, Table]; -- To reply via email subtract one hundred and four === Subject: Re: Converting result to ASCII-art > When running MathKernel from command line in OS X, it shows expressions > kind of like ASCII-art. I have a very long equation that I need to > convert to ASCII, but when doing this the way I normally do, using > Terminal and copying and pasting, it comes out looking like a mess, > because it does too much line wrapping. What I am trying to display is > the result of: > Solve[a x^4+b x^3+c x+d==0,x] Why do they need the solution in radicals to a particular quartic? Are they really going to try to use this code to compute the (numerical) solutions to this quartic? If so they will encounter a number of problems (see Ins and Outs in The Mathematica Journal 9-3): [1] In general, radical formulations are prone to numeric problems. Mathematica Root objects, e.g, Root[Function[x, a x^4+b x^3+c x+d], 1] do not have this liability. [2] For certain parameters, the expression involving radicals may involve I, even when the root is real. This means that numeric evaluation will give small imaginary part. In other words, the radical expression is likely to be useless for any practical purpose. In fact, you can avoid it arising by setting SetOptions[Roots, Cubics -> False, Quartics -> False] > What I really need is some way that I can send this result to someone > (who doesn't have Mathematica, MathReader, or any type of MathML > reader), so that they can copy and paste out of it. MathReader is freely available. > when I use Print to create a PDF, the PDF that it creates > can't be read by either Preview or Acrobat. That's strange. Paul -- Paul Abbott Phone: +61 8 6488 2734 School of Physics, M013 Fax: +61 8 6488 1014 The University of Western Australia (CRICOS Provider No 00126G) AUSTRALIA http://physics.uwa.edu.au/~paul http://InternationalMathematicaSymposium.org/IMS2005/ === Subject: Iterated NDSolve. HELP. I need to detect an event in my system of dif. equations, and then change one of the variables (in a manner which is not specified by the dif. equations), and then re-run the dif equations with the new values. How can I most easily do this? Here is what I have so far. CreatedBy='Mathematica 5.1' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 51623, 1349]*) (*NotebookOutlinePosition[ 52259, 1371]*) (* CellTagsIndexPosition[ 52215, 1367]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell[BoxData[{ ((data = Table[0, {i, 100}, {j, 25}];)), [IndentingNewLine], ((iter = 0;) ), [IndentingNewLine], (({meg, temp = 280, melta = 280, meltb = 300, meltc = 320, meltg = 340, [Beta]a = 10 + (80000 [ExponentialE]^temp)/([ExponentialE]^melta + [ExponentialE]^temp), [Beta]b = 10 + (80000 [ExponentialE]^temp)/([ExponentialE]^meltb + [ExponentialE]^temp), [Beta]c = 10 + (80000 [ExponentialE]^temp)/([ExponentialE]^meltc + [ExponentialE]^temp), [Beta]g = 10 + (80000 [ExponentialE]^temp)/([ExponentialE]^meltg + [ExponentialE]^temp), lig = 10^2 0.6*Exp[(-25)/((8.31*10^(-3)* temp))], deg = 0.2*10^17 * Exp[(-122)/((8.31*10^(-3)* temp))], [Alpha] = 200000, d = 0.1 deg, dd = 0.5 deg , dg = deg, tmax = 1000000, kb = lig, kc = lig, kg = lig, k6a = lig, k6b = lig/2 , k6c = lig/4 , k6g = lig/8 , ke = 0.0001, Tsize = 1, k1 = 0.005, k2 = 0.001, k3 = 0.001, k4 = 0.001, k5 = 0.001, k8 = 0.001, k9 = 0.001, k10 = 0.001, k1d = 0.00001, k2d = 0.00001, k3d = 0.00001, k4d = 0.00001, k5d = 0.00001, k9d = 0.00001 };)[IndentingNewLine]), [IndentingNewLine], (Chemoton[data, iter, meg, t0_ , ima_, imb_, imc_, imd_, ime_, iab_, iaab_, ibb_, ibc_, ibbc_, icc_, icg_, iccg_, igg_, ia_, ib_, ic_, ig_, ie_, iVdash_, iR_, iTdash_, iTstar_, iT_, iS_] := Module[{}, [IndentingNewLine]iter = iter + 1; [IndentingNewLine]meg = NDSolve[{ [IndentingNewLine] (ma')[ t] [Equal] ((2 ((k5 me[t] - k5d ma[t] ma[t])) - k1 ma[t] x[t] + k1d mb[t])), [IndentingNewLine](mb')[ t] [Equal] ((k1 ma[t] x[t] - k1d mb[t] - k2 mb[t] + k2d mc[t] y[t])) , [IndentingNewLine](mc')[ t] [Equal] ((k2 mb[t] - k2d mc[t] y[t] - k3 mc[t] + k3d md[t] Vdash[t])), [IndentingNewLine](md')[ t] [Equal] ((k3 mc[t] - k3d md[t] Vdash[t] - k4 md[t] + k4d me[t] Tdash[t])), [IndentingNewLine](me')[ t] [Equal] ((k4 md[t] - k4d me[t] Tdash[t] - k5 me[t] + k5d ma[t] ma[t])) , [IndentingNewLine](a')[ t] [Equal] ((k6a Vdash[t] a[t] - [Alpha] a[t] b[t] + [Beta]a ab[t] - [Alpha] a[t] ab[t] + [Beta]a aab[t] + d b[t]/2 - ke a[t] e[t])), [IndentingNewLine](ab')[ t] [Equal] (([Alpha] a[t] b[t] - [Beta]a ab[t] - [Alpha] a[t] ab[t] + [Beta]a aab[t] - d ab[t])) , [IndentingNewLine](bb')[ t] [Equal] ((k6b Vdash[t] b[t] + kb aab[t] + [Alpha] b[t]^2 - [Beta]b bb[t] - d bb[t]/10 + dd cc[t]/20)) , [IndentingNewLine](aab')[ t] [Equal] (( [Alpha] a[t] ab[t] - kb aab[t] - [Beta]a aab[t] - d aab[t]/10)) , (b')[ t] [Equal] (( (- [Alpha]) b[t] a[t] + [Beta]a ab[t] - [Alpha] b[t] c[t] + [Beta]b bc[t] - [Alpha] b[t] bc[t] + [Beta]b bbc[t] - 2 [Alpha] b[t]^2 + 2 [Beta]b bb[t] - d b[t] + dd c[t]/2 - ke b[t] e[t])) , [IndentingNewLine](bc')[ t] [Equal] (([Alpha] b[t] c[t] - [Beta]b bc[t] - [Alpha] b[t] bc[t] + [Beta]b bbc[t] - dd bc[t])), [IndentingNewLine](bbc')[ t] [Equal] (( [Alpha] b[t] bc[t] - kc bbc[t] - [Beta]b bbc[t] - dd bbc[t]/10)), [IndentingNewLine](cc')[ t] [Equal] ((k6c Vdash[t] c[t] + kc bbc[t] + [Alpha] c[t]^2 - [Beta]c cc[t] - dd cc[t]/10 + dg gg[t]/20)), [IndentingNewLine](c')[ t] [Equal] (( (- [Alpha]) b[t] c[t] + [Beta]b bc[t] - 2 [Alpha] c[t]^2 + 2 [Beta]c cc[t] - dd c[t] - [Alpha] c[t] g[t] + [Beta]c cg[t] - [Alpha] c[t] cg[t] + [Beta]c ccg[t] + dg g[t]/2 - ke c[t] e[t])) , [IndentingNewLine](cg')[ t] [Equal] (( [Alpha] c[t] g[t] - [Beta]c cg[t] - [Alpha] c[t] cg[t] + [Beta]c ccg[t] - dg cg[t])), [IndentingNewLine](ccg')[ t] [Equal] (( [Alpha] c[t] cg[t] - kg ccg[t] - [Beta]c ccg[t] - dg ccg[t]/10)), [IndentingNewLine](gg')[ t] [Equal] ((k6g Vdash[t] g[t] + kg ccg[t] + [Alpha] g[t]^2 - [Beta]g gg[t] - dg gg[t]/10)), [IndentingNewLine](g')[ t] [Equal] (( (- [Alpha]) c[t] g[t] + [Beta]c cg[t] - 2 [Alpha] g[t]^2 + 2 [Beta]g gg[t] - dg g[t] - ke g[t] e[t])) , [IndentingNewLine](e')[ t] [Equal] ((ke a[t] e[t] + ke b[t] e[t] + ke c[t] e[t] + ke g[t] e[t] - dg*0 e[t])), [IndentingNewLine](Vdash')[ t] [Equal] (( k3 mc[t] - k3d md[t] Vdash[t] - ((k6a Vdash[t] a[t] + k6b Vdash[t] b[t] + k6c Vdash[t] c[ t] + k6g Vdash[t] g[ t])))) , [IndentingNewLine] (R')[ t] [Equal] ((((k6a Vdash[t] a[t] + k6b Vdash[t] b[t] + k6c Vdash[t] c[ t] + k6g Vdash[t] g[t])) + k9d T[t] - k9 Tstar[t] R[t])) , [IndentingNewLine] (Tdash')[ t] [Equal] (( k4 md[t] - k4d me[t] Tdash[t] - k8 Tdash[t] )) , [IndentingNewLine] (Tstar')[ t] [Equal] (( k8 Tdash[t] - k9 Tstar[t] R[t] + k9d T[t])) , [IndentingNewLine] (T')[ t] [Equal] ((k9 Tstar[t] R[t] - k9d T[t] - k10 T[t] S[t])), [IndentingNewLine] (S')[ t] [Equal] k10 T[t] Tsize S[t] , [IndentingNewLine](x')[ t] [Equal] 0, [IndentingNewLine] (y')[t] [Equal] 0, [IndentingNewLine] ma[t0] [Equal] ima, mb[t0] [Equal] imb, mc[t0] [Equal] imc, md[t0] [Equal] imd, me[t0] [Equal] ime, ab[t0] [Equal] iab, aab[t0] [Equal] iaab, bb[t0] [Equal] ibb, bc[t0] [Equal] ibc, bbc[t0] [Equal] ibbc, cc[t0] [Equal] icc, cg[t0] [Equal] icg, ccg[t0] [Equal] iccg, gg[t0] [Equal] igg, a[t0] [Equal] ia, b[t0] [Equal] ib, c[t0] [Equal] ic, g[t0] [Equal] ig, e[t0] [Equal] ie, Vdash[t0] [Equal] iVdash, R[t0] [Equal] iR, [IndentingNewLine]Tdash[t0] [Equal] iTdash, Tstar[t0] [Equal] iTstar, T[t0] [Equal] iT, S[t0] [Equal] iS, x[t0] [Equal] 0.01, [IndentingNewLine]y[t0] [Equal] 0.000001}, { ma, mb, mc, md, me, a, ab, bb, aab, b, bc, bbc, cc, c, cg, ccg, gg, g, e, Vdash, R, Tdash, Tstar, T, S, x, y}, {t, t0, t0 + tmax}, MaxSteps [Rule] Infinity, Method [Rule] {EventLocator, [Rule] ((S[ t] - 2)), [RuleDelayed] {data[([iter, 1])] = ma[t]; data[([iter, 2])] = mb[t]; data[([iter, 3])] = mc[t]; data[([iter, 4])] = md[t] ; data[([iter, 5])] = me[t]; [IndentingNewLine]data[([iter, 5])] = ab[t]; [IndentingNewLine]data[([iter, 6])] = aab[t]; [IndentingNewLine]data[([iter, 7])] = bb[t]; [IndentingNewLine]data[([iter, 8])] = bc[t]; [IndentingNewLine]data[([iter, 9])] = bbc[t]; [IndentingNewLine]data[([iter, 10])] = cc[t]; [IndentingNewLine]data[([iter, 11])] cg[t]; [IndentingNewLine]data[([iter, 12])] ccg[t]; [IndentingNewLine]data[([iter, 13])] gg[t]; [IndentingNewLine]data[([iter, 14])] a[t]; [IndentingNewLine]data[([iter, 15])] b[t]; [IndentingNewLine]data[([iter, 16])] c[ t]; [IndentingNewLine]data[([iter, 17])] g[t]; [IndentingNewLine]data[([iter, 18])] e[ t]; [IndentingNewLine]data[([iter, 19])] = Vdash[t]; [IndentingNewLine]data[([iter, 20])] = R[t]; [IndentingNewLine]data[([iter, 21])] = Tdash[t]; [IndentingNewLine]data[([iter, 22])] = Tstar[t]; [IndentingNewLine]data[([iter, 23])] = T[t]; [IndentingNewLine]data[([iter, 24])] = S [t]; [IndentingNewLine]data[([iter, 25])] = t; [IndentingNewLine]Throw[ end = t, ]}}][IndentingNewLine] [IndentingNewLine]]), [IndentingNewLine], (Chemoton[data, iter, meg, 0 , 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0, 0, 0, 0, 0, 1])}], Input], Cell[BoxData[ RowBox[{(General::spell1), ((:)( )), RefGuideLinkText, ButtonFrame->None, ButtonData:>General::spell1])> }]], Message], Cell[BoxData[ RowBox[{(General::spell), ((:)( )), RefGuideLinkText, ButtonFrame->None, ButtonData:>General::spell])> }]], Message], Cell[BoxData[ RowBox[{(General::spell), ((:)( )), RefGuideLinkText, ButtonFrame->None, ButtonData:>General::spell])> }]], Message], Cell[BoxData[ RowBox[{(General::spell1), ((:)( )), RefGuideLinkText, ButtonFrame->None, ButtonData:>General::spell1])> }]], Message], Cell[BoxData[ RowBox[{(General::spell), ((:)( )), RefGuideLinkText, ButtonFrame->None, ButtonData:>General::spell])> }]], Message], Cell[BoxData[ RowBox[{(General::stop), ((:)( )), RefGuideLinkText , ButtonFrame->None, ButtonData:>General::stop])> }]], Message], Cell[BoxData[ RowBox[{(General::spell1), ((:)( )), RefGuideLinkText, ButtonFrame->None, ButtonData:>General::spell1])> }]], Message], Cell[BoxData[ RowBox[{(General::spell), ((:)( )), RefGuideLinkText, ButtonFrame->None, ButtonData:>General::spell])> }]], Message], Cell[BoxData[ RowBox[{(General::spell1), ((:)( )), RefGuideLinkText, ButtonFrame->None, ButtonData:>General::spell1])> }]], Message], Cell[BoxData[ RowBox[{(General::spell1), ((:)( )), RefGuideLinkText, ButtonFrame->None, ButtonData:>General::spell1])> }]], Message], Cell[BoxData[ RowBox[{(General::stop), ((:)( )), RefGuideLinkText, ButtonFrame->None, ButtonData:>General::stop])> }]], Message], Cell[BoxData[ RowBox[{{, RowBox[{{, RowBox[{ RowBox[{ma, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{mb, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{mc, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{md, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{me, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{a, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{ab, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{bb, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{aab, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{b, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{bc, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{bbc, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{cc, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{c, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{cg, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{ccg, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{gg, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{g, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{e, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{Vdash, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{R, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{Tdash, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{Tstar, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{T, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{S, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{x, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}], ,, RowBox[{y, [Rule], TagBox[(InterpolatingFunction[{{0.`, 140554.44684630845`}}, <>]), False, Editable->False]}]}], }}], }}]], Output] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ (((Plot[{e[t] /. meg, a[t] /. meg, b[t] + 2 bb[t] /. meg, c[t] + 2 cc[t] /. meg, g[t] + 2 gg[t] /. meg} , {t, 0, 140554}, PlotStyle [Rule] {RGBColor[0.5, 0.5, 0.5], RGBColor[1, 0, 1], RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[0, 0, 1]}, PlotRange [Rule] All])([IndentingNewLine]) ))], Input], Cell[GraphicsData[PostScript, < %! %%Creator: Mathematica %%AspectRatio: .61803 MathPictureStart /Mabs { Mgmatrix idtransform Mtmatrix dtransform } bind def /Mabsadd { Mabs 3 -1 roll add 3 1 roll add exch } bind def %% Graphics %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10 scalefont setfont % Scaling calculations 0.0238095 6.77591e-06 0.0147143 0.615682 [ [.15933 .00221 -15 -9 ] [.15933 .00221 15 0 ] [.29485 .00221 -15 -9 ] [.29485 .00221 15 0 ] [.43036 .00221 -15 -9 ] [.43036 .00221 15 0 ] [.56588 .00221 -15 -9 ] [.56588 .00221 15 0 ] [.7014 .00221 -18 -9 ] [.7014 .00221 18 0 ] [.83692 .00221 -18 -9 ] [.83692 .00221 18 0 ] [.97244 .00221 -18 -9 ] [.97244 .00221 18 0 ] [.01131 .13785 -18 -4.5 ] [.01131 .13785 0 4.5 ] [.01131 .26099 -18 -4.5 ] [.01131 .26099 0 4.5 ] [.01131 .38412 -18 -4.5 ] [.01131 .38412 0 4.5 ] [.01131 .50726 -18 -4.5 ] [.01131 .50726 0 4.5 ] [ 0 0 0 0 ] [ 1 .61803 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath 0 g .25 Mabswid [ ] 0 setdash .15933 .01471 m .15933 .02096 L s [(20000)] .15933 .00221 0 1 Mshowa .29485 .01471 m .29485 .02096 L s [(40000)] .29485 .00221 0 1 Mshowa .43036 .01471 m .43036 .02096 L s [(60000)] .43036 .00221 0 1 Mshowa .56588 .01471 m .56588 .02096 L s [(80000)] .56588 .00221 0 1 Mshowa .7014 .01471 m .7014 .02096 L s [(100000)] .7014 .00221 0 1 Mshowa .83692 .01471 m .83692 .02096 L s [(120000)] .83692 .00221 0 1 Mshowa .97244 .01471 m .97244 .02096 L s [(140000)] .97244 .00221 0 1 Mshowa .125 Mabswid .05769 .01471 m .05769 .01846 L s .09157 .01471 m .09157 .01846 L s .12545 .01471 m .12545 .01846 L s .19321 .01471 m .19321 .01846 L s .22709 .01471 m .22709 .01846 L s .26097 .01471 m .26097 .01846 L s .32873 .01471 m .32873 .01846 L s .3626 .01471 m .3626 .01846 L s .39648 .01471 m .39648 .01846 L s .46424 .01471 m .46424 .01846 L s .49812 .01471 m .49812 .01846 L s .532 .01471 m .532 .01846 L s .59976 .01471 m .59976 .01846 L s .63364 .01471 m .63364 .01846 L s .66752 .01471 m .66752 .01846 L s .73528 .01471 m .73528 .01846 L s .76916 .01471 m .76916 .01846 L s .80304 .01471 m .80304 .01846 L s .8708 .01471 m .8708 .01846 L s .90468 .01471 m .90468 .01846 L s .93856 .01471 m .93856 .01846 L s .25 Mabswid 0 .01471 m 1 .01471 L s .02381 .13785 m .03006 .13785 L s [(0.2)] .01131 .13785 1 0 Mshowa .02381 .26099 m .03006 .26099 L s [(0.4)] .01131 .26099 1 0 Mshowa .02381 .38412 m .03006 .38412 L s [(0.6)] .01131 .38412 1 0 Mshowa .02381 .50726 m .03006 .50726 L s [(0.8)] .01131 .50726 1 0 Mshowa .125 Mabswid .02381 .0455 m .02756 .0455 L s .02381 .07628 m .02756 .07628 L s .02381 .10707 m .02756 .10707 L s .02381 .16863 m .02756 .16863 L s .02381 .19942 m .02756 .19942 L s .02381 .2302 m .02756 .2302 L s .02381 .29177 m .02756 .29177 L s .02381 .32256 m .02756 .32256 L s .02381 .35334 m .02756 .35334 L s .02381 .41491 m .02756 .41491 L s .02381 .44569 m .02756 .44569 L s .02381 .47648 m .02756 .47648 L s .02381 .53804 m .02756 .53804 L s .02381 .56883 m .02756 .56883 L s .02381 .59961 m .02756 .59961 L s .25 Mabswid .02381 0 m .02381 .61803 L s .5 .5 .5 r .5 Mabswid .02381 .01533 m .06244 .01533 L .10458 .01533 L .14415 .01534 L .18221 .01534 L .22272 .01534 L .26171 .01534 L .30316 .01534 L .34309 .01535 L .3815 .01535 L .40095 .01535 L .42237 .01536 L .46172 .01536 L .48113 .01537 L .502 .01538 L .52314 .01538 L .54323 .0154 L .56303 .01541 L .58142 .01543 L .60194 .01545 L .62055 .01548 L .64142 .01551 L .66062 .01556 L .69917 .01567 L .71799 .01575 L .73866 .01585 L .7598 .01597 L .77908 .01612 L .81799 .01652 L .83707 .0168 L .85783 .0172 L .87761 .01769 L .89862 .01839 L .91809 .01926 L .93637 .02036 L .95655 .02201 L .97505 .0241 L .97619 .02426 L s 1 0 1 r .02381 .01717 m .02846 .01718 L .03279 .01718 L .03754 .01718 L .04262 .01718 L .06244 .01721 L .07379 .01722 L .08451 .01724 L .10458 .01728 L .12455 .01734 L .14299 .0174 L .16331 .01749 L .18234 .01759 L .22018 .01787 L .24043 .01806 L .25895 .01828 L .27954 .01858 L .29866 .01892 L .33685 .01986 L .35738 .02057 L .37598 .02138 L .39523 .02244 L .41605 .02394 L .43599 .02582 L .45705 .02847 L .47669 .03175 L .49502 .03575 L .51538 .04155 L .53393 .04836 L .57378 .06877 L .61211 .09554 L .65289 .12894 L .69216 .16415 L .72991 .20188 L .77011 .2487 L .8088 .30143 L .84994 .36592 L .88956 .43569 L .92767 .50817 L .96823 .58775 L .97619 .60332 L s 1 0 0 r .02381 .0172 m .02499 .0159 L .02605 .01577 L .02846 .01555 L .03068 .01541 L .03279 .01531 L .03507 .01522 L .0375 .01514 L .04016 .01508 L .04262 .01503 L .04496 .01499 L .04749 .01496 L .05205 .01492 L .05483 .0149 L .05748 .01488 L .06244 .01485 L .0675 .01484 L .07289 .01482 L .07798 .01481 L .08259 .0148 L .08803 .01479 L .09391 .01479 L .10458 .01478 L .11408 .01477 L .12452 .01477 L .13541 .01476 L .14558 .01476 L .16594 .01476 L .18449 .01475 L .20358 .01475 L .22434 .01475 L .24411 .01475 L .2541 .01475 L .26512 .01475 L .27454 .01475 L .28447 .01475 L .28966 .01475 L .29535 .01475 L .30051 .01475 L .30532 .01475 L .30795 .01475 L .31037 .01475 L .31164 .01475 L .31303 .01475 L .31373 .01475 L .31448 .01475 L .3152 .01475 L .31585 .01475 L .31711 .01475 L .31828 .01475 L Mistroke .31957 .01475 L .32029 .01475 L .32094 .01475 L .32214 .01475 L .32343 .01475 L .32578 .01475 L .32803 .01475 L .33049 .01475 L .33547 .01475 L .34007 .01475 L .34437 .01475 L .35485 .01475 L .36476 .01475 L .38333 .01475 L .40328 .01475 L .42171 .01475 L .442 .01475 L .46103 .01475 L .49883 .01476 L .51905 .01476 L .53757 .01477 L .5474 .01477 L .55653 .01477 L .56719 .01478 L .57725 .01478 L .58709 .01479 L .59774 .0148 L .60743 .01482 L .61634 .01483 L .62606 .01485 L .63515 .01488 L .64511 .01491 L .6558 .01496 L .67701 .01509 L .69713 .01524 L .70677 .0153 L .71205 .01533 L .71701 .01535 L .72576 .01539 L .73041 .0154 L .73543 .01541 L .74491 .01543 L .75505 .01545 L .76617 .01549 L .77653 .01553 L .79727 .01566 L .81613 .01581 L .85608 .01619 L .89451 .01667 L .9354 .01736 L Mistroke .97477 .01824 L .97619 .01828 L Mfstroke 0 1 0 r .02381 .01613 m .02499 .01521 L .02605 .01519 L .02729 .01516 L .02846 .01513 L .03279 .015 L .03507 .01495 L .0375 .0149 L .04016 .01486 L .04262 .01483 L .04496 .01481 L .04749 .01479 L .05205 .01477 L .05483 .01476 L .05748 .01475 L .06244 .01474 L .0651 .01474 L .0675 .01473 L .07009 .01473 L .07289 .01473 L .07789 .01473 L .08259 .01472 L .08816 .01472 L .09404 .01472 L .09907 .01472 L .10458 .01472 L .10982 .01472 L .11478 .01472 L .12409 .01472 L .13411 .01472 L .145 .01472 L .1544 .01472 L .16478 .01472 L .17574 .01472 L .18579 .01472 L .20513 .01472 L .22599 .01472 L .24491 .01472 L .26561 .01472 L .28522 .01472 L .30617 .01472 L .32752 .01472 L .34767 .01472 L .36769 .01472 L .38614 .01472 L .39583 .01472 L .4049 .01472 L .41485 .01472 L .42044 .01472 L .42554 .01472 L Mistroke .428 .01472 L .43032 .01472 L .43161 .01472 L .43233 .01472 L .43299 .01472 L .43541 .01472 L .43772 .01472 L .43987 .01472 L .44104 .01472 L .44211 .01472 L .44329 .01472 L .44456 .01472 L .44585 .01472 L .4465 .01472 L .44722 .01472 L .44849 .01472 L .44967 .01472 L .45035 .01472 L .45107 .01472 L .45234 .01472 L .45522 .01472 L .45772 .01472 L .46004 .01472 L .4653 .01472 L .47037 .01472 L .47585 .01472 L .4858 .01472 L .49548 .01472 L .5044 .01472 L .5232 .01472 L .53388 .01472 L .54385 .01472 L .55429 .01472 L .56418 .01472 L .58273 .01472 L .59237 .01472 L .60262 .01472 L .61136 .01472 L .62103 .01472 L .63111 .01472 L .64035 .01472 L .6505 .01472 L .65561 .01472 L .6612 .01472 L .66647 .01472 L .67146 .01472 L .68079 .01472 L .68601 .01472 L .69083 .01472 L .70173 .01472 L Mistroke .71141 .01472 L .72047 .01473 L .7411 .01473 L .77989 .01474 L .79962 .01475 L .82114 .01475 L .84174 .01476 L .86086 .01478 L .90001 .0148 L .94162 .01484 L .97619 .01487 L Mfstroke 0 0 1 r .02381 .01647 m .03279 .01827 L .03793 .01928 L .04262 .01994 L .04517 .0202 L .04758 .02041 L .05034 .0206 L .05288 .02074 L .05747 .02092 L .05988 .021 L .06244 .02106 L .06743 .02116 L .07023 .0212 L .0728 .02123 L .07777 .02127 L .0825 .02131 L .08797 .02134 L .09305 .02136 L .09863 .02137 L .10458 .02139 L .11487 .02141 L .12066 .02141 L .12599 .02142 L .13642 .02143 L .14616 .02144 L .16499 .02145 L .18565 .02146 L .22456 .02147 L .26592 .02148 L .30576 .0215 L .34409 .02152 L .38488 .02154 L .42414 .02156 L .46189 .02159 L .5021 .02163 L .54078 .02167 L .58192 .0217 L .60245 .02172 L .62155 .02173 L .64115 .02175 L .65966 .02175 L .66947 .02176 L .67501 .02176 L .68011 .02176 L .68914 .02176 L .69414 .02176 L .6987 .02176 L .70102 .02176 L .70354 .02176 L .70593 .02176 L Mistroke .70814 .02176 L .71071 .02177 L .71305 .02177 L .71574 .02177 L .71828 .02177 L .72286 .02178 L .72708 .02179 L .73171 .0218 L .73659 .02182 L .74609 .02187 L .75627 .02194 L .77461 .02212 L .79589 .02239 L .81603 .02272 L .83598 .02315 L .85441 .02369 L .87311 .02442 L .89373 .02548 L .91311 .0268 L .93398 .02865 L .95406 .03096 L .97517 .03409 L .97619 .03426 L Mfstroke 0 0 m 1 0 L 1 .61803 L 0 .61803 L closepath clip newpath % End of Graphics MathPictureEnd >], Graphics, ImageSize->{288, 177.938}, ImageMargins->{{43, 0}, {0, 0}}, ImageRegion->{{0, 1}, {0, 1}}, ImageCache->GraphicsData[Bitmap, < CF5dJ6E]HGAYHf4PAg9QL6QYHgooooo`005Oooool00ol0003oooooooooo`2hoooo o`03 ool0oooooooooooo04gooooo000Eooooo`03o`000?oooooooooo0;Wooooo00?oo`3ooooooooo ool0 C?ooool001Gooooo00?o0000ooooooooool0^_ooool00ooo0?ooooooooooo`1;ooooo`005Ooo ool0 0ol0003oooooooooo`2kooooo`03ool0oooooooooooo04[ooooo000Eooooo`;o0000_Oooool0 0ooo 0?ooooooooooo`19ooooo`005Oooool00ol0003oooooooooo`2mooooo`03ool0oooooooooooo 04So oooo000Eooooo`03o`000?oooooooooo0;kooooo00?oo`3oooooooooool0Aoooool001Gooooo 00?o 0000ooooooooool0_oooool00ooo0?ooooooooooo`16ooooo`005Oooool00ol0003ooooooooo o`30 ooooo`03ool0oooooooooooo04Gooooo0002ooooo`;o00001?ooool00ol0003oooooooooo`03 oooo o`?o00001?ooool00ol0003oooooooooo`30ooooo`03ool0oooooooooooo04Gooooo00001Ooo oooo 0000oooooooooooo000000[ooooo00?o0000ooooooooool00oooool00ol0003oooooooooo`31 oooo o`03ool0oooooooooooo04Cooooo00001Ooooooo0000oooooooooooo000000Oooooo1Ol00004 oooo o`03o`000?oooooooooo0<;ooooo00?oo`3oooooooooool0@oooool00005ooooool0003ooooo oooo ool000001oooool01?l0003oooooooooool00005ooooo`;o0000a?ooool00ooo0?oooooooooo o`12 ooooo`0000Goooooo`000?ooooooooooo`000008ooooo`03o`000?oooooo000000Gooooo00?o 0000 ooooooooool0`oooool00ooo0?ooooooooooo`12ooooo`0000Goooooo`000?ooooooooooo`00 0009 ooooo`;o00001Oooool00ol0003oooooooooo`34ooooo`03ool0oooooooooooo047ooooo0002 oooo o`;o00002oooool00ol0003oooooooooo`03ooooo`03o`000?oooooooooo0oooool001Gooooo00?o0000ooooooooool0boooool00ooo0?oooooooooo o`0j ooooo`005Oooool00ol0003oooooooooo`3Oooool001Gooooo00?o0000oooooooo ool0 cOooool00ooo0?ooooooooooo`0hooooo`005Oooool2o`0007ooooo00?oo`3oooooooooool09?ooool001Gooooo00?o0000oooo oooo ool0h_ooool00ooo0?ooooooooooo`0Sooooo`005Oooool00ol0003oooooooooo`3Rooooo`03 ool0 oooooooooooo02?ooooo000Eooooo`03o`000?oooooooooo0>?ooooo00?oo`3oooooooooool0 8_oo ool001Gooooo00?o0000ooooooooool0hoooool00ooo0?ooooooooooo`0Rooooo`005Oooool0 0ol0 003oooooooooo`3Tooooo`03ool0oooooooooooo027ooooo000Eooooo`;o0000i_ooool00ooo 0?oo ooooooooo`0Pooooo`005Oooool00ol0003oooooooooo`3Uooooo`03ool0oooooooooooo023o oooo 000Eooooo`03o`000?oooooooooo0>Kooooo00?oo`3oooooooooool07oooool001Gooooo00?o 0000 ooooooooool0i_ooool00ooo0?ooooooooooo`0Oooooo`005Oooool00ol0003oooooooooo`3W oooo o`03ool0oooooooooooo01kooooo000Eooooo`03o`000?oooooooooo0>Oooooo00?oo`3ooooo oooo ool07_ooool000;ooooo0_l00004ooooo`03o`000?oooooooooo00;ooooo0ol00005ooooo`03 o`00 0?oooooooooo0>Sooooo00?oo`3oooooooooool07Oooool00005ooooool0003oooooooooool0 0000 1oooool01Ol0003ooooooooooooooooo000000Cooooo00?o0000ooooooooool0j?ooool00ooo 0?oo ooooooooo`0Mooooo`0000Goooooo`000?ooooooooooo`000007ooooo`05o`000?oooooooooo oooo ool000001?ooool2o`000>[ooooo00?oo`3oooooooooool07?ooool00005ooooool0003ooooo oooo ool000002?ooool3o`0000Gooooo00?o0000ooooooooool0jOooool00ooo0?ooooooooooo`0L oooo o`0000Goooooo`000?ooooooooooo`000007ooooo`05o`000?ooooooooooooooool000001?oo ool0 0ol0003oooooooooo`3Zooooo`03ool0oooooooooooo01_ooooo00001Ooooooo0000oooooooo oooo 000000Oooooo00Go0000ooooooooooooooooo`000004ooooo`03o`000?oooooooooo0>[ooooo 00?o o`3oooooooooool06oooool000;ooooo0_l00009ooooo`?o00001Oooool00ol0003ooooooooo o`3[ ooooo`03ool0oooooooooooo01[ooooo000Eooooo`03o`000?oooooooooo0>_ooooo00?oo`3o oooo ooooool06_ooool001Gooooo00?o0000ooooooooool0k?ooool00ooo0?ooooooooooo`0Ioooo o`00 5Oooool00ol0003oooooooooo`3/ooooo`03ool0oooooooooooo01Wooooo000Eooooo`;o0000 k_oo ool00ooo0?ooooooooooo`0Hooooo`005Oooool00ol0003oooooooooo`3]ooooo`03ool0oooo oooo oooo01Sooooo000Eooooo`03o`000?oooooooooo0>kooooo00?oo`3oooooooooool05oooool0 01Go oooo00?o0000ooooooooool0k_ooool00ooo0?ooooooooooo`0Gooooo`005Oooool00ol0003o oooo ooooo`3^ooooo`03ool0oooooooooooo01Oooooo000Eooooo`03o`000?oooooooooo0>oooooo 00?o o`3oooooooooool05_ooool001Gooooo00?o0000ooooooooool0koooool00ooo0?oooooooooo o`0F ooooo`005Oooool00ol0003oooooooooo`3`ooooo`03ool0oooooooooooo01Gooooo000Eoooo o`;o 0000lOooool00ooo0?ooooooooooo`0Eooooo`005Oooool00ol0003oooooooooo`3aooooo`03 ool0 oooooooooooo01Cooooo000Eooooo`03o`000?oooooooooo0?7ooooo00?oo`3oooooooooool0 5?oo ool001Gooooo00?o0000ooooooooool0l_ooool00ooo0?ooooooooooo`0Cooooo`005Oooool0 0ol0 003oooooooooo`3booooo`03ool0oooooooooooo01?ooooo000Eooooo`03o`000?oooooooooo 0??o oooo00?oo`3oooooooooool04_ooool001Gooooo00?o0000ooooooooool0loooool00ooo0?oo oooo ooooo`0Booooo`005Oooool00ol0003oooooooooo`3dooooo`03ool0oooooooooooo017ooooo 000E ooooo`;o0000mOooool00ooo0?ooooooooooo`0Aooooo`005Oooool00ol0003oooooooooo`3e oooo o`03ool0oooooooooooo013ooooo000Eooooo`03o`000?oooooooooo0?oooooo2Oooool001Go oooo 00?o0000ooooooooool0ooooool9ooooo`005Oooool00ol0003oooooooooo`3oooooo`Wooooo 000E ooooo`03o`000?oooooooooo0?oooooo2Oooool00?oooooo8Oooool00?oooooo8Oooool00?oo oooo 8Oooool00001 >], ImageRangeCache->{{{0, 287}, {176.938, 0}} -> {-12017.7, -0.0984178, 565.126, 0.00621951}}], Cell[BoxData[ TagBox[([SkeletonIndicator] Graphics [SkeletonIndicator]), False, Editable->False]], Output] }, Open ]], Cell[BoxData[ (But now I want to be able to take the values at the end condition, and feed them back into the chemoton function slightly changed . Please can someone show me how to do this ((??)( )))], Input] }, FrontEndVersion->5.1 for Macintosh, ScreenRectangle->{{0, 1024}, {0, 706}}, WindowSize->{1020, 560}, WindowMargins->{{Automatic, 0}, {Automatic, 4}} ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 11635, 185, 1368, Input], Cell[13414, 240, 358, 5, 21, Message], Cell[13775, 247, 358, 5, 21, Message], Cell[14136, 254, 365, 5, 21, Message], Cell[14504, 261, 364, 5, 21, Message], Cell[14871, 268, 367, 5, 21, Message], Cell[15241, 275, 332, 5, 21, Message], Cell[15576, 282, 359, 5, 21, Message], Cell[15938, 289, 359, 5, 21, Message], Cell[16300, 296, 359, 5, 21, Message], Cell[16662, 303, 354, 5, 21, Message], Cell[17019, 310, 333, 5, 21, Message], Cell[17355, 317, 5734, 165, 235, Output] }, Open ]], Cell[CellGroupData[{ Cell[23126, 487, 390, 7, 75, Input], Cell[23519, 496, 27683, 838, 186, 9122, 604, GraphicsData, PostScript, Graphics], Cell[51205, 1336, 130, 3, 27, Output] }, Open ]], Cell[51350, 1342, 269, 5, 43, Input] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************) But now I want to be able to take the values at the end condition, and feed them back into the chemoton function slightly changed. Please can someone show me how to do this?? Yours ever, Chrisantha www.chrisantha.com === Subject: Re: Numerical Eigenvalues for a 11x11 matrix > Hi everyone, > I am using MAthematica to perform some physical simulations, i. e. solving > master equations for the smallest eigenvalue, and I encounter a problem. > I have a 11x11 matrix and should find numerically it's smallest eigenvalue and > plot it as a function of x. The entries of the matrix are sums of Fermi > functions [f(x) = 1 / (1-exp(x))]. Now there occurs always an overflow error > (General::ovfl: Overflow occurred in computation). I can bypass this error > by not using the normal plot function, but rather ListPlot and calculate the > the matrix and its eigenvalue using a higher precision. The precision I have > to use varies between 500 and 1000, or even more for some settings, which > slows down my calculations very badly. > Since an 11x11 matrix is not so huge and there are quite good procedures for > numerically finding roots, I am somewhat puzzled by this behaviour of my > calculations, and it seems to me (after discussion with some other physicis > even more) that there should be some way to do such calculations without > using such enormous precision. > I am very thankful for any suggestions and help! > Fabian Try to post some actual code, so people can reproduce your problem. David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Triangularize Matrix for Newmark method Keff=L^TDL === Subject: Taking the Log causing Mathematica kernel crash. Mathematica 5.1 on Windows. Clear[Global`*] f[t_] := Sin[3.5 t] + 2 Cos[2 t]; g[t_] := Piecewise[{{0, t < -2Pi}, { f[t], t = -2Pi && t = 2Pi}, {0, t > 2Pi}}]; c[w_] := Integrate[ g[t] Exp[-I w t], {t, -Infinity, Infinity}] ; Plot[20 Log[10, Abs[c[w]]], {w, -5, 5}, PlotRange -> All] The above code causes Mathemtica kernel crash. Change the last line above to remove the Log, then it is OK: Plot[20 Abs[c[w]], {w, -5, 5}, PlotRange -> All] Nasser === Subject: BenchmarkReport[] It might be interesting for Mac folks, that the iMac G5 my son uses with the Student edition of Mathematica 5.1 clocked 0.77 with Panther. The same with Tiger is 0.96. A 24% increase. So, if you have a G5, do not hesitate to upgrade. J.87nos === Subject: Integrate gives wrong answer of: fmin[x_, p_]:=[p(1-(x-a+e)/(2e))^(p-1)]/2e which is the pdf of the minimum of p draws from a uniform distribution on [a-e,a+e], and Integrate[Abs[Min[mi,mc]-Min[mj,mc]]*fmin[mc,k]*fmin[mi,ni-k]*fmin[mj,nj-k], {mc,a-e,a+e},{mi,a-e,a+e},{mj,a-e,a+e},Assumptions->{kel_Integers, niel_Integers,njel_Integers,1<=k<=Min[ni,nj],0what I did) >testList = {{1, 8}, {2, 9}, {3, 10}, {4, 11}, {5, 12}, {6, 13}, {7, >14}}; >str = OpenWrite[test.dat]; >Write [str, testList]; Close[str]; >test.dat looks like {{1, 8}, {2, 9}, {3, 10}, {4, 11}, {5, 12}, {6, >13}, {7, 14}} >But, I want the test.dat to look like: >1 8 >2 9 >3 10 >4 11 >and so on... >Can anyone give me any suggestions as to how I can accomplish this? Probably the simplest way to achieve what you want is to use Export, i.e., Export[test.dat, testList, Table] -- To reply via email subtract one hundred and four === Subject: Re: MapThread >I have been working on the following problem: >states = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14} >stim = {33, 44, 55, 66, 77} >The locations of state 3,5,7,9,11 to be equal 33,44,55,66,77 >MapThread[{#1 = #2} &, {Take [states, {3, 12, 2}], stim}] >I tried to the above but it gives me errors: Set::setraw: Cannot >assign to raw object 3 >However these work individually: >MapThread[#1 &, {Take [states, {3, 12, 2}], stim}] This is exactly equivalent to Take[states, {3, 12, 2}] >MapThread[ #2 &, {Take [states, {3, 12, 2}], stim}] And this is exactly equivalent to stim That is MapThread isn't needed in either of these. Quite frankly, it is not at all obvious as to what it is you want. If what you are trying to create is a pairing of selected values from state with stim, then noting the values from state are odd integers starting from 3 MapIndexed[Flatten@{#1, 2 #2 + 1}&, stim] will do the trick. This can be made a little more general using Transpose@{stim, Take[states, {3, 12, 2}]} Which eliminates the assumption about the desired state values being odd integers -- To reply via email subtract one hundred and four