Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #12199
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Subscript in parameter names |
| Date | 2012-10-28 05:56 +0000 |
| Message-ID | <k6ihf9$cj1$1@smc.vnet.net> (permalink) |
| References | <20121027034731.0C53F687C@smc.vnet.net> |
| Organization | Time-Warner Telecom |
Needs["PhysicalConstants`"]
SpeedOfLight
(299792458*Meter)/Second
L[x_, v_] := x*Sqrt[1 - v^2/c^2]
L[Subscript[L, 0], v]
Sqrt[1 - v^2/c^2]*Subscript[
L, 0]
% /. {v -> 250000000. Meter/Second,
c -> SpeedOfLight}
0.5519000950955603*
Subscript[L, 0]
Bob Hanlon
On Fri, Oct 26, 2012 at 11:47 PM, Per R=F8nne <per@rqnne.invalid> wrote:
> You define functions in Mathematica like this:
>
> c[a_, b_]:= ^2a^6+b^6
>
> Giving Sqrt[a^2+b^2]
>
> But how will you define a function with a parameter with a subscript,
> like
>
> L[L^_0^ _,v]:=L^_0*^21-^/v^6 c^6
>
> Giving L[L0,v]:= L0*Sqrt[1-v^2/c^2]
>
> Except that L0 should be with a real subscript.
>
> In this example, c is 299,792,458 m/s, L0 the proper length in the
> velocity direction of an object with speed v relative to the observed
> lenght L from an intertial system with speed 0.
> --
> Per Erik R=F8nne
> http://www.RQNNE.dk
> Errare humanum est, sed in errore perseverare turpe
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Subscript in parameter names Bob Hanlon <hanlonr357@gmail.com> - 2012-10-28 05:56 +0000
csiph-web