Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4944 > unrolled thread

Table->Value

Started byMariano Pierantozzi <mariano.pierantozzi@gmail.com>
First post2011-09-14 09:21 +0000
Last post2011-09-15 08:50 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Table->Value Mariano Pierantozzi <mariano.pierantozzi@gmail.com> - 2011-09-14 09:21 +0000
    Re: Table->Value David Bailey <dave@removedbailey.co.uk> - 2011-09-15 08:42 +0000
    Re: Table->Value Armand Tamzarian <mike.honeychurch@gmail.com> - 2011-09-15 08:50 +0000

#4944 — Table->Value

FromMariano Pierantozzi <mariano.pierantozzi@gmail.com>
Date2011-09-14 09:21 +0000
SubjectTable->Value
Message-ID<j4prnm$fo1$1@smc.vnet.net>
Hi to everyone,
I've got a problem that seem stupid, but is a lost of time to me.
I've generate a table with solutions of a series of equations
pfugacita =
v = Table[
   NSolve[pressioni[[1, i]] - (R temperature[[1, i]])/(
      V - b[[1, i]]) +
      a[[1, i]]/( - (b[[1, i]])^2 + 2 b[[1, i]] V + V^2) == 0, V,
    Reals], {i, 41}] // Grid
The solutions are a table and in each row i've got the three solutions of
one equation.
The results are
.............
{
 {{V -> 26.5173}, {V -> 340.686}, {V -> 191821.}},
 {{V -> 26.6798}, {V -> 326.358}, {V -> 135843.}},
 {{V -> 26.8489}, {V -> 312.824}, {V -> 98061.}},
 {{V -> 27.0252}, {V -> 300.031}, {V -> 72039.1}},
 {{V -> 27.209}, {V -> 287.932}, {V -> 53792.5}},
 {{V -> 27.4009}, {V -> 276.484}, {V -> 40774.4}},
 {{V -> 27.6013}, {V -> 265.647}, {V -> 31339.2}},
 {{V -> 27.8109}, {V -> 255.384}, {V -> 24398.6}},
 {{V -> 28.0302}, {V -> 245.661}, {V -> 19221.5}},
 {{V -> 28.26}, {V -> 236.446}, {V -> 15312.4}},
 {{V -> 28.501}, {V -> 227.71}, {V -> 12322.2}},
 {{V -> 28.754}, {V -> 219.424}, {V -> 10009.8}}
}
...........
And now i want to use this values to calculate some variations; but i don't
know how trasform the table of solutions in a table of pure number.
i.e.
 {{ 26.5173}, { 340.686}, { 191821.}},
 { 26.6798}, { 326.358}, { 135843.}},
 {{ 26.8489}, {312.824}, {98061.}},
 {{ 27.0252}, { 300.031}, { 72039.1}},
 {{27.209}, {287.932}, { 53792.5}},
 { 27.4009},  276.484}, {40774.4}},
 {{27.6013}, {265.647}, { 31339.2}},
 {{27.8109}, { 255.384}, { 24398.6}},
 {{ 28.0302}, 245.661}, { 19221.5}},
 {{28.26}, {236.446}, {15312.4}},
 {{ 28.501}, { 227.71}, {12322.2}},
 {{ 28.754}, {219.424}, { 10009.8}}
}
If I had one equations it's non problem for me, but i don't be able with a
table.
Thaks for yuor help...
MP

[toc] | [next] | [standalone]


#4959

