Message Boards Message Boards

0
|
6717 Views
|
8 Replies
|
2 Total Likes
View groups...
Share
Share this post:

How do I get output with simple numbers with just one power of 10

Posted 10 years ago
For some reason I can't paste the code into the Mathematica box.
Or even pasted here, so I have attached my whole file.
PS. managed something below but it looks messy.
Look at the section
'Let us approximate some variables and create a simple Universe'
and you will understand what I mean.
Sorry for the mess, my first post, gone wrong. Andrew

¹d = 6.6300 Quantity[Superscript[10,-34],"Meters"];
(* Primary ¹diameter 6.63 10^-34 m *)
¹c = (¹d) Pi; (* Primary ¹circumference *)
¹r = (¹c)/(2 Pi); (* Primary ¹radius *)
¹L = 6.6300 Quantity[Superscript[10,-2],"Meters"];
(* "Primary ¹Length" 6.63 10^-2 m *)
¹S¹A = 2 Pi (¹r) (¹L); (* "Primary ¹Surface¹Area" *)
¹V = Pi (¹r)^2 (¹L);
(* Primary Volume of one 'APE' the coil itself \ 2.29 10^-68 ((m)^3) *)
\.b2C = (¹L); (* "Secondary \.b2Circumference" 6.63 10^-2 m *)
\.b2R = (\.b2C)/(2 Pi); (* "Secondary \.b2Radius" *)
\.b2D = (\.b2C)/Pi; (* "Secondary \.b2Diameter" *)
\.b2V = (4/3) Pi (\.b2R)^3; (* "Secondary \.b2Volume" 2.29 10^-68 ((m)^3) *)
\¹\ = 4.1400 Quantity[Superscript[10,38],"Kilograms"]/Quantity[1,("Meters")^3]; Estimate Maximum Primary ¹Density of the \Universe 4.14 10^38 kg/1 ((m)^3) *)
¹m = (¹\) (¹V); (* Mass of one 'APE' 4.49 10^-31 kg *)
\.b2\ = (¹m)/(\.b2V); (* Secondary Density of 'APE' *)
¹primeNumber = 5.2800 10^84;
(* 252097800623 Prime Number of 'APE's in the known \Universe 5.28 10^84 *)
mknownUniverse = (¹primeNumber)(¹m);
minVU = ¹primeNumber (¹V);
(* minimum Volume of the known Universe \1.08 10^16 ((m)^3) *)
Attachments:
POSTED BY: Andrew Pepes
8 Replies
Posted 10 years ago
I understood you were likely new to Mathematica and I do not hold that against you.

What I mean by "You have been desktop published" is. "Ooo look, I have Mathematica. I can type 4^500. And it works! But look at all the buttons. I need to push lots of those buttons and see what happens. Ooo look, I can change the font. Ooo look, I can have superscripts. Oh I just HAVE to have superscripts and a new font. Ooo look, it has units, I need units, I just have to have units. Ooo look, it has thousands of different characters. I just have to use some of those characters in names for my variables. I can plot Sin. And it works, well actually it finally worked when I figured out it wasn't sin(x) and wasn't sin(ax) and wasn't Sin(ax) and wasn't Sin[ ax ], but was Sin[ a*x ] ! Ooo look, I can change colors and make labels and push all kinds of buttons... Hey... why doesn't some of this stuff work after I have done all this?!?!?" The answer is that I say "You have been desktop published." The "Windows mindset" has convinced you and convinced the authors of Mathematica that you just MUST have a thousand buttons to be able to play with and change the publishing of your presentation, but when you have played with it enough then you have dug yourself a deep hole and down at the bottom of that hole the calculations don't even work any more, not unless you know far far far more than you know, and probably far more than I know, BUT all the pixels you have put in that window do look d**m good, even if they aren't a correct answer. Please understand, I do not blame you personally for this, an entire industry has spent almost thirty years intent on convincing themselves and convincing you that you just have to have fonts and superscripts and a thousand buttons and tens of thousands of different characters and desktop publish literally every key you press.

This is not because you are using the trial version. This is because you drank the Koolaid(tm) and went wild pushing buttons to desktop publish. If you are not American and do not know American slang, "drinking the Koolaid" refers to a sugary drink for children and when they drink enough of it then something is done to their minds. So the slang now refers to anyone who has embraced something and in the process lost their mind.

