(Some) New Computations in the Forthcoming Wolfram Language

Jon McLoone, Wolfram Research

Join the Conversation #WolframTechConf

A New Kind of Computation?

st="Subsubsection";
nonItem=Item["",Frame->{{True,True},{False,False}}];
h1={Style["Symbolic Computation",st,Black],Item[Style["vs",st,Black],Frame->{{True,True},{False,False}}],Style["Numeric Computation",st,Black]};
h2=Style[#,st,Black]&/@{"Symbolic Computation","Asymptotic Computation","Numeric Computation"};
Magnify[#,1]&@FlipView[{TextGrid[{h1,
{"Exact results",nonItem,"Approximate results"},
{"Model",nonItem,"Single value"},
{"Solve, Sum, DSolve etc",nonItem,"FindRoot, NSum, NDSolve etc"}},ItemSize->{Scaled[1/3],Automatic},FrameStyle->LightGray,Frame->All,Alignment->{Center,Automatic}],
TextGrid[{h2,
{"Exact results","Approximate results","Approximate results"},
{"Model","Model","Single value"},
{"Solve, Sum, DSolve, etc","AsymptoticSolve, AsymptoticSum, AsymptoticDSolve, etc","FindRoot, NSum, NDSolve, etc"}},ItemSize->{Scaled[1/3],Automatic},FrameStyle->LightGray,Frame->All,Alignment->Center]}]

A New Kind of Computation?

New: AsymptoticSolve, AsymptoticSum and AsymptoticRSolveValue

Style[Multicolumn[Names["Asymptotic*"],Dividers->{{{Lighter[Gray,.5]},Darker[Gray,.6]},{Darker[Gray,.6],{False},Darker[Gray,.6]}},Frame->Darker[Gray,.6],ItemStyle->14,Spacings->{Automatic,.8},
Background->{None,{{White,Lighter[Blend[{Blue,Green}],.8]}}}],Magnification->1.2]

Example: AsymptoticSolve

Solve[(E^y)-Cos[x y]+x==0,{x,y}]

With[{x=0.1},FindRoot[(E^y)-Cos[x y]+x==0,{y,0}]]

soln=AsymptoticSolve[(E^y)-Cos[x y]+x==0,{y,0},{x,0,7}]

soln/.x->0.1

Plot[y/.soln,{x,-1,1}]

Quadratic Optimization

New solvers, plugin mechanism and low-level interface

QuadraticOptimization, SecondOrderConeOptimization, SemidefiniteOptimization, ConicOptimization, LinearFractionalOptimization...

QuadraticOptimization[2 ((Subscript[x, 1])^2)+ 20((Subscript[x, 2])^2)+6 (Subscript[x, 1])(Subscript[x, 2])+5(Subscript[x, 1]),{(Subscript[x, 2])-(Subscript[x, 1])≥ 2},{(Subscript[x, 1]),(Subscript[x, 2])}]

Typically used via FindRoot and FindMinimum

FindMinimum[{2 ((Subscript[x, 1])^2)+ 20((Subscript[x, 2])^2)+6 (Subscript[x, 1])(Subscript[x, 2])+5(Subscript[x, 1]),(Subscript[x, 2])-(Subscript[x, 1])≥ 2},{(Subscript[x, 1]),(Subscript[x, 2])}]

Direct interface provides additional information

QuadraticOptimization[2 ((Subscript[x, 1])^2)+ 20((Subscript[x, 2])^2)+6 (Subscript[x, 1])(Subscript[x, 2])+5(Subscript[x, 1]),{(Subscript[x, 2])-(Subscript[x, 1])≥ 2},{(Subscript[x, 1]),(Subscript[x, 2])},"DualMaximizer"]

Audio Machine Learning

DynamicModule[{recording,text="",mode="Listen",wa=""},
Column[{
Button[Dynamic[mode],

If[mode==="Listen",
mode="Stop";recording=AudioRecord[],
mode="Listen";AudioStop[recording];
text=SpeechRecognize[Audio[recording]];
AudioPlay[SpeechSynthesize[text]];
wa=WolframAlpha[text]
],Method->"Queued"],
Dynamic[Style[Text[text],20]],
Dynamic[wa]
}]]

Text analysis

TextCases[ExampleData[{"Text", "AliceInWonderland"}], "Sentence"]

aliceWords[type_]:={type, Union@TextCases[ExampleData[{"Text", "AliceInWonderland"}], type]};

Grid[ aliceWords/@ {"Numeral","FoodType","MeasurementDevice", "Volcano","WolframLanguageSymbol"},Frame->All,FrameStyle->LightGray]

Keys@$TextCasesTypes

Polygons

showPolygon[poly_]:=Graphics[{EdgeForm[Black],LightBlue,poly}];

RandomPolygon[10]//showPolygon

Polygon[RandomReal[1,{10,2}]]//showPolygon

Polygons

Construction

CrossingPolygon, WindingPolygon

Polygon[{{0,0},{1,0},{0.7,0.8},{0,1}}->{{0.25,0.25},{0.6,0.2},{0.2,0.7}}]//showPolygon

Polygons

Properties & measures

SimplePolygonQ, ConvexPolygonQ, MonotonePolygonQ
Area, Perimeter

Polygons

Decomposition

PolygonDeomposition, InnerPolygon, OuterPolygon, CanonicalPolygon

lhs=Graphics[{EdgeForm[{Thickness[0.005],Black}],LightBlue,Polygon[{{0,0},{3,0},{3,3},{0,3}}->{{{1,1},{2,1},{2,2},{1,2}}}]}];
rhs=;
rhs2=;
With[{sz=140},FlipView[{
Grid[{{
Show[lhs,ImageSize->sz],

}},Alignment->{Center,Center}],
Grid[{{
Show[lhs,ImageSize->sz],
Style[Overscript[Style["⟶",sz],"PolygonDecompose"],sz/5],
Show[rhs,ImageSize->sz]

}},Alignment->{Center,Center}],
Grid[{{
Show[lhs,ImageSize->sz],
Style[Overscript[Style["⟶",sz],"PolygonDecompose"],sz/5],
Show[rhs,ImageSize->sz],
Style[Overscript[Style["⟶",sz],"PolygonDecompose"],sz/5],
Show[rhs2,ImageSize->sz]

}},Alignment->{Center,Center}]}]]

Polygons & Polyhedra

With[{t=20},Dynamic[Show[,ViewPoint->20{Cos[Clock[2π,t]],Cos[Clock[2π,t]],Clock[2π,t]},SphericalRegion->True,ViewVertical->{1,0,0}]]]

More Color Support

ColorReplace[,->Red]

DynamicModule[{col=},
Column[{
ColorSlider[Dynamic[col],AppearanceElements->"Spectrum",ImageSize->{500,100}],
Dynamic[Show[ImageRecolor[,{ColorNeighborhood[,0.3]->col}],ImageSize->500]]}]]

Visualization : UnityLink

Visualization : Geovisualization

GeoVectorPlot

GeoVectorPlot[,VectorPoints->All,VectorScale->0.03]

Visualization : Geovisualization

GeoStreamPlot

GeoStreamPlot[]

Visualization : Geovisualization

Styles

Table[GeoStreamPlot[,StreamScale->Full,StreamStyle->s],{s,{"Toothpick","Dart",Directive[Orange,Dashed],"Drop"}}]

Visualization : Geovisualization

More than 500 Projections

GeoStreamPlot[,GeoProjection->"Albers"]

GeoAreaScale, GeoRangeScale

Visualization: Symbolic Data Wrappers

data={3,2,Callout[4,"Big"]};
Row[{ListPlot[data,BaseStyle->20],PieChart[data,BaseStyle->20]}]

New Symbolic Wrapper- ErrorBar

data={ErrorBar[1,0.1],ErrorBar[1,0.4],ErrorBar[3,0.1],ErrorBar[4,0.2]};

ListPlot[data]

ListLinePlot[data,ScalingFunctions->"Log"]

BarChart[data]

New error-support in data

Around[10,1]

Around[10,{1,2}]+Around[10,{1,1}]

Error bars automated for Around

ListLinePlot[data=Table[Around[RandomReal[{10,20}],{1,1}],10]]

ErrorBar Styles

ListLinePlot[data,ErrorBarFunction->"Bars"]

ListLinePlot[data,ErrorBarFunction->"Points"]

ListLinePlot[data,ErrorBarFunction->"Band"]

2D Errors

ListPlot[data=Table[Around[RandomReal[10],RandomReal[{0.25,0.5},{2,2}]],10]]

ListPlot[data,ErrorBarFunction->"Ellipse"]

Thank you