|
Sehr geehrter Herr Hoelzl, Sie schrieben: > Ich habe herausgefunden, warum die Ausgabe von NodalAnalyze nicht mehr > ganz funktioniert: > > Das Ergebnis von NodalAnalyze ist eine Expression mit Head NodalAnalysis. > > NodMat.m enthaelt zwei Format[] fuer NodalAnalysis, > wobei nur die zweite angewendet wird (MMA-2.2 verwendete beide): > Format[NodalAnalysis[y_,x___]] := TableForm[ Prepend[N[y,3], Label /. {x}]] > Format[NodalAnalysis[y_,x___]] := y[[1,2]] /; SameQ[Dimensions[y],{1,2}] > > ?NodalAnalysis zeigt beide Format[] aber nur ein entsprechendes MakeBoxes[]: > MakeBoxes[NodalAnalysis[y_, x___], FormatType_] ^:= > Format[y[[1,2]] /; Dimensions[y] === {1, 2}, FormatType] > > Wie kann man beide Format[] aktivieren ? Ich habe die Frage an Tom Wickham-Jones, den Verantwortlichen für die Formatierung bei Wolfram Research weitergeleitet. Er antwortete: > A simple workaround is to put the condition in the lhs of the rule. > I'm investigating why this is necessary. D.h. also Format[NodalAnalysis[y_,x___]] := TableForm[ Prepend[N[y,3], Label /. {x}]] Format[NodalAnalysis[y_ /; SameQ[Dimensions[y],{1,2}],x___]] := y[[1,2]] Es handelt sich wohl um einen Bug bei der Umsetzung der alten Version 2 Format-Befehle in die neuen Version 3 MakeBoxes-Befehle. Damit erhält man dann In[3]:= ?NodalAnalysis MakeBoxes[NodalAnalysis[y_ /; Dimensions[y] === {1, 2}, x___], FormatType_] ^:= Format[y[[1,2]], FormatType] MakeBoxes[NodalAnalysis[y_, x___], FormatType_] ^:= Format[TableForm[Prepend[N[y, 3], Label /. {x}]], FormatType] Format[NodalAnalysis[y_ /; Dimensions[y] === {1, 2}, x___]] := y[[1,2]] Format[NodalAnalysis[y_, x___]] := TableForm[Prepend[N[y, 3], Label /. {x}]] Ich empfehle Ihnen also, die entsprechenden Zeilen im Nodal-Paket so abzuändern. mit freundlichen Grüßen, Roman Mäder |