A5 == I agree with Mr. Kuska, that the system Mr Nagesh describes is not> userfriendly. But I think, the suggestions of Mr. Kuska do not make itmore> userfriendly, rather the opposite is true.>> Mr. Nagesh asks>> Is any body here have expertise or information about the capability of> Mathematica as a system simulation tool?> Mr. Kuska answers:> Since the most system simulation tools are simply solving a system of> ordinary differntial equations it is simple to do this with NDSolve[].>> My comment:>> That is: He sees the simulation system merely as a set of differential> equations.>> hmm, since the original poster write>> My refrigeration system simulation package is likely to have> approximately 60 First order Differential equations.>> it seems not completly wrong to assume that the system consists of> of ode's ..>Yout should not ignore the word merely.It is not enough to have a set 60 differential equations and a set of200-250 numbers. That is not simulation system, which can be used by userswith the exception, perhaps, of the programmer of the system himself.How does e.g. the user know what meaning a number in the set has, ought hecount the numbers from the beginning?Your nice command shows only, if there is an input, which is not a number.But I think the user would like to know, which of the 200 elements are notnumbers.The only good of your command is, that it looks nice and shows yourknowledge!>> The question of Mr. Nagesh:>> My 4th Objective:- How can I program the check for correctness of the> input values supplied by the package user ?> The answer of Mr. Kuska is:> And @@ (NumericQ /@ {aListOfAllYourNumericParameters})>> My comment:>> This is a nice command and shows the knowledge of Mr.Kuska. But does Mr.> Nagesh understand it and is it sufficient to check, if all inputs are> numerical?>> It seems you have a deeper knowlege about the things that Mr. Nagesh> understand. You know him personally ? It is not very polite to> make speculations *what* a other person understand.>> And no it is not sufficent to check that all parameters are numbers.> Typical paramters described by intervals, where the assumptions of> a model are valid. But for this checks one needs more knowlege> about the meaning of the parameters. And one needs the knowlege about> the differntial equations, to find out the eigenvalues of the jacobian> ...> Additionally I think, it is not userfriendly to see the input merely asa> set of 200-250 numbers.>> My suggestion is, that JLink is used, a suggestion Mr. Kusk takes into> consideration, too.>> That will be fast as lightning !> But further I suggest, that classes are defined in Java, which representthe> parts of the system.>> That is notable nonsense! When the differntial equations should be> solved with Mathematica, the parts can't be Java classes. Mathematica's> NDSolve[] need a explicit expression to integrate the equations.That's not nonsense, the Mathematica program does not fetch the classes butthe numbers in the classes (or better in the objects).the Java classes in textform. They can then be fetched from the Mathematicaprogram and transformed into expressions by the Command ToExpression.The aim is, to have a clear separation of the system into components, whichare manageable and understandable.>> OK you can call a Java class member from Mathematica but this will> be incredible slow when the right hand side is evaluated 200-300> times and every evaluation make several callbacks to the Java source.> Event handler of the Java main program (without some modification in> the event loop) while it is evaluating an other command.My idea is to fetch the values once from the Java objects at the beginning.200-250 numbers is not so much..> Constructors of the classes should build objects with default values.>> That's a great idea. If a simulation run should be documented, one> always> need the full listing of the Java source to find the actual parameter> settings.That is not my opinion. I think not every user of the simulation systemshould have to know Java and Mathematica.The user must look for the values in the objects. And the values are in theobjects, if they come from the constructor or from the graphical userinterface.I think, there should be listings of the objects including names of thevariables. In the objects the values are in an meaningful environment.>> Graphical user interfaces> should give the opportunity to change the data fields in the objects and> check the input for correctness.>> *and* what has a GUI for 200-250 variables to do with Mathematica ?> BTW one has typical much less variables because many parameters> are fixed and it make no sense to change, for example, material> constants of materials that can't exchanged> The system should give the opportunity, to store the objects on harddisk> (serialization).>> accessed directly.> Can you be so kind, to explain *how* your posting help a person that> ask How can I build a simulation system with Mathematica ?>> You *can* say Don't use Mathematica, use Java! but this has nothing> to do with the question or with my reply.It is you, who proposes to solve the problem with C/C++ and not to useMathematica (see below!)My point of view is:Use Mathematica, for what Mathemtica is good, and Java, for what Java isgood.Mathematica is not so good as Java for data entry and Java is better thanMathematica to represent the simulation system (by objects).>> But I still would suggest to use C/C++ and a numerical> ode-solver, make a fancy GUI/Script> interface and don't use Mathematica for such a simple task.> The ode-solver is the smallest part of such a simulation system.>> Jens> My name is Nagesh and pursuing research studies in Refrigeration. At> present I am writing a Dynamic Refrigeration System SimulationPackage.> I> am using Mathematica as a programming language for the same sincelast> one> year. I don't have any programming experience before this. I have> following> querries:-> 1. Is any body here have expertise or information about thecapability> of> Mathematica as a system simulation tool?>> Since the most system simulation tools are simply solving a systemof> ordinary differntial equations it is simple to do this with NDSolve[].>> 2. Is is possible to program a user friendly interface for my system> simulation package with Mathematica or I have to use some other> software?>> Write a MathLink or J/Link frontend that launch the kernel. But you> should keep> in mind that the user interface is typical 80-90 % of your code.> If you just whant to solve some ode's it is probably easyer to> include one of the excelent ode-solvers from netlib in your C-code> than to call Mathematica to do that. As long as you dont wish tochange> the ode's very often (than Mathematica is more ßexible) you should> not use Mathematica.>> 3. My refrigeration system simulation package is likely to have> approximately 60 First order Differential equations. Is is possibleto> solve these in Mathematica ?>> Sure.> If yes then can anybody here guide me about> this further.>> Write down the equations and call NDSolve[].> I am explaining below in short about the objectives I want tofulfill> from> coding out of my main input file>> 1. Example from Main Input File ( this will contain about 200-250> variables> which will be entered by the user of this package)>> This sounds like a *very* userfiendly interface ;-)> Below is examples of two variables entered into this file, whichwill be> used in other analysis files for further evaluation.>> 2. Example from other analysis file ( there will be about 20-25other> such> component analysis files ) where the above mentioned variables frommain> input file will be used for further evaluations:->> Below is one example from this file explaining how the variablesfrom> main> input file will be used in other files.>> I hope that this short information will be useful for guiding me to> solve> the following problems that I am facing. I am facing follwingproblems> or> objectives:->> 1. My 1st Objective:- The user of this package must be able tochange> only> the value of the variable in the main input file but he must not beable> to> change the name of the variable itself. For example he must be ableto> change the value of the variable but he must not be able tochange> the> name of this variable itself.> Here our problem is how to achieve or program it so that ourobjective> will> be fullfilled.>> Options with defaulf values ? or something like>> {aParam,bParam}={ODEParameter1,ODEParameter2} /.> userRules /.> {ODEParameter1->1,ODEParameter2->2}> 2. My 2nd Objective:- How I can program the main input file so thatit> will> be user friendly in terms of its visuals and satisfying theconstraint> mentioned above in objective1.>> What is *userfiendly* in a file with 250 variables ???> 3. My 3rd Objective:- How can I program the optional values for each> variable in the main input file ? so that there will be always avalue> assigned to each variable listed in main input file whenever theuser> opens> up this file. If user want to change the values of some variablesthen> he> can change them and run the simulation otherwise the simulation runwill> be> done with optional values assigned to each variable in the inputfile.>> See above.> 4. My 4th Objective:- How can I program the check for correctness ofthe> input values supplied by the package user ?>> And @@ (NumericQ /@ {aListOfAllYourNumericParameters})> Jens>>Reply-To: kuska@informatik.uni-leipzig.de ==== > I agree with Mr. Kuska, that the system Mr Nagesh describes is not> userfriendly. But I think, the suggestions of Mr. Kuska do not make it more> userfriendly, rather the opposite is true.> Mr. Nagesh asks> Is any body here have expertise or information about the capability of> Mathematica as a system simulation tool?> Mr. Kuska answers:> Since the most system simulation tools are simply solving a system of> ordinary differntial equations it is simple to do this with NDSolve[].> My comment:> That is: He sees the simulation system merely as a set of differential> equations.hmm, since the original poster writeMy refrigeration system simulation package is likely to have approximately 60 First order Differential equations.it seems not completly wrong to assume that the system consists ofof ode's ..> The question of Mr. Nagesh:> My 4th Objective:- How can I program the check for correctness of the> input values supplied by the package user ?> The answer of Mr. Kuska is:> And @@ (NumericQ /@ {aListOfAllYourNumericParameters})> My comment:> This is a nice command and shows the knowledge of Mr.Kuska. But does Mr.> Nagesh understand it and is it sufficient to check, if all inputs are> numerical?It seems you have a deeper knowlege about the things that Mr. Nagesh understand. You know him personally ? It is not very polite tomake speculations *what* a other person understand.And no it is not sufficent to check that all parameters are numbers.Typical paramters described by intervals, where the assumptions ofa model are valid. But for this checks one needs more knowlege about the meaning of the parameters. And one needs the knowlege aboutthe differntial equations, to find out the eigenvalues of the jacobian...> Additionally I think, it is not userfriendly to see the input merely as a> set of 200-250 numbers.> My suggestion is, that JLink is used, a suggestion Mr. Kusk takes into> consideration, too.That will be fast as lightning ! > But further I suggest, that classes are defined in Java, which represent the> parts of the system.That is notable nonsense! When the differntial equations should besolved with Mathematica, the parts can't be Java classes. Mathematica'sNDSolve[] need a explicit expression to integrate the equations.OK you can call a Java class member from Mathematica but this willbe incredible slow when the right hand side is evaluated 200-300times and every evaluation make several callbacks to the Java source.Event handler of the Java main program (without some modification inthe event loop) while it is evaluating an other command.> Constructors of the classes should build objects with default values.That's a great idea. If a simulation run should be documented, onealwaysneed the full listing of the Java source to find the actual parametersettings. > Graphical user interfaces> should give the opportunity to change the data fields in the objects and> check the input for correctness.*and* what has a GUI for 200-250 variables to do with Mathematica ?BTW one has typical much less variables because many parametersare fixed and it make no sense to change, for example, materialconstants of materials that can't exchanged> The system should give the opportunity, to store the objects on harddisk> (serialization).> accessed directly.> Can you be so kind, to explain *how* your posting help a person thatask How can I build a simulation system with Mathematica ?You *can* say Don't use Mathematica, use Java! but this has nothingto do with the question or with my reply. But I still would suggest to use C/C++ and a numerical ode-solver, make a fancy GUI/Scriptinterface and don't use Mathematica for such a simple task.The ode-solver is the smallest part of such a simulation system. Jens>> My name is Nagesh and pursuing research studies in Refrigeration. At> present I am writing a Dynamic Refrigeration System Simulation Package.> I> am using Mathematica as a programming language for the same since last> one> year. I don't have any programming experience before this. I have> following> querries:-> 1. Is any body here have expertise or information about the capability> of> Mathematica as a system simulation tool?>> Since the most system simulation tools are simply solving a system of> ordinary differntial equations it is simple to do this with NDSolve[].>> 2. Is is possible to program a user friendly interface for my system> simulation package with Mathematica or I have to use some other> software?>> Write a MathLink or J/Link frontend that launch the kernel. But you> should keep> in mind that the user interface is typical 80-90 % of your code.> If you just whant to solve some ode's it is probably easyer to> include one of the excelent ode-solvers from netlib in your C-code> than to call Mathematica to do that. As long as you dont wish to change> the ode's very often (than Mathematica is more ßexible) you should> not use Mathematica.>> 3. My refrigeration system simulation package is likely to have> approximately 60 First order Differential equations. Is is possible to> solve these in Mathematica ?>> Sure.> If yes then can anybody here guide me about> this further.>> Write down the equations and call NDSolve[].> I am explaining below in short about the objectives I want to fulfill> from> coding out of my main input file>> 1. Example from Main Input File ( this will contain about 200-250> variables> which will be entered by the user of this package)>> This sounds like a *very* userfiendly interface ;-)> Below is examples of two variables entered into this file, which will be> used in other analysis files for further evaluation.>> 2. Example from other analysis file ( there will be about 20-25 other> such> component analysis files ) where the above mentioned variables from main> input file will be used for further evaluations:->> Below is one example from this file explaining how the variables from> main> input file will be used in other files.>> I hope that this short information will be useful for guiding me to> solve> the following problems that I am facing. I am facing follwing problems> or> objectives:->> 1. My 1st Objective:- The user of this package must be able to change> only> the value of the variable in the main input file but he must not be able> to> change the name of the variable itself. For example he must be able to> change the value of the variable but he must not be able to change> the> name of this variable itself.> Here our problem is how to achieve or program it so that our objective> will> be fullfilled.>> Options with defaulf values ? or something like>> {aParam,bParam}={ODEParameter1,ODEParameter2} /.> userRules /.> {ODEParameter1->1,ODEParameter2->2}> 2. My 2nd Objective:- How I can program the main input file so that it> will> be user friendly in terms of its visuals and satisfying the constraint> mentioned above in objective1.>> What is *userfiendly* in a file with 250 variables ???> 3. My 3rd Objective:- How can I program the optional values for each> variable in the main input file ? so that there will be always a value> assigned to each variable listed in main input file whenever the user> opens> up this file. If user want to change the values of some variables then> he> can change them and run the simulation otherwise the simulation run will> be> done with optional values assigned to each variable in the input file.>> See above.> 4. My 4th Objective:- How can I program the check for correctness of the> input values supplied by the package user ?>> And @@ (NumericQ /@ {aListOfAllYourNumericParameters})> Jens>Reply-To: kuska@informatik.uni-leipzig.de ==== > My name is Nagesh and pursuing research studies in Refrigeration. At> present I am writing a Dynamic Refrigeration System Simulation Package. I> am using Mathematica as a programming language for the same since last one> year. I don't have any programming experience before this. I have following> querries:-> 1. Is any body here have expertise or information about the capability of> Mathematica as a system simulation tool?Since the most system simulation tools are simply solving a system ofordinary differntial equations it is simple to do this with NDSolve[].> 2. Is is possible to program a user friendly interface for my system> simulation package with Mathematica or I have to use some other software?Write a MathLink or J/Link frontend that launch the kernel. But youshould keepin mind that the user interface is typical 80-90 % of your code.If you just whant to solve some ode's it is probably easyer toinclude one of the excelent ode-solvers from netlib in your C-codethan to call Mathematica to do that. As long as you dont wish to changethe ode's very often (than Mathematica is more ßexible) you shouldnot use Mathematica.> 3. My refrigeration system simulation package is likely to have> approximately 60 First order Differential equations. Is is possible to> solve these in Mathematica ?Sure. > If yes then can anybody here guide me about> this further.Write down the equations and call NDSolve[].> I am explaining below in short about the objectives I want to fulfill from> coding out of my main input file> 1. Example from Main Input File ( this will contain about 200-250 variables> which will be entered by the user of this package)This sounds like a *very* userfiendly interface ;-)> > Below is examples of two variables entered into this file, which will be> used in other analysis files for further evaluation.> 2. Example from other analysis file ( there will be about 20-25 other such> component analysis files ) where the above mentioned variables from main> input file will be used for further evaluations:-> Below is one example from this file explaining how the variables from main> input file will be used in other files.> I hope that this short information will be useful for guiding me to solve> the following problems that I am facing. I am facing follwing problems or> objectives:-> 1. My 1st Objective:- The user of this package must be able to change only> the value of the variable in the main input file but he must not be able to> change the name of the variable itself. For example he must be able to> change the value of the variable but he must not be able to change the> name of this variable itself.> Here our problem is how to achieve or program it so that our objective will> be fullfilled.Options with defaulf values ? or something like{aParam,bParam}={ODEParameter1,ODEParameter2} /. userRules /. {ODEParameter1->1,ODEParameter2->2}> 2. My 2nd Objective:- How I can program the main input file so that it will> be user friendly in terms of its visuals and satisfying the constraint> mentioned above in objective1.What is *userfiendly* in a file with 250 variables ???> 3. My 3rd Objective:- How can I program the optional values for each> variable in the main input file ? so that there will be always a value> assigned to each variable listed in main input file whenever the user opens> up this file. If user want to change the values of some variables then he> can change them and run the simulation otherwise the simulation run will be> done with optional values assigned to each variable in the input file.See above.> 4. My 4th Objective:- How can I program the check for correctness of the> input values supplied by the package user ?And @@ (NumericQ /@ {aListOfAllYourNumericParameters})> Jens ==== You would need to make assumptions about y, and you can't. The functionand the limits have to take care of that, and when you try to do that,you end up with an expression that has different antiderivatives ondifferent regions, for different values of x. So, you have to break itup. The assumption x > 0 implies that x is real, so Im[x]==0 isunnecessary.one = Integrate[Cosh[2 (y - x)] 2 y, {y, Min[x, 1/2], 1/2}, Assumptions -> {x > 0}];two = Integrate[Cosh[2 (x - y)] 2 y, {y, 0, Min[x, 1/2]}, Assumptions -> {x > 0}];one + two // FullSimplifyPlot[{one, two, one + two}, {x, 0, 1/2}]; (1/4)*E^(-1 - 2*x)*(E + (-2 + E)*E^(4*x))Bobby Treat-----Original Message----- there something implicit that I am missing in the Assumptions ?MS.-- 12:02am up 5:06, 1 user, load average: 0.54, 0.22, 0.08Reply-To: spammers-go-here@yahoo.com ==== On Friday 27 September 2002 04:18 am, DrBob, as drbob@bigfoot.com, held forth the following in comp.soft-sys.math.mathematica () :> You would need to make assumptions about y, and you can't. The function> and the limits have to take care of that, and when you try to do that,> you end up with an expression that has different antiderivatives on> different regions, for different values of x. So, you have to break it> up. The assumption x > 0 implies that x is real, so Im[x]==0 is> unnecessary.> one = Integrate[Cosh[2 (y - x)]> 2 y, {y, Min[x, 1/2], 1/2}, Assumptions -> {x > 0}];> two = Integrate[Cosh[2 (x - y)] 2> y, {y, 0, Min[x, 1/2]}, Assumptions -> {x > 0}];> one + two // FullSimplify> Plot[{one, two, one + two}, {x, 0, 1/2}];> > (1/4)*E^(-1 - 2*x)*(E + (-2 + E)*E^(4*x))> Bobby Treat> > -----Original Message-----> I have been trying to integrate the following :> Integrate[Cosh[2 Abs[x-y]] 2 y, {y,0,1/2},> Assumptions->{Im[x]==0,x>0}]> However, Mathematica chokes and simply returns the integral as> it is. However, if I> split up the integral into two portions, it quickly gives me an answer> for the parts. Is> there something implicit that I am missing in the Assumptions ?> MS.> ?Anyways, I will try what you suggest.-- 12:53pm up 27 min, 1 user, load average: 0.19, 0.15, 0.09 ==== Put this after the Plot statement, in the same cell:SelectionMove[EvaluationNotebook[], All, GeneratedCell]FrontEndTokenExecute[OpenCloseGroup] FrontEndTokenExecute[SelectionAnimate]Bobby Treat-----Original Message-----Do[Plot[Sin[t]*Sin[x], {x, 0, Pi}, PlotRange -> {{0, Pi}, {-1, 1}},ImageSize -> 400]; SelectionMove[EvaluationNotebook[], All, GeneratedCell];FrontEndExecute[{FrontEnd`SelectionAnimate[ 0.1]}]; FrontEndExecute[{FrontEndToken[Clear]}], {t, 0, 15, 0.1}]This works but the cell dividing line ßashes on and off spoiling theanimation and if there is anything in the cell below this jumps up anddown.Is there a proper way of doing this?Hugh Goyder ==== >>So would it take about the same amont of time for the completeprintoutof digits? Of course it would take a few additional seconds to formatthe output...I think it would take FAR more time for a complete printout, and mightcrash the Front End. I was thinking about the fact that I calculatedall those digits and then threw them away. I could save them with Saveor DumpSave, and read them in with Get the next time I wanted any ofthem, although the file would be close to 70 MB (if not more). I may dothat, in fact -- I have plenty of disk space.The next step would be to somehow reuse the stored digits if I wantedMORE digits. But how?The Bailey-Borwein-Plouffe Pi algorithm is an avenue of attack, since itcan calculate digits far from the decimal point, without calculatingthose in between. Unfortunately, it calculates hexadecimal digits inthat way, not decimal digits. (That's true for the version I've seen,anyway.) Still, I could take the stored digits, convert to hexadecimal,add more hexadecimal digits with the B-B-P algorithm, and then convertback to decimal. In both conversions, I'd have to be very cognizant ofhow much precision I end up with, but that shouldn't be too difficult.It might go faster if I store hexadecimal digits, as well as decimaldigits, to eliminate one of those conversions at each increase in thenumber of digits.The next step would be to set up an application that allowed anyone toping for digits across the Internet, and would return them if they'restored.Hasn't someone already done that? It seems as if someone would have.Bobby Treat-----Original Message-----> Could you tell me the CPU you used and its speed etc...i am curious,to> other programs out there.> I used one processor of a dual 1GH Mac and got the same answer withthe> following speed:> 4.2 for Mac OS X (June 4, 2002)> oldmax = $MaxPrecision> 6> 1. 10> $MaxPrecision = Infinity> Infinity> With[{n = 2^26}, Timing[> pd = RealDigits[N[Pi, n + 1], 10, 20,> 19 - n]; ]]> {28794.1 Second, Null}> MaxMemoryUsed[]> 512055204> pd> {{3, 3, 8, 6, 3, 2, 2, 0, 8, 9, 6, 2, 2, 3,> 4, 0, 9, 8, 0, 3}, -67108844}> Tom Burton ==== I've been trying to get my Mathematica 4.1 properly configured. I set:######################################################### ##########/usr/local/mathematica/SystemFiles/FrontEnd/ TextResources/X/Specific.tr: @@resource maxForXListFonts 10000# xlsfonts | wc -l 5572/etc/X11/XF86Config: FontPath /usr/X11R6/lib/X11/fonts/100dpi:unscaled FontPath /usr/X11R6/lib/X11/fonts/75dpi:unscaled FontPath /usr/X11R6/lib/X11/fonts/CID FontPath /usr/X11R6/lib/X11/fonts/Speedo FontPath /usr/X11R6/lib/X11/fonts/Type1 FontPath /usr/X11R6/lib/X11/fonts/URW FontPath /usr/X11R6/lib/X11/fonts/kwintv:unscaled FontPath /usr/X11R6/lib/X11/fonts/latin2/Type1 FontPath /usr/X11R6/lib/X11/fonts/local/mma/Type1 FontPath /usr/X11R6/lib/X11/fonts/local/mma/X:unscaled FontPath /usr/X11R6/lib/X11/fonts/misc:unscaled FontPath /usr/X11R6/lib/X11/fonts/misc/sgi:unscaled FontPath /usr/X11R6/lib/X11/fonts/truetype FontPath /usr/X11R6/lib/X11/fonts/uni:unscaled# ls -R /usr/X11R6/lib/X11/fonts/ | grep //usr/X11R6/lib/X11/fonts/:/usr/X11R6/lib/X11/fonts/100dpi: /usr/X11R6/lib/X11/fonts/75dpi:/usr/X11R6/lib/X11/fonts/CID:/ usr/X11R6/lib/X11/fonts/Speedo:/usr/X11R6/lib/X11/fonts/Type1 :/usr/X11R6/lib/X11/fonts/URW:/usr/X11R6/lib/X11/fonts/ encodings:/usr/X11R6/lib/X11/fonts/encodings/large:/usr/X11R6 /lib/X11/fonts/kwintv:/usr/X11R6/lib/X11/fonts/latin2:/usr/ X11R6/lib/X11/fonts/latin2/Type1:/usr/X11R6/lib/X11/fonts/ local:/usr/X11R6/lib/X11/fonts/local/mma:/usr/X11R6/lib/X11/ fonts/local/mma/Type1:/usr/X11R6/lib/X11/fonts/local/mma/X:/ usr/X11R6/lib/X11/fonts/misc:/usr/X11R6/lib/X11/fonts/misc/ sgi:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/ fonts/uni:/usr/X11R6/lib/X11/fonts/util:##################### ###################################When I open the Mathematica Book Reference Guide in the Help Browser, I get a beep and the message says:Unable to find font with family Helvetica, weight Bold, slant Plain, and size 26. Substituting Courier.Compared to the things which *were* broken, this is a minor problem. I can live with the beep. What I would now like to know is how to tell Mathematica what fonts to use by default. This seemingly simple question seems to have no simple answer. Could someone please help me.TIA,^LReply-To: kuska@informatik.uni-leipzig.de ==== I expect that the Helvetica request comes from theFrontend menues and this is lited I your X resources$TopDirectory/SystemFiles/FontEnd/SystemResources/X /XMathematicarequest the helvetica font:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!! GENERAL GUI STYLE / COLOR SETTINGS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!! Choose your GUI widget background color.! CDE: Comment this out.*background: #c0c0c0! Choose a font for buttons/text fields, etc.! You can use xfontsel to get a listing of fonts.!*Menu*fontList: -*-helvetica-medium-r-*-*-*-100-*-*-*-*-*-*! Or just set all the fonts at once.*fontList: -*-helvetica-medium-r-*-*-*-100-*-*-*-*-*-* Jens> I've been trying to get my Mathematica 4.1 properly configured.> I set:> ############################################################# ######> /usr/local/mathematica/SystemFiles/FrontEnd/TextResources/X/ Specific.tr:> @@resource maxForXListFonts> 10000> # xlsfonts | wc -l> 5572> /etc/X11/XF86Config:> FontPath /usr/X11R6/lib/X11/fonts/100dpi:unscaled> FontPath /usr/X11R6/lib/X11/fonts/75dpi:unscaled> FontPath /usr/X11R6/lib/X11/fonts/CID> FontPath /usr/X11R6/lib/X11/fonts/Speedo> FontPath /usr/X11R6/lib/X11/fonts/Type1> FontPath /usr/X11R6/lib/X11/fonts/URW> FontPath /usr/X11R6/lib/X11/fonts/kwintv:unscaled> FontPath /usr/X11R6/lib/X11/fonts/latin2/Type1> FontPath /usr/X11R6/lib/X11/fonts/local/mma/Type1> FontPath /usr/X11R6/lib/X11/fonts/local/mma/X:unscaled> FontPath /usr/X11R6/lib/X11/fonts/misc:unscaled> FontPath /usr/X11R6/lib/X11/fonts/misc/sgi:unscaled> FontPath /usr/X11R6/lib/X11/fonts/truetype> FontPath /usr/X11R6/lib/X11/fonts/uni:unscaled> # ls -R /usr/X11R6/lib/X11/fonts/ | grep /> /usr/X11R6/lib/X11/fonts/:> /usr/X11R6/lib/X11/fonts/100dpi:> /usr/X11R6/lib/X11/fonts/75dpi:> /usr/X11R6/lib/X11/fonts/CID:> /usr/X11R6/lib/X11/fonts/Speedo:> /usr/X11R6/lib/X11/fonts/Type1:> /usr/X11R6/lib/X11/fonts/URW:> /usr/X11R6/lib/X11/fonts/encodings:> /usr/X11R6/lib/X11/fonts/encodings/large:> /usr/X11R6/lib/X11/fonts/kwintv:> /usr/X11R6/lib/X11/fonts/latin2:> /usr/X11R6/lib/X11/fonts/latin2/Type1:> /usr/X11R6/lib/X11/fonts/local:> /usr/X11R6/lib/X11/fonts/local/mma:> /usr/X11R6/lib/X11/fonts/local/mma/Type1:> /usr/X11R6/lib/X11/fonts/local/mma/X:> /usr/X11R6/lib/X11/fonts/misc:> /usr/X11R6/lib/X11/fonts/misc/sgi:> /usr/X11R6/lib/X11/fonts/truetype:> /usr/X11R6/lib/X11/fonts/uni:> /usr/X11R6/lib/X11/fonts/util:> ########################################################> When I open the Mathematica Book Reference Guide in the Help Browser, I get> a beep and the message says:> Unable to find font with family Helvetica, weight Bold, slant Plain, and> size 26. Substituting Courier.> Compared to the things which *were* broken, this is a minor problem. I can> live with the beep. What I would now like to know is how to tell Mathematica what> fonts to use by default. This seemingly simple question seems to have no> simple answer.> > Could someone please help me.> TIA,> ^L ==== > I expect that the Helvetica request comes from the> Frontend menues and this is lited I your X resources> $TopDirectory/SystemFiles/FontEnd/SystemResources/X/ XMathematica$PreferencesDirectory? This is where I expected to find this kind of thing in the first place. The idea of chaning user preferences in a system file bothers me.> request the helvetica font:> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!> !> ! GENERAL GUI STYLE / COLOR SETTINGS> !> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!> ! Choose your GUI widget background color.> ! CDE: Comment this out.> *background: #c0c0c0> ! Choose a font for buttons/text fields, etc.> ! You can use xfontsel to get a listing of fonts.> !*Menu*fontList: -*-helvetica-medium-r-*-*-*-100-*-*-*-*-*-*> ! Or just set all the fonts at once.> *fontList: -*-helvetica-medium-r-*-*-*-100-*-*-*-*-*-*I still don't know why Mathematica would ship with the font defaults arranged in such a way as to cause it to give me errors when viewing the help files. It makes me think something is still amiss. Were they expecting my system to have these already installed? Should I have other fonts installed? Where would I get them, if I wanted them?> Jens> STH ==== I have spent far more time attempting to get Mathematica configured than I have using it. I've found the the product to be exceptionally difficult to As an example, I spent several hours trying to figure out how to tell Mathematica to understand the delete key in the way most contemporary systems understand it. I wanted to avoid modifying system configuration files such as:/usr/local/mathematica/SystemFiles/FrontEnd/TextResources/ KeyEventTranslations.trI expected to be able to change something in my own ~/.Mathematic directory, but I could not figure out an obvious way to affect this modification. I want to adjust the font size used in the widgets, but again, I see no ovbious means of modifying these attributes. I suspect it can be accomplished by modifying the ~/.Mathematica/4.1/FrontEnd/init.m. Perhaps to an experienced Mathematica user, the syntax and semantics of this file are obvious. They aren't to me.I also find the overall look & feel of the interface to be archaic. I understand that Mathematica 4.1 was written years ago, and much of the desktops for Unix which exist today did not exist when it was written. I should be receiving Mathematica 4.2 in a few days, so perhaps these concerns will prove undounded. Something tells me that not a lot has changed in this respect.What have others observed?Reply-To: kuska@informatik.uni-leipzig.de ==== I can't understand your criticism. Open a terminal windowand type >maththe delete key work perfect, due to your terminal settings anda command line is the most modern interface I can imagine.It still comes with Mathematica 4.2 and is perfect as before. Jens> I have spent far more time attempting to get Mathematica configured than I> have using it. I've found the the product to be exceptionally difficult to> As an example, I spent several hours trying to figure out how to tell Mathematica to> understand the delete key in the way most contemporary systems understand> it. I wanted to avoid modifying system configuration files such as:> /usr/local/mathematica/SystemFiles/FrontEnd/TextResources/ KeyEventTranslations.tr> I expected to be able to change something in my own ~/.Mathematic directory,> but I could not figure out an obvious way to affect this modification. I> want to adjust the font size used in the widgets, but again, I see no> ovbious means of modifying these attributes. I suspect it can be> accomplished by modifying the ~/.Mathematica/4.1/FrontEnd/init.m. Perhaps> to an experienced Mathematica user, the syntax and semantics of this file are> obvious. They aren't to me.> I also find the overall look & feel of the interface to be archaic. I> understand that Mathematica 4.1 was written years ago, and much of the desktops for> Unix which exist today did not exist when it was written. I should be> receiving Mathematica 4.2 in a few days, so perhaps these concerns will prove> undounded. Something tells me that not a lot has changed in this respect.> What have others observed? ==== > > I can't understand your criticism. Open a terminal window> and type>>math> the delete key work perfect, due to your terminal settings and> a command line is the most modern interface I can imagine.> It still comes with Mathematica 4.2 and is perfect as before.> Jens> If I could use bash to edit the command line, recall the command history, and other sorts of things that bash is good at, that would make the command line attractive. There *are* certain advantages to the gui side of things. For example the M-k code completion. That can really speed things up with languages such as Java and C++. I don't believe there is any fundamental reason such a thing could not exist with the command line. IMHO, a well conceived XEmacs lisp package could provide a wonderful frontend. I played around with mma.el for a few minutes, but it wasn't acting like a normal XEmacs package, so I switched back to cursing the Mod1<->Ctrl inversion of the Mathematica frontend.gui front end, get in the way of what really matters. The last thing I Mathematica. What I want to do is improve the overal experience for all of us.STH ==== Dear friendsI have the following problem with Legend and LogPlot and LogPlotPlot: Needs[Graphics`Graphics`]Needs[Graphics`Legend`]{q1[t _],q2[t_],q3[t_]}={0.1 Exp[-0.02 t], 0.2 Exp[-0.025 t], 0.4 Exp[-0.028 t]};(*With Plot legend works fine*)Plot[{q1[t],q2[t],q3[t]}, {t, 0, 100},PlotStyle[Rule]{ {AbsoluteThickness[0.5], AbsoluteDashing[{4,4}]}, AbsoluteThickness[1.5], {AbsoluteThickness[2], AbsoluteDashing[{1,8}]}}, AxesLabel[Rule]{Y, X}, PlotLabel[Rule]Title, PlotLegend[Rule]{1,3,5}, LegendPosition[Rule] {0.5,0}](*However with LogPlot or LogLogPlot the legend desappear*)LogLogPlot[{q1[t],q2[t],q3[t]}, {t, 0, 100},PlotStyle[Rule]{ {AbsoluteThickness[0.5], AbsoluteDashing[{4,4}]}, AbsoluteThickness[1.5], {AbsoluteThickness[2], AbsoluteDashing[{1,8}]}}, AxesLabel[Rule]{Y, X}, PlotLabel[Rule]Title, PlotLegend[Rule]{1,3,5}, LegendPosition[Rule] {0.5,0}]I have shown a particular case, but I has this problem always with Legend and LogPlot and LogPlotPlot. I will appreciate any help.GuillermoSanchez------------------------------------ ---------This message was sent using Endymion MailMan. ==== IIRC, there is a way to get a list of all the symbols defined in the currently running session. I can't seem to find the reference to that command. Could somone point me in the direction of documentation which will tell me how to get information about the current session?TIA,Reply-To: kuska@informatik.uni-leipzig.de ==== Mathematica's PostScript does not need a 3d graphics cardand will not use it.Only the RealTime3D` package make use of the 3d graphics and it'smemory. Since it make an off screen rendering it will be slow and since one must be mad to use it for 10^5 polygons it does notmatter how much graphics memory you have. The tiny polygon countsof Plot3D[] & friends can be handled wit 8 MByte :-)MathGL3d will run fine (not fast) with 8 MByte. For the mostMathGL3d applications 64 MByte sufficient.With more than 10^6 polygons or many huge (1024^2) textures you mayrun into problems. For the MathGL3d development I have GeForce 3/4 cardswith 128 MByte RAM.BTW the RAM of the 3d graphics cards is for textures and Mathematicadoes not know what a texture is or how usefull it is for scientificvisualization. Jens> We are about to order new PCs for a university student lab in which> Mathematica will be installed. Of course they will be using 2D and 3D> graphics -- plots of surfaces, e.g. Sooner or later students will want> to rotate such plots, too.> An unresolved issue is how much graphics RAM to get. On existing> machines we typically have 64MB. But for the PCs we are looking at,> manufacturer's limits on graphics RAM, rather than cost, seems to limit> us to 32 MB.> Is 32 MB adequate not just now, but likely to be adequate as well for> the near future (say, a 3- to 5-year equipment lifetime)?> --> Murray Eisenberg murray@math.umass.edu> Mathematics & Statistics Dept.> Lederle Graduate Research Tower phone 413 549-1020 (H)> University of Massachusetts 413 545-2859 (W)> 710 North Pleasant Street> Amherst, MA 01375Reply-To: kuska@informatik.uni-leipzig.de ==== Names[Global`*]?? Jens> IIRC, there is a way to get a list of all the symbols defined in the> currently running session. I can't seem to find the reference to that> command. Could somone point me in the direction of documentation which> will tell me how to get information about the current session?> TIA, ==== To get a complete list of all variables that have been defined for thecurrent Mathematica session, please try:?`*which should return a list of all variables that have been defined for thecurrent Mathematica session.Steven Shippee ==== > IIRC, there is a way to get a list of all the symbols defined in the> currently running session. I can't seem to find the reference to that> command. Could somone point me in the direction of documentation which> will tell me how to get information about the current session?> TIA,>Let's begin with a fresh sessionQuitMake some entries, notice that b, x and y have no definitions - they aresimply created. a=3; b; p= 3x +1; f[y_]:=y^2;We can find all the symbols we have created so far. Names[`*] {a,b,f,p,x,y}Actually, they are the strings of the symbols (otherwise, for example, awould immediately evaluate to 3). InputForm[%] {a, b, f, p, x, y}How can we take out the strings of the undefined symbols?I make a function that test if the symbol has been defined (or has anattribute assigned): SetAttributes[definedQ, HoldFirst]; definedQ[x_String]:= Or[DownValues@@#=!={}, UpValues@@#=!={},OwnValues@@#=!={}, SubValues@@#=!={},DefaultValues@@#=!={},NValues@@#=!={}, Attributes@@#=!={}]&[ ToExpression[x, InputForm, Hold]] definedQ[x_]:= definedQ[Evaluate[ToString[Unevaluated[x]]]]Using this we get Select[Names[`*], definedQ] {a,definedQ,f,p}To get information about the symbolsInformation/@Select[Names[`*], definedQ]; a a = 3 definedQ Attributes[definedQ] = {HoldFirst} definedQ[x_String] := (DownValues @@ #1 =!= {} || UpValues @@ #1 =!= {} || OwnValues @@ #1 =!= {} || SubValues @@ #1 =!= {} || DefaultValues @@ #1 =!= {} || NValues @@ #1 =!= {} & )[ToExpression[x, InputForm, Hold]] definedQ[x_] := definedQ[Evaluate[ ToString[Unevaluated[x]]]] f f[y_] := y^2 p p = 1 + 3*xI have assumed that you are interested only in the symbols in the symbols inthe default context Global`.Other context can be provided for.--Allan---------------------Allan HayesMathematica Training and ConsultingLeicester UKwww.haystack.demon.co.ukhay@haystack.demon.co.ukVoice : +44 (0)116 271 4198 ==== There are several ways (note that newly defined things are by default inGlobal` context) , one would be ?@bye,Borut| IIRC, there is a way to get a list of all the symbols defined in the| currently running session. I can't seem to find the reference to that| command. Could somone point me in the direction of documentation which| will tell me how to get information about the current session?||| TIA,| ==== Dear all,As far as I understand, FindMinimum can be requested to use theBerndt-Hall-Hall-Hausman method, if the option Method->QuasiNewton is specified. I am pretty convinced that there is no way to tellmathematica to produce as an output the Jacobian vector and the Hessianmatrix at every step. In addition, I have not found a way to specify theDavidon-Fletcher-Powell algorithm to be used.Before I start to program it myself, I was wondering if anybody has writtensome [non-commercial] code that produces such an output for BFGS and evenbetter for DFP optimization.Kyriakos _____+**+____+**+___+**+__+**+_Kyriakos ChourdakisLecturer in Financial EconomicsURL: http://www.qmw.ac.uk/~te9001tel: (++44) (+20) 7882 5086Dept of EconomicsUniversity of London, QMLondon E1 4NSU.K. ==== Both Simplify and ImpliesQ need the assumption that all variablesare real in order to use the CAD algorithm. However, Simplifyuses many other methods trying to simplify each subexpressionof the input, while ImpliesQ only tries to prove that the wholeinput is implied by the assumptions.Here is the series of simplifications that Simplify does in thisexample.- An inequality simplification heuristic using the inequality assumption y6 >= -1 is applied to the whole system. We getsimplification:y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6 -> 1 + y4 >= 0 && y5 >= y6 && 1 + y4 + y6 >= y5- We go into simplification of subexpressions, and get thesesimplifications using reduction modulo a GroebnerBasis ofequation assumptions y4 == -1 and y5 == y6 (Simplify keepsthe result of this transformation even if it has the samecomplexity as the original expression.)1 + y4 -> 0y5 -> y61 + y4 + y6 -> y6y5 -> y6- As the result of subexpression simplifications the three inequalities become then:1 + y4 >= 0 -> 0 >= 0y5 >= y6 -> y6 >= y61 + y4 + y6 >= y5 -> y6 >= y6- 0 >= 0 evaluates to True, y6 >= y6 is simplified to True using transformation x >= y -> x - y >= 0.Adam StrzebonskiWolfram Research> That makes everything clear, except for just one small mystery:> In[1]:=> << Experimental`> In[2]:=> FullSimplify[y4 >= -1 && y6 >= -1 &&> y6 <= y5 <= 1 + y4 + y6, y4 == -1 && y6 >= -1 && y5 == y6]> Out[2]=> True> In[3]:=> ImpliesQ[y4 == -1 && y6 >= -1 && y5 == y6,> y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6]> Out[3]=> False> I now understand why the last one returns False, but why does the> second one return True? Should not the same arument apply in both> cases? Or is it because FullSimplify does not actually need the> assumption that the variables are real while ImliesQ does?> Andrzej> Actually, the reason why ImpliesQ (and FullSimplify) fail to> prove the implication is not that the hypothesis is a disjunction.> To use the cylindrical algebraic decomposition algorithm they> need to know that the assumptions imply that all variables are> real.>> The assumptions mechanism infers variable domains in a purely> syntactical way, i.e. v is assumed to be real if there is> an Element[v, Reals] statement or v appears in an inequality.> It does not attempt to analyze assumptions further, to figure> out that, say y6 >= -1 implies that y6 is real, and then if> we have y5 == y6 then y5 must be real too. Doing such an analysis> in general would require solving the assumptions over complex> numbers, and then finding out which variables need to be real.> This would be in general too time consuming to do, but analyzing> linear dependencies like the ones in your example is a possible> future improvement.>> ImpliesQ cannot prove the implication here, because it knows only> that y6 is real.>> In[1]:= <> In[2]:= ImpliesQ[y4 == -1 && y6 >= -1 && y5 == y6,> y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6]>> Out[2]= False>> If we add an explicit assumption that y4 and y5 are real, ImpliesQ> (and FullSimplify) can prove this implication, and the full version> of your example.>> In[3]:= ImpliesQ[Element[y4|y5, Reals] && y4 == -1 && y6 >= -1 && y5 ==> y6,> y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6]>> Out[3]= True>> In[4]:= ImpliesQ[Element[y4|y5, Reals] && (y4 == -1 && y6 >= -1 &&> y5 == y6 || y4 > -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6),> y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6]>> Out[4]=> True>> In[5]:= FullSimplify[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,> Element[y4|y5, Reals] && (y4 == -1 && y6 >= -1 && y5 == y6 ||> y4 > -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6)]>> Out[5]=> True>> Adam Strzebonski> Wolfram Research>> On second thoughts I realized that there seems to be an inherent>> ambiguity about what one coudl mean by using alternatives (statements>> joned by Or) assumptions. In fact it now seems to me that the>> reasonable intertpretation for ImpliesQ and FullSimplify ought to>> perhaps be different. It seems to me that ImpliesQ[Or[a,b],c] ought to>> return True if aand only if ImpliesQ[a,c] and ImpliesQ[b,c] both>> return>> True. If so this could be acomplished by adding the rule>> ImpliesQ[Or[a,b],c] = And[ImpliesQ[a,c],ImpliesQ[b,c]]. That could>> then>> be used in proving that the two answers to the system of inequalities>> that of Vincent's original posting are equivalent. On the other hand>> probably FullSimplify[a, Or[p,q]] ought to return>> Or[FullSimplify[a,p],FullSimplify[a,q]] (or do nothing as it doe>> snow).>> The first approach would seem to be consistent with the way>> FullSimplify works with domain specifications but would however have>> the strange effect of returning True if just one of the alternatives>> were true and the other false. So perhaps after all it is best to>> leave FullSimplify as it is. However, it seems to me that ImpliesQ>> shoud be able to handle such cases (?)>> Andrzej Kozlowski>> Toyama International University>> JAPAN> The modification to FullSimplify that I sent earlier works correctly> only for assumptions of the form Or[a,b] (and even then not is not> always what one would like). For what it's worth here is a better> (but> slow) version:>> In[1]:=> Unprotect[FullSimplify];>> In[2]:=> FullSimplify[expr_, x_ || y__] := FullSimplify[> FullSimplify[expr, x] || FullSimplify[expr, Or[y]]];>> In[3]:=> Protect[FullSimplify];>> For example:>> In[4]:=> FullSimplify[Sqrt[(x - 1)^2] + Sqrt[(x - 2)^2] +> Sqrt[(x - 3)^2], x > 1 || x > 2 || x > 3]>> Out[4]=> -1 + x + Abs[-3 + x] + Abs[-2 + x] ||> -3 + 2*x + Abs[-3 + x] || 3*(-2 + x)>> Andrzej Kozlowski> Toyama International University> JAPAN>> On Thursday, September 26, 2002, at 11:14 AM, Andrzej Kozlowski> The reason why InequalitySolve returns it's answer in what sometimes>> turns out to be unnecessarily complicated form is that the>> underlying>> algorithm, Cylindrical Agebraic Decomposition (CAD) returns its>> answers in this form. Unfortunately it seems to me unlikely that a>> simplification of the kind you need can be can be accomplished in>> any>> general way. To see why observe the following. First of all:>> In[1]:=>> FullSimplify[x > 0 || x == 0]>> Out[1]=>> x >= 0>> This is fine. However:>> In[2]:=>> FullSimplify[x > 0 && x < 2 || x == 0 && x < 2]>> Out[2]=>> x == 0 || 0 < x < 2>> Of course what you would like is simply 0 <= x < 2. One reason why>> you can't get it is that while Mathematica can perform a>> LogicalExpand, as in:>> In[3]:=>> LogicalExpand[(x > 0 || x == 0) && x < 2]>> Out[3]=>> x == 0 && x < 2 || x > 0 && x < 2>> There i no LogicalFactor or anything similar that would reverse>> what LogicalExpand does. if there was then you could perform the>> sort>> of simplifications you need for:>> In[4]:=>> FullSimplify[(x > 0 || x == 0) && x < 2]>> Out[4]=>> 0 <= x < 2>> However, it does not seem to me very likely that such logical>> factoring can be performed by a general enough algorithm (though I>> am no expert in this field). In any case, certainly Mathematica>> can't>> do this.>> I also noticed that Mathematica seems unable to show that the answer>> it returns to your problem is actually equivalent to your simpler>> one. In fact this looks like a possible bug in Mathematica. Let's>> first try the function ImpliesQ from the Experimental context:>> << Experimental`>> Now Mathematica correctly gives:>> In[6]:=>> ImpliesQ[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,>> y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1 && y6 <=>> y5>> <= 1 + y4 + y6]>> Out[6]=>> True>> However:>> In[7]:=>> ImpliesQ[y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1 &&>> y6 <= y5 <= 1 + y4 + y6, y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 +>> y4 + y6]>> Out[7]=>> False>> That simply means that ImpliesQ cannot show the implication, not>> that>> it does not hold. ImpliesQ relies on CAD, as does FullSimplify.>> Switching to FullSimplify we see that:>> In[8]:=>> FullSimplify[y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1>> &&>> y6 <= y5 <= 1 + y4 + y6, y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 +>> y4 + y6]>> Out[8]=>> True>> while>> In[9]:=>> FullSimplify[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,>> y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1 && y6 <=>> y5>> <= 1 + y4 + y6]>> Out[9]=>> y4 >= -1 && y6 <= y5 <= 1 + y4 + y6>> On the other hand, taking just the individual summands of Or as>> hypotheses;>> In[10]:=>> FullSimplify[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,>> y4 > -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6]>> Out[10]=>> True>> In[11]:=>> FullSimplify[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,>> y4 == -1 && y6 >= -1 && y5 == y6 ]>> Out[11]=>> True>> In fact FullSimplify is unable to use Or in assumptions, which can>> be>> demonstrated on an abstract example:>> In[12]:=>> FullSimplify[C,(A||B)&&(C)]>> Out[12]=>> True>> In[13]:=>> FullSimplify[C,LogicalExpand[(A||B)&&(C)]]>> Out[13]=>> C>> This could be fixed by modifying FullSimplify:>> In[14]:=>> Unprotect[FullSimplify];>> In[14]:=>> FullSimplify[expr_,Or[x_,y__]]:=Or[FullSimplify[expr,x], FullSimplify>> [e>> xpr,y]];>> In[15]:=>> Protect[FullSimplify];>> Now at least we get as before:>> In[16]:=>> FullSimplify[y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1>> &&>> y6 <= y5 <= 1 + y4 + y6, y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 +>> y4 + y6]>> Out[16]=>> True>> but also:>> In[17]:=>> FullSimplify[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,>> y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1 && y6 <=>> y5>> <= 1 + y4 + y6]>> Out[17]=>> True>> This seems to me a possible worthwhile improvement in FullSimplify,>> though of course not really helpful for your problem.>> Andrzej Kozlowski>> Toyama International University>> JAPAN>> On Wednesday, September 25, 2002, at 02:51 PM, Vincent Bouchard> I have a set of inequalities that I solve with InequalitySolve. But> then> it gives a complete set of solutions, but not in the way I would> like it> to be! :-) For example, the simple following calculation will give:>> In[1]:= ineq = {y4 >= -1, y5 >= -1, y6 + y4 >= y5 - 1, y5 >= y6, y6>> = -1};> InequalitySolve[ineq,{y4,y6,y5}]>> Out[1]:= y4 == -1 && y6 >= -1 && y5 == y6 ||> y4 > -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6>> the result is good, but I would like it to be in the simpler but> equivalent form>> y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6>> How can I tell InequalitySolve to do that? It is simple for this> example,> but for a large set of simple inequalities InequalitySolve gives> lines and> lines of results instead of a simple result.> Vincent Bouchard>> Andrzej Kozlowski> Toyama International University> JAPAN ==== That makes everything clear, except for just one small mystery:In[1]:=<< Experimental`In[2]:=FullSimplify[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6, y4 == -1 && y6 >= -1 && y5 == y6]Out[2]=TrueIn[3]:=ImpliesQ[y4 == -1 && y6 >= -1 && y5 == y6, y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6]Out[3]=FalseI now understand why the last one returns False, but why does the second one return True? Should not the same arument apply in both cases? Or is it because FullSimplify does not actually need the assumption that the variables are real while ImliesQ does?Andrzej> Actually, the reason why ImpliesQ (and FullSimplify) fail to> prove the implication is not that the hypothesis is a disjunction.> To use the cylindrical algebraic decomposition algorithm they> need to know that the assumptions imply that all variables are> real.>> The assumptions mechanism infers variable domains in a purely> syntactical way, i.e. v is assumed to be real if there is> an Element[v, Reals] statement or v appears in an inequality.> It does not attempt to analyze assumptions further, to figure> out that, say y6 >= -1 implies that y6 is real, and then if> we have y5 == y6 then y5 must be real too. Doing such an analysis> in general would require solving the assumptions over complex> numbers, and then finding out which variables need to be real.> This would be in general too time consuming to do, but analyzing> linear dependencies like the ones in your example is a possible> future improvement.>> ImpliesQ cannot prove the implication here, because it knows only> that y6 is real.>> In[1]:= <> In[2]:= ImpliesQ[y4 == -1 && y6 >= -1 && y5 == y6,> y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6]>> Out[2]= False>> If we add an explicit assumption that y4 and y5 are real, ImpliesQ> (and FullSimplify) can prove this implication, and the full version> of your example.>> In[3]:= ImpliesQ[Element[y4|y5, Reals] && y4 == -1 && y6 >= -1 && y5 ==> y6,> y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6]>> Out[3]= True>> In[4]:= ImpliesQ[Element[y4|y5, Reals] && (y4 == -1 && y6 >= -1 &&> y5 == y6 || y4 > -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6),> y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6]>> Out[4]=> True>> In[5]:= FullSimplify[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,> Element[y4|y5, Reals] && (y4 == -1 && y6 >= -1 && y5 == y6 ||> y4 > -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6)]>> Out[5]=> True>> Adam Strzebonski> Wolfram Research>> On second thoughts I realized that there seems to be an inherent>> ambiguity about what one coudl mean by using alternatives (statements>> joned by Or) assumptions. In fact it now seems to me that the>> reasonable intertpretation for ImpliesQ and FullSimplify ought to>> perhaps be different. It seems to me that ImpliesQ[Or[a,b],c] ought to>> return True if aand only if ImpliesQ[a,c] and ImpliesQ[b,c] both >> return>> True. If so this could be acomplished by adding the rule>> ImpliesQ[Or[a,b],c] = And[ImpliesQ[a,c],ImpliesQ[b,c]]. That could >> then>> be used in proving that the two answers to the system of inequalities>> that of Vincent's original posting are equivalent. On the other hand>> probably FullSimplify[a, Or[p,q]] ought to return>> Or[FullSimplify[a,p],FullSimplify[a,q]] (or do nothing as it doe >> snow).>> The first approach would seem to be consistent with the way>> FullSimplify works with domain specifications but would however have>> the strange effect of returning True if just one of the alternatives>> were true and the other false. So perhaps after all it is best to>> leave FullSimplify as it is. However, it seems to me that ImpliesQ>> shoud be able to handle such cases (?)>> Andrzej Kozlowski>> Toyama International University>> JAPAN> The modification to FullSimplify that I sent earlier works correctly> only for assumptions of the form Or[a,b] (and even then not is not> always what one would like). For what it's worth here is a better > (but> slow) version:>> In[1]:=> Unprotect[FullSimplify];>> In[2]:=> FullSimplify[expr_, x_ || y__] := FullSimplify[> FullSimplify[expr, x] || FullSimplify[expr, Or[y]]];>> In[3]:=> Protect[FullSimplify];>> For example:>> In[4]:=> FullSimplify[Sqrt[(x - 1)^2] + Sqrt[(x - 2)^2] +> Sqrt[(x - 3)^2], x > 1 || x > 2 || x > 3]>> Out[4]=> -1 + x + Abs[-3 + x] + Abs[-2 + x] ||> -3 + 2*x + Abs[-3 + x] || 3*(-2 + x)>> Andrzej Kozlowski> Toyama International University> JAPAN>> On Thursday, September 26, 2002, at 11:14 AM, Andrzej Kozlowski > The reason why InequalitySolve returns it's answer in what sometimes>> turns out to be unnecessarily complicated form is that the >> underlying>> algorithm, Cylindrical Agebraic Decomposition (CAD) returns its>> answers in this form. Unfortunately it seems to me unlikely that a>> simplification of the kind you need can be can be accomplished in >> any>> general way. To see why observe the following. First of all:>> In[1]:=>> FullSimplify[x > 0 || x == 0]>> Out[1]=>> x >= 0>> This is fine. However:>> In[2]:=>> FullSimplify[x > 0 && x < 2 || x == 0 && x < 2]>> Out[2]=>> x == 0 || 0 < x < 2>> Of course what you would like is simply 0 <= x < 2. One reason why>> you can't get it is that while Mathematica can perform a>> LogicalExpand, as in:>> In[3]:=>> LogicalExpand[(x > 0 || x == 0) && x < 2]>> Out[3]=>> x == 0 && x < 2 || x > 0 && x < 2>> There i no LogicalFactor or anything similar that would reverse>> what LogicalExpand does. if there was then you could perform the >> sort>> of simplifications you need for:>> In[4]:=>> FullSimplify[(x > 0 || x == 0) && x < 2]>> Out[4]=>> 0 <= x < 2>> However, it does not seem to me very likely that such logical>> factoring can be performed by a general enough algorithm (though I>> am no expert in this field). In any case, certainly Mathematica >> can't>> do this.>> I also noticed that Mathematica seems unable to show that the answer>> it returns to your problem is actually equivalent to your simpler>> one. In fact this looks like a possible bug in Mathematica. Let's>> first try the function ImpliesQ from the Experimental context:>> << Experimental`>> Now Mathematica correctly gives:>> In[6]:=>> ImpliesQ[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,>> y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1 && y6 <= >> y5>> <= 1 + y4 + y6]>> Out[6]=>> True>> However:>> In[7]:=>> ImpliesQ[y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1 &&>> y6 <= y5 <= 1 + y4 + y6, y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 +>> y4 + y6]>> Out[7]=>> False>> That simply means that ImpliesQ cannot show the implication, not >> that>> it does not hold. ImpliesQ relies on CAD, as does FullSimplify.>> Switching to FullSimplify we see that:>> In[8]:=>> FullSimplify[y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1>> &&>> y6 <= y5 <= 1 + y4 + y6, y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 +>> y4 + y6]>> Out[8]=>> True>> while>> In[9]:=>> FullSimplify[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,>> y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1 && y6 <= >> y5>> <= 1 + y4 + y6]>> Out[9]=>> y4 >= -1 && y6 <= y5 <= 1 + y4 + y6>> On the other hand, taking just the individual summands of Or as>> hypotheses;>> In[10]:=>> FullSimplify[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,>> y4 > -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6]>> Out[10]=>> True>> In[11]:=>> FullSimplify[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,>> y4 == -1 && y6 >= -1 && y5 == y6 ]>> Out[11]=>> True>> In fact FullSimplify is unable to use Or in assumptions, which can >> be>> demonstrated on an abstract example:>> In[12]:=>> FullSimplify[C,(A||B)&&(C)]>> Out[12]=>> True>> In[13]:=>> FullSimplify[C,LogicalExpand[(A||B)&&(C)]]>> Out[13]=>> C>> This could be fixed by modifying FullSimplify:>> In[14]:=>> Unprotect[FullSimplify];>> In[14]:=>> FullSimplify[expr_,Or[x_,y__]]:=Or[FullSimplify[expr,x], FullSimplify >> [e>> xpr,y]];>> In[15]:=>> Protect[FullSimplify];>> Now at least we get as before:>> In[16]:=>> FullSimplify[y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1>> &&>> y6 <= y5 <= 1 + y4 + y6, y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 +>> y4 + y6]>> Out[16]=>> True>> but also:>> In[17]:=>> FullSimplify[y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6,>> y4 == -1 && y6 >= -1 && y5 == y6 || y4 > -1 && y6 >= -1 && y6 <= >> y5>> <= 1 + y4 + y6]>> Out[17]=>> True>> This seems to me a possible worthwhile improvement in FullSimplify,>> though of course not really helpful for your problem.>> Andrzej Kozlowski>> Toyama International University>> JAPAN>> On Wednesday, September 25, 2002, at 02:51 PM, Vincent Bouchard > I have a set of inequalities that I solve with InequalitySolve. But> then> it gives a complete set of solutions, but not in the way I would> like it> to be! :-) For example, the simple following calculation will give:>> In[1]:= ineq = {y4 >= -1, y5 >= -1, y6 + y4 >= y5 - 1, y5 >= y6, y6>> = -1};> InequalitySolve[ineq,{y4,y6,y5}]>> Out[1]:= y4 == -1 && y6 >= -1 && y5 == y6 ||> y4 > -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6>> the result is good, but I would like it to be in the simpler but> equivalent form>> y4 >= -1 && y6 >= -1 && y6 <= y5 <= 1 + y4 + y6>> How can I tell InequalitySolve to do that? It is simple for this> example,> but for a large set of simple inequalities InequalitySolve gives> lines and> lines of results instead of a simple result.> Vincent Bouchard>Andrzej KozlowskiToyama International UniversityJAPAN ==== inside a program I need to solve this linear equation in terms of p1.However something odds happens. Sometimes the solution is computed andsometimes the result is empty [I mean no output...]. Is this a bug of thesolve command or am I doing something wrong? The problem is robust to:changing name to the variables and other makeups..Davidps: Sorry for the stupid way in which I copied the command...Solve[(x^2*((-0.9*x^7*(p^2*(-1 - 5.8*x^6 - 14.010000000000002*x^12 - 18.04*x^18 - 13.06*x^24 - 5.040000000000001*x^30 - 0.81*x^36) + x*(7.777777777777779 - 9.074074074074076*x + 30.333333333333336*x^6 - 21.51851851851852*x^7 - 16.333333333333336*x^8 + 44.33333333333334*x^12 + 3.188888888888883*x^13 - 65.68333333333332*x^14 + 28.777777777777786*x^18 + 47.937037037037044*x^19 - 100.10000000000002*x^20 + 7.*x^24 + 45.6037037037037*x^25 - 69.53333333333333*x^26 + 13.299999999999999*x^31 - 19.833333333333332*x^32 - 1.0499999999999996*x^38) + p*(-6 + 8.296296296296296*x - 28.799999999999997*x^6 + 32.785185185185185*x^7 + 9.333333333333336*x^8 - 55.260000000000005*x^12 + 49.04777777777776*x^13 + 38.38333333333334*x^14 - 52.980000000000004*x^18 + 34.20518518518518*x^19 + 60.20000000000001*x^20 - 25.380000000000003*x^24 + 11.736296296296294*x^25 + 43.63333333333334*x^26 - 4.86*x^30 + 2.8999999999999986*x^31 + 13.533333333333333*x^32 + 0.81*x^37 + 1.0499999999999996*x^38)))/(x + 1.9*x^7 + 0.9*x^13)^2 - ((-1 + p - 7*x^6 + p*x^6 + 6*x^7)*(1.2962962962962965 - 3.111111111111112*x^6 + 9.333333333333336*x^7 - 10.111111111111114*x^12 + 22.05*x^13 - 5.703703703703705*x^18 + 17.15*x^19 + 5.483333333333331*x^25 + 1.0499999999999996*x^31 + p1*x^5*(7.000000000000002 - 7.000000000000002*x + 14.000000000000004*x^6 - 14.000000000000004*x^7 + 7.000000000000002*x^12 - 6.999999999999998*x^13) - 1.166666666666667*p*x^4*x1 - 3.500000000000001*p*x^10*x1 - 1.0500000000000003*p*x^11*x1 - 3.500000000000001*p*x^16*x1 - 3.150000000000001*p*x^17*x1 - 1.166666666666667*p*x^22*x1 - 3.150000000000001*p*x^23*x1 - 1.0500000000000003*p*x^29*x1))/((1 + 0.9*x^6)^2*(1 + x^6)^2)))/(p^2*(1 + x^6)^3) == 0, p1] ==== You're right; I misunderstood your problem. First of all, never use Do-- forget it exists -- and don't put the SelectionMove, etc. commandsinside a loop. That's your biggest problem.This should help:Table[Plot[ Sin[t]*Sin[x], {x, 0, Pi}, PlotRange -> {{0, Pi}, {-1, 1}}], {t, 0, 2Pi - Pi/32, Pi/32}];SelectionMove[EvaluationNotebook[], All, GeneratedCell]FrontEndTokenExecute[OpenCloseGroup] FrontEndTokenExecute[SelectionAnimate]The first time through the animation is a bit slow because the framesare being generated, but then the cell group collapses and things arebetter. I used an increment that's an exact divisor of the period inorder to catch the max and min values of Sin[t], as well as the zerovalue, on each swing. Use the period MINUS the step-size as the upperlimit in order to avoid having a last frame identical to the first.I'm a bit annoyed at the tendency for the plot to jump near zero andPi, but that's because the derivative of Sin is higher there, and we'renot compensating by picking more points there. If we do pick morepoints there, however, we won't perceive t as time. If that's not aconsideration, you could do it this way:f = Which[ -1 ? # ? 1, #, 1 < # ? 3, 2 - #, True, f@Mod[#, 4, -1] ] &;Table[Plot[ f[t]*Sin[x], {x, 0, Pi}, PlotRange -> {{0, Pi}, {-1, 1}}], { t, -1, 2.9, 0.1}];SelectionMove[EvaluationNotebook[], All, GeneratedCell]FrontEndTokenExecute[OpenCloseGroup] FrontEndTokenExecute[SelectionAnimate]Bobby-----Original Message-----Put this after the Plot statement, in the same cell:SelectionMove[EvaluationNotebook[], All, GeneratedCell]FrontEndTokenExecute[OpenCloseGroup] FrontEndTokenExecute[SelectionAnimate]Bobby Treat-----Original Message-----Is it possible to tidy up the generation of the graphic so that itbecomesthe animation?I have tried the followingDo[Plot[Sin[t]*Sin[x], {x, 0, Pi}, PlotRange -> {{0, Pi}, {-1, 1}},ImageSize -> 400]; SelectionMove[EvaluationNotebook[], All, GeneratedCell];FrontEndExecute[{FrontEnd`SelectionAnimate[ 0.1]}]; FrontEndExecute[{FrontEndToken[Clear]}], {t, 0, 15, 0.1}]This works but the cell dividing line ßashes on and off spoiling theanimation and if there is anything in the cell below this jumps up anddown.Is there a proper way of doing this?Hugh Goyder ==== That's nice because it avoids watching the frames being slowly created,and the group doesn't always collapse as it should, the way I've beendoing it.However, a couple of small changes give a smoother animation with 64frames rather than 151, while GENERATING only 33 frames.Block[{$DisplayFunction = Identity, half, graphs, step = Pi/32}, half = Table[GraphicCell[Plot[Sin[t]*Sin[x], {x, 0, Pi}, PlotRange -> {{0, Pi}, {-1, 1}}, ImageSize -> 400]], {t, -Pi/2, Pi/2 - step, step}]; graphs = Rest@Join[half, Rest@Reverse@half]; NotebookWrite[EvaluationNotebook[], Cell[CellGroupData[graphs,Closed]]]; SelectionMove[EvaluationNotebook[], All, GeneratedCell]; FrontEndExecute[{FrontEndToken[EvaluationNotebook[], SelectionAnimate]}]]Bobby-----Original Message----->showing during generation is enough (but uncontrolled).>>Hugh GoyderThis creates a graphics cell from a graphics expression.GraphicCell[graphics_] := Cell[GraphicsData[PostScript, DisplayString[graphics]],Graphics]cellgroup.Block[{$ DisplayFunction=Identity, graphs}, graphs = Table[GraphicCell[ Plot[Sin[t]*Sin[x], {x, 0, Pi}, PlotRange -> {{0, Pi}, {-1,1}}, ImageSize -> 400]], {t,0,15,.1}]; NotebookWrite[EvaluationNotebook[],Cell[CellGroupData[graphs ,Closed]]]; SelectionMove[EvaluationNotebook[], All, GeneratedCell]; FrontEndExecute[{FrontEndToken[EvaluationNotebook[], SelectionAnimate]}] ]------------------------------------------------------------ --Omega ConsultingThe final answer to your Mathematica needsSpend less time searching and more time finding.http://www.wz.com/internet/Mathematica.html ==== I'm woking on a kind of a Mathematica cheat-sheet. So I don't have to repeatthe same learning process if I get pulled away for another 6 months.I've attempted to get my domain name to resolve to my IP address, but it seems Verisign and I have different ideas about what 24 hours is.The site is supposed to be www.globalsymmetry.com, but that will not currently resolve. Here's the IP and path:http://66.92.149.152/proprietary/com/wri/index.html This is not a literary masterpiece. It's probably proof that giving just anybody the power to publish is, perhaps, not a guaranty that more quality publication will take place.If anybody has answers to the questions I've come up with, or comments about the answeres, etc. I'd be happy to know. ==== >>I believe the complexity is O(n log n), so this should be good enough.Umm ...good enough? I understand the words individually, but thephrase makes no sense to me.Bobby Treat-----Original Message-----> crash the Front End. I was thinking about the fact that I calculated> all those digits and then threw them away. I could save them withSave> or DumpSave, and read them in with Get the next time I wanted any of> them, although the file would be close to 70 MB (if not more). I maydo> that, in fact -- I have plenty of disk space.>> The next step would be to somehow reuse the stored digits if I wanted> MORE digits. But how?>> The Bailey-Borwein-Plouffe Pi algorithm is an avenue of attack, sinceit> can calculate digits far from the decimal point, without calculating> those in between. Unfortunately, it calculates hexadecimal digits in> that way, not decimal digits. (That's true for the version I've seen,> anyway.) Still, I could take the stored digits, convert tohexadecimal,> add more hexadecimal digits with the B-B-P algorithm, and then convert> back to decimal. In both conversions, I'd have to be very cognizantof> how much precision I end up with, but that shouldn't be too difficult.> It might go faster if I store hexadecimal digits, as well as decimal> digits, to eliminate one of those conversions at each increase in the> number of digits.>> The next step would be to set up an application that allowed anyone to> ping for digits across the Internet, and would return them if they're> stored.>> Hasn't someone already done that? It seems as if someone would have.>> Bobby TreatIf you're interested in decimal digits, I don't think the BBP algorithmis theway to go. In order to get the nth decimal digit of Pi you need tocompute theprevious n-1 digits, since base conversion is global, not local. ThealgorithmMathematica uses for computing Pi is quite fast - I believe thecomplexity is O(nlog n), so this should be good enough.David> -----Original Message-----calculation in>> So would it take about the same amont of time for the completeprintout> of digits? Of course it would take a few additional seconds to format> the output...>> Or does Mathematica take alot less time when it truncates the output?> Could you tell me the CPU you used and its speed etc...i amcurious,performance> to> other programs out there.>> I used one processor of a dual 1GH Mac and got the same answer with> the> following speed:>> 4.2 for Mac OS X (June 4, 2002)> oldmax = $MaxPrecision> 6> 1. 10> $MaxPrecision = Infinity> Infinity> With[{n = 2^26}, Timing[> pd = RealDigits[N[Pi, n + 1], 10, 20,> 19 - n]; ]]> {28794.1 Second, Null}> MaxMemoryUsed[]> 512055204> pd> {{3, 3, 8, 6, 3, 2, 2, 0, 8, 9, 6, 2, 2, 3,>> 4, 0, 9, 8, 0, 3}, -67108844}>> Tom Burton ==== Edit ->Preferences -> Font OptionsIn Preferences you will find everything you need to configure yourMathematica environment. Also you may want to look up Style Sheets in thebook or the on line help.Yas> I've been trying to get my Mathematica 4.1 properly configured.>> I set:> ############################################################# ######> /usr/local/mathematica/SystemFiles/FrontEnd/TextResources/X/ Specific.tr:> @@resource maxForXListFonts> 10000>> # xlsfonts | wc -l> 5572>> /etc/X11/XF86Config:> FontPath /usr/X11R6/lib/X11/fonts/100dpi:unscaled> FontPath /usr/X11R6/lib/X11/fonts/75dpi:unscaled> FontPath /usr/X11R6/lib/X11/fonts/CID> FontPath /usr/X11R6/lib/X11/fonts/Speedo> FontPath /usr/X11R6/lib/X11/fonts/Type1> FontPath /usr/X11R6/lib/X11/fonts/URW> FontPath /usr/X11R6/lib/X11/fonts/kwintv:unscaled> FontPath /usr/X11R6/lib/X11/fonts/latin2/Type1> FontPath /usr/X11R6/lib/X11/fonts/local/mma/Type1> FontPath /usr/X11R6/lib/X11/fonts/local/mma/X:unscaled> FontPath /usr/X11R6/lib/X11/fonts/misc:unscaled> FontPath /usr/X11R6/lib/X11/fonts/misc/sgi:unscaled> FontPath /usr/X11R6/lib/X11/fonts/truetype> FontPath /usr/X11R6/lib/X11/fonts/uni:unscaled>> # ls -R /usr/X11R6/lib/X11/fonts/ | grep /> /usr/X11R6/lib/X11/fonts/:> /usr/X11R6/lib/X11/fonts/100dpi:> /usr/X11R6/lib/X11/fonts/75dpi:> /usr/X11R6/lib/X11/fonts/CID:> /usr/X11R6/lib/X11/fonts/Speedo:> /usr/X11R6/lib/X11/fonts/Type1:> /usr/X11R6/lib/X11/fonts/URW:> /usr/X11R6/lib/X11/fonts/encodings:> /usr/X11R6/lib/X11/fonts/encodings/large:> /usr/X11R6/lib/X11/fonts/kwintv:> /usr/X11R6/lib/X11/fonts/latin2:> /usr/X11R6/lib/X11/fonts/latin2/Type1:> /usr/X11R6/lib/X11/fonts/local:> /usr/X11R6/lib/X11/fonts/local/mma:> /usr/X11R6/lib/X11/fonts/local/mma/Type1:> /usr/X11R6/lib/X11/fonts/local/mma/X:> /usr/X11R6/lib/X11/fonts/misc:> /usr/X11R6/lib/X11/fonts/misc/sgi:> /usr/X11R6/lib/X11/fonts/truetype:> /usr/X11R6/lib/X11/fonts/uni:> /usr/X11R6/lib/X11/fonts/util:>> ########################################################>> When I open the Mathematica Book Reference Guide in the Help Browser, I get> a beep and the message says:>> Unable to find font with family Helvetica, weight Bold, slant Plain, and> size 26. Substituting Courier.>> Compared to the things which *were* broken, this is a minor problem. I can> live with the beep. What I would now like to know is how to tell Mathematica what> fonts to use by default. This seemingly simple question seems to have no> simple answer.>> Could someone please help me.>> TIA,>> ^L>> ==== > Edit ->Preferences -> Font Options> In Preferences you will find everything you need to configure your> Mathematica environment. Also you may want to look up Style Sheets in the> book or the on line help.> Yas> I went into the preferences browser, and it was not clear to me what I was modifying. At one point I clicked on a field filled with text. I had inteded to edit it, and all the text vanished. It didn't bother me as much as such things use to, because I believe I know a backout strategy. It's been a while since I looked at this stuff, and I have to admit it seems far more tractible than it did a year ago. I'll look at the discussion again, and see if it makes more sence to me now.STH ==== > As an example, I spent several hours trying to figure out how to tell> Mathematica to understand the delete key in the way most contemporary> systems understand it. I wanted to avoid modifying system> configuration files such as:> /usr/local/mathematica/SystemFiles/FrontEnd/TextResources/ KeyEventTranslations.tr>> I expected to be able to change something in my own ~/.Mathematic> directory, but I could not figure out an obvious way to affect this> modification.If you could post a precise description of what you expect the Delete keyto do when depressed, we could probably provide you with a clear cutanswer of what needs to be done.> I want to adjust the font size used in the widgets, but again, I see> no ovbious means of modifying these attributes. I suspect it can be> accomplished by modifying the ~/.Mathematica/4.1/FrontEnd/init.m.> Perhaps to an experienced Mathematica user, the syntax and semantics> of this file are obvious. They aren't to me.The size of fonts in user interface elements is not specified through theMathemtica init.m file. It is set through an X resource. If you are notfamiliar with resources, you may want to track down an introductory texton the X Window System. Information on application-specific resourcesettings can be found in the Mathematica Getting Started Guide:http://documents.wolfram.com/v4/GettingStarted/ TroubleshootingUnixX.htmlThe setting that you would need to adjust is XMathematica*fontList. Thevalue of the resource is an X Logical Font Description field.> I also find the overall look & feel of the interface to be archaic.That's because Mathematica relies on the Motif library for user interfaceelements.http://www.opengroup.org/desktop/ motif.htmlThe appearance of these elements, such as the menu and scroll bars, wouldbe the same for any other Motif application, such as the DDD debugger orreleases of Netscape prior to verison 4.-- User Interface Programmer paulh@wolfram.comWolfram Research, Inc. ==== hi,> I sholdn't have to. If I start messing with X resource settings for my> user environment, I am sure to break something else which is configured> based on the current settings. There should either be a GUI interface, or a> clearly documented, and easily accessible configuration file to modify such> properties as the size of the fonts in the GUI widgets. This is> functionality which is rightfully expected of a modern desktop UI.[snip]> And I'm sure there is some configuration file in which I could place that,> and hope that what you think will be read by my system *will* in fact be> read, and not subsequently overridden during xsession startup. Things> aren't the way they used to be back in the 1980s. The modern Unix desktop> has moved beyond the paradigm of openlook and motif. See for example> http://www.trolltech.com, http://www.gnome.org, and http://www.kde.org>moving the frontend over to QT would have some neat side effects: consistent look & feel with the modern linux gui, themeability, source code truetype fonts as QT supports Xrender and Xft (looks great - see KDE3). i think all of those points are of value, but the most important might be source compatibility. ONE frontend for MOST (or ALL) platforms - sounds like a dream :-))gerald -- *************************************Gerald RothM@th Desktop Development************************************* ==== > If you could post a precise description of what you expect the Delete key> to do when depressed, we could probably provide you with a clear cut> answer of what needs to be done.Item[KeyEvent[Delete], DeleteNext]'Most' means Ômore than half.' >> I want to adjust the font size used in the widgets, but again, I see>> no ovbious means of modifying these attributes. I suspect it can be>> accomplished by modifying the ~/.Mathematica/4.1/FrontEnd/init.m.>> Perhaps to an experienced Mathematica user, the syntax and semantics>> of this file are obvious. They aren't to me.> The size of fonts in user interface elements is not specified through the> Mathemtica init.m file. It is set through an X resource. If you are not> familiar with resources, you may want to track down an introductory text> on the X Window System. I sholdn't have to. If I start messing with X resource settings for my user environment, I am sure to break something else which is configured based on the current settings. There should either be a GUI interface, or a clearly documented, and easily accessible configuration file to modify such properties as the size of the fonts in the GUI widgets. This is functionality which is rightfully expected of a modern desktop UI.> Information on application-specific resource> settings can be found in the Mathematica Getting Started Guide:> http://documents.wolfram.com/v4/GettingStarted/ TroubleshootingUnixX.htmlIt should be in a clear and easy to access configuraton interface, or at least be redily available through the help system in such a way that reasonable queries will locate it. Changing fonts does not belong in a section on trouble shooting, unless this is an acknowledgement that the UI is broken.> The setting that you would need to adjust is XMathematica*fontList. The> value of the resource is an X Logical Font Description field.And I'm sure there is some configuration file in which I could place that, and hope that what you think will be read by my system *will* in fact be read, and not subsequently overridden during xsession startup. Things aren't the way they used to be back in the 1980s. The modern Unix desktop has moved beyond the paradigm of openlook and motif. See for example http://www.trolltech.com, http://www.gnome.org, and http://www.kde.org >> I also find the overall look & feel of the interface to be archaic.> That's because Mathematica relies on the Motif library for user interface> elements.> http://www.opengroup.org/desktop/motif.html> The appearance of these elements, such as the menu and scroll bars, would> be the same for any other Motif application, such as the DDD debugger or> releases of Netscape prior to verison 4.My point exactly. ==== Awk! Legends!Basically, the answer to your question is that the PlotLegend option worksONLY for the Plot command and does not work for other types of plots. Forother types of plots you have to use ShowLegend. And ShowLegend is not allthat easy to use, especially since WRI does not give an example for multiplecurves in the Help.Needs[Graphics`Graphics`]Needs[Graphics`Legend`] {q1[t_], q2[t_], q3[t_]} = {0.1 Exp[-0.02 t], 0.2 Exp[-0.025 t], 0.4 Exp[-0.028 t]};Let's look at your first plot.Plot[{q1[t], q2[t], q3[t]}, {t, 0, 100}, PlotStyle -> {{AbsoluteThickness[0.5], AbsoluteDashing[{4, 4}]}, AbsoluteThickness[1.5], {AbsoluteThickness[2], AbsoluteDashing[{1, 8}]}}, AxesLabel -> {Y, X}, PlotLabel -> Title, PlotLegend -> {1, 3, 5}, LegendPosition -> {0.5, 0}, ImageSize -> 500];The legend is almost as big as the plot. It distracts from the realinformation you are trying to convey. Furthermore, the order of the curvesin the legend is the reverse of their order in the plot.The following shows how to put the legend in a LogLogPlot, or other types ofplots. I defined the plot styles independently because they are used inseveral places. I made the legend much smaller and put it in an empty areaof the plot. I also reversed the order of the keys so they would match theorder of the curves in the plot.styles={{AbsoluteThickness[0.5], AbsoluteDashing[{4,4}]},{AbsoluteThickness[1.5]},{ AbsoluteThickness[ 2],AbsoluteDashing[{1,8}]}};ShowLegend[ LogLogPlot[{q1[t], q2[t], q3[t]}, {t, 0, 100}, PlotStyle -> styles, AxesLabel -> {Y, X}, PlotLabel -> Title, ImageSize -> 500, DisplayFunction -> Identity], {MapThread[{Graphics[{Sequence @@ #1, Line[{{0, 0}, {1, 0}}]}], #2} &, {styles, {1, 3, 5}}] // Reverse, LegendPosition -> {-0.7, -0.4}, LegendSize -> {0.2, 0.3}, LegendShadow -> {0.02, -0.02}, LegendSpacing -> 0.5} ];But why use a legend at all? After all, a legend is nothing but another plotin which you have put labels on the curves. Why not put the labels directlyon the curves in the real plot in the first place?LogLogPlot[{q1[t], q2[t], q3[t]}, {t, 0, 100}, PlotStyle -> styles, AxesLabel -> {Y, X}, PlotLabel -> Title, ImageSize -> 500, Epilog -> MapThread[ Text[SequenceForm[Case , #1], {Log[10, 0.01], Log[10, #2[0.01]]}, {0, -1}] &, {{1, 2, 3}, {q1, q2, q3}}]];In the legend you have keyed the curves to numbers 1, 3 and 5. (Perhaps youjust used these as examples and meant to use something different in the realplots?) But these don't seem to have any obvious relation to your functions.I suppose the reader will have to look at another table or look into thetext of your paper or notebook to find out what 1, 3 and 5 mean. So thereader has to go from the graph to the legend then to the text and thenmentally transfer the meaning of the curve back to the main plot. It is somuch nicer to put the meaning right on the curve if you can.For the most part, legends are just computer junk and not even easy tonicely construct. When the legend urge comes over you - try to resist.David Parkdjmp@earthlink.nethttp://home.earthlink.net/~djmp/ AbsoluteThickness[1.5], {AbsoluteThickness[2], AbsoluteDashing[{1,8}]}}, AxesLabel[Rule]{Y, X}, PlotLabel[Rule]Title, PlotLegend[Rule]{1,3,5}, LegendPosition[Rule] {0.5,0}](*However with LogPlot or LogLogPlot the legend desappear*)LogLogPlot[{q1[t],q2[t],q3[t]}, {t, 0, 100},PlotStyle[Rule]{ {AbsoluteThickness[0.5], AbsoluteDashing[{4,4}]}, AbsoluteThickness[1.5], {AbsoluteThickness[2], AbsoluteDashing[{1,8}]}}, AxesLabel[Rule]{Y, X}, PlotLabel[Rule]Title, PlotLegend[Rule]{1,3,5}, LegendPosition[Rule] {0.5,0}]I have shown a particular case, but I has this problem always with LegendandLogPlot and LogPlotPlot. I will appreciate any help.GuillermoSanchez------------------------------------ ---------This message was sent using Endymion MailMan. ==== Using the Front End as a interface with the kernel I was running some calulations when suddenly pressing Shift+Enter causes the contents of the cell being evaluated to transform to the next text underlined with a red line: NotebookObject[FrontEndObject[LinkObject[dd8,1,1]],8] foollowed by the next messages:An unknown box name (NotebookObject) was sent as the BoxForm for the expression. Check the format rules for the expression.An unknown box name (FrontEndObject) was sent as the BoxForm for the expression. Check the format rules for the expression.An unknown box name (LinkObject) was sent as the BoxForm for the expression. Check the format rules for the expression.An invalid typeset structure was generated: Missing BoxFormData.Any suggestions will be very aprreciated.Cesar ==== I have an odd problem. I need to use and simplify functions that havebeen provided by a piece of software that insists on outputing thefunctional results of a data mining proceedure, using e whenoutputing numbers in scientific notation.I'm having difficultly using Replace, Hold, etc. to correctly evaluatethese types of function formats. For example, y = 5e+5x1+2e-1x2,should be transcribed into 5 10^5 x1 + 0.2 x2.ChuckReply-To: kuska@informatik.uni-leipzig.de ==== str = 5e+5x1+2e-1x2;StringJoin[Characters[str] /. e -> *10^] // ToExpression??Work fine for me.But this type of output is typical generated by a C/FORTRANProgram and you should rewrite the formating rules inthe code that produce this output. Jens> I have an odd problem. I need to use and simplify functions that have> been provided by a piece of software that insists on outputing the> functional results of a data mining proceedure, using e when> outputing numbers in scientific notation.> I'm having difficultly using Replace, Hold, etc. to correctly evaluate> these types of function formats. For example, y = 5e+5x1+2e-1x2,> should be transcribed into 5 10^5 x1 + 0.2 x2.> Chuck ==== RB> I am considering the following integralRB> W[m_,n_]:=Integrate[BesselJ[m, x]*BesselJ[n, x], {x, 0, Infinity}]RB> where m,n are reals >=0. With Mathematica 4.1 I obtain:RB> If[Re[m+n]>-1, -Cos[(m-n)Pi/2]/(2 Pi)*RB> (2 EulerGamma + Log[4] +RB> PolyGamma[0, 1/2(1 + m - n)] +RB> PolyGamma[0, 1/2(1 - m + n)] +RB> 2PolyGamma[0, 1/2(1 + m + n)])RB> Any explanation about the analytical expression will beRB> gratefully accepteed.The expression for W[m_,n_] returned by Mathematica is wrong.To prove, just substitute m = n = 0 which is exactly what you had doneand observe that the output you had hadW[0,0]=-(2 EulerGamma + Log[4] + 4 PolyGamma[0, 1/2])/(2 Pi)= 0.84564was incorrect. The correct answer is 1/2.Mathematica can handle the numeric integration successfullyIn[1] := NIntegrate[BesselJ[1, x]*BesselJ[0, x], {x, 0, Infinity}, Method -> Oscillatory] (* The warnings are skipped *)Out[1] = 0.5Using NIntegrate[BesselJ[0, x]*BesselJ[0, x], {x, 0, Infinity}]without Method -> Oscillatory is not the optimal choice asthe integrand oscillates fairly rapidly over the integrationregion.RB> I suspect that these integrals are divergent (*).In fact, not exactly.Integrate[BesselJ[1, x]*BesselJ[0, x], {x, 0, Infinity}]is equal to 1/2, and Mathematica 4.1 for Microsoft Windows(November 2, 2000) does it correctly, while Mathematica 4.2for Microsoft Windows (February 28, 2002) concocts a strangemixture of a wrong divergence message and the warning thatit cannot check the convergence [should I trust to the secondwarning? or the first?]As a matter of fact,Integrate[BesselJ[1, x]*BesselJ[0, x], {x, 0, Infinity}]converges because the integrand is regular at x=0, bounded overthe whole right semi-axis, and decays as2*Cos[Pi/4 - x]*Cos[(3*Pi)/4 - x]/(Pi*x) + o(1/x)at x -> Infinity .Say, calculateNormal[Series[BesselJ[1, x], {x, Infinity, 1}]] Normal[Series[BesselJ[0, x], {x, Infinity, 1}]] // InputForm->(2*(Cos[Pi/4 - x] - Sin[Pi/4 - x]/(8*x))*(Cos[(3*Pi)/4 - x] +(3*Sin[(3*Pi)/4 - x])/(8*x)))/(Pi*x)then Plot[%,{x,1,10}]and Plot[BesselJ[1,x]*BesselJ[0,x],{x,1,10}]and you could hardly see the difference.Generally, to get to the convergence domain for W in terms ofm and n is easy via the asymtotics of the Bessel functions(use something likeExpand[Normal[Series[BesselJ[m, x], {x, Infinity, 1}]]Normal[Series[BesselJ[n, x], {x, Infinity, 1}]]]then analyze the main term).Best wishes,Vladimir BondarenkoMathematical DirectorSymbolic Testing GroupWeb : http://www.CAS-testing.org/ http://maple.bug-list.org/VER2/ (under tuning) http://maple.bug-list.org/VER3/ (under tuning) http://maple.bug-list.org/VER1/ (under tuning) http://www.beautyriot.com/ (teamwork) http://www.ohaha.com/ (teamwork) Voice: (380)-652-447325 Mon-Fri 9 a.m. - 6 p.m.Mail : 76 Zalesskaya Str, Simferopol, Crimea, Ukraine ==== > inside a program I need to solve this linear equation in terms of p1.> However something odds happens. Sometimes the solution is computed and> sometimes the result is empty [I mean no output...]. Is this a bug of the> solve command or am I doing something wrong? The problem is robust to:> changing name to the variables and other makeups..> DavidThat's the weirdest bug I've seen in weeks. As it happens, it's mine. Atleast the inconsistent behavior, that is. I'll fix it, and maybe alsotry to address the issue of how to handle approximate numbers in testingsubexpressions for zero.I've excised your code and put in place a substantially smaller examplethat I believe is responsible. The table will tend to give erraticresults.zz = (-1.*x^7*(-1. + p - 7.*x^6 + p*x^6 + 6.*x^7)* (7.000000000000002 - 7.000000000000002*x + 14.000000000000004*x^6 - 14.000000000000004*x^7 + 7.000000000000002*x^12 -6.999999999999998*x^13))/ (p^2*(1. + 0.9*x^6)^2*(1. + x^6)^5);One workaround would be to use exact input, say by preprocessing withRationalize.Daniel LichtblauWolfram Research ==== >inside a program I need to solve this linear equation in terms of p1.>However something odds happens. Sometimes the solution is computed and>sometimes the result is empty [I mean no output...]. Is this a bug of the>solve command or am I doing something wrong? The problem is robust to:>changing name to the variables and other makeups..>David>>ps: Sorry for the stupid way in which I copied the command...>>Solve[(x^2*((-0.9*x^7*(p^2*(-1 - 5.8*x^6 - 14.010000000000002*x^12 -> 18.04*x^18 - 13.06*x^24 -> 5.040000000000001*x^30 - 0.81*x^36) +> x*(7.777777777777779 - 9.074074074074076*x +> 30.333333333333336*x^6 -> 21.51851851851852*x^7 -> 16.333333333333336*x^8 +> 44.33333333333334*x^12 +> 3.188888888888883*x^13 -> 65.68333333333332*x^14 +> 28.777777777777786*x^18 +> 47.937037037037044*x^19 -> 100.10000000000002*x^20 + 7.*x^24 +> 45.6037037037037*x^25 -> 69.53333333333333*x^26 +> 13.299999999999999*x^31 -> 19.833333333333332*x^32 -> 1.0499999999999996*x^38) +> p*(-6 + 8.296296296296296*x -> 28.799999999999997*x^6 +> 32.785185185185185*x^7 +> 9.333333333333336*x^8 -> 55.260000000000005*x^12 +> 49.04777777777776*x^13 +> 38.38333333333334*x^14 -> 52.980000000000004*x^18 +> 34.20518518518518*x^19 +> 60.20000000000001*x^20 -> 25.380000000000003*x^24 +> 11.736296296296294*x^25 +> 43.63333333333334*x^26 - 4.86*x^30 +> 2.8999999999999986*x^31 +> 13.533333333333333*x^32 + 0.81*x^37 +> 1.0499999999999996*x^38)))/(x + 1.9*x^7 +> 0.9*x^13)^2 - ((-1 + p - 7*x^6 + p*x^6 +> 6*x^7)*(1.2962962962962965 - 3.111111111111112*x^6>+> 9.333333333333336*x^7 - 10.111111111111114*x^12>+> 22.05*x^13 - 5.703703703703705*x^18 + 17.15*x^19>+> 5.483333333333331*x^25 + 1.0499999999999996*x^31>+> p1*x^5*(7.000000000000002 - 7.000000000000002*x>+> 14.000000000000004*x^6 -> 14.000000000000004*x^7 +> 7.000000000000002*x^12 -> 6.999999999999998*x^13) -> 1.166666666666667*p*x^4*x1 -> 3.500000000000001*p*x^10*x1 -> 1.0500000000000003*p*x^11*x1 -> 3.500000000000001*p*x^16*x1 -> 3.150000000000001*p*x^17*x1 -> 1.166666666666667*p*x^22*x1 -> 3.150000000000001*p*x^23*x1 -> 1.0500000000000003*p*x^29*x1))/((1 + 0.9*x^6)^2*(1>+> x^6)^2)))/(p^2*(1 + x^6)^3) == 0, p1]>You might find it more robust (and the results cleaner) if you Simplify the equation prior to using Solve. Such asSolve[eqn // Rationalize // Simplify, p1]However, if you are assigning values to p or x prior to using Solve, there may not be a solution. That is, for whenever the numerator of the expression for p1 would be zero, e.g., p = (-6 x^7 + 7 x^6 +1)/(x^6 + 1).Bob Hanlon ==== I prefer to delete all output and then Copy As>Notebook expression. ItBobby-----Original Message-----andoutput --- I try to use one tab indent for input and two tabs indent foroutput, plus some blank line adjustment.I wonder if anyone has a way of automatically achieving thisreformating.--Allan---------------------Allan HayesMathematica Training and ConsultingLeicester UKwww.haystack.demon.co.ukhay@haystack.demon.co.ukVoice : +44 (0)116 271 4198> Often posters to MathGroup copy and paste in the complete cellexpression,> including the In and Out numbers, when posting to MathGroup.>> I wonder if this is the best method because one can't then just copyoutall> the statements and paste them into a Mathematica notebook. All thestatement> numbers have to be edited out and if there are many statementdefinitions> this is an extended task for any responder. This, of course, decreasesthe> chances for a response. A better method is for the poster to just copyand> paste the CONTENTS of each cell. This is more work for the poster, butit> may pay off in better responses.>> David Park> djmp@earthlink.net> http://home.earthlink.net/~djmp/>> ==== Could someone explain what is going on here, please?In[1]:= a = 77617.; b = 33096.; In[2]:=SetAccuracy[a, Infinity]; SetAccuracy[b, Infinity]; SetPrecision[a, Infinity]; SetPrecision[b, Infinity]; In[4]:=f := 333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + 5.5*b^8 + a/(2*b)In[5]:=SetAccuracy[f, Infinity]; SetPrecision[f, Infinity]; In[6]:=fOut[6]=-1.1805916207174113*^21In[7]:=a = 77617; b = 33096; In[8]:=g := (33375/100)*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + (55/10)*b^8 + a/(2*b)In[9]:=gOut[9]=-(54767/66192)In[10]:=N[%]Out[ 10]=-0.8273960599468214PK ==== Peter,I hope that the following example will help - it is a matter or when thingsevaluate.The a in SetAccuracy[a, Infinity], below, evaluates before SetAccuracy acts,so we getSetAccuracy[2.3, Infinity]. The value of a is not changed. a = 2.3; aa = SetAccuracy[a, Infinity] 2589569785738035/1125899906842624But, a 2.3Whereas aa 2589569785738035/1125899906842624--Allan------------------- --Allan HayesMathematica Training and ConsultingLeicester UKwww.haystack.demon.co.ukhay@haystack.demon.co.ukVoice : +44 (0)116 271 4198> Could someone explain what is going on here, please?>> In[1]:=> a = 77617.; b = 33096.;>> In[2]:=> SetAccuracy[a, Infinity]; SetAccuracy[b, Infinity];> SetPrecision[a, Infinity]; SetPrecision[b, Infinity];>> In[4]:=> f := 333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + 5.5*b^8 + a/(2*b)>> In[5]:=> SetAccuracy[f, Infinity]; SetPrecision[f, Infinity];>> In[6]:=> f>> Out[6]=> -1.1805916207174113*^21>> In[7]:=> a = 77617; b = 33096;>> In[8]:=> g := (33375/100)*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + (55/10)*b^8+ a/(2*b)>> In[9]:=> g>> Out[9]=> -(54767/66192)>> In[10]:=> N[%]>> Out[10]=> -0.8273960599468214> PK> ==== In receiving notebooks from many different people I have noticed thatbeginners often do not know how to use Text cells and write all of theircomments as Input cells. I have even run across some extremely advancedusers who did not know the easy method for entering Text cells. A goodnotebook is usually a blend of Text cells, Input/Output cells and graphicscells. Text cells are very useful for documenting what you are doing andpassing information to other people. Since many people do not know how touse Text cells, I thought I would write a little explanation for beginnerswho are followers of MathGroup.The very easiest method for entering a Text cell is to put the insertionpoint where you want the new cell to be (at the end of the notebook orbetween two existing cells) and then type Alt-7. Then just start typing andyou will have a Text cell.Alternatively you can use MenuFormatStyleText to start a new Text cell.Often, it is useful to put the ToolBar at the top of the notebook. UseMenuFormatShow ToolBar. The drop-down menu on the ToolBar has the variouskinds of cells available for the current style of the notebook. You canselect Text (or any other style) from there.Some users may hesitate to use Text cells because they want to include amathematical expression in the comments. However, that is also very easy.Just use an Inline cell within the text cell. At the point within the textcell where you want to include a mathematical expression, start an Inlinecell by typing Ctrl-(. A selection placeholder will appear on a pinkbackground. You can type a Mathematica expression there just as in an Inputcell. Use Ctrl-) to complete the Inline cell, or Shift-Space. You can evenselect an Inline cell and evaluate it with Shift-Ctrl-Enter.Putting comments in Text cells is far better than using Input cells (or cellgroup header cells). Mathematica won't try to evaluate Text cells, the textwill wrap properly and adjust better to the notebook width if you change it.You can also check the spelling of words by putting the cursor after a wordand using Ctrl-K. (In an Input cell Mathematica doesn't use the dictionary,but uses the table of symbols instead and hence it won't check spelling.)David Parkdjmp@earthlink.nethttp://home.earthlink.net/~djmp/=== =This is because inline cells are not in StandardForm by default, but TraditionalForm.Use the menu item Cell -> Default Inline Format Type -> StandardForm.>David Park's posting reminded me of a frequent annoyance when I am>trying to include some Mathematica expressions within text cells -- a>Mathematica input expression in Standard Form that involves use of a>Control-key combination to form a superscript, square-root, or built-up>fraction:>>For example, suppose I want to include within a text cell a Standard>Form expression for the square of x, with the exponent 2 raised. If I>type the x first, even if I immediately highlight it and change it to>Courier (to match the default font for Input cells in Standard Form), as>soon as I press the Control-^ key combination, an Inline cell is created>beginning with the x, and then when I type the exponent 2 everything in>that Inline cell is now in Times, and the x is Italic. To change both>characters to Courier is not so easy: it seems to require separately>the entire Inline cell and selecting Courier does not change the exponent!)>>So to avoid this annoyance I normally must first type the desired>expression in a separate Input cell, then copy the contents of that cell>to the desired point in the Text cell.>>Any suggestions on a more efficient method for handling this?> In receiving notebooks from many different people I have noticed that> beginners often do not know how to use Text cells ....>> Some users may hesitate to use Text cells because they want to include a> mathematical expression in the comments....> Just use an Inline cell within the text cell....>>-->Murray Eisenberg murray@math.umass.edu>Mathematics & Statistics Dept.>Lederle Graduate Research Tower phone 413 549-1020 (H)>University of Massachusetts 413 545-2859 (W)>710 North Pleasant Street>Amherst, MA 01375-------------------------------------------------------- ------Omega ConsultingThe final answer to your Mathematica needsSpend less time searching and more time finding.http://www.wz.com/internet/Mathematica.htmlReply-To : murray@math.umass.edu ==== David Park's posting reminded me of a frequent annoyance when I am trying to include some Mathematica expressions within text cells -- a Mathematica input expression in Standard Form that involves use of a Control-key combination to form a superscript, square-root, or built-up fraction:For example, suppose I want to include within a text cell a Standard Form expression for the square of x, with the exponent 2 raised. If I type the x first, even if I immediately highlight it and change it to Courier (to match the default font for Input cells in Standard Form), as soon as I press the Control-^ key combination, an Inline cell is created beginning with the x, and then when I type the exponent 2 everything in that Inline cell is now in Times, and the x is Italic. To change both characters to Courier is not so easy: it seems to require separately the entire Inline cell and selecting Courier does not change the exponent!)So to avoid this annoyance I normally must first type the desired expression in a separate Input cell, then copy the contents of that cell to the desired point in the Text cell.Any suggestions on a more efficient method for handling this?> In receiving notebooks from many different people I have noticed that> beginners often do not know how to use Text cells ....> Some users may hesitate to use Text cells because they want to include a> mathematical expression in the comments....> Just use an Inline cell within the text cell....-- Murray Eisenberg murray@math.umass.eduMathematics & Statistics Dept.Lederle Graduate Research Tower phone 413 549-1020 (H)University of Massachusetts 413 545-2859 (W)710 North Pleasant StreetAmherst, MA 01375 ==== correctly, all you need to do is to make sure the default inline cell formatis StandardForm. Go to the menu item Cell, select Default Inline FormatType,and change it to StandardForm.Carl WollPhysics DeptU of Washington----- Original Message -----> type the x first, even if I immediately highlight it and change it to> Courier (to match the default font for Input cells in Standard Form), as> soon as I press the Control-^ key combination, an Inline cell is created> beginning with the x, and then when I type the exponent 2 everything in> that Inline cell is now in Times, and the x is Italic. To change both> characters to Courier is not so easy: it seems to require separately> the entire Inline cell and selecting Courier does not change theexponent!)>> So to avoid this annoyance I normally must first type the desired> expression in a separate Input cell, then copy the contents of that cell> to the desired point in the Text cell.>> Any suggestions on a more efficient method for handling this?> In receiving notebooks from many different people I have noticed that> beginners often do not know how to use Text cells ....>> Some users may hesitate to use Text cells because they want to include a> mathematical expression in the comments....> Just use an Inline cell within the text cell....>> --> Murray Eisenberg murray@math.umass.edu> Mathematics & Statistics Dept.> Lederle Graduate Research Tower phone 413 549-1020 (H)> University of Massachusetts 413 545-2859 (W)> 710 North Pleasant Street> Amherst, MA 01375>>Reply-To: kuska@informatik.uni-leipzig.de ==== just one comment: the meaning of the Alt-7 key depend on the style sheet that is in use.The TMJ style use Alt-8 for text and one hasto learn new key short-cuts for every style sheet ! Jens> In receiving notebooks from many different people I have noticed that> beginners often do not know how to use Text cells and write all of their> comments as Input cells. I have even run across some extremely advanced> users who did not know the easy method for entering Text cells. A good> notebook is usually a blend of Text cells, Input/Output cells and graphics> cells. Text cells are very useful for documenting what you are doing and> passing information to other people. Since many people do not know how to> use Text cells, I thought I would write a little explanation for beginners> who are followers of MathGroup.> > The very easiest method for entering a Text cell is to put the insertion> point where you want the new cell to be (at the end of the notebook or> between two existing cells) and then type Alt-7. Then just start typing and> you will have a Text cell.> Alternatively you can use MenuFormatStyleText to start a new Text cell.> Often, it is useful to put the ToolBar at the top of the notebook. Use> MenuFormatShow ToolBar. The drop-down menu on the ToolBar has the various> kinds of cells available for the current style of the notebook. You can> select Text (or any other style) from there.> Some users may hesitate to use Text cells because they want to include a> mathematical expression in the comments. However, that is also very easy.> Just use an Inline cell within the text cell. At the point within the text> cell where you want to include a mathematical expression, start an Inline> cell by typing Ctrl-(. A selection placeholder will appear on a pink> background. You can type a Mathematica expression there just as in an Input> cell. Use Ctrl-) to complete the Inline cell, or Shift-Space. You can even> select an Inline cell and evaluate it with Shift-Ctrl-Enter.> Putting comments in Text cells is far better than using Input cells (or cell> group header cells). Mathematica won't try to evaluate Text cells, the text> will wrap properly and adjust better to the notebook width if you change it.> You can also check the spelling of words by putting the cursor after a word> and using Ctrl-K. (In an Input cell Mathematica doesn't use the dictionary,> but uses the table of symbols instead and hence it won't check spelling.)> David Park> djmp@earthlink.net> http://home.earthlink.net/~djmp/ ==== Solve[youre equation, p1, VerifySolutions->True] will return a solution. So willSolve[Rationalize[your equation],p1].Andrzej KozlowskiToyama International UniversityJAPAN>> inside a program I need to solve this linear equation in terms of p1.> However something odds happens. Sometimes the solution is computed and> sometimes the result is empty [I mean no output...]. Is this a bug of > the> solve command or am I doing something wrong? The problem is robust to:> changing name to the variables and other makeups..> David>> ps: Sorry for the stupid way in which I copied the command...>> Solve[(x^2*((-0.9*x^7*(p^2*(-1 - 5.8*x^6 - 14.010000000000002*x^12 -> 18.04*x^18 - 13.06*x^24 -> 5.040000000000001*x^30 - 0.81*x^36) +> x*(7.777777777777779 - 9.074074074074076*x +> 30.333333333333336*x^6 -> 21.51851851851852*x^7 -> 16.333333333333336*x^8 +> 44.33333333333334*x^12 +> 3.188888888888883*x^13 -> 65.68333333333332*x^14 +> 28.777777777777786*x^18 +> 47.937037037037044*x^19 -> 100.10000000000002*x^20 + 7.*x^24 +> 45.6037037037037*x^25 -> 69.53333333333333*x^26 +> 13.299999999999999*x^31 -> 19.833333333333332*x^32 -> 1.0499999999999996*x^38) +> p*(-6 + 8.296296296296296*x -> 28.799999999999997*x^6 +> 32.785185185185185*x^7 +> 9.333333333333336*x^8 -> 55.260000000000005*x^12 +> 49.04777777777776*x^13 +> 38.38333333333334*x^14 -> 52.980000000000004*x^18 +> 34.20518518518518*x^19 +> 60.20000000000001*x^20 -> 25.380000000000003*x^24 +> 11.736296296296294*x^25 +> 43.63333333333334*x^26 - 4.86*x^30 +> 2.8999999999999986*x^31 +> 13.533333333333333*x^32 + 0.81*x^37 +> 1.0499999999999996*x^38)))/(x + 1.9*x^7 +> 0.9*x^13)^2 - ((-1 + p - 7*x^6 + p*x^6 +> 6*x^7)*(1.2962962962962965 - > 3.111111111111112*x^6 +> 9.333333333333336*x^7 - > 10.111111111111114*x^12 +> 22.05*x^13 - 5.703703703703705*x^18 + > 17.15*x^19 +> 5.483333333333331*x^25 + > 1.0499999999999996*x^31 +> p1*x^5*(7.000000000000002 - > 7.000000000000002*x +> 14.000000000000004*x^6 -> 14.000000000000004*x^7 +> 7.000000000000002*x^12 -> 6.999999999999998*x^13) -> 1.166666666666667*p*x^4*x1 -> 3.500000000000001*p*x^10*x1 -> 1.0500000000000003*p*x^11*x1 -> 3.500000000000001*p*x^16*x1 -> 3.150000000000001*p*x^17*x1 -> 1.166666666666667*p*x^22*x1 -> 3.150000000000001*p*x^23*x1 -> 1.0500000000000003*p*x^29*x1))/((1 + > 0.9*x^6)^2*(1 +> x^6)^2)))/(p^2*(1 + x^6)^3) == 0, p1]>Reply-To: murray@math.umass.edu ==== For all names, perhaps: Names[*`*]For names you defined at a normal session (without changing to some other context than the default Global`): Names[Global`*]> IIRC, there is a way to get a list of all the symbols defined in the > currently running session. I can't seem to find the reference to that > command. Could somone point me in the direction of documentation which > will tell me how to get information about the current session?> TIA,> -- Murray Eisenberg murray@math.umass.eduMathematics & Statistics Dept.Lederle Graduate Research Tower phone 413 549-1020 (H)University of Massachusetts 413 545-2859 (W)710 North Pleasant StreetAmherst, MA 01375 ==== > For all names, perhaps:> Names[*`*]> For names you defined at a normal session (without changing to some> other context than the default Global`):> Names[Global`*]>> IIRC, there is a way to get a list of all the symbols defined in the>> currently running session. I can't seem to find the reference to that>> command. Could somone point me in the direction of documentation which>> will tell me how to get information about the current session?>> TIA,>> I think I asked the wrong question. I'll have to look at things some more. What you gave me resulted in far more than I was looking for.http://public.globalsymmetry.com/proprietary/com/wri/ system-symbols.htmlhttp://66.92.149.152/proprietary/com/wri /system-symbols.htmlI think I really hosed the code for generating that table. I used 5 lines. I probably didn't need more than two, but I'm too tired right now to think about it. Mathematica is totaly awesome when it comes to what it was intended for. They really need to rent a Troll for a few months and fix this interface. Qt will run on just about anything. Heck, my Win-XP partition runs XFree86, with the KDE, or it did when I booted into XP a month ago.STH ==== ?*does the trick. You can limit it to Global variables with?Global`*Bobby-----Original Message-----Sender: steve@smc.vnet.netApproved: Steven M. Christensen , Moderator ==== Well, first of of all, your using SetAccuracy and SetPrecision does nothing at all here, since they do not change the value of a or b. You should use a = SetAccuracy[a, Infinity] etc. But even then you won't get the same answer as when you use exact numbers because of the way you evaluate f. Here is the order of evaluation that will give you the same answer, and should explain what is going on:f = SetAccuracy[333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121* b^4 - 2) + 5.5*b^8 + a/(2*b), Infinity];a = 77617.; b = 33096.;a = SetAccuracy[a, Infinity]; b = SetAccuracy[b, Infinity];f 54767-(-----) 66192Andrzej KozlowskiToyama International UniversityJAPAN> Could someone explain what is going on here, please?>> In[1]:=> a = 77617.; b = 33096.;>> In[2]:=> SetAccuracy[a, Infinity]; SetAccuracy[b, Infinity];> SetPrecision[a, Infinity]; SetPrecision[b, Infinity];>> In[4]:=> f := 333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + 5.5*b^8 + > a/(2*b)>> In[5]:=> SetAccuracy[f, Infinity]; SetPrecision[f, Infinity];>> In[6]:=> f>> Out[6]=> -1.1805916207174113*^21>> In[7]:=> a = 77617; b = 33096;>> In[8]:=> g := (33375/100)*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + > (55/10)*b^8 + a/(2*b)>> In[9]:=> g>> Out[9]=> -(54767/66192)>> In[10]:=> N[%]>> Out[10]=> -0.8273960599468214> PK> ==== Andrzej, Bobby, PeterIt looks as if using SetAccuracy succeeds here because the inexact numbersthat occur have finite binary representations. If we change them slightly toavoid this then we have to use Rationalize:1) Using SetAccuracy Clear[a,b,f] f=SetAccuracy[333.74*b^6+a^2*(11*a^2*b^2-b^6-121*b^4-2)+5.4* b^8+a/(2*b), Infinity]; a=77617.1; b=33096.1; a=SetAccuracy[a,Infinity];b=SetAccuracy[b,Infinity ]; f - 15640321149084868351974949239896188679725401538739519428131155 149493891236234 52500771916869370459119776018798804630436149786919912931962574 3010292363124675/ 10867106143970760551000357827554793888198143135975649579607989 867743572824016 06539536129829321813712324363677397376040962) Rewriting as fractions a=776171/10; b=330961/10; f=33374/100*b^6+a^2*(11*a^2*b^2-b^6-121*b^4-2)+54/10*b^8+a/(2 *b) -(5954133808997234115690303589909929091649391296257/ 41370125000000)3) Using Rationalize Clear[a,b,f]f=Rationalize[333.74*b^6+a^2*(11*a^2*b^2-b^6-121 *b^4-2)+5.4*b^8+a/(2*b),0]; a=77617.1; b=33096.1; a=Rationalize[a,0];b=Rationalize[b,0]; f -(5954133808997234115690303589909929091649391296257/ 41370125000000)I use Rationalize[. , 0] besause of results like Rationalize[3.1415959] 3.1416 Rationalize[3.1415959,0] 31415959/10000000--Allan---------------------Allan HayesMathematica Training and ConsultingLeicester UKwww.haystack.demon.co.ukhay@haystack.demon.co.ukVoice : +44 (0)116 271 4198> Well, first of of all, your using SetAccuracy and SetPrecision does> nothing at all here, since they do not change the value of a or b. You> should use a = SetAccuracy[a, Infinity] etc. But even then you won't> get the same answer as when you use exact numbers because of the way> you evaluate f. Here is the order of evaluation that will give you the> same answer, and should explain what is going on:>> f = SetAccuracy[333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*> b^4 - 2) + 5.5*b^8 + a/(2*b), Infinity];>> a = 77617.;> b = 33096.;>> a = SetAccuracy[a, Infinity]; b = SetAccuracy[b, Infinity];>> f>> 54767> -(-----)> 66192>> Andrzej Kozlowski> Toyama International University> JAPAN> Could someone explain what is going on here, please?>> In[1]:=> a = 77617.; b = 33096.;>> In[2]:=> SetAccuracy[a, Infinity]; SetAccuracy[b, Infinity];> SetPrecision[a, Infinity]; SetPrecision[b, Infinity];>> In[4]:=> f := 333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + 5.5*b^8 +> a/(2*b)>> In[5]:=> SetAccuracy[f, Infinity]; SetPrecision[f, Infinity];>> In[6]:=> f>> Out[6]=> -1.1805916207174113*^21>> In[7]:=> a = 77617; b = 33096;>> In[8]:=> g := (33375/100)*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) +> (55/10)*b^8 + a/(2*b)>> In[9]:=> g>> Out[9]=> -(54767/66192)>> In[10]:=> N[%]>> Out[10]=> -0.8273960599468214> PK> ==== > Integrate[BesselJ[1, x]*BesselJ[0, x], {x, 0, Infinity}]>> is equal to 1/2, and Mathematica 4.1 for Microsoft Windows> (November 2, 2000) does it correctly, while Mathematica 4.2> for Microsoft Windows (February 28, 2002) concocts a strange> mixture of a wrong divergence message and the warning that> it cannot check the convergence [should I trust to the second> warning? or the first?]In[6]:=Integrate[BesselJ[1, x]*BesselJ[0, x], {x, 0, Infinity}]Out[6]=1/2In[7]:=Out[7]=4.2 for Mac OS X (June 4, 2002)Andrzej KozlowskiToyama International UniversityJAPAN ==== That should read ...denominator of the expression for p1... Bob>You might find it more robust (and the results cleaner) if you Simplify>the >equation prior to using Solve. Such as>>Solve[eqn // Rationalize // Simplify, p1]>>However, if you are assigning values to p or x prior to using Solve, there>>may not be a solution. That is, for whenever the numerator of the expression>>for p1 would be zero, e.g., >>p = (-6 x^7 + 7 x^6 +1)/(x^6 + 1).>Bob Hanlon ==== > The expression for W[m_,n_] returned by Mathematica is wrong.>> To prove, just substitute m = n = 0 which is exactly what you had done> and observe that the output you had had> W[0,0]=-(2 EulerGamma + Log[4] + 4 PolyGamma[0, 1/2])/(2 Pi)> = 0.84564> was incorrect. The correct answer is 1/2.> Mathematica can handle the numeric integration successfully> In[1] := NIntegrate[BesselJ[1, x]*BesselJ[0, x], {x, 0, Infinity},> Method -> Oscillatory]> (* The warnings are skipped *)> Out[1] = 0.5You'll find that W[m=1,n=0]=1/2, so Mathematica gets that right. W[0,0]diverges. Mathematica gets that wrong.I note that Mathematica yields a result forIntegrate[BesselJ[m, a*x]*BesselJ[n, b*x], {x, 0, Infinity}]that appears to agree with formula 6.512(1) of Gradshteyn and Ryshik (4thed., 1965), including the condition b True]If the zi's need to be scaled, then you can do something like this:colorfn = Hue[.67#]&;With[{ m = {Min[#],Max[#]}&@vals }, Show[Graphics[ {colorfn[#[[3]]], PointSize[.01], Point[{#[[1]],#[[2]]}]}]& /@ (data /. {x_,y_,z_} -> {x, y, (z-m[[1]])/(m[[2]]-m[[1]])}), Axes -> True]]---Selwyn Hollis> I have a list of points l1={xi,yi,zi} how can I make a 2D list plot of ==== John,It is easier to do without ListPlot:Make some data,dat= Table[Random[],{10},{3}];Show[Graphics[{PointSize[.05],{Hue[ 2/3#3],Point[{#1,#2}]}&@@@dat} ], Frame->True ];If the points need to be joined then something likeShow[Graphics[{ Line /@Partition[dat[[All,{1,2}]],2,1], PointSize[.05],{Hue[2/3#3],Point[{#1,#2}]}&@@@dat } ], Frame->True ];--Allan---------------------Allan HayesMathematica Training and ConsultingLeicester UKwww.haystack.demon.co.ukhay@haystack.demon.co.ukVoice : +44 (0)116 271 4198> I have a list of points l1={xi,yi,zi} how can I make a 2D list plot of>> ==== A few years ago we made a package that do just this. Seehttp://cern.ch/jowett/Mathematica/Graphics/ ColorListPlot.htmlThe type of plot you want is covered in the section Examples thenThree-dimensional data. The Introduction gives links for downloading thepackage.JMJ> I have a list of points l1={xi,yi,zi} how can I make a 2D list plot of>> ==== Your problem can be solved in numerous ways of course, try something like .:Module[ { data=Flatten[Table[{x,y,Random[]},{x,10},{y,10}],1] }, Show[ Graphics[ { AbsolutePointSize[10], data/.{x_,y_,z_}[Rule]{Hue[z],Point[{x,y}]} } ] ,AspectRatio[Rule]Automatic ] ]Note that you can replace the main part, ie the transforming rule from pointlists to colored point directives with a function for example .:{Hue[#3],Point[{#1,#2}]}&@@@databye,Borut| I have a list of points l1={xi,yi,zi} how can I make a 2D list plot ofReply-To: kuska@informatik.uni-leipzig.de ==== data = Table[{Random[], Random[], Random[]}, {20}];Show[Graphics[ {Hue[Last[#]], Point[Take[#, 2]]} & /@ data, Axes -> True ] ] Jens> I have a list of points l1={xi,yi,zi} how can I make a 2D list plot of ==== input = 5e+5x1+2e-1x2;StringJoin[Characters[input] //. e -> *10^]5*10^+5x1+2*10^-1x2ToExpression[%]500000*x1 + x2/5Bobby Treat-----Original Message-----should be transcribed into 5 10^5 x1 + 0.2 x2.Chuck ==== Neither SetAccuracy[expr,n] nor SetPrecisions[expr,n] modify expr. These functions modify the prinout not the internal representation. So, the first computation of f is done with approximate numbers and doesn't result in a correct answer due to approximate arithmetic.By assigning a rational expression to each of the variables, you have made them exact numbers and Mathematica responds with an exact solution.>Could someone explain what is going on here, please?>>In[1]:= a = 77617.; b = 33096.;>>In[2]:= SetAccuracy[a, Infinity]; SetAccuracy[b, Infinity];>SetPrecision[a, Infinity]; SetPrecision[b, Infinity];>>In[4]:= f := 333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) +>5.5*b^8 + a/(2*b)>>In[5]:= SetAccuracy[f, Infinity]; SetPrecision[f, Infinity];>>In[6]:= f>>Out[6]= -1.1805916207174113*^21>>In[7]:= a = 77617; b = 33096;>>In[8]:= g := (33375/100)*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) +>(55/10)*b^8 + a/(2*b)>>In[9]:= g>>Out[9]= -(54767/66192)>>In[10]:= N[%]>>Out[10]= -0.8273960599468214>PK> ==== SetAccuracy. However, I still don't understand why the order in which we set the accuracies for f, a, and b matters.In[1]:=f = SetAccuracy[333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + 5.5*b^8 + a/(2*b), Infinity]; a = SetAccuracy[77617., Infinity]; b = SetAccuracy[33096., Infinity]; In[4]:=fOut[4]=-(54767/66192)In[5]:=f = SetAccuracy[333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + 5.5*b^8 + a/(2*b), Infinity] Out[5]=1180591620717411303424Similarily:In[1]:=f = SetAccuracy[333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + 5.5*b^8 + a/(2*b), 50]; a = SetAccuracy[77617., 100]; b = SetAccuracy[33096., 100]; In[4]:=fOut[4]=-0.8273960599468212641107299556`11.4133In [5]:=f = SetAccuracy[333.75*b^6 + a^2*(11*a^2*b^2 - b^6 - 121*b^4 - 2) + 5.5*b^8 + a/(2*b), 100]; Out[5]=1.180591620717411303424`121.0721*^21-PK ==== Hallo,I have the problem, that I want to determine the numerical solution of a double integral, like e.g. the following:<< Statistics`ContinuousDistributions`ndist = NormalDistribution[0, 1];N[Sigma^2/(Abs[Mu_1^2 - Mu_2^2]) Integrate[(Integrate[1/y_1 1/(y - y_1) PDF[ndist, d*Log[y_1] + c*Log[y - y_1] + f]*PDF[ndist, Sigma*(c*Log[y_1] + d*Log[y - y_1] + g)], {y_1,0,y}]), {y,0,Lambda}]]wherebyLambda := 3;Mu_1 := 4;Mu_2 := 5;Sigma := 0.25;a = 1/2 (Mu_1^2 + Mu_2^2/Sigma^2)b = 1/2 (Mu_2^2 + Mu_1^2/Sigma^2)c = -Mu_2/(Mu_1^2 - Mu_2^2)d = -Mu_1/(Mu_2^2 - Mu_1^2)f = d*a + c*bg = c*a + d*bSorry for the poor code... The problem is, that Mathematica doesn't give me a result (after waiting 2 hours I turned my machine off).Thus, the question is, if there is still a possibility of solving such complicated expressions...TIA,Sven. ==== I am trying to solve a system of simultaneous equations with 26 variablesand 14 equations (the 12 free variables can be any of the 26 from the eqns..preferably ones that will minimize the computation time for the other 14).These equation are not linearly related.. the highest degree in any one eqnis degree 4 i believe.. and there are some cross terms in the equations butnot every equation depends on every variable.. (some are actually rathersimple eqns). Any ideas on how to get started with this using mathematica (any ideas for algorithms)..Anything will be helpful..I can be reached at ngupta2@seas.upenn.eduMany thanks,Nachi ==== I should add that the solution is over natural numbers.. this willprobably make a big difference..Nachi> I am trying to solve a system of simultaneous equations with 26 variables> and 14 equations (the 12 free variables can be any of the 26 from the eqns..> preferably ones that will minimize the computation time for the other 14).> These equation are not linearly related.. the highest degree in any one eqn> is degree 4 i believe.. and there are some cross terms in the equations but> not every equation depends on every variable.. (some are actually rather> simple eqns). Any ideas on how to get started with this using> mathematica (any ideas for algorithms)..>> Anything will be helpful..>> I can be reached at ngupta2@seas.upenn.edu>> Many thanks,>> Nachi>> ==== This may seem like a trivial issue, but I find it very frustrating. I use variety of intellectual domains. In every package (JBuilder, KMail, Emacs, XEmacs, Mozilla, xterm, Konsole, etc.) the keyboar mapping is a bit differnt from the other. There are certain idioms which I find to be fairly invaraint between these different packages. I tend to use this common subset more than the package specific idioms.Switching from one package to the next can be a very disorienting experience. It can be even trickier to try and copy and paste from one to the next. I also use Ôspecial' characters in certain domains, .8d,?,.81,?,[CapitalYAcute],fi, §, ø, etc. Add to all of this, that I run beta code for just about everything. The function of my keyboard changed like the weather. I have spent hours trying to figure out why I can no longer type Ô.9a'. This doesn't even address the problems of switching between character encodings, or keyboard compose modes. The last thing I want to start doing is messing with the key mappings in my user environment. I want to control the way my keyboard works with Mathematica from within the Mathematica runtime environment. That is, the configuration should be loaded when Mathematica loads, and should not impact the rest of my X environment.If I have come across as a bit jaded regarding this issue, there are reasons. There is a history. I don't find keyboard configuration issues interesting. I want my fine keyboard to just work, the way I want it to Shift+point movement = select text.Ctrl+Insert = copyShift+Insert = pasteCtrl+c = copyCtrl+x = cutCtrl+v = pasteShift+End = select to end of line.etc.Yes, I said I use XEmacs, and Emacs. Yes (X)Emacs is different, but adding yet another alteration with Mathematica is just too much. Is there a way around this?STH ==== >FrontEndExecute[{> FrontEnd`NotebookWrite[FrontEnd`SelectedNotebook[],> [LeftDoubleBracket][RightDoubleBracket],After]}] FrontEndExecute[{ FrontEnd`NotebookWrite[FrontEnd`SelectedNotebook[], [LeftDoubleBracket][RightDoubleBracket],After], FrontEnd`SelectionMove[FrontEnd`SelectedNotebook[], Previous, Character]}]orFrontEndExecute[{ FrontEnd`NotebookWrite[FrontEnd`SelectedNotebook[], [LeftDoubleBracket][SelectionPlaceholder][ RightDoubleBracket], Placeholder]}]----------------------------------------------- ---------------Omega ConsultingThe final answer to your Mathematica needsSpend less time searching and more time finding.http://www.wz.com/internet/Mathematica.html ==== I'm trying to address the special issues related to using Mathematica on the would not if I used a Windows system. These are typically not all that big if a problem _once I figure out what's going on_. What I hope to do is collect all such matters and document them effectively in something like a haven't discussed here http://66.92.149.152/proprietary/com/wri/index.html I'm interested in hearing what you have to say. Of particular interest are the issues faced by a person who is not familiar with the technical aspects would help make this less painful?STH ==== particular, the y-axis label is typically rotated by 90deg so that it readsup the y-axis. This works fine on macs and windoze, but under linux thelabel runs up the y-axis; however, the letters are rotated so that they arethe same orientation as that for the x-axis. Printouts of the NB are fine,but it looks really stupid when using a video projector to teach or give atalk. I have mentioned this before, and the stock answer is that ... it isMathematica. I personally don't care why the label looks peculiar, just thatit does and that there is no easy workaround.--Kevin J. McCannJoint Center for Earth Systems Technology (JCET)Department of PhysicsUMBCBaltimore MD 21250> I'm trying to address the special issues related to using Mathematica onthe> would not if I used a Windows system. These are typically not all thatbig> if a problem _once I figure out what's going on_. What I hope to do is> collect all such matters and document them effectively in something like awhich I> haven't discussed here http://66.92.149.152/proprietary/com/wri/index.html> I'm interested in hearing what you have to say. Of particular interestare> the issues faced by a person who is not familiar with the technicalaspects> would help make this less painful?>> STH>Reply-To: jmt@dxdydz.net ==== See the MathLink API for C, or the JLink API for java.JLink is easier to use, MathLink is a lower level but native interface. JLink is built on MathLink.As far as I know, the perl API Math::ematica has not been upgraded to Mathematica 4.> Is it possible to get a document of the description of how to> interface with