MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Help Defining Variables (with long names)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16763] Re: Help Defining Variables (with long names)
  • From: Harald Giese <giese at dkrz.de>
  • Date: Wed, 24 Mar 1999 02:24:04 -0500
  • Organization: Institut fuer Meereskunde, Universitaet Hamburg
  • References: <7d73sq$dvv@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Gutierrez Family wrote:
> 
> Hello to all.
> 
> I'm new to Mathematica and have a very basic question (one that I
> haven't found an answer to using the online help - I'm probably
> looking
> in the wrong place).
> 
> What is the best way to declare variable with a 'long name'?  I am
> currently using the underscore to separate the words.  For example:
> 
> liquid_density_of_ethylene_glycol=1.114
> 
> Unfortunately, I run into trouble when performing basic arithmetic.
> For
> 
> example, if I multiply '4*liquid_density_of_ethylene_glycol', I expect
> to get 4.456.  Instead I get '4_ethylene_glycol_of liquid_density'.
> This is after receiving 'Set::write : Tag Times in _ethylene_glycol_of
> liquid_density is Protected.'.
> 
> Can someone please advise?  Thank you very much for your time.
> 
> -- Daly Gutierrez


Daly,

_ or Blank[ ] is a pattern object that can stand for any Mathematica
expression. 
_h or Blank[h] can stand for any expression with head h. 

Therefore, Mathematica interprets _density as a special head. Mathematica has predefined
heads (e.g. Integer, List etc.) but allows you to define your own.
Have a look at the Help Browser: Tour of Mathematica: Mathematica as a
Programming Language.


Regards,
Harald


-- 
Harald Giese
Email: giese at dkrz.de
Phone: +49 (0)40 4123 5796; Fax: +49 (0)40 5605724
Institut fuer Meereskunde der Universitaet Hamburg
(Institute of Oceanography of the University of Hamburg)
Troplowitzstrasse 7, D-22529 Hamburg


  • Prev by Date: Re: Commutators and Operator Powers in Mathematica
  • Next by Date: Re: combining two plots
  • Previous by thread: Re: Help Defining Variables (with long names)
  • Next by thread: Re: Help Defining Variables (with long names)