Re: does the following code shut down anyone else's kernel? - why?
- To: mathgroup at smc.vnet.net
- Subject: [mg69740] Re: does the following code shut down anyone else's kernel? - why?
- From: p-valko at tamu.edu
- Date: Fri, 22 Sep 2006 01:04:08 -0400 (EDT)
- References: <eetvtn$b46$1@smc.vnet.net>
I have not tried the code whether it shuts down the kernel, but first I would recommend to change MachinePrecision to $MachinePrecision in the numbersToMachinePrecisionRep function. P. Chris Chiasson wrote: > (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/