Side note that will only sometimes help you. If you are trying to post a message here there are a couple of things that are not at all obvious, but that will help you. If you want to post a Mathematica code fragment then hit Enter four or five times. Then click your mouse in the middle of those four or five blank lines so you have several blank lines above and several blank lines below. Then click on the little red/orange "spikey ball" at the right end of the second row above the text box where you were typing. That will create a one line empty box. Inside that box you can paste Mathematica code. That box will then expand to be big enough to display your code and the forum posting software will mess with the contents of that box less than if you just paste it or type it along with the text of your message. The reason for several blank lines above and below that box are to keep the posting process from scrambling the code in that box. Then you can position your cursor outside the box and continue the rest of your post. You can even have more than one "spikey ball" code box in a post, as I have done below, BUT you have to have at least several blank lines between each of those or the posting process will start scrambling your code. This will not keep the posting software from still doing some things to mangle the post. After you click Publish to submit the post you then click Edit, delete all the extra inserted newlines and fix other things and then click Publish again and you should be better. That is the recipe that I use and it seems fairly reliable.

Now, back to your message, you say you want a simple answer. That is fairly easy to get, just as long as you don't push dozens of buttons to use all kinds of desktop publishing features.
 d1 = 6.6300*10^-34 ;(* Primary diameter 6.63*10^-34 m *)
 c1 = d1 Pi ; (* Primary circumference *)
 r1 = c1/(2 Pi) ; (* Primary radius *)
 l1 = 6.6300*10^-2; (* "Primary Length" 6.63*10^-2 m *)
 s1a1 = 2 Pi r1 l1; (* "Primary SurfaceArea" *)
 v1 = Pi r1^2 l1; (* Primary Volume of one 'APE' the coil itself 2.29*10^-68m^3 *)
 c2 = l1; (* "Secondary \.b2Circumference" 6.63*10^-2m *)
 r2 = c2/(2 Pi) ; (* "Secondary Radius" *)
 d2 = c2/Pi; (* "Secondary Diameter" *)
v2 = (4/3) Pi r2^3; (* "Secondary \.b2Volume" 2.29*10^-68m^3 *)
rho1 = 4.1400*10^38; (* Estimate Maximum Primary ¹Density of the Universe 4.14 *10^38kg/m^3 *)
m1 = rho1 v1; (* Mass of one 'APE' 4.49*10^-31kg *)
rho2 = m1/v2; (* Secondary Density of 'APE' *)
primeNumber1 = 5.2800*10^84; (* 252097800623 Prime Number of 'APE's in the known Universe 5.28*10^58 *)
mknownUniverse = primeNumber1 m1;
minVU = primeNumber1 v1; (* minimum Volume of the known Universe 1.08*10^16m^3 *)
d = 6.6300*10^-34;
Print["Primary diameter =", d1, "m\n",
"Primary circumference =", c1, "m\n",
"Primary radius =", r1, "m\n",
"Primary Length =", l1, "m\n",
"Primary SurfaceArea =", s1a1, "m^2\n",
"Primary Volume =", v1, "m^3\n",
"Primary rho1 density =", rho1, "kg/m^3\n",
"Secondary Circumference =", c2, "m\n",
"Secondary Radius =", r2, "m\n",
"Secondary Diameter =", d2, "m\n",
"Secondary Volume V=", v2, "m^3\n",
"mass of APE' m=", m1, "kg\n",
"Secondary Density of 'APE' rho2 =", rho2, "kg/m^3\n",
"Mass of known Universe =", mknownUniverse, "kg\n",
"minimumVolumeUniverse =", minVU, "m^3"]
Which when evaluated displays
 Primary diameter =6.63*10^-34m
 Primary circumference =2.08288*10^-33m
 Primary radius =3.315*10^-34m
 Primary Length =0.0663m
 Primary SurfaceArea =1.38095*10^-34m^2
 Primary Volume =2.28892*10^-68m^3
 Primary rho1 density =4.14*10^38kg/m^3
 Secondary Circumference =0.0663m
 Secondary Radius =0.010552m
Secondary Diameter =0.0211039m
Secondary Volume V=4.92141*10^-6m^3
mass of APE' m=9.47613*10^-30kg
Secondary Density of 'APE' rho2 =1.92549*10^-24kg/m^3
Mass of known Universe =5.00339*10^55kg
minimumVolumeUniverse =1.20855*10^17m^3
But it doesn't have all your special characters and superscripts to the left of your characters and automatically handle your units... and an inch above this, at least on my monitor Secondary Diameter isn't quite lined up with Secondary Radius, I tried to figure out why it isn't lined up and that is beyond me, and I simply cannot go on living with something that looks as unspeakably horrible as this... Yes, but I think it gives you the correct answer. You should also double and perhaps even triple check those calculations using different methods and tools if it matters whether those results are really REALLY precisely correct.

See how much of this solves your problem.

And after you get a correct answer, then you can maybe think about desktop publishing the final values that you have calculated, but only if you absolutely cannot resist doing that.

Can you violate some of these guidelines and still have it work? Yes, sometimes. Can you violate some of these guidelines and not have a clue why it doesn't work or what to do to fix it? Yes, often.

