DMUG-Archiv 2006

Frühere

 

Chronologischer Index

 

Spätere

Vorherige

 

Thematischer Index

 

Nächste

Erf für große Zahlen

Hallo,

Erf[x>6]=1.

Leider spinnt MMA manchmal, wenn für sehr große Zahlen die Erf berechnet werden soll:

Plot[Erf[n], {n, -10, 100000}, Frame -> True,  PlotRange -> All]

Dann hilft

Errorfunktion[(z_)?NumericQ] := If[Abs[z] > 6, Sign[z], Erf[z]];
Errorfunktion[(z0_)?NumericQ, (z1_)?NumericQ] := Errorfunktion[z1] - Errorfunktion[z0]; Plot[{Erf[n], 1.025*Errorfunktion[n]}, {n, -6, 6}, Frame -> True, PlotRange -> All]
Plot[{Errorfunktion[n]}, {n, -6, 60000}, Frame -> True, PlotRange -> All]

Diese "eigene" Errorfunktion würde ich gerne im Rahmen einer Unprotect[Erf] Protect[Erf] Definition in die Erf einbauen, was aber in einer unendliche Iteration endet:

Unprotect[Erf]
Erf[(z_)?NumericQ] := If[Abs[z] > 6, Sign[z], Erf[z]];
Protect[Erf]
Erf[8]

In[45]:=
N[Erf[2]]
$IterationLimit::"itlim":"Iteration limit of \!\(4096\) exceeded. \!\(\*ButtonBox[\"Mehr\[Ellipsis]\", ButtonStyle->\"RefGuideLinkText\", ButtonFrame->None, ButtonData:>\"$IterationLimit::itlim\"]\)"

Hold[Erf[2.]]

Was mach ich Falsch?

Gruß

Peter


Antworten:
Re: Erf für grosse Zahlen
Udo und Susanne Krause, 01.01.2006

Frühere

 

Chronologischer Index

 

Spätere

Vorherige

 

Thematischer Index

 

Nächste

DMUG-Archiv, http://www.mathematica.ch/dmug-liste.html; Letzte Änderung: 07.01.2006 10:09