Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1927
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Solve / Reduce isolating results. |
| Date | 2011-04-30 09:52 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <ipgm5a$8qr$1@smc.vnet.net> (permalink) |
On 4/29/11 at 7:35 AM, lrebanks@netvigator.com (Lea Rebanks) wrote:
>Given the enclosed code - see below. Please could someone help me
>setup the code to Solve / Reduce for these 2 missing values only
>required
>{SQ1 -> 5292, XX -> 0.25}
>(I don't want multiple results.) I want positive numbers & NOT
>Complex..
The simplest way I can think of to do what you want is to select
the result you want from the list of returned results by
specifying the desired properties. That is:
In[14]:= Quiet@
Cases[NSolve[{(1/6)*((SQ1*196)*2)^3 - (1/
6)*((((2.75 + XX)*((3.75 + XX)*21^2))*100)*2)^3 ==
1.2902698935932682*^18, (1/6)*((SQ1*100)*2)^3 - (1/
6)*((((2.75 + XX)*((3.75 + XX)*21^2))*36)*2)^3 ==
1.883856772422697*^17}, {SQ1,
XX}], _?((XX /. #) > 0. && (SQ1 /. #) > 0. &)]
Out[14]= {{SQ1->5292.,XX->0.25}}
Here, I use Quiet to suppress the warning messages Mathematica
generates indicating it really isn't meaningful to compare a
complex value to zero. Since you aren't interested in complex
values, it is safe to ignore or suppress this warning.
Note, I also changed Solve to NSolve since that will get rid of
another warning message and NSolve is specifically intended for
approximate numeric answers.
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Solve / Reduce isolating results. Bill Rowe <readnews@sbcglobal.net> - 2011-04-30 09:52 +0000
csiph-web