From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newscon07.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.stealth.net!news.stealth.net!central.cox.net!cox.net!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Jens-Peer Kuska Newsgroups: comp.soft-sys.math.mathematica Subject: Re: nth roots Organization: Universitaet Leipzig Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: Reply-To: kuska@informatik.uni-leipzig.de X-GC-Trace: gv1-WXE7RdBK3rBhck1+SU0Cw9LYK4UxcMsz+lF/M5wuobaBPpBti7IRoeeNg== NNTP-Posting-Date: Fri, 13 Sep 2002 22:27:46 CDT Lines: 26 X-Trace: sv3-KBtbbrnRkkOpOIPz8cifUDqgzL2NgsKqMNT0JoYa/J08/StXvzPFDjcqamR5Zpg+/oO1XKNd8goQDRy!37KeGyZpiTs2C1yzl/A38VClBSbQ0IvfQhdeFhlq0sN4NdMAOjpqeaTDiZ9gryU5Lqugi9U= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:27:46 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35144 Hi, > Simplify: > > 5nth sqrt (3)/sqrt (6) > > 5nth Sqrt(3) > ------------ > Sqrt(6) > > 1st.. is this the correct notation for use on a computer No. May be you mean 3^(1/5)/Sqrt[6] ?? > > 2nd.. how is the solution solved, step by step please. 3^(1/5)/Sqrt[6] // FullSimplify Regards Jens From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!howland.erols.net!newsfeed.mathworks.com!cyclone.swbell.net!newsfeed1.easynews.com!easynews.com!easynews!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Jens-Peer Kuska Newsgroups: comp.soft-sys.math.mathematica Subject: Re: ByteCount for Global symbols Organization: Universitaet Leipzig Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: Reply-To: kuska@informatik.uni-leipzig.de X-GC-Trace: gv1-Pclj6Ly4yePjyqws9eJsOFyll56bte2OOOSFNAwVDfrWPxRsar9H9+bDw== NNTP-Posting-Date: Fri, 13 Sep 2002 22:28:47 CDT Lines: 23 X-Trace: sv3-P5S7KjL37Tl5HNnvkcgzFoTvkqUrviB/MfOc8cvB8TUBiSissziETz3uaKpVKoeBGzvM4IooFK7QZIh!5+wQpcvhBqtJUv3Vk/TBIZRo9lVLwl2h3/jqNPvehO2s5T6mR97uvNmsRA== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:28:47 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35145 Hi, whats wrong with ToExpression[#, StandardForm, Hold] & /@ Names["Global`*"] /. Hold[a_] :> ByteCount[OwnValues[a]] Regards Jens DrBob wrote: > > I want to make a list of all symbols in the Global context, as in > > Names["Global`*"] > > and compute a ByteCount for each symbol's OwnValues -- without > evaluating the symbols. > > It seems possible in principle, but I haven't found a way. > > Bobby Treat From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!prodigy.com!cpk-news-hub1.bbnplanet.com!news.gtei.net!dca6-feed1.news.algx.net!ord2-feed1.news.algx.net!allegiance!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Jens-Peer Kuska Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Arrow pointers rather than Legend Organization: Universitaet Leipzig Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: Reply-To: kuska@informatik.uni-leipzig.de X-GC-Trace: gv1-IhGmVkNhxJ8UNdDMfS6zV373i7PQpiTSTV+MhmNQq+fXB+RzyOB3lGksQ== NNTP-Posting-Date: Fri, 13 Sep 2002 22:29:48 CDT Lines: 33 X-Trace: sv3-coMeaoHPUWa7k2MJ/ZarLwnSJl350GWGo5H9WPPTvO4GoeM7YC3uio4PTm5vmlvSVAmKSqEhEVaR42t!lZZLAgvPMMRvoZ3hkysn6I9PZf1w5irY8zcjj0qzoROM0GdcIfIyLXVyat8= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:29:48 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35146 Hi, Needs["Graphics`Arrow`"] Plot[{Sin[x], Cos[x]}, {x, 0, 2Pi}, Epilog -> {{GrayLevel[0.9], Rectangle[{3.75, 0.25}, {5.2, 0.9}]}, Arrow[{4, 0.75}, {2, Sin[2]}], Text[Sin[x], {4, 0.75}, {-1, 0}], Arrow[{4, 0.5}, {2, Cos[2]}], Text[Cos[x], {4, 0.5}, {-1, 0}]}] Regards Jens JM wrote: > > Instead of using Legend in plots with multiple series is there a way > to have arrows with a text at the end identifying the different > series? The reason I'd like this is that the legend is a bit 'bulky' > looking and I'd want something tidier. > > I know there is an Arrow package but I think you'd need to manually > enter each start and end point of each arrow - is there a simple > command to do this? > > Also - is there a way to adjust the legend font size? I.e. make it > small so that it doesn't interfere with data series. > _ > |\ > \ > \ > \ > \ > thankyou From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!enews.sgi.com!proxad.net!proxad.net!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Todd Gayley Newsgroups: comp.soft-sys.math.mathematica Subject: Re: JLINK and Outputting a Plot Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-b4RHZdp6zuNQujzv0U1pDN06CoH+hvH1XXyPz9VLD3+ayVJUq6VuPU8cw== NNTP-Posting-Date: Fri, 13 Sep 2002 22:30:50 CDT Lines: 42 X-Trace: sv3-0JNxd7v2QOti622SFpqC8vJ5A9nA+DNqKllHamrq8YEB3anLlbbZg/bUc+fk0Okfr4dcCCBzsnjJugd!TjFCIQ+dFfIvaRt5oZfQCciejBV8F9Vv2nW6qfS+Xn4OexBgYyo/xnT/Ans= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:30:50 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35147 At 12:14 AM 9/13/02, Blimbaum Jerry DLPC wrote: >I have written the following in a JLink program: > > >drawArea=JavaNew["com.wolfram.jlink.MathCanvas"]; > >then I perform an analysis of some data with output of this form.... > >plot = DisplayTogether[ListPlot[],ListPlot[].etc...]; > > >Unfortunately, at this point I dont know how to associate 'plot' with >drawArea so that > >draw.Area@RepaintNow[]; repaints the math screen to show the plots I've >computed... > > >I've tried draw.Area@update[plot] and draw.Area@setImage[plot] but these >dont work........how to fix?.........thanks..... Jerry, You use the MathCanvas.setMathCommand() method to specify the Mathematica command that is used to generate the image to display: drawArea.setMathCommand("plot"); You will find a very simple example of this in section 1.2.8.2 of the J/Link User Guide (in the Help Browser hierarchy, this is found at JLink/Part 1. Installable Java/Drawing and Displaying Images in Java Windows/Showing Graphics and Typeset Expressions). You do not need to use the repaintNow() method unless you are updating the image continuously in response to a user action, like dragging a slider. Todd Gayley Wolfram Research From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.cc.ukans.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!cox.net!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Matthias.Bode@oppenheim.de Newsgroups: comp.soft-sys.math.mathematica Subject: AW: nth roots Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-U9yWzTScCAYWb+/2QfeBEGCTgebo/2ITCTlzWvx2c6f18ba22ey+hxQog== NNTP-Posting-Date: Fri, 13 Sep 2002 22:31:51 CDT Lines: 55 X-Trace: sv3-SAoJoKMoElocfIBgucTNcX+l6PsKDTtr7zVuInNyJMVKxPpN3v+opsAfAfLeeM5kVR3lT6p6rd3geqR!B3gqdW7wJvTN2D7NIlQmttYdfARM94u3xgrIeh0TgDu8nkw9fvki+7NY2Oo= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:31:51 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35148 Hello watcher2, try: (((((3^(1/2))^(1/2))^(1/2))^(1/2))^(1/2))/(6^(1/2)) Out: 1/(Sqrt[2]*3^(15/32)) You can see what happened: 1st: 6^(1/2) = 2^(1/2)*3^(1/2); 2nd: subtraction of the 3's exponents (1/2)^5 - 1/2 = 1/32 - 16/32 = - 15/32. MATHEMATICA does these straightforward simplifications without you having to invoke Simplify[]. Best regards, Matthias Bode Sal. Oppenheim jr. & Cie. KGaA Koenigsberger Strasse 29 D-60487 Frankfurt am Main GERMANY Tel.: +49(0)69 71 34 53 80 Mobile: +49(0)172 6 74 95 77 Fax: +49(0)69 71 34 95 380 E-mail: matthias.bode@oppenheim.de Internet: http://www.oppenheim.de -----Ursprüngliche Nachricht----- Von: watcher2@sympatico.ca [mailto:watcher2@sympatico.ca] Gesendet: Freitag, 13. September 2002 07:14 An: mathgroup@smc.vnet.net Betreff: nth roots Simplify: 5nth sqrt (3)/sqrt (6) 5nth Sqrt(3) ------------ Sqrt(6) 1st.. is this the correct notation for use on a computer 2nd.. how is the solution solved, step by step please. From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.stealth.net!news.stealth.net!newsfeed.news2me.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin5.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Kyriakos Chourdakis Newsgroups: comp.soft-sys.math.mathematica Subject: LaTeX and Mathematica Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-NCTH9ShD6oHijWdz9Pt1IjN1fKK8DuMG/8W9R7xCht3ebgkObKCE/Icrg== NNTP-Posting-Date: Fri, 13 Sep 2002 22:32:52 CDT Lines: 33 X-Trace: sv3-AnilUe5Owvx0pWhLNQzyBWkS7l55QvwnKrT+rNoDHI3lJlaz7l/vx5ZtHqTutiY7NU5I3ZlnVmg3o31!aewxrlA97J+znyk+TKebXTHvM7QCCfopQpcQdAddvCFmsQUzJPysAhZhqA== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:32:52 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35149 Dear all, I want to include some Mathematica code in some lecture notes I am writing. For that purpose, I use the LaTeX style provided with Mathematica. It seems to be working fine when I produce a document that is just Mathematica code. The problem - as expected - is that when I include the Mathematica code as a part of a larger document, there are (1) clashes with existing packages (2) some LaTeX elements, such as the equations, start to use the Mathematica fonts too. My objective would be to typeset a document in standard LaTeX, where only the Mathematica code has the Mathematica feeling. Does anyone know of any style available that is completely seperated from all other LaTeX definitions? Best Kyriakos _____+*"*+____+*"*+___+*"*+__+*"*+_ Kyriakos Chourdakis Lecturer in Financial Economics URL: http://www.qmw.ac.uk/~te9001 tel: (++44) (+20) 7882 5086 Dept of Economics University of London, QM London E1 4NS U.K. From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!newsswitch.lcs.mit.edu!snoopy.risq.qc.ca!newsfeed.news2me.com!newsfeed1.easynews.com!easynews.com!easynews!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Jens-Peer Kuska Newsgroups: comp.soft-sys.math.mathematica Subject: Re: LaTeX and Mathematica Organization: Universitaet Leipzig Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: Reply-To: kuska@informatik.uni-leipzig.de X-GC-Trace: gv1-Sjg4db1mvCG6L8c3hctIUMRhoVQ/C4PrCWyEuR9Kz4oCr4ZDQo9DZ01aw== NNTP-Posting-Date: Wed, 18 Sep 2002 01:22:22 CDT Lines: 75 X-Trace: sv3-rDJT7FN6qletF2PnRUv3b1cA6h72bgRAl82tVw7jzXAtGxlIgLy4Q+wzznZ15ucs/NFD8Nlw3TZ1hkA!aZHEp/7qPtLL3X2x2J3iIufy7lHG9TGv1tWuZlg3M3VITrYaDX4FIHGLl+53YS9UNx+KRBc= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Wed, 18 Sep 2002 06:22:22 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35207 Hi, a) you must change the fonts, because the Mathematica symbols are designed to fit to Times/Helvetica/Courier and not to Computer Modern ! Mixing Computer Modern and the Mathematica fonts look not very nice because Comuter Modern has smaler strokes. You need atleast wrisym.sty, i.e. \usepackage[monospacemath]{wrisym} but this will switch the main document font to Times and the mono-space font to courier. With Mathematica 4.2 you can use Adobe-Garamond and Janson as document fonts too, with \usepackage[monospacemath,garamond]{wrisym} but this are commercial fonts and you have to buy it from Adobe. b) If you like the narrow monotype fonts similar to Computer Modern you can use the CMTT fonts, now included in Mathematica 4.2 Just use the package option \usepackage[cmtt]{wrisym} c) I have a TeX frontend that use only the wrisym package and a preprocessor. It run fine with the most style files But you have to use "TeX notebooks" that are essential TeX files with mathinput environments. The TeX frontend send the contents of the mathinput environments to the kernel and paste the output into the final TeX file. It also does some fancy formating with the Mathematica input and replace -> with \Rule, :> with \RuleDelayed .. You can have the program and the style files if you like. Regards Jens Kyriakos Chourdakis wrote: > > Dear all, > > I want to include some Mathematica code in some lecture notes I am writing. > For that purpose, I use the LaTeX style provided with Mathematica. It seems > to be working fine when I produce a document that is just Mathematica code. > > The problem - as expected - is that when I include the Mathematica code as > a part of a larger document, there are > (1) clashes with existing packages > (2) some LaTeX elements, such as the equations, start to use the > Mathematica fonts too. My objective would be to typeset a document in > standard LaTeX, where only the Mathematica code has the Mathematica feeling. > > Does anyone know of any style available that is completely seperated from > all other LaTeX definitions? > > Best > > Kyriakos > > _____+*"*+____+*"*+___+*"*+__+*"*+_ > > Kyriakos Chourdakis > Lecturer in Financial Economics > > URL: http://www.qmw.ac.uk/~te9001 > tel: (++44) (+20) 7882 5086 > Dept of Economics > University of London, QM > London E1 4NS > U.K. From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.stealth.net!news.stealth.net!central.cox.net!cox.net!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!smc.vnet.net!not-for-mail From: "Calimero" Newsgroups: comp.soft-sys.math.mathematica Subject: Help Browser freezes Organization: Universitat Jaume I Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: NNTP-Posting-Date: Fri, 13 Sep 2002 22:33:53 CDT Lines: 7 X-Trace: sv3-MKJoc4FrYGzbG/39/nGUl0TXXUshJZv/EeW3lVBfx+lDENYSk7+vhWjEX+uKYRVpJw5A3sGmd141SI2!ebtSQoHPM0HrbmKsIlS5Zew/NboEHX+zqSQzlluZXFz6z3BYDKKPTgy6kHsaausZ4g== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:33:53 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35150 What about this problem? I have tried the previous suggestions but none of them worked. Will Wolfram help us in this problem? From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!prodigy.com!cpk-news-hub1.bbnplanet.com!washdc3-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!cyclone.swbell.net!cyclone-sf.pbi.net!216.166.71.10!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "Vynce" Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Help Browser freezes Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: X-GC-Trace: gv1-Ze/RLiZ7Qc5tdEyg2zV8qHpD0T6ou1iBdD1NxWCYvfYlF3OyzB0urqAQg== NNTP-Posting-Date: Sat, 14 Sep 2002 23:19:45 CDT Lines: 17 X-Trace: sv3-vvtE16KhaUgQsJ/gdg5pc1aXdhbtlkgFHZd3e0nhTTgf2QUrIQncL5ep5eU5h5fWO+ULQgMzTB4ZlU9!RDbGPIsbdWFjC1cO6HgLhanK7PyaWVKPO9YJpFpiR8qpAdyDWxRgRzEo X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:19:45 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35167 Have you tried deleting ... \Mathematica\4.2\Documentation\English\MainBook\BrowserIndex.nb There are two BrowserIndex files. Only delete the .nb one (or just move it somewhere else). "Calimero" wrote in message news:aluavi$nk7$1@smc.vnet.net... > What about this problem? I have tried the previous suggestions but none of > them worked. Will Wolfram help us in this problem? > > > > > From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!prodigy.com!nntp.flash.net!news-out.visi.com!hermes.visi.com!newsfeed.news2me.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!smc.vnet.net!not-for-mail From: mark@markfisher.net (Mark Fisher) Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Empirical CDF and InterpolatingFunction Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: NNTP-Posting-Date: Fri, 13 Sep 2002 22:34:54 CDT Lines: 95 X-Trace: sv3-MJBcJ7DEIvcSOBw7eY49GS4jEgLOF5M1YK5Z2wvC8e9fYRQ0rpjvWWqRJI00idtdQV9FFpQZffIt/c5!P2NtoBaOYrkA5LVmK92Ai7dRVhNoqDF6+X0NteU0ZTgyLzLSPQMimHlqURnhx7jPrw== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:34:54 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35151 Daniel Lichtblau made two suggestions that allow one to use Interpolation the way I wanted. First, to make the resulting function right-continuous, change the sign twice. Second, to make the end point return the correct value, add an extra (phantom) observation (with an extra (irrelevant) value). (The phantom observation is made at the high end because of the sign reversals.) Here's the code I cooked up based on his suggestions: MakeEmpiricalCDF::usage = "MakeEmpiricalCDF[list] returns a function that evaluates the empirical CDF given the observations in the list. The function is defined on the entire real line." MakeEmpiricalCDF[list_?(VectorQ[#, NumericQ]&)] := Module[{n, s, a, r, idata}, n = Length[list]; s = Sort[list]; a = Append[s, s[[-1]] + 1]; (* phantom obs. *) r = Range[1/n, 1 + 1/n, 1/n]; (* phantom value 1 + 1/n *) idata = Last /@ Split[Transpose[{-a, r}], #1[[1]] == #2[[1]]&]; (* "-a" is the first sign change *) Block[{x}, Function @@ {x, Which @@ { x < s[[ 1]], 0., x > s[[-1]], 1., True, Interpolation[idata, InterpolationOrder -> 0][-x] (* "-x" is the second sign change *) }}] ] The construction "Last /@ Split[ ... ]" accounts for duplicate values. Here are two examples. Needs["Statistics`ContinuousDistributions`"] list1 = RandomArray[NormalDistribution[0, 1], 100]; f1 = MakeEmpiricalCDF[list1]; Plot[f1[x], {x, -4, 4}] list2 = Table[Random[Integer, {1, 10}], {10}]; f2 = MakeEmpiricalCDF[list2]; Plot[f2[x], {x, 0, 11}] --Mark mark@markfisher.net (Mark Fisher) wrote in message news:... > I'm trying to write a fast empirical cummulative distribution function > (CDF). Empirical CDFs are step functions that can be expressed in > terms of a Which statement. For example, given the list of > observations {1, 2, 3}, > > f = Which[# < 1, 0, # < 2, 1/3, # < 3, 2/3, True, 1]& > > is the empirical CDF. Note that f /@ {1, 2, 3} returns {1/3, 2/3, 1} > and f is continuous from the right. > > When the number of observations is large, the Which statement > evaluates fairly slowly (even if it has been Compiled). Since > InterpolationFunction evaluates so much faster in general, I've tried > to use Interpolation with InterpolationOrder -> 0. The problem is that > the resulting InterpolatingFunction doesn't behave the way (I think) > it ought to. For example, let > > g = Interpolation[{{1, 1/3}, {2, 2/3}, {3, 1}}, InterpolationOrder -> > 0] > > Then, g /@ {1, 2, 3} returns {2/3, 2/3, 1} instead of {1/3, 2/3, 1}. > In addition, g is continuous from the left rather than from the right. > > Obviously I am not aware of the considerations that went into > determining the behavior of InterpolationFunction when > InterpolationOrder -> 0. > > So I have two questions: > > (1) Does anyone have any opinions about how InterpolatingFunction > ought to behave with InterpolationOrder -> 0? > > (2) Does anyone have a faster way to evaluate an empirical CDF than a > compiled Which function? > > By the way, here's my current version: > > CompileEmpiricalCDF[list_?(VectorQ[#, NumericQ] &)] := > Block[{x}, Compile[{{x, _Real}}, Evaluate[ > Which @@ Flatten[ > Append[ > Transpose[{ > Thread[x < Sort[list]], > Range[0, 1 - 1/#, 1/#] & @ Length[list] > }], > {True, 1}]] > ]]] > > --Mark From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!prodigy.com!rip!newsfeeds-atl1.usenetserver.com!news.webusenet.com!news-hub.cableinet.net!blueyonder!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "Rob_jack" Newsgroups: comp.soft-sys.math.mathematica Subject: Re: NIntegrate Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: X-GC-Trace: gv1-4R230dIMQ6iSzZdCH8KE8ZZl9k6mGcMz6zBfeB5Smodrk5p1Z4RpWULCg== NNTP-Posting-Date: Fri, 13 Sep 2002 22:35:55 CDT Lines: 28 X-Trace: sv3-3u4zXIyotd7zhRXL0a9oWeydEhrd4nj2Y5lM6dZE8WWa3CqFqbEQhNBc899+kUOepnIyOEJEBZfJD33!MTfyrqWn/H6Fz6Sb69y2OfjXh7yg55TxLhO3wqklyfkE0U2Q7Watid556g== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:35:55 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35152 "Jens-Peer Kuska" wrote > > do you realy think that > > 1.07577/( 1+7.12336*10^-7 (1. + z)^2 ) > > with the z inside is numerical ? or do you mean > > F[z_?NumericQ]: = NIntegrate[f[y,z], {y, 0, Infinity}] > I'm a newbie, bat I mean: ************************* In[1]= NumericQ[z] Out[1]=False ************************* BTW, z is a real number. -- Rob_jack From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!newsswitch.lcs.mit.edu!snoopy.risq.qc.ca!newsfeed.news2me.com!west.cox.net!cox.net!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Jack Goldberg Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Re: A symbol for Floor Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-xWXnNnLm9a2NlsSmP73S/yBooHN1lM3Y5PDIB3F5dwZoNlVFZucxe+2Hg== NNTP-Posting-Date: Fri, 13 Sep 2002 22:36:56 CDT Lines: 18 X-Trace: sv3-TChu9r3QaowNmdS2a9MtQsmWIPOna/+Cabb4QNYnlOxUxM9rIhhCQBkpkpABTZ4wTe75Kx6r2cPIelN!0GXaAmb3NnRTuHBkM8Y4Pit/d/DgOsyAl5OLLXyUzkB0F5nY/omBatzJZT67U03qk3JtfUU= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:36:56 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35153 Hi Group; First a thank you to all those who pointed out to me (and others apparently) about the various ways to input the symbolic form of Floor. On a larger note, it surprises me that no one has yet published a book on how to use Mathematica to write a technical document. The number of questions that appear on this board concerning the details of "how to do it" suggests the need for such documentation. I'm speculating when I say that many users give up in frustration and go back to (or learn) Latex. At least there are bookcases full of "learning Latex". I myself have 5! I don't mean this to sound like a rant, but using Mathematica to publish a document is, for most of us, not worth the effort. Jack From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!rip!ps01-chi1!news.webusenet.com!snoopy.risq.qc.ca!aotearoa.belnet.be!news.belnet.be!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin5.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Jack Goldberg Newsgroups: comp.soft-sys.math.mathematica Subject: Checking Programming errors; a ? Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-qb42yEsWeb3K8pm8YKtsDuOQXcpNc8iDXiamBwOxvbMyGiCB00NAaelKQ== NNTP-Posting-Date: Fri, 13 Sep 2002 22:37:57 CDT Lines: 48 X-Trace: sv3-CRI01UWMZv8ptDODBdlu02wfCVX5d9rJJMDPafaOF+OHsY7kgQDqUE9xjNAPKvCOjlVDTcNpDXVmvZO!xSEcp09vk1XXuy6U9Xty2ckFqpMRNvk1C8wOT2ZysWxV0TAvtiBgTwntg5+cIazmnjGmJe4= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:37:57 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35154 Hi Group: I often run into this difficulty: when designing a program, say as a module, and testing it for various inputs, I get wrong answers. What to do? I use a method that works for me but may not be the best available. I want to show my method and then ask a question about how it can be imporved. (Oh yes, I abandoned Trace a long time ago!) myFunction[f_] := Module[ {L1,L2,L3}, L1 = ... ; L2 = ... ; l3 = ... ; "final step" ] To see what went wrong, I use (* *) selectively as follows: Stage 1 myFunction[f_] := Module[ {L1,L2,L3}, L1 = ... (*; L2 = ... ; L3 = ... ; "final step" *) ] Thus I see if L1 worked as expected. The next step is to put (* after L2 and see if this works. I continue this til the bitter end and I usually find my errors. My question; The process of moving (* *) step by step through the program is quite tedious when the code has lots more lines. What I would like is a "meta-program" which (like FoldList) does this job for me. The output of this "meta-program" is the list of outputs of each line in the module, probably best printed as a column. This sounds like Trace but my problem with Trace is it is terribly difficult to read. For the not-so-subtle programming I do, the only thing I need is what expression is returned line by line. Any advice? All remarks are appreciated! Jack From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!enews.sgi.com!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Jens-Peer Kuska Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Checking Programming errors; a ? Organization: Universitaet Leipzig Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: Reply-To: kuska@informatik.uni-leipzig.de X-GC-Trace: gv1-4R230dIMQ6iSzZdCH8KE8ZZl9k6mGcMz6zBfeB5Smodrk5p1Z4RpWULCg== NNTP-Posting-Date: Wed, 18 Sep 2002 01:23:23 CDT Lines: 60 X-Trace: sv3-sGrqzDhlHCLD100+FaaWflISJBoXKC6h1j8IgFVb41ECO4AZfski81i5mZpYiTYLyJkpSdTqcyc6G5E!QS5xdcLKe4KZFOBWX+KnBCfO6euDAls0pYPcQ6yYlX11anR0jJXykqfsBQ== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Wed, 18 Sep 2002 06:23:24 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35208 Hi, does http://www.mathsource.com/Content/Enhancements/FrontEnd/0211-037 help you ? Regards Jens Jack Goldberg wrote: > > Hi Group: > > I often run into this difficulty: when designing a program, say as a > module, and testing it for various inputs, I get wrong answers. What to > do? I use a method that works for me but may not be the best available. > I want to show my method and then ask a question about how it can be > imporved. (Oh yes, I abandoned Trace a long time ago!) > > myFunction[f_] := Module[ {L1,L2,L3}, > > L1 = ... ; > L2 = ... ; > l3 = ... ; > "final step" > > ] > > To see what went wrong, I use (* *) selectively as follows: > > Stage 1 > > myFunction[f_] := Module[ {L1,L2,L3}, > > L1 = ... (*; > L2 = ... ; > L3 = ... ; > "final step" *) > > ] > > Thus I see if L1 worked as expected. The next step is to put (* after L2 > and see if this works. I continue this til the bitter end and I usually > find my errors. > > My question; The process of moving (* *) step by step through the > program is quite tedious when the code has lots more lines. What I would > like is a "meta-program" which (like FoldList) does this job for me. The > output of this "meta-program" is the list of outputs of each line in the > module, probably best printed as a column. > This sounds like Trace but my problem with Trace is it is terribly > difficult to read. For the not-so-subtle programming I do, the only thing > I need is what expression is returned line by line. > > Any advice? All remarks are appreciated! > > Jack From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!newsfeed1.bredband.com!bredband!HSNX.atgi.net!cyclone-sf.pbi.net!216.166.71.10!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail From: mark@markfisher.net (Mark Fisher) Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Checking Programming errors; a ? Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: X-GC-Trace: gv1-dSjAeWhPL8qGpUQPiFzQrfCSkwKwgxJM8xf0c1BldhcSDeLl3aU8iqI2Q== NNTP-Posting-Date: Wed, 18 Sep 2002 01:11:02 CDT Lines: 93 X-Trace: sv3-s0b6Zfqc3BKnz5hL2AUbPawyeI45jY9s0vim6J4Vudzwc/0R++LU6g6DEMoECbXRGKrzINDOGCbHfJZ!+sq7r8Wvr+l1RHunkVdhIUnTvk51saHNH+mu25Go3Toa3chKdeugPm30nQ== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Wed, 18 Sep 2002 06:11:02 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35196 I've enhanced the code for PartialEvaluation (see my post, which I incorrectly attaced to someone else's reply). It is somewhat more flexible now and does more error checking. It finds the rule in DownValues that matches f[args] (allowing for more than one rule in DownValues); it allows the user to specify the position of the "main" CompoundExpression; and it allows the user to specify an expression that gets appended to the truncated CompoundExpression (and hence evaluated and returned). The package is just a bit too large to post here. It can be downloaded from my web site at http://www.markfisher.net/~mefisher/mma/mathematica.html Nevertheless, I can give an outline of the code here (absent the error checking stuff). PartialEvaluation[f[args], n, expr]: (* get the DownValues and "turn them off" *) dv = DownValues[f]; DownValues[f] = {}; (* find the rule that matches *) matches = Position[MatchQ[f[args], #]& /@ dv[[All, 1]], True]; match = dv[[ matches[[1, 1]] ]]; (* find the "main" CompoundExpression *) ppos = Position[match, HoldPattern[CompoundExpression[__]]]; pos = First[Sort[ppos]]; (* extract, truncate, append to, and reinsert it *) held = Extract[match, pos, Hold]; held = ReplacePart[held, Sequence, {1, 0}]; held = Take[held, n]; held = Join[held, Hold[expr]]; held = ReplacePart[Hold[Evaluate[held]], CompoundExpression, {1, 0}]; match = ReplacePart[match, held, pos, 1]; (* apply the modified rule and restore DownValues *) result = f[args] /. match; DownValues[f] = dv; result --Mark Jack Goldberg wrote in message news:... > Hi Group: > > I often run into this difficulty: when designing a program, say as a > module, and testing it for various inputs, I get wrong answers. What to > do? I use a method that works for me but may not be the best available. > I want to show my method and then ask a question about how it can be > imporved. (Oh yes, I abandoned Trace a long time ago!) > > myFunction[f_] := Module[ {L1,L2,L3}, > > L1 = ... ; > L2 = ... ; > l3 = ... ; > "final step" > > ] > > To see what went wrong, I use (* *) selectively as follows: > > Stage 1 > > myFunction[f_] := Module[ {L1,L2,L3}, > > L1 = ... (*; > L2 = ... ; > L3 = ... ; > "final step" *) > > ] > > Thus I see if L1 worked as expected. The next step is to put (* after L2 > and see if this works. I continue this til the bitter end and I usually > find my errors. > > My question; The process of moving (* *) step by step through the > program is quite tedious when the code has lots more lines. What I would > like is a "meta-program" which (like FoldList) does this job for me. The > output of this "meta-program" is the list of outputs of each line in the > module, probably best printed as a column. > This sounds like Trace but my problem with Trace is it is terribly > difficult to read. For the not-so-subtle programming I do, the only thing > I need is what expression is returned line by line. > > Any advice? All remarks are appreciated! > > Jack From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.stealth.net!news.stealth.net!central.cox.net!cox.net!nntp2.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "David Park" Newsgroups: comp.soft-sys.math.mathematica Subject: RE: Arrow pointers rather than Legend Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-jgZ7mzdEufEyBowEaur+iCJYbbNyNVWBT4thny01v5z9HzN4ql8UXZ7DA== NNTP-Posting-Date: Fri, 13 Sep 2002 22:39:01 CDT Lines: 49 X-Trace: sv3-cu223z5DbgKKOHVskLuNjsvmNUuJVyrar0XixAW1ELd6TqKeCZgryC9rnYc2o6CGS9fXa3mVSxskW5O!6EMrvPSHxDmf5RKSNQoLnkS91MjVZxF3C+mvKha9Jmr0TipdfEF7JPfUsA== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:39:01 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35155 JM, You are certainly correct in wanting to make a tidier plot! Legends are often poor because they actually distract from the message of the data. However, the best solution will depend on the particular nature of your data. If there are not too many curves you could perhaps put Text labels right on top of each curve. If there are many curves, or some of them are close together, use arrows for some of them. If you have a really large number of curves, then maybe a different approach is needed. It is probably not possible to make a useful general routine for labeled arrows because the best placement would depend upon the particular nature of the graph. So, to make a nice graphic you will have to do some "hand" work, specifying each Arrow and Text label. You can actually click the coordinates off the graph to put into the Arrow and Text statements. If you want to actually show me your plot, I could try to make some suggestions. David Park djmp@earthlink.net http://home.earthlink.net/~djmp/ From: JM [mailto:j_m_1967@hotmail.com] Instead of using Legend in plots with multiple series is there a way to have arrows with a text at the end identifying the different series? The reason I'd like this is that the legend is a bit 'bulky' looking and I'd want something tidier. I know there is an Arrow package but I think you'd need to manually enter each start and end point of each arrow - is there a simple command to do this? Also - is there a way to adjust the legend font size? I.e. make it small so that it doesn't interfere with data series. _ |\ \ \ \ \ thankyou From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!newsfeed.wirehub.nl!news.stealth.net!news.stealth.net!central.cox.net!cox.net!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Dale Horton Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Using Slide View in mathematica 4.2 Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-jgZ7mzdEufEyBowEaur+iCJYbbNyNVWBT4thny01v5z9HzN4ql8UXZ7DA== NNTP-Posting-Date: Fri, 13 Sep 2002 22:40:02 CDT Lines: 33 X-Trace: sv3-8EmPcn5540HIX4utriyJ7xvG2OM2m5O5vjh9kzE20nVza630P1uyoI6L/aqndAuMnuyxEi3lhxRTraV!3vimP5BlD5cxJ2XsgEcU8eM0ywIPsWTKgnUUPkawvVRoWyE4yY2FJnEkRWFK4gbx7DrtUj8= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:40:02 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35156 At 02:27 AM 9/11/2002, Brian Higgins wrote: >I am interested in creating a slide presentation using slide view >mode in Mathematica 4.2. I would like to have hyperlinks between >different slides ( e.g., a hyperlink in say slide 6 takes me back to >slide 3). > >I have no difficulty in creating such a hyperlink (using tags) when I >am in the author mode. But the hyperlink does not work when a revert >back to slide view mode. > >I guess it has somthing to do with the fact that in author view mode >your slides are a subset of a single notebook but in slide view mode >each slide becomes a distinct notebook. > >So my question: Is there a way to reference the individual slides >using the hyperlink command? > >Thanks in advance for all your help > >Brian If you set "PagewiseScrolling"->True, then your hyperlink will work. Go to the Option Inspector and set the scope to Notebook. Then go to the option NotebookOptions|Window Properties|ScrollingOptions|"PagewiseScrolling" And set it to True. The disadvantage to this setting is that you can now only have one screen's worth of contents per slide. (But then it is a slide show after all, so maybe that's not so bad.) -Dale From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!newsfeed.mathworks.com!cyclone.swbell.net!newsfeed1.easynews.com!easynews.com!easynews!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!not-for-mail From: swidrygiello@wp.pl (Swidrygiello) Newsgroups: comp.soft-sys.math.mathematica Subject: empirical CDF Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-cl6NdIV5U+aPwg15iacaHIkVGa1B7ZUTabspgW2hKFRijG58djU+OVbbA== NNTP-Posting-Date: Fri, 13 Sep 2002 22:41:03 CDT Lines: 10 X-Trace: sv3-cd0Iw4RfqTzkHDB/Yp7ygyEsPccs2/rA7JziRs+TzUnjLlw/wtWgh+JJqlu1Kl4T8QoX/LMNcAQX3vt!kobf4UFR0QqwAyp3FLd67mK2LKGn8JHH2nJ6X+1LXU2llJohnK/I1RcIZw== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:41:03 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35157 Hello!!! Does anybody know how to calculate in Mathematica: a)empirical CDF, b)empirical PDF, c)normal QQ-plot; d)QQ-plot two different random samples?! Swidrygiello. From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news-out.triton.net!triton.net!newsfeeder.triton.net!nntp-relay.ihug.net!ihug.co.nz!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "ng" Newsgroups: comp.soft-sys.math.mathematica Subject: Postponing loading of Package Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-oBmm5MQbX7ylXDXsqXiDUc5zUS6/fPXhvho3b7ftGLjx+TITBQBWfcf7Q== NNTP-Posting-Date: Fri, 13 Sep 2002 22:42:04 CDT Lines: 36 X-Trace: sv3-t6HOjLjZPwe9AftizgaMbJQ3TAX+0WWnw3A5aw6R8Tu6pWeNBHwutztkvqsqfypNzTc9MfM7CtJfXOj!KhHjtA5VobZG2rhCjUdw9Mzns+pYB7MfzAUyOzrt+YddRtlkLM6BvYLf3w== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:42:04 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35158 I wrote a package (call it "ThisPackage`") that uses DeclarePackage["OtherPackage`", {"BigVariable"} ]. The idea was to prevent the loading of a large file in routine cases. However, when ThisPackage` defines its functions, inside the Private` area, it includes a conditional call to BigVariable. It turns out that OtherPackage is loaded when that function is defined. I was wondering if there is a way to avoid this. Roughly speaking, here is the setting: BeginPackage[ "OtherPackage`" ] BigVariable::usage="example Begin[Private`] BigVariable=Table[x y,{x,1000},{y,1000}] End[ ] EndPackage[ ] BeginPackage[ "ThisPackage`" ] function::usage="example Begin[Private`] function[x_]:=Module[{y}, y=If[x>1000,BigVariable[[x]],x] ] End[ ] EndPackage[ ] I don't want OtherPakage to be loaded unless function[x] is called with x>1000 but it loads when function is defined. Any ideas? Thanks! Nicholas From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!triton.net!smallfeed.triton.net!newsfeed.wirehub.nl!newsfeed.news2me.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Jens-Peer Kuska Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Postponing loading of Package Organization: Universitaet Leipzig Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: Reply-To: kuska@informatik.uni-leipzig.de X-GC-Trace: gv1-xWXnNnLm9a2NlsSmP73S/yBooHN1lM3Y5PDIB3F5dwZoNlVFZucxe+2Hg== NNTP-Posting-Date: Wed, 18 Sep 2002 01:24:26 CDT Lines: 67 X-Trace: sv3-BKgizL3Wzwjcd9CI+7dfR9inJMjRHYKQy6zeo9KLga8fYe0FyrFJucWDTqgJYWu4llL0Z0rumLtq+aJ!s+5NKae3CT0TLvmg82EJRDrHzya2z8+FBLrocib1KFBI2rKJ45pUdggHcA== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Wed, 18 Sep 2002 06:24:26 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35209 Hi, BeginPackage[ "OtherPackage`" ] BigVariable::usage="example" Begin["`Private`"] BigVariable=Table[x y,{x,1000},{y,1000}] End[ ] EndPackage[ ] Print["Loading ..."]; and BeginPackage[ "ThisPackage`" ] function::usage="example" Begin["`Private`"] function[x_]:=Module[{y}, y=If[x>1000, Needs["OtherPackage`"]; OtherPackage`BigVariable[[x]], x] ] End[ ] EndPackage[ ] should do that. Regards Jens ng wrote: > > I wrote a package (call it "ThisPackage`") that uses > DeclarePackage["OtherPackage`", {"BigVariable"} ]. The idea was to prevent > the loading of a large file in routine cases. However, when ThisPackage` > defines its functions, inside the Private` area, it includes a conditional > call to BigVariable. It turns out that OtherPackage is loaded when that > function is defined. I was wondering if there is a way to avoid this. > Roughly speaking, here is the setting: > > BeginPackage[ "OtherPackage`" ] > BigVariable::usage="example > Begin[Private`] > BigVariable=Table[x y,{x,1000},{y,1000}] > End[ ] > EndPackage[ ] > > BeginPackage[ "ThisPackage`" ] > function::usage="example > Begin[Private`] > function[x_]:=Module[{y}, > y=If[x>1000,BigVariable[[x]],x] ] > End[ ] > EndPackage[ ] > > I don't want OtherPakage to be loaded unless function[x] is called with > x>1000 but it loads when function is defined. Any ideas? > > Thanks! > > Nicholas From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!newsswitch.lcs.mit.edu!snoopy.risq.qc.ca!newsfeed.news2me.com!newsfeed-west.nntpserver.com!hub1.meganetnews.com!nntpserver.com!telocity-west!TELOCITY!news-out.spamkiller.net!propagator2-maxim!news-in.spamkiller.net!feed.newsfeeds.com!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "John Jowett" Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Postponing loading of Package Organization: CERN Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: X-GC-Trace: gv1-fs1Ggvvpld9I76f7qQddEKP5R3Un9In1NhDqw4LyYSrSLy+yAkC7F7g3g== NNTP-Posting-Date: Wed, 18 Sep 2002 01:02:40 CDT Lines: 54 X-Trace: sv3-fImB8SJuQEG37cIM0mZMhiNZPF8bCsXdpa3SeaZ+fTazrDVCUj+gEwiKBri6XlZpvXdajvUmU8e16/L!iYpY7OW0hyLw1uUlCJkYc+XM2WtcYFJ5OJgYRRJMSwPnCqQ+C+kryI785Q== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Wed, 18 Sep 2002 06:02:40 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35188 Hello, Dynamic programming might help: replace the line defining BigVariable with BigVariable:=BigVariable=Table[x y,{x,1000},{y,1000}] Then the table will not be calculated unless it is needed. (See the section on "Functions that Remember Values They Have Found", 2.4.9 in the Mathematica Book). John Jowett "ng" wrote in message news:alubet$no8$1@smc.vnet.net... > I wrote a package (call it "ThisPackage`") that uses > DeclarePackage["OtherPackage`", {"BigVariable"} ]. The idea was to prevent > the loading of a large file in routine cases. However, when ThisPackage` > defines its functions, inside the Private` area, it includes a conditional > call to BigVariable. It turns out that OtherPackage is loaded when that > function is defined. I was wondering if there is a way to avoid this. > Roughly speaking, here is the setting: > > BeginPackage[ "OtherPackage`" ] > BigVariable::usage="example > Begin[Private`] > BigVariable=Table[x y,{x,1000},{y,1000}] > End[ ] > EndPackage[ ] > > BeginPackage[ "ThisPackage`" ] > function::usage="example > Begin[Private`] > function[x_]:=Module[{y}, > y=If[x>1000,BigVariable[[x]],x] ] > End[ ] > EndPackage[ ] > > > I don't want OtherPakage to be loaded unless function[x] is called with > x>1000 but it loads when function is defined. Any ideas? > > > Thanks! > > Nicholas > > > > > From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.stealth.net!news.stealth.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!mango.news.easynet.net!easynet.net!proxad.net!proxad.net!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Tomas Garza Newsgroups: comp.soft-sys.math.mathematica Subject: Re: trying to pull numbers out of a string from a file... Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: <200209130514.BAA17465@smc.vnet.net> X-GC-Trace: gv1-hGHFQCTDtHHwfTmCukSRZZ/rKjEfHdhn3o3yT1RuysHZEZKugfJauTTwg== NNTP-Posting-Date: Fri, 13 Sep 2002 22:43:05 CDT Lines: 43 X-Trace: sv3-4bys59gGhaYUzhSVP0Ed69o+yFWDOqIMPN0KyZaaky/ybBQdX5nTBjAWEm9x9/+rakiWZpq0WLMLn7V!IpI6RUqRNoi8RS7jNOZNx3c2OieqtEyMQ9LTKeQjpWG91o5204wnCDndSA8t9aZXd3X6M/I= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:43:05 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35159 Could you send a sample example of your file -- just a few records. Tomas Garza Mexico City ----- Original Message ----- From: "1.156" Subject: trying to pull numbers out of a string from a file... > I've got to extract some numbers from a file that are in lines of text. Since the line contents are not numbers, I presume I must pull the line out as a string. Here I start by pulling out just one line: > > inFile = OpenRead["197-tst.txt"] > y = ReadList[inFile, String, 1, RecordLists -> True] > Close[inFile]; > > This appears to pull in a line. Now I want to take characters 25 to 110 to get just the stuff I want: > y1=StringTake[y ,{25,110}]; > > Here's the output. StringTake doesn't seem to work. > > StringTake[{aEX-004 2002197 0 0 0 5935.80 5946.66 27.06 -1281.9 -229. 321. 317. 367. -115. 126. 146. -410. -426.000000EF 75.}, {25, 110}] > > It doesn't take loading another package as far > as I can tell from the help. I'm thinking that it doesn't work because it's trying to work on a list > rather than a string. I've tried Flatten, and other stuff to try to get to just a string and not a list but > nothing has worked so far. I'm a long way from getting to those numbers in there but heck, I > can't even get to the string. Can anyone point me in the right direction? > > Thanks, Rob > > > From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!rip!ps01-chi1!news.webusenet.com!snoopy.risq.qc.ca!newsfeed.news2me.com!west.cox.net!cox.net!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Selwyn Hollis Newsgroups: comp.soft-sys.math.mathematica Subject: Re: MathematicaTeX Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: X-GC-Trace: gv1-aLoeluLq0V73k6Rl3TA7bGl9J8CWjh0N1cUb2IGQWyEwR5CAGvco8eahw== NNTP-Posting-Date: Fri, 13 Sep 2002 22:44:05 CDT Lines: 65 X-Trace: sv3-1q2mLH5Hc8hdSyZVrwzUsKD0LKvcg/cTysaBt7MAEcojFU6O4RqUIiX+rKGFsI+gG/vf2P169SaoiFV!WqxrAMggOqJm+o6ig5IXGbbPmsbSE+urH42h6LamoJ0eRb6pOF20m557kw== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:44:05 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35160 Jens-Peer Kuska wrote: > Hi, > > you mean the inverse of TeXForm[] ? > For what ? A TeXpert && Mathematica guru && MathLink expert > has a TeX frontend, that translate a TeXNotebook > (that is a TeX file with some Mathematica Input/Output > environments) and send the input cells to a kernel > and insert the output into the final TeX file ... Congratulations to you if you can do that and if you're happy with it. I'd prefer life to be a bit simpler. The point is that many users of Mathematica already have sufficient knowledge of TeX/LaTeX to typeset very complicated mathematics and get excellent results with little or no grief. To achieve even close to the same quality with Mathematica alone can require ten times the effort and a hundred times the grief. ---Selwyn > > The most of the remaining work like creating hyperlinks > to references and figures is done my LaTeX and pdfLaTeX, > with help of CTAN and some macros one generate almost every > layout *and* I have more than 20 books about TeX/LaTeX > (including Don Knuths excelent manuals) but I have not > a single book about the Mathematica Frontend. > > The way is not to teach TeX to the frontend, the way is > to teach TeX a bit Mathematica. > > And a TeXpert will never switch from his beloved TeX > to the Frontend and it's typesetting -- that's why > he is a TeXpert. > > Regards > Jens > > > Selwyn Hollis wrote: > >>Recent threads about word processing and typesetting have got me >>dreaming again... >> >>Wouldn't it be nice if someone developed a package that provided a >>function like this: >> >> DisplayTeX[ " some TeX code " ] >> >>which would cause the kernel to generate PostScript for the typeset >>text, to be displayed by the front end? >> >>I doubt that WRI will ever consider this, but surely there's someone out >>there who's both a TeXpert and a Mathematica guru who can do it. No >>doubt there's money to be made. >> >>Probably just a pipe dream... >> >>--- >>Selwyn Hollis > > From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.stealth.net!news.stealth.net!news.infoave.net!newsfeed1.easynews.com!easynews.com!easynews!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "Annetts, Dave (E&M, North Ryde)" Newsgroups: comp.soft-sys.math.mathematica Subject: RE: trying to pull numbers out of a string from a file. Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-TQJpT+JuFEYn35pqMPWzdkq1Gj3aZdqAsAa5jkbevOBziP9Ff9ybcVRiA== NNTP-Posting-Date: Fri, 13 Sep 2002 22:45:06 CDT Lines: 46 X-Trace: sv3-3bMLbnxlePkwPzXo14FFQAC5I8sIU1eAQhLM74ghkn2mHN3Znq0u5o8Y4HI/eE6NVrb+5UjHVQF3XV+!/G4AnvsSHZeC4G1shhUReoD3jm41bkp1snMJF3qwblBHMtB72+JceBrZFw== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:45:06 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35161 Hi Rob, > inFile = OpenRead["197-tst.txt"] > y = ReadList[inFile, String, 1, RecordLists -> True] > Close[inFile]; > > This appears to pull in a line. Now I want to take characters > 25 to 110 to get just the stuff I want: > y1=StringTake[y ,{25,110}]; > > Here's the output. StringTake doesn't seem to work. > > StringTake[{aEX-004 2002197 0 0 0 5935.80 5946.66 27.06 > -1281.9 -229. 321. 317. 367. -115. 126. > 146. -410. -426.000000EF 75.}, {25, 110}] > > It doesn't take loading another package as far > as I can tell from the help. I'm thinking that it doesn't > work because it's trying to work on a list > rather than a string. I've tried Flatten, and other stuff to > try to get to just a string and not a list but > nothing has worked so far. I'm a long way from getting to > those numbers in there but heck, I > can't even get to the string. Can anyone point me in the > right direction? You might try lst = Read[StringToStream[y1], {Word, Table[Number, {16}], Word, Number}]//Flatten; You can then pick the numbers (or words) from the list "lst". A quicker alternative might be as follows:- ifile = ReadList["197-tst.txt", {Word, Table[Number, {16}], Word, Number}]; Regards, Dave. ========================================== Dr. David Annetts EM Modelling Analyst CSIRO DEM Tel: +612 9490 5416 North Ryde Fax: +612 9490 5467 Australia David.Annetts@csiro.au =========================================== From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!newsfeed.cwix.com!news.maxwell.syr.edu!nntp-relay.ihug.net!ihug.co.nz!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "tgarza01@prodigy.net.mx" Newsgroups: comp.soft-sys.math.mathematica Subject: Re: trying to pull numbers out of a string from a file... Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-qb42yEsWeb3K8pm8YKtsDuOQXcpNc8iDXiamBwOxvbMyGiCB00NAaelKQ== NNTP-Posting-Date: Fri, 13 Sep 2002 22:46:07 CDT Lines: 144 X-Trace: sv3-1f59o04t/wkUfJDCbu3ifxBZtFtqM9kanLGSg6vAfGHEZ0hAxsqFleOZa23sTkW8iKQtWGpw6DDH6Zv!0/YnbMQqfesJ+jhcqv6vo9JdGPDxMe01lbp5iOYDd7HZ5KxVTXB0+EEv8DwKn0LNIU6QjIg= X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sat, 14 Sep 2002 03:46:07 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35162 Hello, Rob: First of all, I used ReadList directly, with Word instead of String, and with the option WordSeparators -> None, like this (I presume your file is adequately located, so that there is no problem in finding it): In[1]:= a = ReadList["197-tst.txt", Word, RecordLists -> True, WordSeparators -> None]; This allowed me to examine your records and I found out that in this way each record comes out as a list of length 1: In[2]:= Head[a[[1]]] Out[2]= List In[3]:= Length[a[[1]]] Out[3]= 1 That is, In[3]:= a[[1]] Out[3]= {"aEX-004 2002197 0 0 0 5935.80 5946.66 27.06 -1281.9 -229. 321. 317. 367. -115. 126. 146. -410. \ -426.000000EF 75."} In[4]:= StringLength[a[[1,1]]] Out[4]= 140 and the characters you want are In[5]:= StringTake[a[[1,1]], {25, 110}] Out[5]= "5935.80 5946.66 27.06 -1281.9 -229. 321. 317. 367. -115. 126. 146." So far, so good. It seems that you want these 11 numbers, OK? The problem now, I think, is that this is just a string and I can think of no easy way to convert it precisely into a list of 11 real numbers. Then, I suggest you read the file in a different way, without the WordSeparators option: In[6]:= b=ReadList["197-tst.txt",Word,RecordLists -> True]; In[7]:= b[[1]] Out[7]= {aEX-004,2002197,0,0,0,5935.80,5946.66,27.06,-1281.9,-229.,321.,317.,367.,-\ 115.,126.,146.,-410.,-426.000000EF,75.} In[8]:= Head[b[[1]]] Out[8]= List In[9]:= Length[b[[1]]] Out[9]= 19 so that each record is now a list of 19 strings. What you want is strings 6 to 16, but converted to reals (unless I'm being presumptuous). This will achieve that: In[10]:= ToExpression[Take[b[[1]],{6,16}]] Out[10]= {5935.8,5946.66,27.06,-1281.9,-229.,321.,317.,367.,-115.,126.,146.} Now you have a nice list of real numbers to work with. You can do this for the whole file like this: In[11]:= ToExpression[Take[#,{6,16}]&/@b]; I hope this will solve your problem. Tomas Garza Mexico City > ----- Original Message ----- > From: "1.156" > Sent: Friday, September 13, 2002 12:14 AM > Subject: trying to pull numbers out of a string from a file... > > > I've got to extract some numbers from a file that are in lines of text. > Since the line contents are not numbers, I presume I must pull the line out > as a string. Here I start by pulling out just one line: > > > > inFile = OpenRead["197-tst.txt"] > > y = ReadList[inFile, String, 1, RecordLists -> True] > > Close[inFile]; > > > > This appears to pull in a line. Now I want to take characters 25 to 110 to > get just the stuff I want: > > y1=StringTake[y ,{25,110}]; > > > > Here's the output. StringTake doesn't seem to work. > > > > StringTake[{aEX-004 2002197 0 0 0 5935.80 5946.66 27.06 -1281.9 -229. > 321. 317. 367. -115. 126. 146. -410. -426.000000EF 75.}, > {25, 110}] > > > > It doesn't take loading another package as far > > as I can tell from the help. I'm thinking that it doesn't work because > it's trying to work on a list > > rather than a string. I've tried Flatten, and other stuff to try to get to > just a string and not a list but > > nothing has worked so far. I'm a long way from getting to those numbers > in there but heck, I > > can't even get to the string. Can anyone point me in the right direction? > > > > Thanks, Rob > > -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!prodigy.com!howland.erols.net!cyclone-sf.pbi.net!216.166.71.10!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!not-for-mail From: andrew.glew@amd.com Newsgroups: comp.soft-sys.math.mathematica Subject: RE: More levels of subsection nesting Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-cl6NdIV5U+aPwg15iacaHIkVGa1B7ZUTabspgW2hKFRijG58djU+OVbbA== NNTP-Posting-Date: Sat, 14 Sep 2002 23:16:41 CDT Lines: 48 X-Trace: sv3-osaDEXjQxx3c4DjHzURfgLbyn7PMKQXtGvEHrKKi2qeBvSzkM44Avzzy1QJ3/p5NQvN/buZmq5oZPq8!6L+M4SRFk6gOyuAzcaqqFScDmsKdwVz0wTsUWPfz6paEsWHYS9HE6xll X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:16:41 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35164 > BRIEF > > Mathematica seems to support 3 levels of nesting: > section, subsection, and subsubsection. > > Q: how can I obtain more levels of nesting? > I typically go 6-7 levels deep. Well, I started by editting the notebook in a text editor (having used Edit Style Sheet to unshare), and I created styles Sub3section ... Sub9section, with Dewey decimal numbering 1.2.3.4.5.6.7.8.9.10 I got collapsable group working, by mucking with CellGroupingRules->{"SectionGrouping", 100}, changing the number. I am not sure what the number is, but I'm guessing it may be a pixel count for the nesting boxes at the left of the screen. I'm a bit worried about whether this is fragile. === Was there any way to accomplish this from the GUI? Or was using a text editor mandatory? === Related: this exercise makes it obvious that a common operation is to "push down" or "pull up" a whole subtree - e.g. a Subsection becomes a Subsubsection, a Subsubsection becomes a Sub3section, etc. The sort of thing that Microsoft Word does with Outline mode. Q: has anyone got something like Outline mode for Mathematica? I'm tempted to go the other way, and ask if anyone has a front end that allows Mathematica to be embedded in Word documents. But that might be a hassle, since Word runs on Windows, and the Mathematica licence I have access to runs on Suns. From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.cc.ukans.edu!logbridge.uoregon.edu!HSNX.atgi.net!cyclone-sf.pbi.net!216.166.71.10!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin5.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "Annetts, Dave (E&M, North Ryde)" Newsgroups: comp.soft-sys.math.mathematica Subject: RE: trying to pull numbers out of a string from a file. Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-nU9u/VUq5gu+MpXiz3lC/SGbDd9v/G92JAT4f9TQR+LaVhEVGRhKWQlZw== NNTP-Posting-Date: Sat, 14 Sep 2002 23:17:43 CDT Lines: 46 X-Trace: sv3-NF677zK4YRMqGvGiqKebYP+V3zEHZzwO344tQ8AjFqmR2i3K7Fqaocsjsw2nBneoA82boH6/Ho9LDYa!Xyzq013wHIrjPnjjM0tEL+/vBpdAe1HETgkC6t4WYUg0ODEbvHulNsTfbUwzpiak3lvSMQ== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:17:43 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35165 Hi Rob, > inFile = OpenRead["197-tst.txt"] > y = ReadList[inFile, String, 1, RecordLists -> True] > Close[inFile]; > > This appears to pull in a line. Now I want to take characters > 25 to 110 to get just the stuff I want: > y1=StringTake[y ,{25,110}]; > > Here's the output. StringTake doesn't seem to work. > > StringTake[{aEX-004 2002197 0 0 0 5935.80 5946.66 27.06 > -1281.9 -229. 321. 317. 367. -115. 126. > 146. -410. -426.000000EF 75.}, {25, 110}] > > It doesn't take loading another package as far > as I can tell from the help. I'm thinking that it doesn't > work because it's trying to work on a list > rather than a string. I've tried Flatten, and other stuff to > try to get to just a string and not a list but > nothing has worked so far. I'm a long way from getting to > those numbers in there but heck, I > can't even get to the string. Can anyone point me in the > right direction? You might try lst = Read[StringToStream[y1], {Word, Table[Number, {16}], Word, Number}]//Flatten; You can then pick the numbers (or words) from the list "lst". A quicker alternative might be as follows:- ifile = ReadList["197-tst.txt", {Word, Table[Number, {16}], Word, Number}]; Regards, Dave. ========================================== Dr. David Annetts EM Modelling Analyst CSIRO DEM Tel: +612 9490 5416 North Ryde Fax: +612 9490 5467 Australia David.Annetts@csiro.au =========================================== From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!prodigy.com!news.stealth.net!news.stealth.net!nntp-relay.ihug.net!ihug.co.nz!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!not-for-mail From: M Hanson Newsgroups: comp.soft-sys.math.mathematica Subject: Export Problem Mathematica 4.0.1.0 Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-e/MgKZT30CdssA8Y9UmHETkiWVrxlBea/nj6ut/OThjEq3xZxJQj3kpDQ== NNTP-Posting-Date: Sat, 14 Sep 2002 23:18:44 CDT Lines: 22 X-Trace: sv3-ZFdUdSfOrDgShR7AGGg85shVINzUUNKYt41hhuOejFHpsNoU7MNEj/kMHkDj76vMiYs9a6ISB42JFhk!zVdTIRFx3cpSLzT1AYctO1x7/gTrOzx/RIBh4IdifJXyOzjxaAIGPAW1lpXn7mbEBxJVgA== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:18:44 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35166 I was and do have problems reading files Exported files in Adobe Illustrator format (.ai) from Adobe Illustrator 10.0.3. With an upgrade to Adobe Illustrator 10.0.3, I can read EPS files created by Mathematica 4.0.1. A message from tech support at Wolfram implies that Adobe Illustrator format files can be read ONLY if you are using the correct Adobe and Wolfram programs. Additionally, Mathematica is going to favor the export of EPS files (is that clear enough?). My approach to using Mathematica as a source of images for Adobe Illustrator 10.0.3 is: Create the image in Mathematica Export["ImageFileName.eps", theMathematicaImageCreated, "EPS"] Open the file ImageFileName.eps within Adobe Illustrator 10.0.3 Save the file as a ".ai" file Be sure to check the ImageSize as it is not often what you told Mathematica. From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!prodigy.com!cpk-news-hub1.bbnplanet.com!news.gtei.net!howland.erols.net!cyclone-sf.pbi.net!216.166.71.10!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "ET" Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Arbitrary Crash with Compile Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: X-GC-Trace: gv1-Sjg4db1mvCG6L8c3hctIUMRhoVQ/C4PrCWyEuR9Kz4oCr4ZDQo9DZ01aw== NNTP-Posting-Date: Sat, 14 Sep 2002 23:20:46 CDT Lines: 63 X-Trace: sv3-Z10zWjo4n3SBLtFiBguFCnIgvu3Cj6jtQSFJtUNGlrvBgFGmXunw+NhzLAYv/7dAfJXYfT0xDx3+X1g!e3jPN9HUbNVifpgNn35NL7QaihcQX/kLuvm6PB7h8rCny+8exKQqCFlBUgA0ZIg2OUFUyg== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:20:46 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35168 I ran it 10 times on 4.2 with no crashes. "Wizard Lab" wrote in message news:alru2n$hct$1@smc.vnet.net... > Jens-Peer Kuska tells me that he gets no crash with Mathematica 4.2, however after working > with this program for more than a month, trying every possible permutation and > manipulation, and having it still crash, I am still worried that upgrading to 4.2 > won't solve my problem. Can anyone else with 4.2 try running this program for me a > good number of times, say 3 or 4, and see if they get similar good results? > > Regards, > > Bernard Gress > > Wizard Lab wrote: > Dear Group, > > I have a program to take the local polynomial non parametric regression > of two variables. It uses Compile, unfortunately, and regularly, but > inconsistently, causes Mathematica to crash (in Win2K, with I forget > what error, and in Win98/Mathematica4.0 with an invalid memory access from > MathDLL.dll). I am running Mathematica 4.1, and have this problem consistently > on 4 different machines. > > Here is the code, if it doesn't crash the first time, it will the second > or third: > > (* > w = Compile[{{xj, _Real, 0}, {XX, _Real, 1}, {YY, _Real, 1}, {h, _Real, > 0}, > {nn, _Integer, 0}, {ord, _Integer, 0}}, > First[Inverse[Sum[Outer[Times, Table[If[Positive[q], (XX[[i]] - xj)^q, > 1], {q, 0, ord}], > Table[If[Positive[q], (XX[[i]] - xj)^q, 1.], {q, 0, > ord}]*E^(-0.5*((XX[[i]] - xj)/h)^2)], {i, nn}]] . > Sum[(Table[If[Positive[q], (XX[[i]] - xj)^q, 1.], {q, 0, ord}]*YY[[i]])* > E^(-0.5*((XX[[i]] - xj)/h)^2), {i, nn}]]]; > *) > > (* > \!\(tt = MemoryInUse[]; > ListPlot[Table[{\((i + 1)\)\^2, \(Timing[ > nn = \((i + 1)\)\^2; \[Epsilon] = Table[Random[]*3, {i, > nn}]; > testX = Table[i* .3 - Random[]*2, {i, nn}]; > testY = Table[Sin[i/3] - 2, {i, nn}] + \[Epsilon]; > Map[w[#, testX, testY, .1 + Random[], nn, 0] &, > testX];]\)[\([1]\)]/Second}, {i, 15}], PlotJoined -> > True, > PlotLabel -> "\"]; > MemoryInUse[] - tt\) > *) > > > From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newscon07.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!triton.net!smallfeed.triton.net!66.181.128.6.MISMATCH!news.ticon.net!ns.osirusoft.com!cyclone-sf.pbi.net!216.166.71.10!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "DrBob" Newsgroups: comp.soft-sys.math.mathematica Subject: RE: Re: NIntegrate Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: Reply-To: X-GC-Trace: gv1-LoBfhwtM4cSDcxn43Q45A2/GmJ0q+yoixUnzYiIlvjyZyJHRXRZ0mR3Ig== NNTP-Posting-Date: Sat, 14 Sep 2002 23:21:47 CDT Lines: 96 X-Trace: sv3-sqoe/s7n9UcfzugtGEidNenZn/7h0RqMt1w2peHNwe0cd5lUyyqZzgKiF09OxJ+DUoDDT5dzKBt8Zmy!AzDw/cfFHaDM5yEMdD1Tqg95U7boogKYbqsHOz/M1gDgO0zuhnYQubzH X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:21:47 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35169 In his not-so-subtle way, Jens-Peer is trying to tell you that since you see z in the error message, that's what NIntegrate saw too. z is a symbol, and NIntegrate needs numbers. Now I'll have to search online for your original problem, since I deleted my copy long ago... (Excuse me a few minutes...) Hmm... OK, I'm back. Well... there's still a missing (or extra) parenthesis in the definition of f and a missing bracket in the definition of F, but I also can't see that you've given z a numerical value. The error shouldn't occur until you use F though, since you used SetDelayed. So, the error message goes with a line you didn't include in your post. However, in your latest post, the lines NumericQ[z] False tell me z is NOT a real number. For instance, NumericQ[1.2] True So, proceeding with the theory that z needs to be numeric, let's try F[1.2] NIntegrate::itraw:Raw object 1.2` cannot be used as an iterator. NIntegrate[f[y, 1.2], {1.2, 0, Infinity}] NIntegrate::"itraw":"Raw object \!\(1.2`\) cannot be used as an iterator." As you see, in the definition of F, you've used z as an iterator. No matter what the argument z to F is -- number, symbol, whatever -- you can't use it as an iterator, because it already has an identity, and iterators are stand-ins -- temporary variables that don't exist outside (in this case) NIntegrate. So, as Jens-Peer pointed out, y should have been your iterator. (Probably. We don't actually know what you were trying to do. We only know for sure that z couldn't be the iterator.) So, if I've made the right guesses, the definition for F should be F[z_] := NIntegrate[f[y, z], {y, 0, Infinity}] But... F[z] will still give you an error if z doesn't have a numerical value, so it's even better to define F this way: ClearAll[F] F[z_?NumericQ] := NIntegrate[f[y, z], {y, 0, Infinity}] That way, F[z] is left unevaluated if z isn't numeric. I can't go any further, since I don't know the value of f -- because I don't know where to add or subtract that pesky parenthesis. (I asked you about that days ago, but your e-mail address was no good -- probably still isn't.) Bobby Treat -----Original Message----- From: Rob_jack [mailto:rob_jackNSP@libero.it] Subject: Re: NIntegrate "Jens-Peer Kuska" wrote > > do you realy think that > > 1.07577/( 1+7.12336*10^-7 (1. + z)^2 ) > > with the z inside is numerical ? or do you mean > > F[z_?NumericQ]: = NIntegrate[f[y,z], {y, 0, Infinity}] > I'm a newbie, bat I mean: ************************* In[1]= NumericQ[z] Out[1]=False ************************* BTW, z is a real number. -- Rob_jack From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.cc.ukans.edu!logbridge.uoregon.edu!HSNX.atgi.net!cyclone-sf.pbi.net!216.166.71.10!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "DrBob" Newsgroups: comp.soft-sys.math.mathematica Subject: RE: Re: ByteCount for Global symbols Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: Reply-To: X-GC-Trace: gv1-izwf0rZUuDjIgTtOU+HbeEkuDnDHCRzDPTyqGT8GIwZ7iA7LI+s97u/7Q== NNTP-Posting-Date: Sat, 14 Sep 2002 23:22:48 CDT Lines: 37 X-Trace: sv3-2XdGPLW22DEuBiWdK3XfF/7CTmiAaYb3pMvMW7ifWqnPaYtXpwEfJxR14B6KkUyQKldxS9d5p2PW1YE!NZZ5SpJMB/iuG0QCML8lkg0AWIbGiJxUYWR4QKFNjBzvsaxQeTtwg6iV X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:22:48 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35170 Thanks! You're brilliant -- though I'm not clear on why that worked. I'm learning the fine art of patterns and Hold one tricky example at a time. Bobby -----Original Message----- From: Jens-Peer Kuska [mailto:kuska@informatik.uni-leipzig.de] Subject: Re: ByteCount for Global symbols Hi, whats wrong with ToExpression[#, StandardForm, Hold] & /@ Names["Global`*"] /. Hold[a_] :> ByteCount[OwnValues[a]] Regards Jens DrBob wrote: > > I want to make a list of all symbols in the Global context, as in > > Names["Global`*"] > > and compute a ByteCount for each symbol's OwnValues -- without > evaluating the symbols. > > It seems possible in principle, but I haven't found a way. > > Bobby Treat From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!isdnet!nerim.net!aotearoa.belnet.be!news.belnet.be!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin5.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "DrBob" Newsgroups: comp.soft-sys.math.mathematica Subject: RE: Re: ByteCount for Global symbols Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: Reply-To: X-GC-Trace: gv1-9yDzVUnKb9DPLBHhm/1lXnje3R9q4KpjoVeXbtETKMy1XggpCjRWSJ+WQ== NNTP-Posting-Date: Sat, 14 Sep 2002 23:23:48 CDT Lines: 40 X-Trace: sv3-AgbL8tHMKYH14D46sSI/GprDr5zTIfLyETsravtZ/1JbgytNbZpBU7FsC+BLjC33lKRuwcE2jdxsR3K!QZvIoFdn1TbMj2OCbn5qlYAQU5aOhnnygNWpfTnBntQdeNNjd3r/gkOiDg== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:23:49 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35171 Here's the fairly useful bit of code I came up with, using Jens-Peer's brilliant solution: names = Names["Global`*"]; counts = ToExpression[#, StandardForm, Hold] & /@ names /. Hold[a_] :> ByteCount[OwnValues[a]]; Select[Transpose[{names, counts}], Last@# > 16 &] // TableForm It tells me how some of my memory is being spent. Bobby Treat -----Original Message----- From: Jens-Peer Kuska [mailto:kuska@informatik.uni-leipzig.de] Subject: Re: ByteCount for Global symbols Hi, whats wrong with ToExpression[#, StandardForm, Hold] & /@ Names["Global`*"] /. Hold[a_] :> ByteCount[OwnValues[a]] Regards Jens DrBob wrote: > > I want to make a list of all symbols in the Global context, as in > > Names["Global`*"] > > and compute a ByteCount for each symbol's OwnValues -- without > evaluating the symbols. > > It seems possible in principle, but I haven't found a way. > > Bobby Treat From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!rip!ps01-sjc1!news.webusenet.com!cox.net!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Jacob Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Mathematica 4.2: Problem with online help. Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: X-GC-Trace: gv1-23kXIckSWkURl+Ex2yhYmiH0FVsKLT1NrS5Dumx4f7NF0lAPu/h9P/1eg== NNTP-Posting-Date: Sat, 14 Sep 2002 23:24:49 CDT Lines: 13 X-Trace: sv3-kH5UvX5zOoWo6368wphZrLSdGzHHuoxqRtQQzrAvZ4IcpKCpiWWabdTuApswBoQXKmnajW9M1iHmKrR!NL4jWE2aDn3DNvw6rCa04ufOXYMvfjz1HFub3nNEMY/qBgn3MK900Wb75Qj4ZcGTruNeMA== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:24:49 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35172 On Fri, 13 Sep 2002 05:20:59 GMT, "Vynce" wrote: >Try deleting ... >\Mathematica\4.2\Documentation\English\MainBook\BrowserIndex.nb > > > > That did it. It now works! Thanks From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.cc.ukans.edu!logbridge.uoregon.edu!HSNX.atgi.net!cyclone-sf.pbi.net!216.166.71.10!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "David Park" Newsgroups: comp.soft-sys.math.mathematica Subject: RE: Checking Programming errors; a ? Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-v8FvqZRK2p9dJAPgr7e9v4OhajwEsRV8V75LrBkja+TTrXqbwRJwmjymw== NNTP-Posting-Date: Sat, 14 Sep 2002 23:25:50 CDT Lines: 79 X-Trace: sv3-dWpJ9qG/kw9USFSa3MUOtJb/jHxtJzaTwjF2KrLaTllXoiLL+3TWp4LLOa3m63QYDWglrJNsvuYFl45!+ODVxVlzac/CgkK8nTlW6I5dvn9nv4+by775UCK6KJrc/dpp5WDOKwrmPCBjeiorgWNq4Q== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:25:50 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35173 Jack, Often, what I do when developing a slightly complicated module is to first test it after I add each statement L1, L2, etc. But then often I want to make changes after I have all the statements in. Then to debug I just add temporary Print statements. For example... myFunction[f_] := Module[ {L1,L2,L3}, L1 = ... ; L2 = ... ; Print[{L1, L2}]; l3 = ... ; ] Sometimes I use multiple Print statements. The only problem with this approach is that sometimes the difficulty might be in a subexpression of a longer expression. This forces me to temporarily break out the longer expression into multiple statements, or perhaps duplicate the subexpression in the Print statement. But I find that the easiest method to track down errors. David Park djmp@earthlink.net http://home.earthlink.net/~djmp/ From: Jack Goldberg [mailto:jackgold@umich.edu] Hi Group: I often run into this difficulty: when designing a program, say as a module, and testing it for various inputs, I get wrong answers. What to do? I use a method that works for me but may not be the best available. I want to show my method and then ask a question about how it can be imporved. (Oh yes, I abandoned Trace a long time ago!) myFunction[f_] := Module[ {L1,L2,L3}, L1 = ... ; L2 = ... ; l3 = ... ; "final step" ] To see what went wrong, I use (* *) selectively as follows: Stage 1 myFunction[f_] := Module[ {L1,L2,L3}, L1 = ... (*; L2 = ... ; L3 = ... ; "final step" *) ] Thus I see if L1 worked as expected. The next step is to put (* after L2 and see if this works. I continue this til the bitter end and I usually find my errors. My question; The process of moving (* *) step by step through the program is quite tedious when the code has lots more lines. What I would like is a "meta-program" which (like FoldList) does this job for me. The output of this "meta-program" is the list of outputs of each line in the module, probably best printed as a column. This sounds like Trace but my problem with Trace is it is terribly difficult to read. For the not-so-subtle programming I do, the only thing I need is what expression is returned line by line. Any advice? All remarks are appreciated! Jack From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!isdnet!btnet-peer1!btnet!newsr1.ipcore.viaginterkom.de!newsfeed.stueberl.de!newspeer1-gui.server.ntli.net!ntli.net!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!smc.vnet.net!not-for-mail From: mark@markfisher.net (Mark Fisher) Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Checking Programming errors; a ? Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: NNTP-Posting-Date: Sun, 15 Sep 2002 23:32:53 CDT Lines: 145 X-Trace: sv3-IYmG+6qnw0fo1obdFT/OjcPE1QkU8rsH1kSNgwjP1yE7IVxvCsuGfyo67n9+83ItYph01x0i3wZ4G3i!oRMCNzHbeFieFCVKbg76jpcMtic3gnoHL2fQI8JqUHS0NX/2W4CWeaU5aDCHEX7U/A== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Mon, 16 Sep 2002 04:32:53 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35186 The following code is my attempt to provide the functionality you requested. It does some rudimentary error checking, but I haven't tried very hard to fool it. The code manipulates the DownValues, locating the "highest" CompoundExpression (see the lines in which "pos" is defined), keeping only those expressions specified. DownValues are restored after the expression is evaluated. The tricky part is keeping the CompoundExpression from evaluating while it is being manipulated. (See the lines in which "held" and "new" are defined.) I'm not sure I'm doing this part the most elegant way, but it seems to work. (* code starts here *) PartialEvaluation::usage = "PartialEvaluation[f[args], n] returns f[args] where only the first n expressions are evaluated in the \"main\" CompoundExpression in DownValues[f]. For example:\n\t Clear[f]\n\t f[x_] := Module[{a,b}, a=3; b=4; a b x]\n\t PartialEvaluation[f, 2]\n returns 4." PartialEvaluation::dvprob = "DownValues[``] is either empty or has more than one element." PartialEvaluation::toobig = "There are only `1` expressions in the CompoundExpression in `2`." PartialEvaluation::noce = "There are no CompoundExpressions in DownValues[``]." SetAttributes[PartialEvaluation, HoldFirst] PartialEvaluation[f_[args__], n_Integer] := Module[{dv, pos, held, new, eval}, Catch[ dv = DownValues[f]; If[Length[dv] != 1, Message[PartialEvaluation::dvprob, f]; Throw[HoldForm[f[args]]]]; pos = Sort[Position[dv, CompoundExpression]]; If[pos == {}, Message[PartialEvaluation::noce, f]; Throw[HoldForm[f[args]]]]; pos = Drop[First @ pos, -1]; held = Extract[dv, pos, Hold] /. CompoundExpression -> Sequence; If[Abs[n] > Length[held], Message[PartialEvaluation::toobig, Length[held], HoldForm[f[args]]]; Throw[HoldForm[f[args]]]]; new = ReplacePart[dv, Take[held, n] /. Hold[x__] :> Hold[CompoundExpression[x]], pos, 1]; DownValues[f] = new; eval = f[args]; DownValues[f] = dv; eval ]] (* code ends here *) --Mark. P.S. The version of this message I posted directly from my newsreader didn't show up, so I'm reposting (a slightly improved version) from Google. "David Park" wrote in message news:... > Jack, > > Often, what I do when developing a slightly complicated module is to first > test it after I add each statement L1, L2, etc. But then often I want to > make changes after I have all the statements in. Then to debug I just add > temporary Print statements. For example... > > myFunction[f_] := Module[ {L1,L2,L3}, > > L1 = ... ; > L2 = ... ; > Print[{L1, L2}]; > l3 = ... ; > > ] > > Sometimes I use multiple Print statements. The only problem with this > approach is that sometimes the difficulty might be in a subexpression of a > longer expression. > This forces me to temporarily break out the longer expression into multiple > statements, or perhaps duplicate the subexpression in the Print statement. > But I find that the easiest method to track down errors. > > David Park > djmp@earthlink.net > http://home.earthlink.net/~djmp/ > > From: Jack Goldberg [mailto:jackgold@umich.edu] > > Hi Group: > > I often run into this difficulty: when designing a program, say as a > module, and testing it for various inputs, I get wrong answers. What to > do? I use a method that works for me but may not be the best available. > I want to show my method and then ask a question about how it can be > imporved. (Oh yes, I abandoned Trace a long time ago!) > > myFunction[f_] := Module[ {L1,L2,L3}, > > L1 = ... ; > L2 = ... ; > l3 = ... ; > "final step" > > ] > > To see what went wrong, I use (* *) selectively as follows: > > Stage 1 > > myFunction[f_] := Module[ {L1,L2,L3}, > > L1 = ... (*; > L2 = ... ; > L3 = ... ; > "final step" *) > > ] > > Thus I see if L1 worked as expected. The next step is to put (* after L2 > and see if this works. I continue this til the bitter end and I usually > find my errors. > > My question; The process of moving (* *) step by step through the > program is quite tedious when the code has lots more lines. What I would > like is a "meta-program" which (like FoldList) does this job for me. The > output of this "meta-program" is the list of outputs of each line in the > module, probably best printed as a column. > This sounds like Trace but my problem with Trace is it is terribly > difficult to read. For the not-so-subtle programming I do, the only thing > I need is what expression is returned line by line. > > Any advice? All remarks are appreciated! > > Jack From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!newsswitch.lcs.mit.edu!snoopy.risq.qc.ca!newsfeed.news2me.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Klamser Newsgroups: comp.soft-sys.math.mathematica Subject: no complex Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-oBmm5MQbX7ylXDXsqXiDUc5zUS6/fPXhvho3b7ftGLjx+TITBQBWfcf7Q== NNTP-Posting-Date: Sat, 14 Sep 2002 23:26:51 CDT Lines: 30 X-Trace: sv3-gITCLAg/Mguv0hivWVIH3TALUOeWSjJIrz+gogOZQjrPo5GdTqFmzfi6BzOB56tT0Hh8DdBRq4H5n0B!uGv+VhmnYmVX7PMvHSJnVBaIjBNFwbSfePian5HWutJhMyK9MK9eby8R X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:26:51 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35174 Hi, Mathematica often produces complex resluts. But the problem is not complex: Try Solve[FR == Pi r1^2 - Pi r2^2, r1] It is simple to eliminate it in this case. Just square it. Does someone give me a hint, how to write ra rule for simplify, lik Ted Ersek did in http://www.verbeia.com/mathematica/tips/Links/Tricks_lnk_41.html I thin, one has to to replace the pattern i Sqrt[-a_] by Sqrt[(i Sqrt[-a_])^2] and then one has to simplify it? Regards, Peter Klamser From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!news.algonet.se!algonet!newsfeed1.bredband.com!bredband!news01.chello.se!amsnews01.chello.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!smc.vnet.net!not-for-mail From: "Hermann Meier" Newsgroups: comp.soft-sys.math.mathematica Subject: (Simple) Empirical CDF Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: NNTP-Posting-Date: Sat, 14 Sep 2002 23:27:52 CDT Lines: 43 X-Trace: sv3-sinqXdCodBFXDV1M+FcTVyPdDxMGXSMkBvd4uL6FvT5lyDxahd0XPIYPmNlQXvoHv1o6gG6i6ha+KLw!mS9Nl4MhtI6m0cf6ldB2WR6oKz0SMh3/fhSNNbSu0c7pjGyAQuP/t2BeMIrXPGP5 X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:27:52 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35175 There has been an interesting discussion about using InterpolatingFunction for an empirical CDF. If one is willing to sacrifice some theoretical soundness, an empirical CDF may be computed in a simplified form: simpleEmpiricalCDF[distr_/;VectorQ[distr,NumberQ]] := With[{nonu=Sort[distr], u=Union[distr]}, Transpose[{u,FoldList[Plus,0,(Count[nonu,#]&/@u)/Length[nonu]]//Rest}]] This code does not return a function, and the result needs some interpretation. Nevertheless, it may be of some use. data = {0.59, 0.72, 0.47, 0.43, 0.31, 0.56, 0.22, 0.9, 0.96, 0.78, 0.66, 0.18, 0.73, 0.43, 0.58, 0.11} (the tie [0.43] will be accounted for in a way that is consistent with some textbooks) simpleEmpiricalCDF[data]//N returns {{0.11,0.0625},{0.18,0.125},{0.22,0.1875},{0.31,0.25},{0.43,0.375},{0.47,0.4 375},{0.56,0.5},{0.58,0.5625},{0.59,0.625},{0.66,0.6875},{0.72,0.75},{0.73,0 ..8125},{0.78,0.875},{0.9,0.9375},{0.96,1.}} A plot may be given with: simpleEmpiricalCDFPlot[distr_/;VectorQ[distr,NumberQ]] := Module[{res,x,p}, res=simpleEmpiricalCDF[distr]; x=({#,#}& /@ Transpose[res][[1]])//Flatten; p=({#,#}& /@ Transpose[res][[2]])//Flatten; p= Join[{0},Drop[p,-2],{1}]; ListPlot[Transpose[{x,p}], PlotRange->{0,1},PlotJoined->True,Axes->None,Frame->True,GridLines->Automati c]] Again, this plot does not reflect theoretical considerations at the lower and upper end. With regard Hermann Meier From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!newsfeed.mathworks.com!cyclone.swbell.net!cyclone-sf.pbi.net!216.166.71.10!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin2.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "DrBob" Newsgroups: comp.soft-sys.math.mathematica Subject: RE: Re: Empirical CDF and InterpolatingFunction Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: Reply-To: X-GC-Trace: gv1-oBmm5MQbX7ylXDXsqXiDUc5zUS6/fPXhvho3b7ftGLjx+TITBQBWfcf7Q== NNTP-Posting-Date: Sat, 14 Sep 2002 23:28:53 CDT Lines: 106 X-Trace: sv3-fcwmR6LN9El7F7TNtMSTliIsa0X1JkllowzArMFgaSdNGlEHp0vyHi4k7KLgXL9x3RbXvtTl+OAVW/x!J1yQCaSlHy4Q36Mpa4Giw/qp4n60pF02/8E8WybyZJ7rpDlcHE5XwrGlvM5DmkRTYXK6MQ== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:28:53 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35176 Caution: where right- and left-continuity are concerned, Daniel's relying on undocumented behavior that may change in the next version. Bobby -----Original Message----- From: Mark Fisher [mailto:mark@markfisher.net] Subject: Re: Empirical CDF and InterpolatingFunction Daniel Lichtblau made two suggestions that allow one to use Interpolation the way I wanted. First, to make the resulting function right-continuous, change the sign twice. Second, to make the end point return the correct value, add an extra (phantom) observation (with an extra (irrelevant) value). (The phantom observation is made at the high end because of the sign reversals.) Here's the code I cooked up based on his suggestions: MakeEmpiricalCDF::usage = "MakeEmpiricalCDF[list] returns a function that evaluates the empirical CDF given the observations in the list. The function is defined on the entire real line." MakeEmpiricalCDF[list_?(VectorQ[#, NumericQ]&)] := Module[{n, s, a, r, idata}, n = Length[list]; s = Sort[list]; a = Append[s, s[[-1]] + 1]; (* phantom obs. *) r = Range[1/n, 1 + 1/n, 1/n]; (* phantom value 1 + 1/n *) idata = Last /@ Split[Transpose[{-a, r}], #1[[1]] == #2[[1]]&]; (* "-a" is the first sign change *) Block[{x}, Function @@ {x, Which @@ { x < s[[ 1]], 0., x > s[[-1]], 1., True, Interpolation[idata, InterpolationOrder -> 0][-x] (* "-x" is the second sign change *) }}] ] The construction "Last /@ Split[ ... ]" accounts for duplicate values. Here are two examples. Needs["Statistics`ContinuousDistributions`"] list1 = RandomArray[NormalDistribution[0, 1], 100]; f1 = MakeEmpiricalCDF[list1]; Plot[f1[x], {x, -4, 4}] list2 = Table[Random[Integer, {1, 10}], {10}]; f2 = MakeEmpiricalCDF[list2]; Plot[f2[x], {x, 0, 11}] --Mark mark@markfisher.net (Mark Fisher) wrote in message news:... > I'm trying to write a fast empirical cummulative distribution function > (CDF). Empirical CDFs are step functions that can be expressed in > terms of a Which statement. For example, given the list of > observations {1, 2, 3}, > > f = Which[# < 1, 0, # < 2, 1/3, # < 3, 2/3, True, 1]& > > is the empirical CDF. Note that f /@ {1, 2, 3} returns {1/3, 2/3, 1} > and f is continuous from the right. > > When the number of observations is large, the Which statement > evaluates fairly slowly (even if it has been Compiled). Since > InterpolationFunction evaluates so much faster in general, I've tried > to use Interpolation with InterpolationOrder -> 0. The problem is that > the resulting InterpolatingFunction doesn't behave the way (I think) > it ought to. For example, let > > g = Interpolation[{{1, 1/3}, {2, 2/3}, {3, 1}}, InterpolationOrder -> > 0] > > Then, g /@ {1, 2, 3} returns {2/3, 2/3, 1} instead of {1/3, 2/3, 1}. > In addition, g is continuous from the left rather than from the right. > > Obviously I am not aware of the considerations that went into > determining the behavior of InterpolationFunction when > InterpolationOrder -> 0. > > So I have two questions: > > (1) Does anyone have any opinions about how InterpolatingFunction > ought to behave with InterpolationOrder -> 0? > > (2) Does anyone have a faster way to evaluate an empirical CDF than a > compiled Which function? > > By the way, here's my current version: > > CompileEmpiricalCDF[list_?(VectorQ[#, NumericQ] &)] := > Block[{x}, Compile[{{x, _Real}}, Evaluate[ > Which @@ Flatten[ > Append[ > Transpose[{ > Thread[x < Sort[list]], > Range[0, 1 - 1/#, 1/#] & @ Length[list] > }], > {True, 1}]] > ]]] > > --Mark From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!newsfeed.frii.net!newsfeed.frii.net!140.99.99.194.MISMATCH!newsfeed1.easynews.com!easynews.com!easynews!news.he.net!cyclone-sf.pbi.net!216.166.71.10!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin5.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "Lawrence A. Walker Jr." Newsgroups: comp.soft-sys.math.mathematica Subject: 'More' hyperlinks Organization: Morgan State University, COMSARE Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-TQJpT+JuFEYn35pqMPWzdkq1Gj3aZdqAsAa5jkbevOBziP9Ff9ybcVRiA== NNTP-Posting-Date: Sat, 14 Sep 2002 23:29:54 CDT Lines: 10 X-Trace: sv3-lku1HL8Cc/Qqa73XftZ2BRYX61QFIsgHsAyvg2jXLrQfVAItoSa5bzRGiZViXgyoEyW4oWrhh1xb1nw!66/UvrDEtiR2MU4EWu+Ngm8mN797hgPRG/+Hqh8teSL3w7fuy01Mj6r9 X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:29:54 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35177 Hey, How can I duplicate those nifty 'More' hyperlinks in my usage statements? That is the hyperlinks that appears at the end of text that is generated after invoking a '?' to get more information about a function. Thanks, Lawrence From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!news.cc.ukans.edu!logbridge.uoregon.edu!HSNX.atgi.net!cyclone-sf.pbi.net!216.166.71.10!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Bill Rowe Newsgroups: comp.soft-sys.math.mathematica Subject: Re: trying to pull numbers out of a string from a file... Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-MVqSJSYIuPDMbAXF3knwbcw2x93PpuoNB+hyZTOPf2GVz0EBmmhvVYfAw== NNTP-Posting-Date: Sat, 14 Sep 2002 23:30:55 CDT Lines: 23 X-Trace: sv3-gWJkUAj5RSAUklJyjS3vpEgtgYS0F11iQONlPTL84cvYIu0sNZk/Du+xn7jMDTINvOLxZ+oHAg9/uyy!phKg+Q+Z9eh7StkH1DSpzWlWBu2rwIiaX+0MejCaik+/hR+kHVkD2Lix X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:30:55 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35178 On 9/13/02 at 1:14 AM, rob@piovere.com (1.156) wrote: >I've got to extract some numbers from a file that are in lines of >text. Since the line contents are not numbers, I presume I must pull >the line out as a string. Here I start by pulling out just one line: > >inFile = OpenRead["197-tst.txt"] >y = ReadList[inFile, String, 1, RecordLists -> True] >Close[inFile]; > >This appears to pull in a line. Now I want to take characters 25 to >110 to get just the stuff I want: y1=StringTake[y ,{25,110}]; > >Here's the output. StringTake doesn't seem to work. ReadList returns a List not a String. So, y is a List and StringTake fails since it expects a String. Also, you do not need the options RecordLists->True when reading Strings. Nor do you need the OpenRead/Close statements with ReadList Try y = First[readList["197-tst.txt",String,1]; y1 = StringTake[y, {25,110}]; From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!prodigy.com!cpk-news-hub1.bbnplanet.com!news.gtei.net!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newspeer1-gui.server.ntli.net!ntli.net!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin5.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Bill Rowe Newsgroups: comp.soft-sys.math.mathematica Subject: Re: empirical CDF Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: X-GC-Trace: gv1-FaLydLZ64jMriHkdI2cscUwJwd2Ajy5zn4flGyn9SRQtdF5uijfHSQRMA== NNTP-Posting-Date: Sat, 14 Sep 2002 23:31:57 CDT Lines: 16 X-Trace: sv3-HToO5wMSutzTw0Axl4FkftEnAQLO66Goz6U8YQ2pyOn2SB0cYpgWoC45/itp6bmdTumX+Bv7peSVtiX!pi3wBaAYBGoqPfaq/g+zXtuizQjy4YTodD2OEX5K1l3JX4G9fDV7S/3A X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:31:58 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35179 On 9/13/02 at 11:33 PM, swidrygiello@wp.pl (Swidrygiello) wrote: >Does anybody know how to calculate in Mathematica: >a)empirical CDF, >b)empirical PDF, >c)normal QQ-plot; >d)QQ-plot two different random samples?! Yes, but there are a number of issues particularly with an empirical PDF. A very nice package that does all of the above and more is mathStatica. See http://www.mathstatica.com for details. Obviously, it is less expensive to write your own functions. Just recently in message Mark Fisher posted code that addresses the empirical CDF. However, in this code you may want to replace 1/n with 1/(n+1) or (j-0.5)/n depending on your application. Note, these will have no significant effect for large data sets. The key issue with an empirical PDF is deciding the bin width. A simple approach would be to use the functions in Statistics`DataManipulation` and Graphics`Graphics`. Look at the functions Histogram, Frequencies and BinListCounts. More sophisticated approaches involve kernel methods. These methods will generate smoother estimates for the PDF. Again, the key is bandwidth. There is no apriori choice for bin width or bandwith. Bad choices will obscure significant features in the data set. From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!newspeer.monmouth.com!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin5.nnrp.aus1.giganews.com.POSTED!not-for-mail From: Daniel Lichtblau Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Why is my Implementation of Sorted Trees So Slow? Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: <200209080731.DAA05480@smc.vnet.net> X-GC-Trace: gv1-rIh8Lv379YxHoN3G9JKQMqdnbVZTIiQaal1v/cB1EGIyMepX8rk8NA+BA== NNTP-Posting-Date: Sat, 14 Sep 2002 23:32:58 CDT Lines: 162 X-Trace: sv3-ALjS2Bu3GVzeOzXa1dR71KGAJma9e+2pcvKyyg+2h6h/gp3IToLrk7KSLFRdPUrY11WE03EYsfD1m0e!nzPKRZ5jr6Yk3yVASBimya4bHL7H4rsJ4/W85CbS1h3BNkM0fUId30OqHQ== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:32:59 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35180 Husain Ali Al-Mohssen wrote: > > Hi all, > > I am trying to implement a very simple sorted tree to quickly store some > real numbers I need. I have written an add, delete, minimum, and pop > (delete the lowest value) function and they seem to work ok but are very > slow. Let's just look @ my implementation of the add part: > nums=Null;(*my initial blank Tree) > In[326]:= > Clear[add] > > In[327]:= > add[Null,x_Real]:=node[x,Null,Null] > > add[Null,node[x_Real,lower_,higher_]]=node[x,lower,higher] > > In[328]:= > add[node[x_Real,lower_,higher_],y_Real]:= > If[x>y,node[x,add[lower,y],higher],node[x,lower,add[higher,y]]] > > In[288]:= > add[node[x_Real,lowerx_,higherx_],node[y_Real,lowery_,highery_]]:=If[x>y, > node[x,add[lowerx,node[y,lowery,highery]],higherx], > node[x,lowerx,add[higherx,node[y,lowery,highery]]] > ] > > Now this is my attempt to test how fast my add works: > > SeedRandom[5]; > Do[nums=add[nums,Random[]],{5000}];//Timing > > Out[333]= > {13.279 Second,Null} > > (running on Mathematica 4.1 on a win2k VMWare machine running on Linux RH7.3 > running on an 1.4GHz Athlon with 1GB of ram). > > Questions: > 1. Is this as fast as I can get my code to run? > 2. Am I doing something obviously stupid? > 3. would Compiling things help? > > Thanks, > Husain I'll respond to your third question first. No, use of Compile will not help. You do not have a tensor structure and moreover it will copy its arguments. Hence invoking it within a loop would be quite slow for a problem where the argument grows in size. One thing you did not check is the actual run-time complexity of your code. On my 15.GHz machine I get: In[6]:= SeedRandom[5]; In[7]:= ee = Table[Random[], {10000}]; In[8]:= nums = Null; Timing[Do[nums = add[nums,ee[[j]]],{j,1000}];] Out[8]= {0.34 Second, Null} In[9]:= nums = Null; Timing[Do[nums = add[nums,ee[[j]]],{j,2000}];] Out[9]= {1.28 Second, Null} In[10]:= nums = Null; Timing[Do[nums = add[nums,ee[[j]]],{j,4000}];] Out[10]= {4.94 Second, Null} In[11]:= nums = Null; Timing[Do[nums = add[nums,ee[[j]]],{j,8000}];] Out[11]= {25.08 Second, Null} We see this is clearly of no better than quadratic complexity, whereas I would guess you were expecting O(n*Log[n]). So this indicates a problem. Offhand I do not know what aspect of your code is responsible, but I'll give some different code that has the desired complexity. Note that some of this, and code very similar to that below, is discussed at: http://library.wolfram.com/conferences/devconf99/lichtblau/ in the section entitled Trees. There is a corresponding Mathematica notebook available at: http://library.wolfram.com/conferences/devconf99/ near the bottom of the web page. The code I used to implement a tree structure similar to yours is below. One difference is that, as I place node values in the center, when they are flattened the tree is automatically sorted. You might (or might not) regard this as an added benefit. leftsubtree[node[left_, _, _]] := left rightsubtree[node[_, _, right_]] := right nodevalue[node[_, val_, _]] := val emptyTree = node[]; Clear[treeInsert] treeInsert[emptyTree, elem_] := node[emptyTree, elem, emptyTree] treeInsert[tree_, elem_] /; OrderedQ[{nodevalue[tree], elem}] := node[leftsubtree[tree], nodevalue[tree], treeInsert[rightsubtree[tree], elem]] treeInsert[tree_, elem_] := node[treeInsert[leftsubtree[tree],elem], nodevalue[tree], rightsubtree[tree]] Now for some tests. In[40]:= tt1k = First[Timing[ff1k = node[]; Do[ff1k = treeInsert[ff1k, ee[[j]]], {j,1000}];]] Out[40]= 0.15 Second We will check that the flattened version is actually sorted. In[41]:= gg1k = Apply[List,Flatten[ff1k]]; In[42]:= gg1k === Sort[Take[ee,1000]] Out[42]= True Also we will observe that the maximum depth is reasonable. In[43]:= Depth[ff1k] Out[43]= 23 In the perfectly balanced case it would be 10 so this is not too bad. For larger examples I'll just show timings. In[44]:= tt2k = First[Timing[ff2k = node[]; Do[ff2k = treeInsert[ff2k, ee[[j]]], {j,2000}];]] Out[44]= 0.32 Second In[45]:= tt4k = First[Timing[ff4k = node[]; Do[ff4k = treeInsert[ff4k, ee[[j]]], {j,4000}];]] Out[45]= 0.73 Second In[47]:= tt8k = First[Timing[ff8k = node[]; Do[ff8k = treeInsert[ff8k, ee[[j]]], {j,8000}];]] Out[47]= 1.58 Second In[53]:= SeedRandom[5]; ee = Table[Random[], {32000}]; In[54]:= tt32k = First[Timing[ff32k = node[]; Do[ff32k = treeInsert[ff32k, ee[[j]]], {j,32000}];]] Out[54]= 7.58 Second This is not of blinding speed but it has the advantage of exhibiting the appropriate run-time complexity. One can, with careful coding, cut down on tree size but if you check with LeafCount you will find that the version above is already not too wasteful (3x larger than #values stored). Moreover the code needed would run a bit slower as it would have more cases to check. As for removing nodes, I think you will need to use some form of held attribute so as to avoid copying the entire tree when you alter elements. Daniel Lichtblau Wolfram Research From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!news-out.visi.com!hermes.visi.com!newsfeed.news2me.com!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin5.nnrp.aus1.giganews.com.POSTED!not-for-mail From: "DrBob" Newsgroups: comp.soft-sys.math.mathematica Subject: RE: trying to pull numbers out of a string from a file... Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: Reply-To: X-GC-Trace: gv1-kNCNQ0SxhV0IPFSPJnf6hz6EwKDJJ2MTr+nn6KQq2pqUbpe/jHqEeu4TA== NNTP-Posting-Date: Sat, 14 Sep 2002 23:33:59 CDT Lines: 178 X-Trace: sv3-J0GsnBuyYO41HuVCVm2exjqa2gRx1ihP86RuVXMPcby4tIESte9UQcDr0XkU9CGb6H3lXZzpapzJeZa!8FLyVA1+dkCnaGIk7eAxVkx507aap7oYOcePFK1d2e/+D7wqppDDNAME X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Sun, 15 Sep 2002 04:33:59 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35181 >>So far, so good. It seems that you want these 11 numbers, OK? The problem now, I think, is that this is just a string and I can think of no easy way to convert it precisely into a list of 11 real numbers. You could try StringToStream followed by a Read from that stream. Bobby Treat -----Original Message----- From: tgarza01@prodigy.net.mx [mailto:tgarza01@prodigy.net.mx] Subject: trying to pull numbers out of a string from a file... Hello, Rob: First of all, I used ReadList directly, with Word instead of String, and with the option WordSeparators -> None, like this (I presume your file is adequately located, so that there is no problem in finding it): In[1]:= a = ReadList["197-tst.txt", Word, RecordLists -> True, WordSeparators -> None]; This allowed me to examine your records and I found out that in this way each record comes out as a list of length 1: In[2]:= Head[a[[1]]] Out[2]= List In[3]:= Length[a[[1]]] Out[3]= 1 That is, In[3]:= a[[1]] Out[3]= {"aEX-004 2002197 0 0 0 5935.80 5946.66 27.06 -1281.9 -229. 321. 317. 367. -115. 126. 146. -410. \ -426.000000EF 75."} In[4]:= StringLength[a[[1,1]]] Out[4]= 140 and the characters you want are In[5]:= StringTake[a[[1,1]], {25, 110}] Out[5]= "5935.80 5946.66 27.06 -1281.9 -229. 321. 317. 367. -115. 126. 146." So far, so good. It seems that you want these 11 numbers, OK? The problem now, I think, is that this is just a string and I can think of no easy way to convert it precisely into a list of 11 real numbers. Then, I suggest you read the file in a different way, without the WordSeparators option: In[6]:= b=ReadList["197-tst.txt",Word,RecordLists -> True]; In[7]:= b[[1]] Out[7]= {aEX-004,2002197,0,0,0,5935.80,5946.66,27.06,-1281.9,-229.,321.,317.,367 .,-\ 115.,126.,146.,-410.,-426.000000EF,75.} In[8]:= Head[b[[1]]] Out[8]= List In[9]:= Length[b[[1]]] Out[9]= 19 so that each record is now a list of 19 strings. What you want is strings 6 to 16, but converted to reals (unless I'm being presumptuous). This will achieve that: In[10]:= ToExpression[Take[b[[1]],{6,16}]] Out[10]= {5935.8,5946.66,27.06,-1281.9,-229.,321.,317.,367.,-115.,126.,146.} Now you have a nice list of real numbers to work with. You can do this for the whole file like this: In[11]:= ToExpression[Take[#,{6,16}]&/@b]; I hope this will solve your problem. Tomas Garza Mexico City > ----- Original Message ----- > From: "1.156" > Sent: Friday, September 13, 2002 12:14 AM > Subject: trying to pull numbers out of a string from a file... > > > I've got to extract some numbers from a file that are in lines of text. > Since the line contents are not numbers, I presume I must pull the line out > as a string. Here I start by pulling out just one line: > > > > inFile = OpenRead["197-tst.txt"] > > y = ReadList[inFile, String, 1, RecordLists -> True] > > Close[inFile]; > > > > This appears to pull in a line. Now I want to take characters 25 to 110 to > get just the stuff I want: > > y1=StringTake[y ,{25,110}]; > > > > Here's the output. StringTake doesn't seem to work. > > > > StringTake[{aEX-004 2002197 0 0 0 5935.80 5946.66 27.06 -1281.9 -229. > 321. 317. 367. -115. 126. 146. -410. -426.000000EF 75.}, > {25, 110}] > > > > It doesn't take loading another package as far > > as I can tell from the help. I'm thinking that it doesn't work because > it's trying to work on a list > > rather than a string. I've tried Flatten, and other stuff to try to get to > just a string and not a list but > > nothing has worked so far. I'm a long way from getting to those numbers > in there but heck, I > > can't even get to the string. Can anyone point me in the right direction? > > > > Thanks, Rob > > -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!prodigy.com!news.stealth.net!news.stealth.net!central.cox.net!cox.net!nntp2.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin4.nnrp.aus1.giganews.com.POSTED!smc.vnet.net!not-for-mail From: "DrBob" Newsgroups: comp.soft-sys.math.mathematica Subject: RE: 'More' hyperlinks Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: Reply-To: NNTP-Posting-Date: Sun, 15 Sep 2002 23:28:49 CDT Lines: 42 X-Trace: sv3-qQYvSObT85fE3X5OcLtcwduXoL0Ys6Icws3+Dso5kvxd2gpHDyirFQJwU8r3dpzVQz33B2dMYDrc+mJ!+dFFGbZe7xR3EnZ2N4ogeYXTL+4lBe+xEXTlA3BhwiokCRJ5WgH8lQEu0TC1r45arw== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Mon, 16 Sep 2002 04:28:49 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35182 Evaluate ?Floor and then, with your cursor in the output cell from that, push Ctrl-Shift-E, and you should see something like: Information["Floor", LongForm -> False] "Floor[x] gives the greatest integer less than or equal to x."*Button[More\[Ellipsis], ButtonData :> "Floor", Active -> True, ButtonStyle -> "RefGuideLink"] OK. Change ButtonData :> "Floor" to ButtonData :> "Ceiling", and push Ctrl-Shift-E again. Push the "More..." button, and you should go to Ceiling in the Help Browser, not Floor. Another method is to click Input>Create Button>RefLink and type in Ceiling. You should get a button that takes you to Help for Ceiling. Push Ctrl-Shift-E in both cells and compare, and you'll see some clues to your options. Clues are all you get in Mathematica, so get used to it! Bobby Treat -----Original Message----- From: Lawrence A. Walker Jr. [mailto:lwalker701@earthlink.net] Subject: 'More' hyperlinks Hey, How can I duplicate those nifty 'More' hyperlinks in my usage statements? That is the hyperlinks that appears at the end of text that is generated after invoking a '?' to get more information about a function. Thanks, Lawrence From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.stueberl.de!aotearoa.belnet.be!news.belnet.be!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!bin3.nnrp.aus1.giganews.com.POSTED!smc.vnet.net!not-for-mail From: "DrBob" Newsgroups: comp.soft-sys.math.mathematica Subject: RE: no complex Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: Reply-To: NNTP-Posting-Date: Sun, 15 Sep 2002 23:29:50 CDT Lines: 55 X-Trace: sv3-wR5SPjaP2wLZxSMv4kV/aiJbbSA2n79SFXzzLKfp6QbLmYhObhXYrlp4lOPCgqF2jZdMJPeM+rv/4pR!kxqWrKGu3IvqakvA+5+a7bC7hGF6+71NPe15UDTb+NAfy0HXSq/csVR/IU93a5eZXA== X-Complaints-To: abuse@GigaNews.Com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Date: Mon, 16 Sep 2002 04:29:50 GMT Xref: newsmst01.news.prodigy.com comp.soft-sys.math.mathematica:35183 Since r1 and r2 only appear squared, you can do it this way: Simplify[Solve[FR == Pi*r1Sq - Pi*r2Sq, r1Sq]] {{r1Sq -> FR/Pi + r2Sq}} or Simplify[Solve[FR == Pi*r1Sq - Pi*r2^2, r1Sq]] {{r1Sq -> FR/Pi + r2^2}} Then r1 is the square root of r1Sq. In the complex plane, real numbers have two square roots, but we usually ignore that. Bobby Treat -----Original Message----- From: Klamser [mailto:klamser@t-online.de] Subject: no complex Hi, Mathematica often produces complex resluts. But the problem is not complex: Try Solve[FR == Pi r1^2 - Pi r2^2, r1] It is simple to eliminate it in this case. Just square it. Does someone give me a hint, how to write ra rule for simplify, lik Ted Ersek did in http://www.verbeia.com/mathematica/tips/Links/Tricks_lnk_41.html I thin, one has to to replace the pattern i Sqrt[-a_] by Sqrt[(i Sqrt[-a_])^2] and then one has to simplify it? Regards, Peter Klamser From ???@??? Fri Jan 01 00:00:00 1999 Path: newssvr05.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!nntp.flash.net!newsfeed.mathworks.com!cyclone.swbell.net!cyclone-sf.pbi.net!216.166.71.10!border1.nnt