       Re: Equation problem

• To: mathgroup at smc.vnet.net
• Subject: [mg109278] Re: Equation problem
• From: "David Park" <djmpark at comcast.net>
• Date: Tue, 20 Apr 2010 05:51:06 -0400 (EDT)

```You are really going to have to spend some time learning the basics and
syntax of Mathematica. It's not Fortran, and equations are not entered in
anything like the form you have. Without doing some preliminary study from
the Documentation Center you will waste A LOT of time.

But, this is probably a good example to cut your teeth on so here is one
solution.

First, try to solve equations exactly with parameters before you put dirty,
messy, approximate data values into them. Mathematica is good at exact
solutions and it should always be the first choice. So we define the
equation.  (You can copy these statements, paste them into your notebook,
and evaluate them to see the results.) You should look up many of these
names and symbols in Help.

eqn = y == (1 + Sqrt[c/x] x)/d

Notice that eqn is a symbol that contains the actual equation (Set with =)
and the equation itself has == for Equal, which is different than Set.
Notice that I have used c and d to represent the numbers in the equation. We
can save, and later use, their values in the variable data as follows.

data = {c -> 5.71*^-8, d -> 6.38*^9}

These are substitution rules. Look up Rule and ReplaceAll in Help.

Now we solve the equation and, at the end, substitute the data values. Here
I do this all in one cell and give a step by step annotation with Print
statements. (Again, copy, paste and evaluate.)

Print["Solution of the equation for x"]
step1 = Solve[eqn, x]
Print["There is only one solution rule. Pick it out."]
step2 = Part[step1, 1, 1]
Print["Use the solution rule on x to obtain the value."]
step3 = x /. step2
Print["Write as a polynomial in y by using Apart."]
step4 = Apart[step3]
Print["Substitute the data values."]
step5 = step4 /. data // Expand

The net result is that it does not look like y can be well represented by a
+ b y unless y is much less than 10^-10

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

From: Asttro [mailto:imoric1 at gmail.com]

I just started using Mathematica and have no idea how to do the following...

I have the starting equation:

y=((1+sqrt(5.71e8/x))*x)/6.38e9

What I want is to obtain x=a+b*y, where a and b are parameters.

Is this possible in Mathematica?

```

• Prev by Date: Re: Button Problem
• Next by Date: Re: Button Problem
• Previous by thread: Re: Equation problem
• Next by thread: make arrows same size in VectorPlot?