Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #10014 > unrolled thread
| Started by | David <dwarnold45@suddenlink.net> |
|---|---|
| First post | 2012-05-10 09:00 +0000 |
| Last post | 2012-05-15 08:52 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
File size 5.5MB David <dwarnold45@suddenlink.net> - 2012-05-10 09:00 +0000
Re: File size 5.5MB A Retey <awnl@gmx-topmail.de> - 2012-05-11 04:14 +0000
Re: File size 5.5MB Andre Koppel <akoppel@akso.de> - 2012-05-15 08:52 +0000
| From | David <dwarnold45@suddenlink.net> |
|---|---|
| Date | 2012-05-10 09:00 +0000 |
| Subject | File size 5.5MB |
| Message-ID | <jog02s$g2c$1@smc.vnet.net> |
All,
Very new to CDF format of Mathematica, but concerned at the file size
of a simple file.
Something as simple of this, along with its output, is 5.5MB. How
come?
ContourPlot3D[
r*(1 - u/q) - u/(1 + u^2) == 0, {r, 0, 1}, {q, 0, 10}, {u, 0, 10},
AxesLabel -> {r, q, u}, MeshFunctions -> {#1 &}, Mesh -> 9]
Phil = ContourPlot3D[
r*(1 - u/q) - u/(1 + u^2) == 0, {r, 0, 1}, {q, 0, 10}, {u, 0, 10},
AxesLabel -> {r, q, u}, MeshFunctions -> {#2 &}, Mesh -> 4,
ContourStyle -> Opacity[0.5]]
F[u_, r_, q_] := r*(1 - u/q) - u/(1 + u^2)
BC = {r, q} /.
Solve[{F[u, r, q] == 0, D[F[u, r, q], u] == 0}, {r, q}][[1]]
BC = {BC[[1]], BC[[2]], 0}
h = ParametricPlot3D[
BC, {u, 1.12, \!\(TraditionalForm\`4.781283795978355\)},
PlotStyle -> {Thickness[0.01], RGBColor[1, 0, 0]}];
Show[Phil, h]
David
[toc] | [next] | [standalone]
| From | A Retey <awnl@gmx-topmail.de> |
|---|---|
| Date | 2012-05-11 04:14 +0000 |
| Message-ID | <joi3mn$n4l$1@smc.vnet.net> |
| In reply to | #10014 |
Hi,
> Very new to CDF format of Mathematica, but concerned at the file size
> of a simple file.
>
> Something as simple of this, along with its output, is 5.5MB. How
> come?
Because it contains 3 nontrivial 3d vector graphics? I won't argue that
this could not probably be done more efficient, but it isn't that bad
that I'd consider it a real problem (if you look into the file or the
cell expressions you will find that the graphics content even is
compressed by default). Maybe you want to explain what your problem
with the file size exactly is, so we can suggest what you can do to
solve that particular problem.
There are various ways to get your files smaller, maybe simple settings
like:
ContourPlot3D[
r*(1 - u/q) - u/(1 + u^2) == 0, {r, 0, 1}, {q, 0, 10}, {u, 0, 10},
AxesLabel -> {r, q, u}, MeshFunctions -> {#1 &}, Mesh -> 9,
PlotPoints -> 5, MaxRecursion -> 2]
will already be sufficient for what you want to achieve, but as another
extreme you could create very small rasterized "previews" in the file
and recreate the full 3d vectorgraphic only when the user wants to
interact with it. That possibility is the real benefit of using CDF
instead of e.g. PDF. Of course things like that need a little extra
effort, here is an example:
With[{
code = Hold@ContourPlot3D[
r*(1 - u/q) - u/(1 + u^2) == 0, {r, 0, 1}, {q, 0, 10}, {u, 0, 10},
AxesLabel -> {r, q, u}, MeshFunctions -> {#1 &}, Mesh -> 9
]
},
DynamicModule[{content =
Button[Rasterize @@ code, content = ReleaseHold[code],
Appearance -> None]},
Dynamic[content]
]
]
it will create a rasterized graphics as a static preview. If you save
that file it will be about 50kB for me (that would be about 150kB for
three such graphics). Only when the user clicks on the graphics it is
replaced with the interactive 3d graphics. Of course you probably might
want to improve that so it becomes clearer to potential users/readers
how to use it and what is going on while the 3d graphics is recreated.
hth,
albert
[toc] | [prev] | [next] | [standalone]
| From | Andre Koppel <akoppel@akso.de> |
|---|---|
| Date | 2012-05-15 08:52 +0000 |
| Message-ID | <jot5gn$ali$1@smc.vnet.net> |
| In reply to | #10014 |
Take a look. Into the file.
It didn't only contain the instructions for the calculations. It also
contains detailed plotting instructions line by line. This is
because the cdr-Interpreter isn't a small Mathematica. It is a
viewer for previously calculated result. It is also unable to do own
rendering, it only draws simple lines generated by a renderer.
On Thu, 10 May 2012 09:00:12 +0000 (UTC), David
<dwarnold45@suddenlink.net> wrote:
> All,
> Very new to CDF format of Mathematica, but concerned at the file
size
> of a simple file.
> Something as simple of this, along with its output, is 5.5MB. How
> come?
> ContourPlot3D[
> r*(1 - u/q) - u/(1 + u^2) == 0, {r, 0, 1}, {q, 0, 10}, {u, 0, 10},
> AxesLabel -> {r, q, u}, MeshFunctions -> {#1 &}, Mesh -> 9]
> Phil = ContourPlot3D[
> r*(1 - u/q) - u/(1 + u^2) == 0, {r, 0, 1}, {q, 0, 10}, {u, 0, 10},
> AxesLabel -> {r, q, u}, MeshFunctions -> {#2 &}, Mesh -> 4,
> ContourStyle -> Opacity[0.5]]
> F[u_, r_, q_] := r*(1 - u/q) - u/(1 + u^2)
> BC = {r, q} /.
> Solve[{F[u, r, q] == 0, D[F[u, r, q], u] == 0}, {r, q}][[1]]
> BC = {BC[[1]], BC[[2]], 0}
> h = ParametricPlot3D[
> BC, {u, 1.12, \!\(TraditionalForm\`4.781283795978355\)},
> PlotStyle -> {Thickness[0.01], RGBColor[1, 0, 0]}];
> Show[Phil, h]
> David
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web