MathGroup Archive 2006

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

Search the Archive

does the following code shut down anyone else's kernel? - why?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69729] does the following code shut down anyone else's kernel? - why?
  • From: "Chris Chiasson" <chris at chiasson.name>
  • Date: Thu, 21 Sep 2006 07:32:09 -0400 (EDT)

(MakeBoxes[#1,_]=#2)&@@@{{SectionModulus,"I"},{YoungsModulus,"E"},{Meter,
        "m"},{Newton,"N"}};

$Assumptions=#>0&/@{Newton,X,Meter,YoungsModulus,SectionModulus};

$UnitList={{X,Meter},{F,Newton},{P,Newton}};

deUnitizeVariablesRep=#\[Rule]Times[##]&@@@$UnitList;

unitizeVariablesRep=#\[Rule]Divide[##]&@@@$UnitList;

dropSIUnitsRep={Meter\[Rule]1,Newton\[Rule]1};

numbersToMachinePrecisionRep=
    x_Real\[RuleDelayed]SetPrecision[x,MachinePrecision];

cm=Centi*Meter;

Format[F[a_]]=Subscript[F,a];

rep[1]={H\[Rule]25.0``1 cm,L\[Rule]250.0``1 cm,A\[Rule]25.0``1 cm^2,
      SectionModulus\[Rule]750.0``1 cm^4,
      YoungsModulus\[Rule]70``0 Giga Pascal};

rep[2]={Centi\[Rule]1/100,Giga\[Rule]10^9,Pascal\[Rule]Newton/Meter^2};

eqn[1]=F[1]\[Equal]A YoungsModulus (1-Sqrt[1+(X^2-2 H X)/L^2]);

eqn[2]=F[cr]\[Equal]Pi^2*YoungsModulus*SectionModulus/L^2;

eqn[3]=F\[Equal]Min[eqn[1][[2]],eqn[2][[2]]];

eqn[4]=P\[Equal](H-X)*F/Sqrt[L^2+X^2-2*H*X];

blah[1][X_]=
  eqn[4][[2]]/.Rule@@eqn[3]/.rep[1]/.rep[2]/.deUnitizeVariablesRep//
      PiecewiseExpand//FullSimplify


(very quick) result of last command:

No more memory available.
Mathematica kernel has shut down.
Try quitting other applications and then retry.


-- 
http://chris.chiasson.name/


  • Prev by Date: Re: How to delete a row and a column in a matrix?
  • Next by Date: Re: Split a file into multiple files using a pattern
  • Previous by thread: Re: question about NDelayDSolve
  • Next by thread: Re: does the following code shut down anyone else's kernel? - why?