For Programmers: Free Programming Magazines  


Home > Archive > Mathematica > November 2005 > Time needed for calculation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Time needed for calculation
JikaiRF@aol.com

2005-11-23, 3:59 am


Dear Sirs,
I have some questions about how long a computer can calculate, without
damages on hard wear.
More specifically speaking, I intend to depict trajectories on (k, c) axis,
which are derived from programming on Mathematica.
My program is as follows:

<< Graphics`ImplicitPlot`
L = 48;

a = 0.1;

A = 1;

r = 0.1;

t = 0.046296296296296294`;

ImplicitPlot[A r L (1 - a)((1 -t) c k^a == (a+(1-a)(1- t)) L^2 (1-a)^2 (1- t
)^3 k^(3a-1)
+L(1-a) c (1- t) (-A(a+(1-a)(1- t))(2- t)-(1-a)(1- t)^2
+A a(1- t)) k^(2a-1)
+A c^2 (A(a+(1-a)(1- t))+(1-a)(1- t) -A a(1- t)) k^(a-1)
+A^2 r c^2, {k, 0.8, 1.5}]

This program seems to work well. However, I cannot obtain the curve which
should be derived from the above program, though my computer continues to
calculate more than fifteen minutes.

I would like to know how long a computer can calculate without damages on
hardware, and additionally how long it takes to obtain the required curve based
on my computer.
Especially, my computer is PowerBook G4 with 1.5 GHz processor.

Sincerely,
Fujio Takata.


David Park

2005-11-24, 7:59 am

Fujio,

Try out ImplicitPlot with two iterators. You equation was missing a
parenthesis and I made an assumption about where it should be. Look over a
wider domain to begin with. Then maybe you can zoom in on the part you want.
Sometimes it helps to evaluate equations before you put them into
ImplicitPlot, just so you can better see what you are dealing with.

<< Graphics`ImplicitPlot`

L = 48;
a = 0.1;
A = 1;
r = 0.1;
t = 0.046296296296296294`;

eqn = A*r*L*(1 - a)*((1 - t)*c*k^a) ==
(a + (1 - a)*(1 - t))*L^2*(1 - a)^2*(1 - t)^3*
k^(3*a - 1) + L*(1 - a)*c*(1 - t)*
((-A)*(a + (1 - a)*(1 - t))*(2 - t) -
(1 - a)*(1 - t)^2 + A*a*(1 - t))*k^(2*a - 1) +
A*c^2*(A*(a + (1 - a)*(1 - t)) +
(1 - a)*(1 - t) - A*a*(1 - t))*k^(a - 1) +
A^2*r*c^2

4.120000000000001*c*k^0.1 ==
0.1*c^2 + (1.7212962962962965*c^2)/k^0.9 -
(106.93561728395063*c)/k^0.8 + 1551.4025308641978/
k^0.7

ImplicitPlot[eqn, {k, 1, 300}, {c, 0, 100},
AspectRatio -> 1]

ImplicitPlot[eqn, {k, 0.8, 1.5}, {c, 15, 50},
AspectRatio -> 1]

Those evaluate almost instantly.

David Park
djmp@earthlink.net
http://home.earthlink.net/~djmp/

From: JikaiRF@AOL.COM [mailto:JikaiRF@AOL.COM]



Dear Sirs,
I have some questions about how long a computer can calculate, without
damages on hard wear.
More specifically speaking, I intend to depict trajectories on (k, c) axis,
which are derived from programming on Mathematica.
My program is as follows:

<< Graphics`ImplicitPlot`
L = 48;

a = 0.1;

A = 1;

r = 0.1;

