MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Unhandled Memory Fault

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg1509] Re: Unhandled Memory Fault
  • From: withoff (David Withoff)
  • Date: Tue, 20 Jun 1995 02:47:46 -0400
  • Organization: Wolfram Research, Inc.

In article <3rqk74$hs3 at news0.cybernetics.net> edg at wam.umd.edu writes:
>In <3rn5c2$acd at news0.cybernetics.net>, withoff at wri.com (David Withoff) writes:
>>>ITable = 
>>>  Table[
>>>	Clear[Vm];
>>>	Clear[Kt];
>>>	Clear[Invt];
>>>	Vm[K_,t_]:= Vm[K,t] = 
>>>      		Module[{Inv},
>>>  	  	P Inv + g Inv^2 + b Vm[K + Inv,t+1] /.
>>>  	  	Solve[D[P Inv + g Inv^2 + 
>>>	         	b Vm[K + Inv,t+1],Inv]==0,Inv][[1]]];
>>>	Vm[K_,z]:= P (Kbar - K) + g (Kbar - K)^2;
>>>	Table[{Invt[b_,g_,K_,Kbar_,P_,t_]:= 
>>>       		Invt[b,g,K,Kbar,P,t] = Inv /.
>>>       		Solve[D[P Inv + g Inv^2 +
>>>  	      		b Vm[K + Inv,t+1],Inv]==0,Inv][[1]]},{t,0,z-1}];
>>>	Kt[0]:= 0;
>>>	Kt[t_]:= Kt[t] = Invt[b,g,Kt[t-1],Kbar,P,t-1] + Kt[t-1];
>>>	Invt[b,g,Kt[z],Kbar,P,z]:= Kbar - Kt[z];
>>>	Table[{Invt[b,g,Kt[t],Kbar,P,t]}[[1]],{t,0,z}]
>>>,{z,1,6}]
>>
>>My guess is that the equations are so large that the Solve
>>function causes the computer to run out of memory.  
>
>Is it possible to run out of memory on such a calculation when 300 meg of 
>virtual memory is available?

Yes.  I could elaborate on that by digging around in the internal
algorithms, but the answer would still be yes.  Symbolic manipulations
with large expressions will often quite correctly use more memory
than any realistic computer.

>>In examples like this where the coefficients are huge, but
>>the equation is of the form a x + b == 0, I would be inclined
>>to extract the coefficients a and b from the equation and
>>write my own program to construct the answer (which I can
>>work out in my head), rather than sending the equation off
>>to Solve, where the problem may get bogged down in machinery
>>that is intended for much more complicated equations.
>
>Unfortunately, since the problem is recursive, the "coefficients" will not
>be the same every time...or am I missing something here?

It doesn't matter whether the coefficients are the same every time.
Since you know that the equations are linear, you can expand to
get something of the form c0 + c1 x == 0, substitute x->0 to
get c0, subtract c0 and substitute x->1 to get c1, and construct
the answer -c0/c1 yourself, thereby avoiding Solve.

>Ezra D. Greenberg 
>Department of Economics
>University of Maryland at College Park
>edg at wam.umd.edu

Dave Withoff


  • Prev by Date: Download from Mathsource
  • Next by Date: Rule writing for handling temperatures
  • Previous by thread: Re: Re: Download from Mathsource
  • Next by thread: Rule writing for handling temperatures