Message Boards Message Boards

0
|
4671 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Avoid a syntax error while calculating jet velocities?

Posted 5 years ago

I keep receiving this syntax error. Anyone have an idea as to why?

Attachment

Attachments:
POSTED BY: Dan Rivera
3 Replies

Please post actual code rather than images thereof (can use the image to show the error message). Also indicate what you have tried in order to debug the problem.

POSTED BY: Daniel Lichtblau
gamma[beta_] := 1/Sqrt[1 - beta^2]
c = 299792458 ; (*speed of light, m/s*)
Mile = 1600 ;(*Meter*)
Hour = 3600 ;(*Second*)
speedF35 = 1200.*Mile/Hour;
betaF35 = speedF35/c;
gammaF35 = gamma[betaF35];
SetOptions[SelectedNotebook[], PrintPrecision -> 30]
Print["Speed of F35 = ", speedF35, " m/s"]
Print["beta of F35 = ", betaF35]
Print["Lorentz factor of F35 = ", gammaF35]

Speed of F35 = 533.3333333333333 m/s

beta of F35 = 1.7790085077234774*10^-6

Lorentz factor of F35 = 1.0000000000015825

WolframLanguage has a units framework! Try e.g.:

c = EntityValue[Entity["PhysicalConstant", "SpeedOfLight"], "Value"];
speedF35 = Quantity[1200, "Miles"/"Hours"];

Maybe there are some more problems with your code, but I cannot try, because you posted just a picture of code.

POSTED BY: Henrik Schachner
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