FromDavid Bailey <dave@removedbailey.co.uk>
Date2011-09-15 08:42 +0000
Message-ID<j4sdqd$ske$1@smc.vnet.net>
In reply to#4944
On 14/09/2011 10:21, Mariano Pierantozzi wrote:
> Hi to everyone,
> I've got a problem that seem stupid, but is a lost of time to me.
> I've generate a table with solutions of a series of equations
> pfugacita =
> v = Table[
>     NSolve[pressioni[[1, i]] - (R temperature[[1, i]])/(
>        V - b[[1, i]]) +
>        a[[1, i]]/( - (b[[1, i]])^2 + 2 b[[1, i]] V + V^2) == 0, V,
>      Reals], {i, 41}] // Grid
> The solutions are a table and in each row i've got the three solutions of
> one equation.
> The results are
> .............
> {
>   {{V ->  26.5173}, {V ->  340.686}, {V ->  191821.}},
>   {{V ->  26.6798}, {V ->  326.358}, {V ->  135843.}},
>   {{V ->  26.8489}, {V ->  312.824}, {V ->  98061.}},
>   {{V ->  27.0252}, {V ->  300.031}, {V ->  72039.1}},
>   {{V ->  27.209}, {V ->  287.932}, {V ->  53792.5}},
>   {{V ->  27.4009}, {V ->  276.484}, {V ->  40774.4}},
>   {{V ->  27.6013}, {V ->  265.647}, {V ->  31339.2}},
>   {{V ->  27.8109}, {V ->  255.384}, {V ->  24398.6}},
>   {{V ->  28.0302}, {V ->  245.661}, {V ->  19221.5}},
>   {{V ->  28.26}, {V ->  236.446}, {V ->  15312.4}},
>   {{V ->  28.501}, {V ->  227.71}, {V ->  12322.2}},
>   {{V ->  28.754}, {V ->  219.424}, {V ->  10009.8}}
> }
> ...........
> And now i want to use this values to calculate some variations; but i don't
> know how trasform the table of solutions in a table of pure number.
> i.e.
>   {{ 26.5173}, { 340.686}, { 191821.}},
>   { 26.6798}, { 326.358}, { 135843.}},
>   {{ 26.8489}, {312.824}, {98061.}},
>   {{ 27.0252}, { 300.031}, { 72039.1}},
>   {{27.209}, {287.932}, { 53792.5}},
>   { 27.4009},  276.484}, {40774.4}},
>   {{27.6013}, {265.647}, { 31339.2}},
>   {{27.8109}, { 255.384}, { 24398.6}},
>   {{ 28.0302}, 245.661}, { 19221.5}},
>   {{28.26}, {236.446}, {15312.4}},
>   {{ 28.501}, { 227.71}, {12322.2}},
>   {{ 28.754}, {219.424}, { 10009.8}}
> }
> If I had one equations it's non problem for me, but i don't be able with a
> table.
> Thaks for yuor help...
> MP
V/. {
  {{V -> 26.5173}, {V -> 340.686}, {V -> 191821.}},
  {{V -> 26.6798}, {V -> 326.358}, {V -> 135843.}},
  {{V -> 26.8489}, {V -> 312.824}, {V -> 98061.}},
  {{V -> 27.0252}, {V -> 300.031}, {V -> 72039.1}},
  {{V -> 27.209}, {V -> 287.932}, {V -> 53792.5}},
  {{V -> 27.4009}, {V -> 276.484}, {V -> 40774.4}},
  {{V -> 27.6013}, {V -> 265.647}, {V -> 31339.2}},
  {{V -> 27.8109}, {V -> 255.384}, {V -> 24398.6}},
  {{V -> 28.0302}, {V -> 245.661}, {V -> 19221.5}},
  {{V -> 28.26}, {V -> 236.446}, {V -> 15312.4}},
  {{V -> 28.501}, {V -> 227.71}, {V -> 12322.2}},
  {{V -> 28.754}, {V -> 219.424}, {V -> 10009.8}}

Of course, you shouldn't wrap Grid round the calculation until the last 
step.

It is definitely recommended not to use variables (or create functions) 
that start with a capital letter unless they also contain a special 
character - such as \[Breve]. The problem is that all such names are 
reserved for future versions of Mathematica, and you don't want your 
code to break when you upgrade! The single letters, E and I already have 
built-in definitions!

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [next] | [standalone]


#4977

FromArmand Tamzarian <mike.honeychurch@gmail.com>
Date2011-09-15 08:50 +0000
Message-ID<j4se97$so8$1@smc.vnet.net>
In reply to#4944
On Sep 14, 7:21 pm, Mariano Pierantozzi
<mariano.pieranto...@gmail.com> wrote:
> Hi to everyone,
> I've got a problem that seem stupid, but is a lost of time to me.
> I've generate a table with solutions of a series of equations
> pfugacita =
> v = Table[
>    NSolve[pressioni[[1, i]] - (R temperature[[1, i]])/(
>       V - b[[1, i]]) +
>       a[[1, i]]/( - (b[[1, i]])^2 + 2 b[[1, i]] V + V^2) == 0, =
V,
>     Reals], {i, 41}] // Grid
> The solutions are a table and in each row i've got the three solutions of
> one equation.
> The results are
> .............
> {
>  {{V -> 26.5173}, {V -> 340.686}, {V -> 191821.}},
>  {{V -> 26.6798}, {V -> 326.358}, {V -> 135843.}},
>  {{V -> 26.8489}, {V -> 312.824}, {V -> 98061.}},
>  {{V -> 27.0252}, {V -> 300.031}, {V -> 72039.1}},
>  {{V -> 27.209}, {V -> 287.932}, {V -> 53792.5}},
>  {{V -> 27.4009}, {V -> 276.484}, {V -> 40774.4}},
>  {{V -> 27.6013}, {V -> 265.647}, {V -> 31339.2}},
>  {{V -> 27.8109}, {V -> 255.384}, {V -> 24398.6}},
>  {{V -> 28.0302}, {V -> 245.661}, {V -> 19221.5}},
>  {{V -> 28.26}, {V -> 236.446}, {V -> 15312.4}},
>  {{V -> 28.501}, {V -> 227.71}, {V -> 12322.2}},
>  {{V -> 28.754}, {V -> 219.424}, {V -> 10009.8}}}
>
> ...........
> And now i want to use this values to calculate some variations; but i don=
't
> know how trasform the table of solutions in a table of pure number.
> i.e.
>  {{ 26.5173}, { 340.686}, { 191821.}},
>  { 26.6798}, { 326.358}, { 135843.}},
>  {{ 26.8489}, {312.824}, {98061.}},
>  {{ 27.0252}, { 300.031}, { 72039.1}},
>  {{27.209}, {287.932}, { 53792.5}},
>  { 27.4009},  276.484}, {40774.4}},
>  {{27.6013}, {265.647}, { 31339.2}},
>  {{27.8109}, { 255.384}, { 24398.6}},
>  {{ 28.0302}, 245.661}, { 19221.5}},
>  {{28.26}, {236.446}, {15312.4}},
>  {{ 28.501}, { 227.71}, {12322.2}},
>  {{ 28.754}, {219.424}, { 10009.8}}}
>
> If I had one equations it's non problem for me, but i don't be able with =
a
> table.
> Thaks for yuor help...
> MP

results = {{{V -> 26.5173}, {V -> 340.686}, {V -> 191821.}}, {{V ->
     26.6798}, {V -> 326.358}, {V -> 135843.}}, {{V -> 26.8489}, {V ->
      312.824}, {V -> 98061.}}, {{V -> 27.0252}, {V -> 300.031}, {V ->
      72039.1}}, {{V -> 27.209}, {V -> 287.932}, {V ->
     53792.5}}, {{V -> 27.4009}, {V -> 276.484}, {V ->
     40774.4}}, {{V -> 27.6013}, {V -> 265.647}, {V ->
     31339.2}}, {{V -> 27.8109}, {V -> 255.384}, {V ->
     24398.6}}, {{V -> 28.0302}, {V -> 245.661}, {V ->
     19221.5}}, {{V -> 28.26}, {V -> 236.446}, {V -> 15312.4}}, {{V ->
      28.501}, {V -> 227.71}, {V -> 12322.2}}, {{V -> 28.754}, {V ->
     219.424}, {V -> 10009.8}}};

then

tmp = V /. results

or

tmp = results[[All, All, 1, 2]]

Flatten[Partition[tmp, {3, 1}], 1]

Mike

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web