I sincerely hope it works out for you.
POSTED BY: Bill Simpson
Posted 10 years ago
Dear Bill

Thanks for your help. Especially going back and tidying the text after posting. I still can't get my code pasted using the Mathematica symbol. 

I am "drinking the Koolaid" who has embraced something and in the process lost their mind, but I am not 'desktop published'.

I used prefixed superscripts because this is the notation I use to distinguish between different levels of dimensions of space and time.

I did not realise that Mathematica could not handle prefixed superscripts.
But I do not think this is the real problem.

Using your code does not solve my problem, because you are doing calculations with numbers only and then you are specifying the units.

I want Mathematica to work with units, so when I start doing complex maths I do not have to work out what the units should be.

PS I also try and use symbols that already mean something in physics like the Greek letter 'rho' for density (because density has many levels, it will be more confusing using multiple letters and numbers to assign to each, especially when you are trying to follow formulas).

Using my notation also eliminates confusion with formulas
2Pir2^2 can be interpreted as 8Pir and 2Pir3^2 maybe 2Pi9r,
but r^2 with any prefixed supercript can only be interpreted as r squared.

Regards
Mr Andrew Pepes
PPS I don't know what the term will be for 'desktop published' in the graphics animation context, but I will be worse in that area because I want to simulate a dynamic entity in at least 7 dimensions which will probably need many nested functions.
POSTED BY: Andrew Pepes
Posted 10 years ago
Hi Everyone

Solved my problem.

Mathematica can cope with prefixed superscripts in variable names and Greek letters (with prefixed superscripts).

Need to specify units in the following form.

¹d = Quantity[6.6300 10^-34, "meters"];

and it works out all the other formulas to one power of 10, and gets the units correct as well.

Mr Andrew Pepes 
POSTED BY: Andrew Pepes
Posted 10 years ago
I tried the Mathematica symbol and tried to paste my code into the box but it did not work!

Could it be because I am still using the trial version?
Or am I doing something else wrong?
Also when I type my responce it looks like normal text but when I post it, it comes out messy.
Andrew

PS this time it worked! but still not able to paste into Mathematica code.
POSTED BY: Andrew Pepes
Posted 10 years ago
You have been "desktop published."

This means that you have used enough of the available tools to make your input look published
that you are now unable to do many kinds of calculations with your input.
In[1]:= ¹d = Quantity[6.6300*Superscript[10,-34], "Meters"];
¹L = Quantity[6.6300*Superscript[10,-2], "Meters"];,
¹\[Rho] = Quantity[4.1400*Superscript[10,38],"Kilograms"*"Meters"^-3];
FullForm[¹d ¹L]

Out[4]//FullForm= Quantity[43.9569*Superscript[10,-34]*Superscript[10,-2],"Meters"^2]]
POSTED BY: Bill Simpson
Posted 10 years ago
Hi Bill
I am new to Mathematica, but I do not understand what you mean by 'desktop published' ?
Are you saying after you have done a certain amount of calculations or processing you can not do any more?

I just want a simple answer like

density = 1.92549 x 10^-70 Kg/metre^3          and not unresovled mess like the following

"Secondary Density of 'APE' \.b2\ =" (Quantity[(<span style="line-height: 1.6em;">192.549 (Superscript[10.,-34])^2 Superscript[10.,38])/(Superscript[</span><span style="line-height: 1.6em;">10.,-2])^2, ("Kilograms")/("Meters")^3])

Are you saying Mathematica can't do that?
Regards
Andrew Pepes
POSTED BY: Andrew Pepes
Use the formatting tools at the top of the composition area.  in partidular use the Mathemaica icon for entering code.
POSTED BY: David Reiss
Posted 10 years ago
So when I output the answers with

N[Column[{"Primary ¹diameter =" ¹d, "Primary ¹circumference =" ¹c,
"Primary ¹radius =" ¹r, "Primary ¹Length = " ¹L,
"Primary ¹Surface¹Area =" ¹S¹A, "Primary ¹Volume =" ¹V,
"Primary ¹\density =" ¹\ ,
"Secondary \.b2Circumference =" \.b2C,
"Secondary \.b2Radius =" \.b2R, "Secondary \.b2Diameter =" \.b2D,
"Secondary \.b2Volume \.b2V=" \.b2V, "¹mass of 'APE' ¹m=" ¹m ,
"Secondary Density of 'APE' \.b2\ =" \.b2\,
"Mass of known Universe = " mknownUniverse,
"minimumVolumeUniverse =" minVU}]]

I get multiple factor of 10.

It is only me trying to improve the layout. Andrew
PS I tried pasting the output but I can not get it to display what I see!
POSTED BY: Andrew Pepes
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract