Wolfram 언어

풍부한 Knowledgebase 액세스

특수 함수 파생 네트워크

Wolfram 언어는 300개 이상의 내장된 수학 함수를 포함하고 있습니다. 이러한 함수 각각에 미분 조작을 적용하는 것을 고려해봅니다. 대부분의 경우, 미분의 결과로 하나 이상의 새로운 함수가 나타납니다. 연결의 수량화는 그들에 대한 기호와 조작의 관계에 관한 흥미로운 연구가 될 것입니다. 특히, 다음의 예는 저차원 미분에서 발생한 네트워크에서 파생하였습니다.

초등 미분에서 학습한것처럼, 자연 로그의 미분은 역함수를 제공합니다.

In[1]:=
Click for copyable input
D[Log[x], x]
Out[1]=

한편, 어떤 함수는 원래 함수를 통해 도함수를 직접 표현할 수 있습니다.

In[2]:=
Click for copyable input
D[ProductLog[x], x]
Out[2]=

MathematicalFunctionData"LowOrderDerivatives" 특성은 모든 도함수에 신속하고 간편한 엑세스를 제공합니다.

In[3]:=
Click for copyable input
Entity["MathematicalFunction", "EllipticF"][ EntityProperty["MathematicalFunction", "LowOrderDerivatives"]] // TraditionalForm
Out[3]//TraditionalForm=

미분 후 함수를 식별하기 위해 모든 함수와 그의 인수 패턴을 수집합니다. (흔히 나타나는 거듭 제곱을 피하기 위해 거듭 제곱 함수와 평방근 함수는 무시합니다). 예를 들어, 항등식 sec^'(x)=tan(x) sec(x)를 기반으로, 함수 Sec 함수는 Tan과 자신을 포함, 결과적으로 둘은 연결됩니다.

전체 Wolfram 언어 입력 표시하기
In[4]:=
Click for copyable input
allFunctions = DeleteCases[MathematicalFunctionData[], Entity["MathematicalFunction", "Sqrt"] | Entity["MathematicalFunction", "Power"]];
In[5]:=
Click for copyable input
patts = EntityValue[allFunctions, EntityProperty["MathematicalFunction", "ArgumentPattern"]];
In[6]:=
Click for copyable input
toPattern[p_] := Activate[Hold @@ { p /. Verbatim[PatternTest][a_, b_] :> a /. Verbatim[Alternatives][a_, __] :> a /. Verbatim[Blank][_] :> _}]
In[7]:=
Click for copyable input
pairs = {#1, toPattern[#2]} & @@@ Transpose[{allFunctions, patts}];
In[8]:=
Click for copyable input
(identify[#2] = #1) & @@@ pairs;
In[9]:=
Click for copyable input
makeConnection[f1_, id_] := Module[{indices, heldSubexpressions, f2List, \[ScriptCapitalF]\[GothicCapitalF]}, indices = Quiet[Cases[ MapIndexed[\[ScriptCapitalF]\[GothicCapitalF], id, {0, \[Infinity]}], _\[ScriptCapitalF]\[GothicCapitalF], \ \[Infinity]][[All, -1]]]; heldSubexpressions = Union[Extract[id, indices, Hold]]; f2List = Union[Last /@ DeleteCases[({#1, identify[#1]} & /@ heldSubexpressions), {_, _identify}]]; {f1 \[DirectedEdge] #, id /. HoldPattern[Function[_, Inactivate[x_]]] :> HoldForm[x]} & /@ f2List]
In[10]:=
Click for copyable input
makeConnection[Entity["MathematicalFunction", "Sec"] , Function[{x}, Inactivate[D[Sec[x], x] == Sec[x] Tan[x]]]]
Out[10]=

모든 도함수를 분석하고, 자명한 셀프 루프는 모든 결과의 그래프에서 제외하여 결과의 그래프 구조를 시각화합니다.

전체 Wolfram 언어 입력 표시하기
In[11]:=
Click for copyable input
\[Lambda]F = Length[allFunctions]; Monitor[ allConnections = Table[ fD = allFunctions[[\[ScriptJ]]]; derivatives = Activate[ allFunctions[[\[ScriptJ]]][ EntityProperty["MathematicalFunction", "LowOrderDerivatives"]] /. HoldPattern[Power[E, z_]] :> Exp[z]]; connections = If[derivatives === Missing["NotAvailable"], {}, {#[[1, 1]], SortBy[#[[All, -1]], LeafCount]} & /@ GatherBy[ Flatten[makeConnection[fD, #] & /@ derivatives, 1] // Union, First]], {\[ScriptJ], \[Lambda]F}];, Row[{"function ", \[ScriptJ], " of ", \[Lambda]F, ": ", fD}]];
In[12]:=
Click for copyable input
gr = Graph[Flatten[allConnections, 1][[All, 1]]]
Out[12]=

연결 수를 셉니다.

In[13]:=
Click for copyable input
Flatten[allConnections, 1] // Length
Out[13]=

셀프 루프를 구합니다.

In[14]:=
Click for copyable input
selfLoops = Select[ConnectedComponents[ Graph[Flatten[allConnections /. DirectedEdge -> UndirectedEdge, 1][[All, 1]]]], Length[#] == 1 &]
Out[14]=

미분에서 닫혀있는 함수군을 찾고 레이블이있는 그래프로 시각화합니다.

전체 Wolfram 언어 입력 표시하기
In[15]:=
Click for copyable input
smallLoops = Select[ConnectedComponents[ Graph[Flatten[allConnections /. DirectedEdge -> UndirectedEdge, 1][[All, 1]]]], 1 < Length[#] < 20 &];
In[16]:=
Click for copyable input
Graph[Select[Flatten[allConnections, 1], MemberQ[#, Alternatives @@ Flatten[smallLoops], \[Infinity]] &][[ All, 1]], VertexLabels -> ((# -> MapAt[Nothing &, CommonName[#], {{1, 1}}]) & /@ Union[Flatten[smallLoops]])]
Out[16]=

대부분의 함수는 그래프의 거대한 성분의 일부입니다. 정점에 마우스를 가져가면 함수가, 옆 부분으로 이동하면 함수를 연결하는 도함수가 보입니다.

In[17]:=
Click for copyable input
allConnectionsRest = Select[Flatten[allConnections, 1], FreeQ[#, Alternatives @@ Flatten[{selfLoops, smallLoops}], \[Infinity]] &];
In[18]:=
Click for copyable input
grf = Graph[allConnectionsRest[[All, 1]], VertexLabels -> Placed["Name", Tooltip], EdgeLabels -> ((#1 -> Tooltip[" ", Column[#2]]) & @@@ allConnectionsRest), PerformanceGoal -> "Quality", ImageSize -> Full]
Out[18]=

그래프를 커뮤니티에 분할하여 타원 함수, 초기하 함수, 창 함수, 제타 함수 등 여러 함수를 나타냅니다.

In[19]:=
Click for copyable input
CommunityGraphPlot[grf, FindGraphCommunities[grf, Method -> "Modularity"]]
Out[19]=

관련 예제

de en es fr ja pt-br ru zh