|
Lieber Albert Faessler, ich habe ein notebook angehaengt ("comcon.ma", mit Mma 2.2 fuer RISC6000 erstellt), in dem Sie Funktionen fuer komplexe Konjugation u.ae. finden. Die Funktion ReImDecompose sollte Ihren Zweck erfuellen. Der Unterschied zum ReIm Package ist, dass nur komplexe Variablen speziell als solche erklaert werden muessen, zum Beispiel als Paar {z,zbar}, alle Symbole ansonsten als reell behandelt werden. Mit freundlichem Gruss, Ludger Hannibal Fachbereich Physik der Carl von Ossietzky Universitaet Oldenburg mailto://hannibal@XXXXXXX.de http://www.physik.uni-oldenburg.de/Docs/theo2/hannibal.html (*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "X Window System Mathematica Notebook Front End Version 2.2"; X11StandardFontEncoding; fontset = title, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 48, fontName, "times"; fontset = subtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 36, fontName, "times"; fontset = subsubtitle, inactive, noPageBreakBelow, noPageBreakInGroup, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 24, fontName, "times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M31, bold, a20, 36, fontName, "times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M24, bold, a15, 24, fontName, "times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M21, bold, a12, 18, fontName, "times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 24, fontName, "times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 18, fontName, "times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, 24, fontName, "courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 24, fontName, "courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 24, fontName, "courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 24, fontName, "courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, 24, fontName, "courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 24, fontName, "courier"; fontset = name, inactive, noPageBreakInGroup, nohscroll, preserveAspect, M7, italic, B65535, 18, fontName, "times"; fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 12, fontName, "times"; fontset = leftheader, 12, fontName, "times"; fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, italic, 12, fontName, "times"; fontset = leftfooter, 12, fontName, "times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 18, fontName, "times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 18, fontName, "times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 18, fontName, "courier"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, fontName, "times";paletteColors = 128; automaticGrouping; currentKernel; ] :[font = input; initialization; preserveAspect] *) ComplexPair[a_]:=( If[MatchQ[Head[a],List] && Length[a]==2 && MatchQ[Head[a[[1]]],Symbol] && MatchQ[Head[a[[2]]],Symbol] && !MatchQ[a[[1]],a[[2]]], If[MatchQ[Head[ComplexSymbols],List], AppendTo[ComplexSymbols,a], ComplexSymbols={a}], Print[a," is not a pair of type {symbol1, symbol2} "] ];ComplexSymbols) (* :[font = input; initialization; preserveAspect] *) ComplexPair[a_,b__]:=(ComplexPair[a];ComplexPair[b]; ComplexSymbols) (* :[font = input; initialization; preserveAspect; startGroup] *) ComplexPair::usage="ComplexPair[{s1,s2},{t1,t2},...] adds pairs of symbols to the list ComplexSymbols of symbols which are recognized as complex by ComplexConjugate. " (* :[font = output; output; inactive; preserveAspect; endGroup] "ComplexPair[{s1,s2},{t1,t2},...] adds pairs of symbols\ to the list ComplexSymbols of symbols which are\ recognized as complex by ComplexConjugate. " ;[o] ComplexPair[{s1,s2},{t1,t2},...] adds pairs of symbols to\ the list ComplexSymbols of symbols which are recognized\ as complex by ComplexConjugate. :[font = input; preserveAspect; startGroup] ComplexPair[{a,b},{c,d}] :[font = output; output; inactive; preserveAspect; endGroup] {{a, b}, {c, d}} ;[o] {{a, b}, {c, d}} :[font = input; preserveAspect; startGroup] ComplexPair[x,{v},{i,i}] :[font = print; inactive; preserveAspect] x is not a pair of type {symbol1, symbol2} {v} is not a pair of type {symbol1, symbol2} {i, i} is not a pair of type {symbol1, symbol2} :[font = output; output; inactive; preserveAspect; endGroup] {{a, b}, {c, d}} ;[o] {{a, b}, {c, d}} :[font = input; preserveAspect] :[font = input; initialization; preserveAspect] *) ComplexConjugate[expr_]:= If[MatchQ[Head[ComplexSymbols],List], expr/. Join[{Complex[u_,v_]->Complex[u,-v]}, Map[# /. List->Rule &,ComplexSymbols], Map[# /. List->Rule &,Map[Reverse,ComplexSymbols]] ], expr/. Complex[u_,v_]->Complex[u,-v] ] (* :[font = input; initialization; preserveAspect] *) RealPart[x_]:=Simplify[ 1/2 x +1/2 ComplexConjugate[x]] (* :[font = input; initialization; preserveAspect] *) ImaginaryPart[x_]:=Simplify[1/2/I x - 1/2/I ComplexConjugate[x]] (* :[font = input; preserveAspect; startGroup] f=a/(1+2 I b/(1+2 I a)) :[font = output; output; inactive; preserveAspect; endGroup] a/(1 + (2*I*b)/(1 + 2*I*a)) ;[o] a ------------- 2 I b 1 + --------- 1 + 2 I a :[font = input; preserveAspect; startGroup] ComplexConjugate[f] :[font = output; output; inactive; preserveAspect; endGroup] a/(1 - (2*I*b)/(1 - 2*I*a)) ;[o] a ------------- 2 I b 1 - --------- 1 - 2 I a :[font = input; preserveAspect; startGroup] RealPart[f] :[font = output; output; inactive; preserveAspect; endGroup] (a*(1 + 4*a^2 + 4*a*b))/(1 + 4*a^2 + 8*a*b + 4*b^2) ;[o] 2 a (1 + 4 a + 4 a b) ----------------------- 2 2 1 + 4 a + 8 a b + 4 b :[font = input; preserveAspect; startGroup] ImaginaryPart[f] :[font = output; output; inactive; preserveAspect; endGroup] (-2*a*b)/(1 + 4*a^2 + 8*a*b + 4*b^2) ;[o] -2 a b ----------------------- 2 2 1 + 4 a + 8 a b + 4 b :[font = input; initialization; preserveAspect] *) ReImDecompose[x_]:=RealPart[x]+I ImaginaryPart[x] (* :[font = input; preserveAspect; startGroup] ReImDecompose[f] :[font = output; output; inactive; preserveAspect; endGroup] (-2*I*a*b)/(1 + 4*a^2 + 8*a*b + 4*b^2) + (a*(1 + 4*a^2 + 4*a*b))/(1 + 4*a^2 + 8*a*b + 4*b^2) ;[o] 2 -2 I a b a (1 + 4 a + 4 a b) ----------------------- + ----------------------- 2 2 2 2 1 + 4 a + 8 a b + 4 b 1 + 4 a + 8 a b + 4 b ^*) |