t = 0.046296296296296294`;

ImplicitPlot[A r L (1 - a)((1 -t) c k^a == (a+(1-a)(1- t)) L^2 (1-a)^2 (1- t
)^3 k^(3a-1)
+L(1-a) c (1- t) (-A(a+(1-a)(1- t))(2- t)-(1-a)(1- t)^2
+A a(1- t)) k^(2a-1)
+A c^2 (A(a+(1-a)(1- t))+(1-a)(1- t) -A a(1- t))
k^(a-1)
+A^2 r c^2, {k, 0.8, 1.5}]

This program seems to work well. However, I cannot obtain the curve which
should be derived from the above program, though my computer continues to
calculate more than fifteen minutes.

I would like to know how long a computer can calculate without damages on
hardware, and additionally how long it takes to obtain the required curve
based
on my computer.
Especially, my computer is PowerBook G4 with 1.5 GHz processor.

Sincerely,
Fujio Takata.



Daniel Lichtblau

2005-11-24, 7:59 am

JikaiRF@AOL.COM wrote:
> Dear Sirs,
> I have some questions about how long a computer can calculate, without
> damages on hard wear.
> More specifically speaking, I intend to depict trajectories on (k, c) axis,
> which are derived from programming on Mathematica.
> My program is as follows:
>
> << Graphics`ImplicitPlot`
> L = 48;
>
> a = 0.1;
>
> A = 1;
>
> r = 0.1;
>
> t = 0.046296296296296294`;
>
> ImplicitPlot[A r L (1 - a)((1 -t) c k^a == (a+(1-a)(1- t)) L^2 (1-a)^2 (1- t
> )^3 k^(3a-1)
> +L(1-a) c (1- t) (-A(a+(1-a)(1- t))(2- t)-(1-a)(1- t)^2
> +A a(1- t)) k^(2a-1)
> +A c^2 (A(a+(1-a)(1- t))+(1-a)(1- t) -A a(1- t)) k^(a-1)
> +A^2 r c^2, {k, 0.8, 1.5}]
>
> This program seems to work well. However, I cannot obtain the curve which
> should be derived from the above program, though my computer continues to
> calculate more than fifteen minutes.
>
> I would like to know how long a computer can calculate without damages on
> hardware, and additionally how long it takes to obtain the required curve based
> on my computer.
> Especially, my computer is PowerBook G4 with 1.5 GHz processor.
>
> Sincerely,
> Fujio Takata.
>


I have no idea what sort of computation load a PowerBook can handle.
Also it is not at all clear what you did to find the curve in question.
The approach below will get you a polynomial reasonably fast.

expr = (-A)*r*L*(1 - a)*(1 - t)*c*k^a + (a + (1 - a)*(1 - t))*
L^2*(1 - a)^2*(1 - t)^3*k^(3*a - 1) +
L*(1 - a)*c*(1 - t)*((-A)*(a + (1 - a)*(1 - t))*(2 - t) -
(1 - a)*(1 - t)^2 + A*a*(1 - t))*k^(2*a - 1) +
A*c^2*(A*(a + (1 - a)*(1 - t)) + (1 - a)*(1 - t) -
A*a*(1 - t))*k^(a - 1) + A^2*r*c^2

In[25]:= rexpr = Rationalize[expr, 0]

Out[25]=
c^2/10 + (6375024143593*c^2)/(3703618114621*k^(9/10)) -
(388844671178*c)/(3636250307*k^(4/5)) +
307126999725/(197967319*k^(7/10)) -
(165668129149671*c*k^(1/10))/40210710958658

Now convert to a Laurent polynomial (only integer powers) by removing
the denominator power in k.

In[37]:= rexpr2 = PowerExpand[rexpr /. k -> l^10]

Out[37]=
c^2/10 + (6375024143593*c^2)/(3703618114621*l^9) -
(388844671178*c)/(3636250307*l^8) +
307126999725/(197967319*l^7) - (165668129149671*c*l)/
40210710958658

We can recover an implicit polynomial by eliminating l from the system
{rexpr2,l^10-k}.

imppoly =
First[GroebnerBasis[{rexpr2, l^10 - k}, {c, k}, l,
MonomialOrder -> EliminationOrder]]

The resulting polynomial will be quite resistant to direct use of
ImplicitPlot because the coefficients are too large to find zeros via
e.g. subdivision with machine arithmetic. I get what appears to be a
reasonable result from rescaling numerically as below.

In[75]:= imppoly2 = N[Expand[imppoly/10^450]]

Out[75]=
-0.44710407299089117*c^20 + 3.6929000651811335*^15*c^10*k -
5.435249465194847*c^19*k - 1.5816021229154092*^29*k^2 +
5.590311570192779*^16*c^9*k^2 - 23.71722762253775*c^18*k^2 +
2.8406692481577024*^17*c^8*k^3 - 43.059424056179864*c^17*k^3 +
5.701837604927303*^17*c^7*k^4 - 28.130472729642648*c^16*k^4 +
3.901760263753945*^17*c^6*k^5 - 2.2597182065813595*c^15*k^5 +
4.17821551222496*^16*c^5*k^6 - 3.1477095526033976*c^14*k^6 +
13.931088647720639*c^13*k^7 - 61.13817833192989*c^12*k^8 +
266.15182908720067*c^11*k^9 + 1.9581785245917768*^-13*c^20*
k^9 - 2759.462163976083*c^10*k^10

That is, the plot one might obtain as below gives something visually
similar to what I saw with the implicit plot of expr. But it has a new
graphical component (though not a distinct algebraic component, because
the polynomial is irreducible). I would guess this corresponds to
"parasite" solutions when one goes back to the radical formulation of
the implicit equation.

ImplicitPlot[imppoly2 == 0, {k, 0.1, 100}, {c, 5, 80}]


Daniel Lichtblau
Wolfram Research

Renan

2005-11-24, 7:59 am

On 11/23/05, JikaiRF@aol.com <JikaiRF@aol.com> wrote:


> I would like to know how long a computer can calculate without damages on
> hardware, and additionally how long it takes to obtain the required curve based
> on my computer.


If you have proper ing, I assume your computer should never be harmed.

Most modern CPU's are made to withstand hours at 100% load, given
proper ing.

I leave my computer (a Pentium 4, which is known for its high
temperatures) working for hours and no problem.

--
Thanks/obrigado, Renan "Wishmaster" Birck - Canoas, Rio Grande do Sul, Brasil
MSN: wizard_of_yendor@hotmail.com
Orkut: http://www.orkut.com/Profile.aspx?u...360379963855296

Bill Rowe

2005-11-24, 7:59 am

On 11/23/05 at 1:12 AM, JikaiRF@AOL.COM wrote:

>Dear Sirs, I have some questions about how long a computer can
>calculate, without damages on hard wear.


Unless there is something rather unusual about your computer or it is in an inappropriate environment, then the length of time it can be performing a computation before doing damage to hardware is far longer than you are likely to want to wait.

<snip>

>This program seems to work well. However, I cannot obtain the
>curve which should be derived from the above program, though my
>computer continues to calculate more than fifteen minutes.


>I would like to know how long a computer can calculate without
>damages on hardware, and additionally how long it takes to obtain
>the required curve based on my computer. Especially, my computer is
>PowerBook G4 with 1.5 GHz processor.


I am using an older generation PowerBook (800 MHz processor) and have run computations far longer than 15 minutes with no apparent harm to hardware. What will occur with a PowerBook is the bottom surface will definitely be warm or hot to the touch. So, th
e main thing is to make sure there is adequate ventilation to keep it from overheating.
--
To reply via email subtract one hundred and four

Bob Hanlon

2005-11-24, 7:59 am

If your computer is properly ventilated it should run almost indefinately.

You were missing a parentheses that I took a guess at. This may not be the
same equation.

I have a slower computer than yours and together these plots run in a couple
of seconds

Needs["Graphics`"];

L=48;
a=1/10;
A=1;
r=1/10;
t=Rationalize[0.046296296296296294`];

eqn=Simplify[A r L (1-a)((1-t) c k^a)==
(a+(1-a)(1-t)) L^2 (1-a)^2 (1-t)^3 k^(3a-1)+
L(1-a) c (1-t) (-A(a+(1-a)(1-t))(2-t)-
(1-a)(1-t)^2+A a(1-t)) k^(2a-1)+A c^2 (A(a+(1-
a)(1-t))+(1-a)(1-t)-
A a(1-t)) k^(a-1)+A^2 r c^2];

soln=c/.Solve[eqn,c];

Plot[Evaluate[soln],{k,0.8,1.5},
Frame->True,Axes->False,PlotStyle->Blue];

Bound the ImplicitPlot in both variables

ImplicitPlot[eqn,{k,0.8,1.5},{c,21,41},
AspectRatio->1/GoldenRatio,ImageSize->288,
Frame->True,Axes->False,PlotStyle->Blue];


Bob Hanlon

>
> From: JikaiRF@AOL.COM
> Date: 2005/11/23 Wed AM 01:12:58 EST
> Subject: Time needed for calculation
>
>
> Dear Sirs,
> I have some questions about how long a computer can calculate, without
> damages on hard wear.
> More specifically speaking, I intend to depict trajectories on (k, c) axis,
> which are derived from programming on Mathematica.
> My program is as follows:
>
> << Graphics`ImplicitPlot`
> L = 48;
>
> a = 0.1;
>
> A = 1;
>
> r = 0.1;
>
> t = 0.046296296296296294`;
>
> ImplicitPlot[A r L (1 - a)((1 -t) c k^a == (a+(1-a)(1- t)) L^2 (1-a)^2 (1- t
> )^3 k^(3a-1)
> +L(1-a) c (1- t) (-A(a+(1-a)(1- t))(2- t)-(1-a)(1- t)^2
> +A a(1- t)) k^(2a-1)
> +A c^2 (A(a+(1-a)(1- t))+(1-a)(1- t) -A a(1- t)) k^(a-1)
> +A^2 r c^2, {k, 0.8, 1.5}]
>
> This program seems to work well. However, I cannot obtain the curve

which
> should be derived from the above program, though my computer continues

to
> calculate more than fifteen minutes.
>
> I would like to know how long a computer can calculate without damages

on
> hardware, and additionally how long it takes to obtain the required curve

based
> on my computer.
> Especially, my computer is PowerBook G4 with 1.5 GHz processor.
>
> Sincerely,
> Fujio Takata.
>
>
>


Peter Pein

2005-11-24, 7:59 am

JikaiRF@aol.com schrieb:
> Dear Sirs,
> I have some questions about how long a computer can calculate, without
> damages on hard wear.
> More specifically speaking, I intend to depict trajectories on (k, c) axis,
> which are derived from programming on Mathematica.
> My program is as follows:
>
> << Graphics`ImplicitPlot`
> L = 48;
>
> a = 0.1;
>
> A = 1;
>
> r = 0.1;
>
> t = 0.046296296296296294`;
>
> ImplicitPlot[A r L (1 - a)((1 -t) c k^a == (a+(1-a)(1- t)) L^2 (1-a)^2 (1- t
> )^3 k^(3a-1)
> +L(1-a) c (1- t) (-A(a+(1-a)(1- t))(2- t)-(1-a)(1- t)^2
> +A a(1- t)) k^(2a-1)
> +A c^2 (A(a+(1-a)(1- t))+(1-a)(1- t) -A a(1- t)) k^(a-1)
> +A^2 r c^2, {k, 0.8, 1.5}]
>
> This program seems to work well. However, I cannot obtain the curve which
> should be derived from the above program, though my computer continues to
> calculate more than fifteen minutes.
>
> I would like to know how long a computer can calculate without damages on
> hardware, and additionally how long it takes to obtain the required curve based
> on my computer.
> Especially, my computer is PowerBook G4 with 1.5 GHz processor.
>
> Sincerely,
> Fujio Takata.
>
>


Hello,

when you specify only one range in ImplicitPlot, Mathematica tries to
solve the equation before plotting. When you give the ranges of k _and_
c, then another Algorithm will be used. I'm afraid, Mathematica tries to
solve w.r.t. k. Otherwise the answer should come almost instantly.

In[1]:= L = 48; a = 1/10; A = 1; r = 1/10; t = 5/108;
eqn = FullSimplify[
A*r*L*(1 - a)*(1 - t)*c*k^a ==
(a + (1 - a)*(1 - t))*L^2*(1 - a)^2*(1 - t)^3*k^(3*a - 1) +
L*(1 - a)*c*(1 - t)*((-A)*(a + (1 - a)*(1 - t))*(2 - t) -
(1 - a)*(1 - t)^2 + A*a*(1 - t))*k^(2*a - 1) +
A*c^2*(A*(a + (1 - a)*(1 - t)) + (1 - a)*(1 - t) -
A*a*(1 - t))*k^(a - 1) + A^2*r*c^2,
k > 0]
Out[2]=
103*c*(16819*k^(1/10) + 648*k) ==
15*c^2*(1859 + 108*k^(9/10)) + 25132721*k^(1/5)

In[3]:=
First[Timing[ImplicitPlot[eqn, {k, 0.8, 1.2}, {c, 0, 50},
PlotPoints -> 300, ImageSize -> 500, AspectRatio ->
GoldenRatio - 1]]]
[plot omitted]
Out[3]= 0.234*Second

And don't be afraid; if you did not overclock your hardware,
long-lasting calculations will not do any harm to your machine.

Rumors were afloat, some companies use their computers 24 hours/day ;-)

Regards,
Peter

2005-11-25, 3:59 am


I assume that several ws of continuous computation are more then enough
to make you feel comfortable wit "LONG" computations.
During this time the CPU load was 100%, and there also heavy use of the
virtual memory, so I suspect that most parts of the computer were busy (may
besides the floppy, keyboard and the screen).
yehuda


George Woodrow III

2005-11-25, 3:59 am

I use a 1.33 Ghz Powerbook (17 inch), and there are no real issues
running a calculation overnight. Both fans may come on, but there is
no problem. The limitations are the usual hardware ones -- RAM and HD
space. As long as the problem is solvable in 32 bit space, the
Powerbook can get the job done, just not as fast as some other
computers.

Personally, I'm looking forward to a quad core intel-mac. ;-)

george

On Nov 24, 2005, at 6:33 AM, Daniel Lichtblau wrote:

> JikaiRF@AOL.COM wrote:
>
> I have no idea what sort of computation load a PowerBook can handle.
> Also it is not at all clear what you did to find the curve in
> question.
> The approach below will get you a polynomial reasonably fast.
>
> expr = (-A)*r*L*(1 - a)*(1 - t)*c*k^a + (a + (1 - a)*(1 - t))*
> L^2*(1 - a)^2*(1 - t)^3*k^(3*a - 1) +
> L*(1 - a)*c*(1 - t)*((-A)*(a + (1 - a)*(1 - t))*(2 - t) -
> (1 - a)*(1 - t)^2 + A*a*(1 - t))*k^(2*a - 1) +
> A*c^2*(A*(a + (1 - a)*(1 - t)) + (1 - a)*(1 - t) -
> A*a*(1 - t))*k^(a - 1) + A^2*r*c^2
>
> In[25]:= rexpr = Rationalize[expr, 0]
>
> Out[25]=
> c^2/10 + (6375024143593*c^2)/(3703618114621*k^(9/10)) -
> (388844671178*c)/(3636250307*k^(4/5)) +
> 307126999725/(197967319*k^(7/10)) -
> (165668129149671*c*k^(1/10))/40210710958658
>
> Now convert to a Laurent polynomial (only integer powers) by removing
> the denominator power in k.
>
> In[37]:= rexpr2 = PowerExpand[rexpr /. k -> l^10]
>
> Out[37]=
> c^2/10 + (6375024143593*c^2)/(3703618114621*l^9) -
> (388844671178*c)/(3636250307*l^8) +
> 307126999725/(197967319*l^7) - (165668129149671*c*l)/
> 40210710958658
>
> We can recover an implicit polynomial by eliminating l from the system
> {rexpr2,l^10-k}.
>
> imppoly =
> First[GroebnerBasis[{rexpr2, l^10 - k}, {c, k}, l,
> MonomialOrder -> EliminationOrder]]
>
> The resulting polynomial will be quite resistant to direct use of
> ImplicitPlot because the coefficients are too large to find zeros via
> e.g. subdivision with machine arithmetic. I get what appears to be a
> reasonable result from rescaling numerically as below.
>
> In[75]:= imppoly2 = N[Expand[imppoly/10^450]]
>
> Out[75]=
> -0.44710407299089117*c^20 + 3.6929000651811335*^15*c^10*k -
> 5.435249465194847*c^19*k - 1.5816021229154092*^29*k^2 +
> 5.590311570192779*^16*c^9*k^2 - 23.71722762253775*c^18*k^2 +
> 2.8406692481577024*^17*c^8*k^3 - 43.059424056179864*c^17*k^3 +
> 5.701837604927303*^17*c^7*k^4 - 28.130472729642648*c^16*k^4 +
> 3.901760263753945*^17*c^6*k^5 - 2.2597182065813595*c^15*k^5 +
> 4.17821551222496*^16*c^5*k^6 - 3.1477095526033976*c^14*k^6 +
> 13.931088647720639*c^13*k^7 - 61.13817833192989*c^12*k^8 +
> 266.15182908720067*c^11*k^9 + 1.9581785245917768*^-13*c^20*
> k^9 - 2759.462163976083*c^10*k^10
>
> That is, the plot one might obtain as below gives something visually
> similar to what I saw with the implicit plot of expr. But it has a new
> graphical component (though not a distinct algebraic component,
> because
> the polynomial is irreducible). I would guess this corresponds to
> "parasite" solutions when one goes back to the radical formulation of
> the implicit equation.
>
> ImplicitPlot[imppoly2 == 0, {k, 0.1, 100}, {c, 5, 80}]
>
>
> Daniel Lichtblau
> Wolfram Research
>


Pratik Desai

2005-11-25, 3:59 am


Peter Pein wrote:

>JikaiRF@aol.com schrieb:
>
>
>
>Hello,
>
>when you specify only one range in ImplicitPlot, Mathematica tries to
>solve the equation before plotting. When you give the ranges of k _and_
>c, then another Algorithm will be used. I'm afraid, Mathematica tries to
>solve w.r.t. k. Otherwise the answer should come almost instantly.
>
>In[1]:= L = 48; a = 1/10; A = 1; r = 1/10; t = 5/108;
>eqn = FullSimplify[
> A*r*L*(1 - a)*(1 - t)*c*k^a ==
> (a + (1 - a)*(1 - t))*L^2*(1 - a)^2*(1 - t)^3*k^(3*a - 1) +
> L*(1 - a)*c*(1 - t)*((-A)*(a + (1 - a)*(1 - t))*(2 - t) -
> (1 - a)*(1 - t)^2 + A*a*(1 - t))*k^(2*a - 1) +
> A*c^2*(A*(a + (1 - a)*(1 - t)) + (1 - a)*(1 - t) -
> A*a*(1 - t))*k^(a - 1) + A^2*r*c^2,
> k > 0]
>Out[2]=
>103*c*(16819*k^(1/10) + 648*k) ==
> 15*c^2*(1859 + 108*k^(9/10)) + 25132721*k^(1/5)
>
>In[3]:=
>First[Timing[ImplicitPlot[eqn, {k, 0.8, 1.2}, {c, 0, 50},
> PlotPoints -> 300, ImageSize -> 500, AspectRatio ->
> GoldenRatio - 1]]]
>[plot omitted]
>Out[3]= 0.234*Second
>
>And don't be afraid; if you did not overclock your hardware,
>long-lasting calculations will not do any harm to your machine.
>
>

But I have found instances where the notebook becomes corrupted.
Especially when the code involves graphics

Pratik

>Rumors were afloat, some companies use their computers 24 hours/day ;-)
>
>Regards,
> Peter
>
>
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com