mm-899
===
Subject: Re: Strange Behaviour of Solve?
i tried (using Mathematica 6.0) to solve a system of equations:
In:=Solve[{b == g, a == (g*v/c), (b)^2 + (a)^2 == 1}, g]
> Out:={}
But when i use
In:=Solve[{b == g, a == (g*v/c), (b)^2 + (a)^2 == 1}, {a, b, g}]
> Out={{g -> -c/Sqrt[c^2 + v^2], b -> -c/Sqrt[c^2 + v^2],
> a -> -v/Sqrt[c^2 + v^2]}, {g -> c/Sqrt[c^2 + v^2],
> b -> c/Sqrt[c^2 + v^2], a -> v/Sqrt[c^2 + v^2]}}
i suddenly get the solution for g. It seems to me, that the number
> of solutions for one variable depends on the number of variables
> i want to solve for. Is this behaviour of Solve to be
> expected?
Andreas Maier
Yes. Solve gives only generic solutions, which means solutions that
do not depend on the parameters having any special values. In
Solve[{b == g, a == (g*v/c), (b)^2 + (a)^2 == 1}, g]
{}
g is a variable and a,b,v,c are all parameters. The system has no
solutions that are valid for all values of the parameters. You can
see that by using Reduce instead of Solve:
Reduce[{b == g, a == g*(v/c), b^2 + a^2 == 1}, g]
c^2 + v^2 != 0 && (b == -(c/Sqrt[c^2 + v^2]) ||
b == c/Sqrt[c^2 + v^2]) && c != 0 &&
a == (b*v)/c && g == b
this tells you that g==b is a solution of your system provided that
the parameters satisfy the given relations. On the other hand:
Solve[{b == g, a == (g*v/c), (b)^2 + (a)^2 == 1}, {a, b, g}]
{{g -> -c/Sqrt[c^2 + v^2], b -> -c/Sqrt[c^2 + v^2],
a -> -v/Sqrt[c^2 + v^2]}, {g -> c/Sqrt[c^2 + v^2],
b -> c/Sqrt[c^2 + v^2], a -> v/Sqrt[c^2 + v^2]}}
is a system with three variables a,b,g and two parameters v and c.
The solutions that you get for {a,b,g} are valid for all values of v
and c, provided we assume that c!=0 and c^2+v^2 !=0 which Solve does
automatically (if c ==0 the second equation would be problematic, and
if c^2+v^2==0 the solutions, if any could not be given in the form
Solve returns). Reduce is more careful:
Reduce[{b == g, a == g*(v/c), b^2 + a^2 == 1}, {a, b, g}]
(v == 0 && a == 0 && (b == -1 || b == 1) && g == b &&
c != 0) || (c^2 + v^2 != 0 &&
(a == -(v/Sqrt[c^2 + v^2]) ||
a == v/Sqrt[c^2 + v^2]) && a*c != 0 &&
b == (v - a^2*v)/(a*c) && g == b)
You can see a simpler example of the same phenomenon here:
Solve[x + y == x, x]
{}
because y is a parameter and there is no solution valid for all
values of y, but:
Solve[x + y == x, {x, y}]
Solve::svars:Equations may not give solutions for all solve
variables. >>
{{y -> 0}}
Now we have infinitely many solutions of the form {x,0} where x can
by any complex number.
Andrzej Kozlowski
===
Subject: Re: in Mathematica 6?
Unless an explicit Return is used, the value returned by Do is Null.
Use this:
Do[Print@Plot[Sin[x i],{x,-3,3}],{i,1,10}]
(Of course you have to change your Sun to Sin in any case.)
> I tryed to run older notebooks in Mathematica 6 and I have this
> problem: when I have the Show[] function in somewhere, it doesn't plot
> anything!
> Fro example, run this:
> Do[Plot[Sun[x i],{x,-3,3}],{i,1,10}]
It doesn't output anything!
> What's the problem?
--
Murray Eisenberg murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
===
Subject: Re: in Mathematica 6?
Do[Print[Plot[Sun[x i], {x, -3, 3}]], {i, 1, 10}]
Table[Plot[Sun[x i], {x, -3, 3}], {i, 1, 10}] // ColumnForm
Table[Plot[Sun[x i], {x, -3, 3}], {i, 1, 10}] // Column
Bob Hanlon
> I tryed to run older notebooks in Mathematica 6 and I have this
> problem: when I have the Show[] function in somewhere, it doesn't plot
> anything!
> Fro example, run this:
> Do[Plot[Sun[x i],{x,-3,3}],{i,1,10}]
It doesn't output anything!
> What's the problem?
===
Subject: UnTableForming a TableFormed Table?
Suppose you create a source table in Table form:
myTableS = Table[ ----- ],
then create a formatted version of it, with TableForm options added:
myTableF = TableForm[ TableS, {tableheadings, tablepacings, etc} ]
Is there any _simple_ way to UnTableForm the formatted table to get
back to the unformatted source table?
myTableS ??=?? UnTableForm[ myTableF ]
----------
[Why would anyone want this? Well, now you can have a _single_ module
that creates a formatted table, which then carries _both_ its data and
its labels. You can run the module several times for different input
parameter values; Print[] the individual formatted tables with their
labels; or unformat them to ListPlot[] them, Join[] them, etc.
One can envision a smarter Join[] command that would function for tables
like the DisplayTogether[] command does for plots, joining the data in a
set of formatted tables, then (as an option) restoring the formatting
options from the last table in the set to the joined tables.]
===
Subject: Cascaded (Multi-range) Iterators?
Seems like a very useful (and feasible?) (and not too difficult)
extension to the Iterator concept for Tables, etc., would be a cascaded
or multi-range Iterator, e.g. something like
Table[ f[x], { {x, 0, 1, 0.1}, {x, 2, 10}, {x, 20, 100, 10} } ]
I often have need for a different step sizes over different ranges
capability like this, and have to resort to workarounds to achieve it.
[Apologies if my searches in the Help files have missed something that
already does this.]
===
That works fine, but I'm wondering why PlotJoined is color-coded red --
indicating it's not a recognized option? (version 6.0.1)
Bobby
> The Sort included below is to cover the case when the data is not
> pre-sorted by labels
dat1 = {{A1, 2}, {A4, 1}, {A2, 3}};
> dat2 = {{A1, 2.2}, {A3, 0.5}, {A2, 2.9}, {A4, 1.1}};
xcoord = Union[Join @@ (#[[All, 1]] & /@ {dat1, dat2})];
dat = Sort /@ ({dat1, dat2} /.
> {x_, y_?NumericQ} : {Position[xcoord, x][[1, 1]], y});
ListPlot[dat,
> PlotJoined -> True,
> Frame -> True,
> FrameTicks -> {Thread[{Range[Length[xcoord]], xcoord}],
> Automatic, None, None},
> Epilog -> {AbsolutePointSize[4],
> Thread[{{Blue, Red}, Map[Point, dat, {2}]}]}]
> Bob Hanlon
> I have two sets of data:
>> dat1 = {{A1,2},{A2,3},{A4,1}}
>> dat2 = {{A1,2.2},{A2,2.9},{A3,0.5},{A4,1.1}}
>> Is there a simple way I can plot these with the {A1, A2, A3,
>> A4} as
>> equidistant tick marks/labels along the horizontal axis and a standard
>> numerical vertical axis?
>> Note the missing A3 in dat1.
>> I could not find anything in the options of ListPlot, or in the new
>> (6.0)
>> Maarten van der Burgt
>> Leuven, Belgium
>
--
DrMajorBob@bigfoot.com
===
Subject: buliding on functions
so i have a group functions that i want to work on three list at the
same time. everytime i've tryed to get mathematica to run through all
at the smae time. i find out the functions only acted on one list. any
ideas?
===
Subject: numbered lists problem
Steps to reproduce:
1. Create a new notebook and change the style to JournalArticle.
2. Create three cells with whatever text you want and change their
styles to Item1Numbered.
3. Choose File->Save As and save the notebook as an HTML file.
Expected Result:
An HTML file that contains a numbered list of the items entered in the
notebook.
Actual Result:
The HTML file shows only the plain text of the items entered in the
notebook.
In[1]:= {$Version,Internal`$CreationID}
Out[1]= {6.0 for Microsoft Windows (32-bit) (April 27, 2007),853857}
Speculation:
***Assuming I have used the style correctly***, I speculate that,
since the JournalArticle.nb stylesheet depends on
PublicationDefault.nb and thus likely originated from Publicon, Mathematica
6's Save As HTML code is not using the following part of the
Item1Numbered style:
TaggingRules:>{
ExtraConversionRules -> {
General -> {NestingLevel -> 30},
TeX -> {CellGroupEnvironment -> enumerate},
HTML -> {CellGroupEnvironment -> ol}}}
As a result, the
tags that are generated for each cell are not
wrapped in overall tags. This is why the browser does not number
the - entries.
--
http://chris.chiasson.name/
===
Subject: Re: What's happening with Showin Mathematica 6?
>I tryed to run older notebooks in Mathematica 6 and I have this
>problem: when I have the Show[] function in somewhere, it doesn't
>plot anything! Fro example, run this: Do[Plot[Sun[x
>i],{x,-3,3}],{i,1,10}]
>It doesn't output anything! What's the problem?
This is because you need to explicitly output the graphics when
Plot is used inside a Do loop, i.e.,
Do[Print@Plot[Sin[x i], {x, -3, 3}], {i, 1, 10}]
Note, I've no idea as to what function you had in mind when you
use Sun. I changed this to Sin simply to have a standard
function to plot. Also, instead of using Do you could use Table
to generate a list of plots which can more easily be manipulated
later. For example,
GraphicsGrid[
Partition[sineplots = Table[Plot[Sin[x i], {x, -3, 3}], {i,
9}], 3],
ImageSize -> Large]
then later you could do
Show[Take[sineplots, {4, 6}]]
--
To reply via email subtract one hundred and four
===
The current option is Joined. Apparently the old option (PlotJoined) also
works but is color coded as improper. When PlotJoined worked I didn't pay
attention to the color coding.
Bob Hanlon
> That works fine, but I'm wondering why PlotJoined is color-coded red
--
> indicating it's not a recognized option? (version 6.0.1)
Bobby
> The Sort included below is to cover the case when the data is not
> pre-sorted by labels
dat1 = {{A1, 2}, {A4, 1}, {A2, 3}};
> dat2 = {{A1, 2.2}, {A3, 0.5}, {A2, 2.9}, {A4, 1.1}};
xcoord = Union[Join @@ (#[[All, 1]] & /@ {dat1, dat2})];
dat = Sort /@ ({dat1, dat2} /.
> {x_, y_?NumericQ} : {Position[xcoord, x][[1, 1]], y});
ListPlot[dat,
> PlotJoined -> True,
> Frame -> True,
> FrameTicks -> {Thread[{Range[Length[xcoord]], xcoord}],
> Automatic, None, None},
> Epilog -> {AbsolutePointSize[4],
> Thread[{{Blue, Red}, Map[Point, dat, {2}]}]}]
> Bob Hanlon
> I have two sets of data:
>> dat1 = {{A1,2},{A2,3},{A4,1}}
>> dat2 = {{A1,2.2},{A2,2.9},{A3,0.5},{A4,1.1}}
>> Is there a simple way I can plot these with the {A1, A2,
A3,
>> A4} as
>> equidistant tick marks/labels along the horizontal axis and a standard
>> numerical vertical axis?
>> Note the missing A3 in dat1.
>> I could not find anything in the options of ListPlot, or in the new
>> (6.0)
>> Maarten van der Burgt
>> Leuven, Belgium
>
--
> DrMajorBob@bigfoot.com
===
Subject: Re: change slider to pointed rectangle or arrow
>Is there any way within Manipulate to make a slider appear as either
>a filled rectangle topped by a triangle -- a shape very roughly like
>this
>^
>||
>_
>-- or as just a filled triangle or vertical arrow?
>What about in a more general expression using an explicit Slider?
>I ask this because the help gives the following example --
>Table[Slider[0.5, Appearance -> a], {a, {UpArrow, DownArrow}}]
>-- but I see absolutely no differences in the results as from not
>using the Appearance option at all.
Using:
In[8]:= $Version
Out[8]= 6.0 for Mac OS X PowerPC (32-bit) (June 19, 2007)
when I do:
Table[Slider[0.5, Appearance -> a], {a, {UpArrow, DownArrow}}]
I see two sliders. The first looks similar to the ASCII graphic
you posted and the second is an inverted version of the first.
And when I do:
Table[Slider[0.5], {a, {UpArrow, DownArrow}}]
The slider button on both sliders is a circle
--
To reply via email subtract one hundred and four
===
Subject: Exporting Mathematica 5.0 Notebooks to Latex for use in Miktex 2.6
Hi
Ive been struggling to export my mathematica 5.0 notebook to LaTeX
form for use in Miktex 2.6. When I try to save as special > latex , I
get this error
Mathematica has detected a possible internal error. If possible,
report the error to support@wolfram.com, quoting Assertion
'!Expression written to link when FrontEnd was not expecting any
expressions' failed at KernelBackground.c:435, and describe in as
much detail as possible what you were doing when the error occurred.
I have browsed forums and i realize i have to change some font
settings in my miktex, but i only find information for miktex 2.4. I
currently have the latest miktex (2.6) and the directory structure are
not the same. I even came across detailed instructions for 2.4 at
http://www.physik.uni-osnabrueck.de/franzius/Downloads/MMA/MMaFontsMiktexEng
lish.html
but when I try to download the old miktex 2.4, there are no
repositories.
I even installed publicon and pasted some of my equations in the ams-
journal style sheet so that it could export to amslatex. But with
Publicon i get errors since it cant recognices wolframcharacter and I
dont know how to fix it.
I really need to solve this quickly because I have a lot of thesis
material in my mathematica notebooks. Any help would be greatly
appreciated.
Shahriar
===
Subject: Re: Re: annoying documentation in 6 (rant)
It's not what I'd call entirely obvious, but...
?ColorData
ColorData[scheme] gives a function that generates colors in the
named color scheme when applied to parameter values.
ColorData[scheme,property] gives the specified property of a
color scheme.
ColorData[collection] gives a list of color schemes in a named
collection.
ColorData[] gives a list of named collections of color schemes. >>
Armed with that, type...
ColorData[]
{Gradients, Indexed, Named, Physical}
ColorData[Gradients]
{DarkRainbow, Rainbow, Pastel, Aquamarine, BrassTones,
BrownCyanTones, CherryTones, CoffeeTones, FuchsiaTones,
GrayTones, GrayYellowTones, GreenPinkTones, PigeonTones,
RedBlueTones, RustTones, SiennaTones, ValentineTones,
AlpineColors, ArmyColors, AtlanticColors, AuroraColors,
AvocadoColors, BeachColors, CandyColors, CMYKColors,
DeepSeaColors, FallColors, FruitPunchColors, IslandColors,
LakeColors, MintColors, NeonColors, PearlColors,
PlumColors, RoseColors, SolarColors, SouthwestColors,
StarryNightColors, SunsetColors, ThermometerColors,
WatermelonColors, RedGreenSplit, DarkTerrain,
GreenBrownTerrain, LightTerrain, SandyTerrain,
BlueGreenYellow, LightTemperatureMap, TemperatureMap,
BrightBands, DarkBands}
ColorData[Physical]
{BlackBodySpectrum, HypsometricTints, VisibleSpectrum}
ColorData[HypsometricTints, Panel]
et cetera, et cetera, etc...
There's also the ColorSchemes palette, which would be more helpful if it
had scroll bars rather than sliders.
Bobby
On Sun, 15 Jul 2007 00:14:35 -0500, David Bailey
>> An example of how hype has intruded into the documentation in
>> Mathematica 6 is the paragraph at the top of the page
>> guide/NewIn60AlphabeticalListing:
>> By far the largest release since Version 1.0 in 1988, Version 6.0
>> adds
>> a remarkable breadth of new functionality. As well as introducing
>> several major new fundamental concepts, it adds nearly a thousand new
>> functions, and significantly enhances a large fraction of all
>> existing
>> Mathematica functions.
>> I have no objection to the assertion that Mathematica 6.0 is by far
the
>> largest release since Version 1.0, or that it adds nearly a thousand
>> new functions, or that it significantly enhances a large fraction of
>> all existing Mathematica functions.
>> But... Must it say remarkable breadth of new functionality? Must
>> there be the sledge hammer of major new fundamental concepts?
>> Is it really necessary in the documentation explicitly to remind users
>> as to how wonderful Mathematica, and Mathematica 6.0 in particular, is?
>> Is this sort of stuff aimed at making folks feel good about their
>> purchase and use of Mathematica 6.0? Or, since the same documentation
>> appears on the Wolfram web site, does the problem arise from confounding
>> advertising with documentation?
>> Sorry for the rant.
> Let me add slightly to your rant!
I don't like documentation - such as that for the new ColorData function
> which feels (and is) vague. This contains phrases such as:
> Typical collections of schemes include: (followed by a list which is
> certainly incomplete because it doesn't include Legacy, which you
need
> to translate the old colour scheme!
Furthermore, can someone tell me what 'collections' refers to in this
> context?
This style of documentation suggests that the author only included those
> particularly unfortunate now that so many arguments and option names are
> specified as strings - so it isn't easy to find all the possibilities.
Much of the explanation of this function only happens via the examples,
> and goodness knows how many extra possibilities have been coded but
> never documented!
David Bailey
> http://www.dbaileyconsultancy.co.uk
--
DrMajorBob@bigfoot.com
===
Subject: Copying cells in simple text form?
Is there a way to select a group of cells having different formats;
copy them (using the Copy As menu command, or ???); and
paste them into a text file, email message, or newsgroup posting
so they appear exactly as they appear in normal notebook view?
(That is, without all kinds ofn and ( and [Rule] appearing
the
pasted content)
I can't seem to find such . . .
===
Subject: Odd little Bessel function quirk
[Indented lines are Output cells; others are Input cells]
f[r_] := If[r .b2 1, BesselJ[0, r], BesselK[0, r]]
f[r]
If[r .b2 1, BesselJ[0, r], BesselK[0, r]]
D[f[r], r]
If[r .b2 1, 1/2 (BesselJ[-1, r] - BesselJ[1, r]),
1/2 (-BesselK[-1, r] - BesselK[1, r])]
D[f[r], r] /. r .b2 1 -> True
-BesselJ[1, r]
D[f[r], r] /. r .b2 1 -> False
-BesselK[1, r]
Nothing erroneous here (so far as I know) -- but how come the results of
the (superfluous) 4th and 5th Input lines are simplified, but the 3rd
one is not? [When I'm struggling with Bessel functions, I can use all
the simplification I can get!]
===
Subject: Re: What's happening with Show[] in Mathematica 6?
> I tryed to run older notebooks in Mathematica 6 and I have this
> problem: when I have the Show[] function in somewhere, it doesn't plot
> anything!
> Fro example, run this:
> Do[Plot[Sun[x i],{x,-3,3}],{i,1,10}]
It doesn't output anything!
> What's the problem?
First, I believe you meant *Sin* rather than /Sun/. Second, use *Print*
as it has been answered many time previously in this newsgroup. For
instance,
Do[Print@Plot[Sin[x i], {x, -3, 3}], {i, 1, 10}]
Jean-Marc
===
Subject: Re: Strange Behaviour of Solve?
i tried (using Mathematica 6.0) to solve a system of equations:
In:=Solve[{b == g, a == (g*v/c), (b)^2 + (a)^2 == 1}, g]
> Out:={}
But when i use
In:=Solve[{b == g, a == (g*v/c), (b)^2 + (a)^2 == 1}, {a, b, g}]
> Out={{g -> -c/Sqrt[c^2 + v^2], b -> -c/Sqrt[c^2 + v^2],
> a -> -v/Sqrt[c^2 + v^2]}, {g -> c/Sqrt[c^2 + v^2],
> b -> c/Sqrt[c^2 + v^2], a -> v/Sqrt[c^2 + v^2]}}
i suddenly get the solution for g. It seems to me, that the number
> of solutions for one variable depends on the number of variables
> i want to solve for. Is this behaviour of Solve to be
> expected?
Andreas Maier
You may have overlooked the second form of the *Solve* function. The
online help tells us that, Solve[eqns, vars, elims] attempts to solve
the equations for vars, eliminating the variables elims. Therefore,
In[1]:= Solve[{b == g, a == g*(v/c), b^2 + a^2 == 1}, g, {a, b}]
Out[1]=
c c
{{g -> -(-------------)}, {g -> -------------}}
2 2 2 2
Sqrt[c + v ] Sqrt[c + v ]
returns the expected result for g.
Jean-Marc
===
Subject: Re: Strange Behaviour of Solve?
Solve[{b == g, a == (g*v/c), (b)^2 + (a)^2 == 1}, g, {a, b}]
{{g -> -(c/Sqrt[c^2 + v^2])},
{g -> c/Sqrt[c^2 + v^2]}}
Bob Hanlon
i tried (using Mathematica 6.0) to solve a system of equations:
In:=Solve[{b == g, a == (g*v/c), (b)^2 + (a)^2 == 1}, g]
> Out:={}
But when i use
In:=Solve[{b == g, a == (g*v/c), (b)^2 + (a)^2 == 1}, {a, b, g}]
> Out={{g -> -c/Sqrt[c^2 + v^2], b -> -c/Sqrt[c^2 + v^2],
> a -> -v/Sqrt[c^2 + v^2]}, {g -> c/Sqrt[c^2 + v^2],
> b -> c/Sqrt[c^2 + v^2], a -> v/Sqrt[c^2 + v^2]}}
i suddenly get the solution for g. It seems to me, that the number
> of solutions for one variable depends on the number of variables
> i want to solve for. Is this behaviour of Solve to be
> expected?
Andreas Maier
===
Subject: Re: Strange behaviour of Simplify
i'm trying to simplify the following expression
In:= gamma=c Sqrt[g00])/Sqrt[c^2 g00 + g11 v^2]
------------------------^
The above expression is syntacticly incorrect: either a parenthesis is
missing before the 'c' or this parenthesis must be discarded.
> In:=LeafCount[gamma]
> Out:=52
using Simplify
In:= gamma2=Simplify[gamma, {Sqrt[g00] > 0, c > 0 }]
Out:=c/Sqrt[c^2 + (g11 v^2)/g00]
> In:=LeafCount[gamma2]
> Out:=44
Why is Mathematica (I'm using V6.0) able to cancel Sqrt[g00], but is
> not
> able to cancel c? I also tried ComplexityFunction->LeafCount, which
> should work, because
In:=gamma3=1/Sqrt[1 + (g11 v^2)/(c^2 g00)]
> In:=LeafCount[gamma3]
> Out:=43
the LeafCount of gamma3 is smaller than gamma2, but it doesn' work.
> Can anybody tell me, how i can transform gamma to gamma3 in
> Mathematica?
Andreas Maier
Moreover, the leaf count numbers you are reporting are fishy: I have got
a difference of only one between the leaf count of gamma2 and of gamma3.
You should experiment again with a fresh kernel and copy the
input/output from the exact expressions you are working on.
In[1]:= gamma = (c*Sqrt[g00])/Sqrt[c^2*g00 + g11*v^2]
LeafCount[%]
Out[1]= (c*Sqrt[g00])/Sqrt[c^2*g00 + g11*v^2]
Out[2]= 22
In[3]:= gamma2 = Simplify[gamma, {Sqrt[g00] > 0, c > 0}]
LeafCount[%]
Out[3]= c/Sqrt[c^2 + (g11*v^2)/g00]
Out[4]= 18
In[5]:= gamma3 = 1/Sqrt[1 + (g11*v^2)/(c^2*g00)]
LeafCount[%]
Out[5]= 1/Sqrt[1 + (g11*v^2)/(c^2*g00)]
Out[6]= 17
Jean-Marc
===
Subject: Re: Strange behaviour of Simplify
i'm trying to simplify the following expression
In:= gamma=c Sqrt[g00])/Sqrt[c^2 g00 + g11 v^2]
...
Why is Mathematica (I'm using V6.0) able to cancel Sqrt[g00], but is
> not
> able to cancel c?
...
because there is not c but Sqrt[c^2] in the denominator (try an
arbitrary c with Re[c] < 0).
PO
===
Subject: Re: Strange behaviour of Simplify
i'm trying to simplify the following expression
In:= gamma=c Sqrt[g00])/Sqrt[c^2 g00 + g11 v^2]
> In:=LeafCount[gamma]
> Out:=52
using Simplify
In:= gamma2=Simplify[gamma, {Sqrt[g00] > 0, c > 0 }]
Out:=c/Sqrt[c^2 + (g11 v^2)/g00]
> In:=LeafCount[gamma2]
> Out:=44
Why is Mathematica (I'm using V6.0) able to cancel Sqrt[g00], but is
> not
> able to cancel c? I also tried ComplexityFunction->LeafCount, which
> should work, because
In:=gamma3=1/Sqrt[1 + (g11 v^2)/(c^2 g00)]
> In:=LeafCount[gamma3]
> Out:=43
the LeafCount of gamma3 is smaller than gamma2, but it doesn' work.
> Can anybody tell me, how i can transform gamma to gamma3 in
> Mathematica?
Andreas Maier
There is nothing strange about this behaviour. Simplify only uses
certain specified transformation functions and applies certain
sequences of them (such that the complexity does not increase at any
step) but there is no such sequence of functions that would do what
you want, because any such sequence would have to temporarily inrease
the complexity of the expression. Rather than spend time and energy
on trying to find a suitable mix of TransformationFunctions and a
ComplexityFunction that would produce the result you want, it is much
simpler to use replacement rules or a combination of replacement
rules and Simplify, like this:
Simplify[gamma /. c -> Sqrt[t], {Sqrt[g00] > 0, t > 0}] /. t -> c^2
1/Sqrt[(g11*v^2)/(c^2*g00) + 1]
Andrzej Kozlowski
===
Subject: an exploitation of the single vs. multi argument behavior of
Unevaluated
Unevaluated with multiple arguments is treated as
Unevaluated[Sequence[arg1,arg3,etc]], where Sequence doesn't have its
normal Sequence effect.
Unevaluated with one argument has its intended behavior.
Unevaluated with no arguments is treated as Unevaluated[Sequence[]].
Compare:
In[1]:= f/@Unevaluated[]
Out[1]= Sequence[]
In[2]:= f/@Unevaluated[1]
Out[2]= 1
In[3]:= f/@Unevaluated[1,2]
Out[3]= Sequence[f[1],f[2]]
In situations where I am using Unevaluated with a variable number of
arguments, the behavior with a single argument would usually produce
an error, so (on Maxim's recommendation) I usually explicitly specify
Unevaluated@Sequence[args] on the right hand side of pattern
transformation rules, where args can correspond to zero or more
arguments.
However, I found one situation where the single vs. multi argument
behavior can be exploited. It involves needing to specify either one
of two alternative pattern right hand sides to a function. (Also,
specifying Sequence sequence either inside or outside of Unevaluated
in this situation would produce undesirable results. i.e.
Sequence[Unevaluated[a1],Unevaluated[a2]] or
Unevaluated[Sequence[a1,a2]] would be bad.):
Cases[AbsoluteOptions@EvaluationNotebook[],(str_String/;StringQ@Unevaluated@
str)|(symb_Symbol/;AtomQ@Unevaluated@symb):>ToString@Unevaluated[str,symb],In
finity]
The resulting list of strings is useful for exploring possible options
of Cell via the string matching functions.
P.S.
For one of Mathematica 6's more annoying features, evaluate:
AbsoluteOptions@$FrontEnd
to receive:
ToExpression::notstrbox:
FEPrivate`FrontEndResourceString[GetFEKernelInit] is not a string or a
box. ToExpression can only interpret strings or boxes as Mathematica
input. >>
P.P.S.
The old v5 documentation search was good for some things. For
instance, try figuring out what the Margins option is for by using
Google search or the Mathematica 6 search. I suppose the old version's
advantage in this case could be eliminated by adding a regular
expression search to Mathematica 6.
--
http://chris.chiasson.name/
===
Subject: Re: Palette to write out Global Names to a Selected NB
Much appreciated. Programming on the Box function
level I find very confusing. If you know of any
good overviews for a beginner on this level,
Don
===
Subject: Re: change slider to pointed rectangle or arrow
> Is there any way within Manipulate to make a slider appear as either a
> filled rectangle topped by a triangle -- a shape very roughly like this
^
> | |
> _
-- or as just a filled triangle or vertical arrow?
What about in a more general expression using an explicit Slider?
I ask this because the help gives the following example --
Table[Slider[0.5, Appearance -> a], {a, {UpArrow, DownArrow}}]
-- but I see absolutely no differences in the results as from not using
> the Appearance option at all.
On my (WinXP) laptop, the UpArrow slider looks like the shape you
describe asa rectangle topped by a triangle, the DownnArrow slider is
the same only upside down.
--
Helen Read
University of Vermont
===
Subject: Re: change slider to pointed rectangle or arrow
> Is there any way within Manipulate to make a slider appear as either a
> filled rectangle topped by a triangle -- a shape very roughly like this
^
> | |
> _
-- or as just a filled triangle or vertical arrow?
What about in a more general expression using an explicit Slider?
I ask this because the help gives the following example --
Table[Slider[0.5, Appearance -> a], {a, {UpArrow, DownArrow}}]
-- but I see absolutely no differences in the results as from not using
> the Appearance option at all.
Weird. On my Wintel machine, I clearly see a difference.
ColumnForm[
Table[Slider[0.5,
Appearance -> a], {a, {, UpArrow, DownArrow}}]]
See http://homepages.nyu.edu/~jmg336/mathematica/SliderUpDownArrows.png
Jean-Marc
===
Subject: Re: change slider to pointed rectangle or arrow
> I tried your example, and I'm getting an error appearing in the Messages
> window:
The specified setting for the option SliderBoxOptions, Appearance
> cannot be used.
This refers, I believe, just to the value of a.
Yes, sorry about that: I copied the wrong line to the email! (Note
that I am not sure about the settings Automatic, but it seems that
it does not generate any error message.)
In[1]:= $Version
Out[1]= 6.0 for Microsoft Windows (32-bit) (April 20, 2007)
In[2]:= ColumnForm[
Table[Slider[0.5,
Appearance -> a], {a, {Automatic, UpArrow, DownArrow}}]]
> More importantly, I'm just seeing three ordinary, rectangular sliders.
Yet I do see the anticipated effect in the screen shot you linked in
> your reply.
Something very peculiar is going on!
My version is
$Version
> 6.0 for Microsoft Windows (32-bit) (June 19, 2007)
which is what is otherwise known as 6.0.1.
Hum, the behavior seems to be platform and/or version dependent.
Jean-Marc
>> Is there any way within Manipulate to make a slider appear as either a
>> filled rectangle topped by a triangle -- a shape very roughly like
this
>> ^
>> | |
>> _
>> -- or as just a filled triangle or vertical arrow?
>> What about in a more general expression using an explicit Slider?
>> I ask this because the help gives the following example --
>> Table[Slider[0.5, Appearance -> a], {a, {UpArrow,
DownArrow}}]
>> -- but I see absolutely no differences in the results as from not
>> using the Appearance option at all.
Weird. On my Wintel machine, I clearly see a difference.
ColumnForm[
> Table[Slider[0.5,
> Appearance -> a], {a, {, UpArrow, DownArrow}}]]
See http://homepages.nyu.edu/~jmg336/mathematica/SliderUpDownArrows.png
Jean-Marc
> --
> Murray Eisenberg murray@math.umass.edu
> Mathematics & Statistics Dept.
> Lederle Graduate Research Tower phone 413 549-1020 (H)
> University of Massachusetts 413 545-2859 (W)
> 710 North Pleasant Street fax 413 545-1801
> Amherst, MA 01003-9305
>
===
Subject: Re: change slider to pointed rectangle or arrow
As I already replied, I'm not seeing the UpArrow or DownArrow shapes on
the pointers from:
ColumnForm[
Table[Slider[0.5, Appearance -> a], {a, {UpArrow,
DownArrow}}]]
Here's what I'm seeing:
http://www.math.umass.edu/~murray/images/sliders.png
Moreover, even if I go into Options Inspector and reset the option
Formatting Options > Expression Formatting > Controls Options >
SliderBoxOptions > Appearance
from its default setting {Automatic,Automatic} to {UpArrow,UpArrow}, I
still see no difference.
>> Is there any way within Manipulate to make a slider appear as either a
>> filled rectangle topped by a triangle -- a shape very roughly like this
>> ^
>> | |
>> _
>> -- or as just a filled triangle or vertical arrow?
>> What about in a more general expression using an explicit Slider?
>> I ask this because the help gives the following example --
>> Table[Slider[0.5, Appearance -> a], {a, {UpArrow,
DownArrow}}]
>> -- but I see absolutely no differences in the results as from not
>> using the Appearance option at all.
Weird. On my Wintel machine, I clearly see a difference.
ColumnForm[
> Table[Slider[0.5,
> Appearance -> a], {a, {, UpArrow, DownArrow}}]]
See http://homepages.nyu.edu/~jmg336/mathematica/SliderUpDownArrows.png
Jean-Marc
>
--
Murray Eisenberg murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
===
Subject: Re: change slider to pointed rectangle or arrow
I tried your example, and I'm getting an error appearing in the Messages
window:
The specified setting for the option SliderBoxOptions, Appearance
cannot be used.
This refers, I believe, just to the value of a.
More importantly, I'm just seeing three ordinary, rectangular sliders.
Yet I do see the anticipated effect in the screen shot you linked in
your reply.
Something very peculiar is going on!
My version is
$Version
6.0 for Microsoft Windows (32-bit) (June 19, 2007)
which is what is otherwise known as 6.0.1.
>> Is there any way within Manipulate to make a slider appear as either a
>> filled rectangle topped by a triangle -- a shape very roughly like this
>> ^
>> | |
>> _
>> -- or as just a filled triangle or vertical arrow?
>> What about in a more general expression using an explicit Slider?
>> I ask this because the help gives the following example --
>> Table[Slider[0.5, Appearance -> a], {a, {UpArrow,
DownArrow}}]
>> -- but I see absolutely no differences in the results as from not
>> using the Appearance option at all.
Weird. On my Wintel machine, I clearly see a difference.
ColumnForm[
> Table[Slider[0.5,
> Appearance -> a], {a, {, UpArrow, DownArrow}}]]
See http://homepages.nyu.edu/~jmg336/mathematica/SliderUpDownArrows.png
Jean-Marc
>
--
Murray Eisenberg murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
===
Subject: PersepctiveTransform?
It is listed on the Geometric Transforms page but is otherwise unavailable.
--
David Park
djmpark@comcast.net
http://home.comcast.net/~djmpark/