MathGroup Archive 2007

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

Search the Archive

Re: Multiple Constants

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83264] Re: [mg83215] Multiple Constants
  • From: DrMajorBob <drmajorbob at bigfoot.com>
  • Date: Fri, 16 Nov 2007 05:33:54 -0500 (EST)
  • References: <20087331.1195162053751.JavaMail.root@m35>
  • Reply-to: drmajorbob at bigfoot.com

First, you misspelled Constant.

Second, as Help will tell you, the syntax is

    SetAttributes[{a, b, c}, Constant]

Third, that only affects Dt, as Help also explains... and you're not using  

Dt.

Fourth, these are NOT equations or any other legal syntax in Mathematica,  
since "=" means Set, not Equal.

> x+y+z=1
> b*x+c*y+d*z=A
> f*x+g*y+h*z=Q

You mean

eqns = {x + y + z == 1, b x + c y + d z == a, f x + g y + h z == q}

Fifth, b,c,d,A,f,g,h,Q are NOT constants; they're parameters.

Sixth, these are the variables you don't consider "constant":

Complement[
  eqns /. Equal -> List // Flatten // Variables, {b, c, d, a, f, g, h,
   q}]

{x, y, z}

And finally, here's how you solve for them:

Solve[eqns, {x, y, z}]

{{x -> -((a g - d g - a h + c h - c q + d q)/(
     c f - d f - b g + d g + b h - c h)),
   y -> -((a f - d f - a h + b h - b q + d q)/(-c f + d f + b g - d g -
       b h + c h)),
   z -> -((a f - c f - a g + b g - b q + c q)/(
     c f - d f - b g + d g + b h - c h))}}

SetAttributes didn't help (or hurt).

Bobby

On Thu, 15 Nov 2007 04:37:30 -0600, <thehammerster at gmail.com> wrote:

> Hi,
> I'm new to Mathematica and I feel like this is a stupid question but I
> can't seem to define more than one constant
>
> If I type
> SetAttributes[a,b,c,Contstant]
> I get
> SetAttributes::argrx: SetAttributes called with 4 arguments; 2
> arguments are \expected.
>
> I have three equations and three variables I want to solve for and I
> have 8 constants.
>
> x+y+z=1
> b*x+c*y+d*z=A
> f*x+g*y+h*z=Q
>
> b,c,d,A,f,g,h,Q are constants and I want a generic equations that I
> can use for many different variations of these constants.
>
> I've done the calculation by hand but fear I have made a mistake and
> would like to double check my calculation, and then use the equation
> to propagate my errors, as each constant has an associated standard
> error of the mean. Propagation of my error will give me an error on my=

> model calculation, which is really important.
>
> Thanks
>
>



-- =

DrMajorBob at bigfoot.com


  • Prev by Date: Re: Re: Solving simple equations
  • Next by Date: Version 4: Zoom2D and GetGraphicsCoordinates palettes combined
  • Previous by thread: Re: Multiple Constants
  • Next by thread: Solving Differential Equations with Vectors