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


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

how to export to Excel in Mathematica from a Parametricplot command

Started bymrafiee20@gmail.com
First post2012-07-03 02:22 +0000
Last post2012-07-05 18:53 +0000
Articles 5 — 3 participants

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


Contents

  how to export to Excel in Mathematica from a Parametricplot command mrafiee20@gmail.com - 2012-07-03 02:22 +0000
    Re: how to export to Excel in Mathematica from a Parametricplot command "Alexey Popkov" <lehin.p@gmail.com> - 2012-07-04 07:36 +0000
    Re: how to export to Excel in Mathematica from a Parametricplot command Dominik Hezel <sendme2000@me.com> - 2012-07-04 07:37 +0000
    Re: how to export to Excel in Mathematica from a Parametricplot command "Alexey Popkov" <lehin.p@gmail.com> - 2012-07-05 18:52 +0000
    Re: how to export to Excel in Mathematica from a Parametricplot command Dominik Hezel <sendme2000@me.com> - 2012-07-05 18:53 +0000

#10757 — how to export to Excel in Mathematica from a Parametricplot command

Frommrafiee20@gmail.com
Date2012-07-03 02:22 +0000
Subjecthow to export to Excel in Mathematica from a Parametricplot command
Message-ID<jstl0d$k81$1@smc.vnet.net>
Hi all,

This example is from Mathematica:
http://reference.wolfram.com/mathematica/ref/ParametricPlot.html

NDSolve[{y'[t] == y[t] (x[t] - 1), x'[t] == x[t] (2 - y[t]), 
   x[0] == 1, y[0] == 2.7}, {x, y}, {t, 0, 10}];
ParametricPlot[Evaluate[{x[t], y[t]} /. First[%]], {t, 0, 10}]

My question is:
How can I export the results (*.xls or *.dat) to plot it with other programs like Origin pro, Excel, Tecplot, etc.?

[toc] | [next] | [standalone]


#10787

From"Alexey Popkov" <lehin.p@gmail.com>
Date2012-07-04 07:36 +0000
Message-ID<jt0rq6$1h5$1@smc.vnet.net>
In reply to#10757
<mrafiee20@gmail.com> wrote: news:jstl0d$k81$1@smc.vnet.net...
> Hi all,
>
> This example is from Mathematica:
> http://reference.wolfram.com/mathematica/ref/ParametricPlot.html
>
> NDSolve[{y'[t] == y[t] (x[t] - 1), x'[t] == x[t] (2 - y[t]),
>   x[0] == 1, y[0] == 2.7}, {x, y}, {t, 0, 10}];
> ParametricPlot[Evaluate[{x[t], y[t]} /. First[%]], {t, 0, 10}]
>
> My question is:
> How can I export the results (*.xls or *.dat) to plot it with other 
> programs like Origin pro, Excel, Tecplot, etc.?
>
>

Try this:
NDSolve[{y'[t] == y[t] (x[t] - 1), x'[t] == x[t] (2 - y[t]), x[0] == 1,
y[0] == 2.7}, {x, y}, {t, 0, 10}];
f[t_] = {x[t], y[t]} /. First[%];
ParametricPlot[f[t], {t, 0, 10}]
points = First@Cases[%, l_Line :> First@l, Infinity];
Export["points.dat", points, "Table"]

HTH,

Alexey


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


#10789

FromDominik Hezel <sendme2000@me.com>
Date2012-07-04 07:37 +0000
Message-ID<jt0rs3$1ho$1@smc.vnet.net>
In reply to#10757
You'll probably get some more elegant solutions, but this works:

NDSolve[{y'[t] == y[t] (x[t] - 1), x'[t] == x[t] (2 - y[t]), 
  x[0] == 1, y[0] == 2.7}, {x, y}, {t, 0, 10}]
ParametricPlot[Evaluate[{x[t], y[t]} /. First[%]], {t, 0, 10}]

exp = Evaluate[{x[t], y[t]} /. First[%]];
exp2 = exp[[1, 3, 2, 2, 1]];
Export["Desktop/exp.xls", exp2]

You might want to transpose it before export.
.Dominik

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


#10812

From"Alexey Popkov" <lehin.p@gmail.com>
Date2012-07-05 18:52 +0000
Message-ID<jt4np8$4n6$1@smc.vnet.net>
In reply to#10757
<mrafiee20@gmail.com> wrote: news:jstl0d$k81$1@smc.vnet.net...
> Hi all,
>
> This example is from Mathematica:
> http://reference.wolfram.com/mathematica/ref/ParametricPlot.html
>
> NDSolve[{y'[t] == y[t] (x[t] - 1), x'[t] == x[t] (2 - y[t]),
>   x[0] == 1, y[0] == 2.7}, {x, y}, {t, 0, 10}];
> ParametricPlot[Evaluate[{x[t], y[t]} /. First[%]], {t, 0, 10}]
>
> My question is:
> How can I export the results (*.xls or *.dat) to plot it with other 
> programs like Origin pro, Excel, Tecplot, etc.?
>
>

Try this:
NDSolve[{y'[t] == y[t] (x[t] - 1), x'[t] == x[t] (2 - y[t]), x[0] == 1,
y[0] == 2.7}, {x, y}, {t, 0, 10}];
f[t_] = {x[t], y[t]} /. First[%];
ParametricPlot[f[t], {t, 0, 10}]
points = First@Cases[%, l_Line :> First@l, Infinity];
Export["points.dat", points, "Table"]

HTH,

Alexey


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


#10814

FromDominik Hezel <sendme2000@me.com>
Date2012-07-05 18:53 +0000
Message-ID<jt4nr5$4nr$1@smc.vnet.net>
In reply to#10757
You'll probably get some more elegant solutions, but this works:

NDSolve[{y'[t] == y[t] (x[t] - 1), x'[t] == x[t] (2 - y[t]), 
  x[0] == 1, y[0] == 2.7}, {x, y}, {t, 0, 10}]
ParametricPlot[Evaluate[{x[t], y[t]} /. First[%]], {t, 0, 10}]

exp = Evaluate[{x[t], y[t]} /. First[%]];
exp2 = exp[[1, 3, 2, 2, 1]];
Export["Desktop/exp.xls", exp2]

You might want to transpose it before export.
.Dominik

[toc] | [prev] | [standalone]


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


csiph-web