Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #16682
| From | totarefugium <mtaktikos@t-online.de> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Problems with Solve |
| Date | 2014-03-23 09:01 +0000 |
| Message-ID | <lgm7st$2c$1@smc.vnet.net> (permalink) |
| References | <lgj2cs$lcg$1@smc.vnet.net> |
| Organization | Time-Warner Telecom |
Hello,
In[1]:= N[Solve[z + 5 (z^2 - 1) + 1 z^3 == 1, z]]
Out[1]= {{z -> 0.925423 + 0. I}, {z -> -4.47735 + 2.22045*10^-16 I}, {z
-> -1.44807 - 4.44089*10^-16 I}}
In[2]:=[N[Solve[z + 5 (z^2 - 1) + 1 z^3 == 1, z] ] /.
Complex[re_, im_ /; Abs[im] < 0.001] :> re
Out[2] = {{z -> 0.925423}, {z -> -4.47735}, {z -> -1.44807}}
HTH,
Michael Taktikos
Hamburg/Germany
On 22.03.2014 05:09, Samuel Mark Young wrote:
> I'm trying to use the solutions of Solve from solving a cubic equation - however, it keeps returning complex answers when there are real solutions. For example:
>
> Solve[z + 5 (z^2 - 1) + 1 z^3 == 1, z]
>
> This equation has 3 real solutions. However, the answers returned when I ask mathematica for a decimal answer are complex (which I need to do later on when an integration needs solving numerically):
> {{z -> 0.925423 + 0. I}, {z -> -4.47735 +
> 2.22045*10^-16 I}, {z -> -1.44807 - 4.44089*10^-16 I}}
>
> I'm guessing this is to do with the finite precision that is used in the calculations as the imaginary components are very small, but am unsure how to deal with them and they shouldn't be there. Any suggestions?
>
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar
Problems with Solve Samuel Mark Young <sy81@sussex.ac.uk> - 2014-03-22 04:09 +0000 Re: Problems with Solve totarefugium <mtaktikos@t-online.de> - 2014-03-23 09:01 +0000 Re: Problems with Solve totarefugium <mtaktikos@t-online.de> - 2014-03-23 08:59 +0000 Re: Problems with Solve danl@wolfram.com - 2014-04-01 07:03 +0000
csiph-web