What’s New in Mathematical Computation?

Devendra Kapadia
Wolfram Research

(RowDefault[, (Spacer1), , (Spacer1), ])  #WolframTechConf

Plan for the Talk

I will discuss new developments related to the following areas:

Game Theory

Symbolic Matrix Algebra

PDE Modeling

Core Calculus

GPU Computation

Books and Courses

Matrix Games

In 14.2, MatrixGame specifies a simultaneous move or one-shot game.

Define a 2-player zero-sum game:

game=MatrixGame[{{3,-5},{2,4}}]

Dataset for the game:

game["Dataset"]

Plot the game:

MatrixGamePlot[game]

Solve the game:

FindMatrixGameStrategies[game]

Verify the result:

VerifyMatrixGameStrategy[game,%[[1]]]

Compute the expected payoffs :

MatrixGamePayoff[game,%%[[1]]]

Tree Games

TreeGame specifies a sequential move game or a game tree.

Define a 2-player tree game:

game=TreeGame[{"A",{"B",{2,2},{1,3}},{"B",{-3,2},{4,3/2}}}]

Plot the game:

TreeGamePlot[game]

Solve the game:

FindTreeGameStrategies[game]

Verify the result:

VerifyTreeGameStrategy[game,%[[1]]]

Compute the expected payoffs :

TreeGamePayoff[game,%%[[1]]]

Predefined Games

GameTheoryData includes a collection of around 50 classic games:

GameTheoryData[]//Text

Let’s pick rock paper scissors:

Obtain a description of the game:

GameTheoryData["RockPaperScissors","Description"]

Find a source for the game:

GameTheoryData["RockPaperScissors","Source"]

Classify the game:

GameTheoryData["RockPaperScissors","Classes"]

Obtain a MatrixGame representation:

game=GameTheoryData["RockPaperScissors"]

The new functionality provides useful tools for learning Game Theory.

Array Algebra

Version 14.2 includes three new functions for doing array algebra.

ComponentExpand returns a component-wise expression:

ComponentExpand[v\[Cross]w,(v|w)∈Vectors[3]]

ArrayExpand is the analog of Expand for array operations:

ArrayExpand[(a+b).(c+d)]

ArraySimplify is the analog of Simplify for array operations:

ArraySimplify[%]

Symbolic Matrix Algebra

Version 14.2 is equipped with a large number of matrix identities.

Inverse:

ArrayExpand[(Inverse[((Inverse[a]))])]

Transpose:

ArrayExpand[(Transpose[(a.b.c)]),(a|b|c)∈Matrices[{n,n}]]

ArraySimplify[%,(a|b|c)∈Matrices[{n,n}]]

MatrixExp:

ArrayExpand[Det[MatrixExp[a]]]

This feature has been frequently requested by users.

PDE Modeling

Version 14.2 includes new functionality for modeling magnetic fields.

For example, let’s model a 3D cylindrical permanent magnet.

Set up the variables:

vars={Vm[x,y,z],{x,y,z}};

Define the magnet region:

magnet=Cylinder[{{0,0,-1/10},{0,0,1/10}},1/10];

Define the magnetization vector:

pars=<|"Magnetization"->{0,0,Piecewise[{{1*^5,RegionMember[magnet][{x,y,z}]}},0]}|>;

Set up a sphere of air of large radius for the surrounding volume:

mesh=;

Visualize the magnet inside the mesh:

Show[]

Set up the magnetostatIc PDE component:

op=MagnetostaticPDEComponent[vars,pars];

Set up boundary conditions:

(Subscript[Γ, p])=MagneticPotentialCondition[x^2+y^2+z^2>=2^2,vars,pars]

Solve the PDE:

VmFun=NDSolveValue[{op==0,(Subscript[Γ, p])},Vm,{x,y,z}∈mesh]

Visualize the magnetic field:

Show[,]

Array Calculus

Support for symbolic arrays has been added to 12 calculus functions.

For example, compute a line integral:

LineIntegrate[(VectorSymbol1["x"]).(VectorSymbol1["x"]),(VectorSymbol1["x"])∈Line[{{0,0},{0,1}}]]

Solve a system of ODEs:

(A={{0,1},{-1,0}})//MatrixForm

DSolve[{(VectorSymbol2["x", 2])'[t]==A.(VectorSymbol2["x", 2])[t],(VectorSymbol2["x", 2])[0]=={1,1}}, (VectorSymbol2["x", 2])[t],t]

SumConvergence

In 14.1, SumConvergence analyzed only the end behavior of sums:

SumConvergence[1/n^2,n]

In 14.2, one can also specify the interval of summation:

SumConvergence[1/n^2,{n,1,∞}]

SumConvergence[1/n^2,{n,0,∞}]

SumConvergence[1/n^2,{n,a,∞}]

This feature was suggested by experience from Wolfram|Alpha.

Fourier Transforms

14.2 adds support for numerical computation of Fourier transforms

Significant updates have been made for the related  documentation.

Further improvements for these functions are planned in the near future.

GPU Computation

A significant effort is being made to use GPU acceleration in our solvers.

The following plots show a performance comparison for LinearSolve:

RTX 4090 versus  2 x Xeon 4410T == 20 “Sapphire Rapids” cores with hyper-threading.

Comparing LinearSolve[a,x,Method->"Direct"] to LinearSolve[aGPU,xGPU] in matrix-vector case.

Books and Courses

A print/Kindle version of our Calculus e-book was published in July 2024.

The online Complex Analysis course went live recently.

Future topics include Laplace transforms, special functions, PDEs, etc.

Thank you!