MathGroup Archive 2007

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

Search the Archive

Re: Multiple Constants

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83246] Re: Multiple Constants
  • From: "David Park" <djmpark at comcast.net>
  • Date: Fri, 16 Nov 2007 05:23:18 -0500 (EST)
  • References: <fhh80l$946$1@smc.vnet.net>

You don't have to use SetAttributes to solve your equations for x,y and z. 
The following is a way to solve the equations and use the solutions.

eqns = {x + y + z == 1, b*x + c*y + d*z == A, f*x + g*y + h*z == Q};

Solve[eqns, {x, y, z}];
xyzsols = First[%]

Then to use the solutions, say by substituting into some expression:

3 x^2 + 4 y z /. xyzsols
% // Simplify

As I said, you don't have to SetAttributes to constant for the symbols you 
don't want to solve for and I wouldn't. But if you look at Help for 
SetAttibutes and then under More Information you will see that you can set 
the attribute of more than one symbol by enclosing them in list brackets.

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

-- 
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/


<thehammerster at gmail.com> wrote in message news:fhh80l$946$1 at smc.vnet.net...
> 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
> 



  • Prev by Date: Re: Multiple Constants
  • Next by Date: Re: Minimizing Mathematica file size for source code control?
  • Previous by thread: Re: Multiple Constants
  • Next by thread: Re: Multiple Constants