Maplesoft Blog

The Maplesoft blog contains posts coming from the heart of Maplesoft. Find out what is coming next in the world of Maple, and get the best tips and tricks from the Maple experts.

Maple 2020 offers many improvements motivated and driven by our users.

Every single update in a new release has a story behind it. It might be a new function that a customer wants, a response to some feedback about usability, or an itch that a developer needs to scratch.

I’ll end this post with a story about acoustic guitars and how they drove improvements in signal and audio processing. But first, here are some of my personal favorites from Maple 2020.

Graph theory is a big focus of Maple 2020. The new features include more control over visualization, additional special graphs, new analysis functions, and even an interactive layout tool.

I’m particularly enamoured by these:

  • We’ve introduced new centrality measures - these help you determine the most influential vertices, based on their connections to other vertices
  • You now have more control over the styling of graphs – for example, you can vary the size or color of a nodebased on its centrality

I’ve used these two new features to identify the most influential MaplePrimes users. Get the worksheet here.

@Carl Love – looks like you’re the biggest mover and shaker on MaplePrimes (well, according to the eigenvector centrality of the MaplePrimes interaction graph).

We’ve also started using graph theory elsewhere in Maple. For example, you can generate static call graph to visualize dependencies between procedures calls in a procedure

You now get smoother edges for 3d surfaces with non-numeric values. Just look at the difference between Maple 2019 and 2020 for this plot.

Printing and PDF export has gotten a whole lot better.  We’ve put a lot of work into the proper handling of plots, tables, and interactive components, so the results look better than before.

For example, plots now maintain their aspect ratio when printed. So your carefully constructed psychrometric chart will not be squashed and stretched when exported to a PDF.

We’ve overhauled the start page to give it a cleaner, less cluttered look – this is much more digestible for new users (experienced users might find the new look attractive as well!). There’s a link to the Maple Portal, and an updated Maple Fundamentals guide that helps new users learn the product.

We’ve also linked to a guide that helps you choose between Document and Worksheet, and a link to a new movie.

New messages also guide new users away from some very common mistakes. For example, students often type “e” when referring to the exponential constant – a warning now appears if that is detected

We’re always tweaking existing functions to make them faster. For example, you can now compute the natural logarithm of large integers much more quickly and with less memory.

This calculation is about 50 times faster in Maple 2020 than in prior versions:

Many of our educators have asked for this – the linear algebra tutorials now return step by step solutions to the main document, so you have a record of what you did after the tutor is closed.

Continuing with this theme, the Student:-LinearAlgebra context menu features several new linear algebra visualizations to the Student:-LinearAlgebra Context Menu. This, for example, is an eigenvector plot.

Maple can now numerically evaluate various integral transforms.

The numerical inversion of integral transforms has application in many branches of science and engineering.

Maple is the world’s best tool for the symbolic solution of ODEs and PDEs, and in each release we push the boundary back further.

For example, Maple 2020 has improved tools for find hypergeometric solutions for linear PDEs.

This might seem like a minor improvement that’s barely worth mentions, but it’s one I now use all the time! You can now reorder worksheet tabs just by clicking and dragging.

The Hough transform lets you detect straight lines and line segments in images.

Hough transforms are widely used in automatic lane detection systems for autonomous driving. You can even detect the straight lines on a Sudoku grid!

The Physics package is always a pleasure to write about because it's something we do far better than the competition.

The new explore option in TensorArray combines two themes in Maple - Physics and interactive components. It's an intuitive solution to the real problem of viewing the contents of higher dimensional tensorial expressions.

There are many more updates to Physics in Maple 2020, including a completely rewritten FeynmanDiagrams command.

The Quantum Chemistry Toolbox has been updated with more analysis tools and curriculum material.

There’s more teaching content for general chemistry.

Among the many new analysis functions, you can now visualize transition orbitals.

I promised you a story about acoustic guitars and Maple 2020, didn’t I?

I often start a perfectly innocuous conversation about Maple that descends into several weeks of intense, feverish work.

The work is partly for me, but mostly for my colleagues. They don’t like me for that.

That conversation usually happens on a Friday afternoon, when we’re least prepared for it. On the plus side, this often means a user has planted a germ of an idea for a new feature or improvement, and we just have to will it into existence.

One Friday afternoon last year, I was speaking to a user about acoustic guitars. He wanted to synthetically generate guitar chords with reverb, and export the sound to a 32-bit Wave file. All of this, in Maple.

This started a chain of events that that involved least-square filters, frequency response curves, convolution, Karplus-Strong string synthesis and more. We’ll package up the results of this work, and hand it over to you – our users – over the next one or two releases.

Let me tell you what made it into Maple 2020.

Start by listening to this:

It’s a guitar chord played twice, the second time with reverb, both generated with Maple.

The reverb was simulated with convolving the artificially generated guitar chord with an impulse response. I had a choice of convolution functions in the SignalProcessing and AudioTools packages.

Both gave the same results, but we found that SignalProcessing:-Convolution was much faster than its AudioTools counterpart.

There’s no reason for the speed difference, so R&D modified AudioTools:-Convolution to leverage SignalProcessing:-Convolution for the instances for which their options are compatible. In this application, AudioTools:-Convolution is 25 times faster in Maple 2020 than Maple 2019!

We also discovered that the underlying library we use for the SignalProcessing package (the Intel IPP) gives two options for convolution that we were previously not using; a method which use an explicit formula and a “fast” method that uses FFTs. We modified SignalProcessing:-Convolution to accept both options (previously, we used just one of the methods),

That’s the story behind two new features in Maple 2020. Look at the entirety of what’s new in this release – there’s a tale for each new feature. I’d love to tell you more, but I’d run out of ink before I finish.

To read about everything that’s new in Maple 2020, go to the new features page.

Playing mini-golf recently, I realized that my protractor can only help me so far since it can't calculate the speed of the swing needed.  I decided a more sophisticated tool was needed and modeled a trick-shot in MapleSim.

To start, I laid out the obstacles, the ball and club, the ground, and some additional visualizations in the MapleSim environment.

 

When running the simulation, my first result wasn't even close to the hole (similar to when I play in real life!).

 

The model clearly needed to be optimized. I went to the Optimization app in MapleSim (this can be found under Add Apps or Templates  on the left hand side).

 

Inside the app I clicked "Load System" then selected the parameters I wanted to optimize.

 

For this case, I'm optimizing 's' (the speed of the club) and 'theta' (the angle of the club). For the Objective Function I added a Relative Translation Sensor to the model and attached a probe to the Vector Norm of the output.

 

Inside the app, I switched to the Objective Function section.  Selecting Probes, I added the new probe as the Objective Function by giving it a weight of 1.

 

 

Scrolling down to "Execute Parameter Optimization", I checked the "Use Global Optimization Toolbox" checkbox, and clicked Run Parameter Optimization.

 

Following a run time of 120 seconds, the app returns the graph of the objective function. 

 

Below the plot, optimal values for the parameters are given. Plugging these back into the parameter block for the simulation we see that the ball does in fact go into the hole. Success!

 

 

Mini_golf_Global_Optimization.msim

 

 The Joint Mathematics Meetings are taking place next week (January 1518) in Denver, CO. This meeting is a must-attend for anyone interested in learning about innovative mathematical research, advancing mathematical achievement, providing the communication and tools to progress in the field, encouraging mathematical research, and connecting with the mathematical community.

Maplesoft will at booth #1100  in the networking area (located just outside the exhibit hall doors). Stop by our booth or the networking area to chat with me and other members of the Maplesoft team, pick up some free Maplesoft swag or win some prizes. We’ve got some good ones!

There are also several interesting Maple-related talks and events happening this week. 

Attend our Workshop - Maple: Math Software for Teaching, Learning and Research

Thursday January 16th, 2020

Centennial Ballroom AHYATT Denver Colorado

Catered Reception: 6:00PM6:30PM
Training Workshop: 6:30PM8:00PM

Are you new to the Maple world and interested in finding out what Maple can do for you? Are you an old hand at Maple but curious about the many new features we’ve added in the past few years? Come join us for an interactive workshop that will guide you through Maple’s capabilities, with an emphasis on our latest additions.

The topics we’ll be covering include:

  • Our natural math notation for input and output
  • Tools for creating interactive documents that incorporate math, text and graphics
  • An overview of our vast library containing packages for advanced mathematics research scientific and engineering applications
  • A brief look at Maple’s powerful programming language|
  • Online and mobile tools that augment the Maple experience

Register herewww.com/ 

We are also 3 show floor talks, at the end of Aisle 600 inside the exhibits:

The Maple Companion App

 January 15

3:00 pm -3:55 pm

Using Maple to Enhance Teaching and Learning

 January 16

11:00 am-11:55 am

The Maple Companion App

January 17

11:00 am- 11:55 am

 

If you are attending the Joint Math Meetings and plan on presenting anything on Maple, please let me know and I'll add it to our list!


See you there!

Charlotte 

We recently had a question about using some of the plotting commands in Maple to draw things. We were feeling creative and thought why not take it a step further and draw something in 3D.

Using the geom3d, plottools, and plots packages we decided to make a gingerbread house.

To make the base of the house we decided to use 2 cubes, as these would give us additional lines and segments for the icing on the house.

point(p__1,[2,3,2]):
point(p__2,[3,3,2]):
cube(c1,p__1,2):
cube(c2,p__2,2):
base:=draw([c1,c2],color=tan);

Using the same cubes but changing the style to be wireframe and point we made some icing lines and decorations for the gingerbread house.

base_decor1:=draw([c1,c2],style=wireframe,thickness=3,color=red,transparency=0.2):
base_decor2:=draw([c1,c2],style=wireframe,thickness=10,color=green,linestyle=dot):
base_decor3:=draw([c1,c2],style=point,thickness=2,color="Silver",symbol=sphere):
base_decor:=display(base_decor1,base_decor2,base_decor3);

To create the roof we found the vertices of the cubes and used those to find the top corners of the base.

v1:=vertices(c1):
v2:=vertices(c2):
pc1:=seq(point(pc1||i,v1[i]),i=1..nops(v1)):
pc2:=seq(point(pc2||i,v2[i]),i=1..nops(v2)):
topCorners:=[pc1[5],pc1[6],pc2[1],pc2[2]]:
d1:=draw(topCorners):

Using these top corners we found the midpoints (where the peak of the roof would be) and added the roof height to the coordinates.

midpoint(lc1,topCorners[1],topCorners[2]):
detail(lc1);

point(cc1,[-(2*sqrt(3))/3 + 2, (2*sqrt(3))/3 + 3+1, 2]):
d3:=draw(cc1):

midpoint(lc2,topCorners[3],topCorners[4]):
detail(lc2);

point(cc2,[(2*sqrt(3))/3 + 3, (2*sqrt(3))/3 + 3+1, 2]):
d4:=draw(cc2):

With the midpoints and vertices at the front and rear of the house we made two triangles for the attic of the gingerbread house.

triangle(tf,[topCorners[1],topCorners[2],cc1]):
front:=draw(tf,color=brown):

triangle(tb,[topCorners[3],topCorners[4],cc2]):
back:=draw(tb,color=tan):

Using these same points again we made more triangles to be the roof.

triangle(trl,[cc1,cc2,pc1[5]]):
triangle(trh,[pc2[2],pc1[6],cc1]):
triangle(tll,[cc1,cc2,pc2[2]]):
triangle(tlh,[pc2[1],pc1[5],cc2]):
roof:=draw([trl,trh,tll,tlh],color="Chocolate");

Our gingerbread house now had four walls, a roof, and icing, but no door. Creating the door was as easy as making a parallelepiped, but what is a door without more icing?

door:=display(plottools:-parallelepiped([1,0,0],[0,1.2,0],[0,0,0.8],[0.8,1.9,1.6]),color="DarkRed"):
door_decor1:=display(plottools:-parallelepiped([1,0,0],[0,1.2,0],[0,0,0.8],[0.8,1.9,1.6]),color="Gold",style=line):
door_decor2:=display(plottools:-parallelepiped([1,0,0],[0,1.2,0],[0,0,0.8],[0.8,1.9,1.6]),color="Silver", style=line,linestyle=dot,thickness=5):
door_decor:=display(door_decor1,door_decor2):

Now having a door we could have left it like this, but what better way to decorate a gingerbread house than with candy canes? Naturally, if we were going to have one candy cane we were going to have lots of candy canes. To facilitate this we made a candy cane procedure.

candy_pole:=proc(c:=[0,0,0], {segR:=0.1}, {segH:=0.1}, {segn:=7}, {tilt_theta:=0}, {theta:=0}, {arch:=true}, {flip:=false})
local cane1,cane2,cane_s,cane_c,cane0,cane,i,cl,cd,ch, cane_a,tmp,cane_ac,cane_a1,cane00,cane01,cane02,cane_a1s,tmp2,cane_a2s:
uses plots,geom3d:
cl:=c[1]:
cd:=c[2]:
ch:=c[3]:
cane1:=plottools:-cylinder([cd, ch, cl], segR, segH,style=surface):

cane2:=display(plottools:-rotate(cane1,Pi/2,[[cd,ch,cl],[cd+1,ch,cl]])):
cane_s:=[cane2,seq(display(plottools:-translate(cane2,0,segH*i,0)),i=1..segn-1)]:
cane_c:=seq(ifelse(type(i,odd),red,white),i=1..segn):

cane0:=display(cane_s,color=[cane_c]):

if arch then

cane_a:=plottools:-translate(cane2,0,segH*segn-segH/2,0):
tmp:=i->plottools:-rotate(cane_a,i*Pi/24, [ [cd,ch+segH*segn-segH/2,cl+segR*2] , [cd+1,ch+segH*segn-segH/2,cl+segR*2] ] ):

cane_ac:=seq(ifelse(type(i,odd),red,white),i=1..24):

                cane_a1s:=seq(plottools:-translate(tmp(i),0,segH*i/12,segR*i/4),i=1..12):

tmp2:=i->plottools:-rotate(cane_a1s[12],i*Pi/24,[[cd,ch+segH*segn-0.05,cl+segR*2],[cd+1,ch+segH*segn-0.05,cl+segR*2]]):

cane_a2s:=seq(plottools:-translate(tmp2(i),0,-segH*i/500,segR*i/4),i=1..12):
cane_a1:=display(cane_a1s,cane_a2s,color=[cane_ac]):
cane00:=display(cane0,cane_a1);

                if flip then

cane01:=plottools:-rotate(cane00,tilt_theta,[[cd,ch,cl],[cd+1,ch,cl]]):
cane02:=plottools:-rotate(cane01,theta,[[cd,ch,cl],[cd,ch+1,cl]]):
cane:=plottools:-reflect(cane01,[[cd,ch,cl],[cd,ch+1,cl]]):

                else

cane01:=plottools:-rotate(cane00,tilt_theta,[[cd,ch,cl],[cd+1,ch,cl]]):
cane:=plottools:-rotate(cane01,theta,[[cd,ch,cl],[cd,ch+1,cl]]):

                end if:

                return cane:

else

                cane:=plottools:-rotate(cane0,tilt_theta,[[cd,ch,cl],[cd+1,ch,cl]]):

                return cane:

end if:

end proc:

With this procedure we decided to add candy canes to the front, back, and sides of the gingerbread house. In addition we added two candy poles.

Candy Canes in front of the house:

cane1:=candy_pole([1.2,0,2],segn=9,arch=false):
cane2:=candy_pole([2.8,0,2],segn=9,arch=false):
cane3:=candy_pole([2.7,0.8,3.3],segn=9,segR=0.05,tilt_theta=-Pi/7):
cane4:=candy_pole([1.3,0.8,3.3],segn=9,segR=0.05,tilt_theta=-Pi/7,flip=true):
front_canes:=display(cane1,cane2,cane3,cane4):

Candy Canes at the back of the house:

caneb3:=candy_pole([1.5,4.2,2.5],segn=15,segR=0.05,tilt_theta=-Pi/3,flip=true):
caneb4:=candy_pole([2.5,4.2,2.5],segn=15,segR=0.05,tilt_theta=-Pi/3):}
back_canes:=display(caneb3,caneb4):

Candy Canes at the left of the house:

canel1:=candy_pole([0.8,1.5,2.5],segn=15,segR=0.05,tilt_theta=-Pi/7,theta=Pi/2):
canel2:=candy_pole([0.8,2.5,2.5],segn=15,segR=0.05,tilt_theta=-Pi/7,theta=Pi/2):
canel3:=candy_pole([0.8,4,2.5],segn=15,segR=0.05,tilt_theta=-Pi/7,theta=Pi/2):
left_canes:=display(canel1,canel2,canel3):

Candy Canes at the right of the house:

caner1:=candy_pole([3.2,1.5,2.5],segn=15,segR=0.05,tilt_theta=-Pi/7,theta=Pi/2):
caner2:=candy_pole([3.2,2.5,2.5],segn=15,segR=0.05,tilt_theta=-Pi/7,theta=Pi/2):
caner3:=candy_pole([3.2,4,2.5],segn=15,segR=0.05,tilt_theta=-Pi/7,theta=Pi/2):
right_canes:=display(caner1,caner2,caner3):

canes:=display(front_canes,back_canes,right_canes,left_canes):

With these canes in place all that was left was to create the ground and display our Gingerbread House.

ground:=display(plottools:-parallelepiped([5,0,0],[0,0.5,0],[0,0,4],[0,1.35,0]),color="DarkGreen"):

display([door,door_decor,d1,base,base_decor,d3,d4,front,back,roof,ground,canes],orientation=[-100,0,95]);

You can download the full worksheet creating the gingerbread house below:

Geometry_Gingerbread.mw

I am very pleased to announce that we have released a new version of the free Maple Companion app. For those you may have missed it, the first release of this app gave you a way to take a picture of math using your phone’s camera and upload it into Maple. Instructors have told me they’ve found this very useful in their classes, as they no longer have to deal with transcription errors as students enter problems into Maple.

So that’s good. But version 2 is a lot better. The Maple Companion now solves math problems directly on your phone. It can handle problems from algebra, precalculus, calculus, linear algebra, differential equations, and more. No need to upload to Maple – students can solve the problem by hand, and then use the app to check their answer, try new operations on the same expression, and even create plots. And if they want to do even more, they can still upload the expression into Maple for more advanced operations and explorations.

There’s also a built-in math editor, so you can enter problems without the camera, too. And if you use the camera, and it misinterprets part of your expression, you can fix it using the editor instead of having to retake the picture.  Good as the math recognition is, even in the face of some pretty poor handwriting, the ability to tweak the results has proven to be extremely useful.

There’s lots more we’d like to do with the Maple Companion app over time, and we’d like hear your thoughts, as well. How else can it help students learn?  How else can it act as a complement to Maple? Let us know!

Visit Maple Companion to learn more, find links to the app stores so you can download the app, and access the feedback form. And if you already have version 1, you can get the new release simply by updating the app on your phone.

 

This update fixes the problems inadvertently introduced in Maple 2019.2, namely:

  • Maple failed to run the code in the maple.ini/.mapleinit initialization files when loading existing worksheets containing a restart() command
  • Installing some packages from the MapleCloud was unsuccessful

For anyone who installed the 2019.2 update, installing 2019.2.1 will fix these problems.

If you are at Maple 2019.1 or earlier, installing this update will bring you straight to Maple 2019.2.1.

This update is available through Tools>Check for Updates in Maple, and is also available from our website on the Maple 2019.2.1 download page.

If you are a MapleSim user, please note that these problems do not affect your use of MapleSim. If you use Maple on its own, and if you use Maple command initialization files and/or you need to install a package from the MapleCloud that does not work, please contact Maplesoft Technical Support for assistance.

We sincerely apologize for the inconvenience and thank you for your patience as we worked through this issue.

We have just released updates to Maple and MapleSim.

Maple 2019.2 includes corrections and improvements to a variety of areas in the product, including a new “Go to page ____” option in print preview (that am personally quite pleased about), sections are expanded by default when printing or exporting, a fix to a problem using non-executable math with text in document mode that sometimes made it impossible to advance to a new line using Enter, improvements to VectorCalculus, select, abs and other math functions, support for macOS Catalina, and more.  We recommend that all Maple 2019 users install these updates.

This update is available through Tools>Check for Updates in Maple, and is also available from our website on the Maple 2019.2 download page, where you can also find more details.

For MapleSim users, the MapleSim 2019.2 family of products includes enhancements in the areas of model development and toolchain connectivity, including substantial enhancements to the MapleSim CAD toolbox.   For more details and download instructions, visit the MapleSim 2019.2 download page.

I’m very pleased to announce that we have just released the Maple Companion mobile app for iOS and Android phones. As its name implies, this free app is a complement to Maple. You can use it to take pictures of math you find out in the wild (e.g. in your handwritten notes, on a blackboard, in a textbook), and bring that math into Maple so you can get to work.

The Maple Companion lets you:

  • Avoid the mistakes that can occur when transcribing mathematical expressions into Maple manually
  • Save time when entering multiple equations into Maple, such as when you are checking your homework or pulling information from a reference book
  • Push math you’ll need later into Maple now, even if you don’t have your computer handy

The Maple Companion is an idea we started playing with recently. We believe it has interesting potential as a tool to help students learn math, and we’d really like your feedback to help shape its future direction. This first release is a step towards that goal, so you can try it out and start thinking about what else you would like to see from an app like this. Should it bring in entire documents? Integrate with tutors and Math Apps? Help students figure out where they went wrong when solving a problem? Let us know what you think!

Visit Maple Companion to learn more, link to the app stores so you can download the app, and access the feedback form. And of course, you are also welcome to give us your ideas in the comment section of this post.

We are currently in the process of updating the support FAQs at https://faq.maplesoft.com. We’ve been working on updating the existing content for clarity, and have added several new articles already.

 

The majority of our FAQs are from questions people ask us in Technical Support at support@maplesoft.com, but we’d also like to like to add content from other sources.

Since we have such a great community here at MaplePrimes, we wanted to reach out and ask if there are any articles or questions that you'd like to see added to our FAQ.

 

We look forward to hearing your feedback!

We occasionally get asked questions about methods of Perturbation Theory in Maple, including the Lindstedt-Poincaré Method. Presented here is the most famous application of this method.

Introduction

During the dawn of the 20th Century, one problem that bothered astronomers and astrophysicists was the precession of the perihelion of Mercury. Even when considering the gravity from other planets and objects in the solar system, the equations from Newtonian Mechanics could not account for the discrepancy between the observed and predicted precession.

One of the early successes of Einstein's General Theory of Relativity was that the new model was able to capture the precession of Mercury, in addition to the orbits of all the other planets. The Einsteinian model, when applied to the orbit of Mercury, was in fact a non-negligible perturbation of the old model. In this post, we show how to use Maple to compute the perturbation, and derive the formula for calculating the precession.

In polar coordinates, the Einsteinian model can be written in the following form, where u(theta)=a(1-e^2)/r(theta), with theta being the polar angle, r(theta) being the radial distance, a being the semi-major axis length, and e being the eccentricity of the orbit:
 

# Original system.
f := (u,epsilon) -> -1 - epsilon * u^2;
omega := 1;
u0, du0 := 1 + e, 0;
de1 := diff( u(theta), theta, theta ) + omega^2 * u(theta) + f( u(theta), epsilon );
ic1 := u(0) = u0, D(u)(0) = du0;


The small parameter epsilon (along with the amount of precession) can be found in terms of the physical constants, but for now we leave it arbitrary:
 

# Parameters.
P := [
    a = 5.7909050e10 * Unit(m),
    c = 2.99792458e8 * Unit(m/s),
    e = 0.205630,
    G = 6.6740831e-11 * Unit(N*m^2/kg^2), 
    M = 1.9885e30 * Unit(kg), 
    alpha = 206264.8062, 
    beta = 415.2030758 
];
epsilon = simplify( eval( 3 * G * M / a / ( 1 - e^2 ) / c^2, P ) ); # approximately 7.987552635e-8


Note that c is the speed of light, G is the gravitational constant, M is the mass of the sun, alpha is the number of arcseconds per radian, and beta is the number of revolutions per century for Mercury.

We will show that the radial distance, predicted by Einstein's model, is close to that for an ellipse, as predicted by Newton's model, but the perturbation accounts for the precession (42.98 arcseconds/century). During one revolution, the precession can be determined to be approximately
 

sigma = simplify( eval( 6 * Pi * G * M / a / ( 1 - e^2 ) / c^2, P ) ); # approximately 5.018727337e-7


and so, per century, it is alpha*beta*sigma, which is approximately 42.98 arcseconds/century.
It is worth checking out this question on Stack Exchange, which includes an animation generated numerically using Maple for a similar problem that has a more pronounced precession.

Lindstedt-Poincaré Method in Maple

In order to obtain a perturbation solution to the perturbed differential equation u'+omega^2*u=1+epsilon*u^2 which is periodic, we need to write both u and omega as a series in the small parameter epsilon. This is because otherwise, the solution would have unbounded oscillatory terms ("secular terms"). Using this Lindstedt-Poincaré Method, we substitute arbitrary series in epsilon for u and omega into the initial value problem, and then choose the coefficient constants/functions so that both the initial value problem is satisfied and there are no secular terms. Note that a first-order approximation provides plenty of agreement with the measured precession, but higher-order approximations can be obtained.

To perform this in Maple, we can do the following:
 

# Transformed system, with the new independent variable being the original times a series in epsilon.
de2 := op( PDEtools:-dchange( { theta = phi/b }, { de1 }, { phi }, params = { b, epsilon }, simplify = true ) );
ic2 := ic1;

# Order and series for the perturbation solutions of u(phi) and b. Here, n = 1 is sufficient.
n := 1;
U := unapply( add( p[k](phi) * epsilon^k, k = 0 .. n ), phi );
B := omega + add( q[k] * epsilon^k, k = 1 .. n );

# DE in terms of the series.
de3 := series( eval( de2, [ u = U, b = B ] ), epsilon = 0, n + 1 );

# Successively determine the coefficients p[k](phi) and q[k].
for k from 0 to n do

    # Specify the initial conditions for the kth DE, which involves p[k](phi).
    # The original initial conditions appear only in the coefficient functions with index k = 0,
    # and those for k > 1 are all zero.
    if k = 0 then
        ic3 := op( expand( eval[recurse]( [ ic2 ], [ u = U, epsilon = 0 ] ) ) );
    else
        ic3 := p[k](0), D(p[k])(0);
    end if:

    # Solve kth DE, which can be found from the coefficients of the powers of epsilon in de3, for p[k](phi).
    # Then, update de3 with the new information.
    soln := dsolve( { simplify( coeff( de3, epsilon, k ) ), ic3 } );
    p[k] := unapply( rhs( soln ), phi );
    de3 := eval( de3 );

    # Choose q[k] to eliminate secular terms. To do this, use the frontend() command to keep only the terms in p[k](phi)
    # which have powers of t, and then solve for the value of q[k] which makes the expression zero. 
    # Note that frontend() masks the t-dependence within the sine and cosine terms.
    # Note also that this method may need to be amended, based on the form of the terms in p[k](phi).
    if k > 0 then
        q[1] := solve( frontend( select, [ has, p[k](phi), phi ] ) = 0, q[1] );
        de3 := eval( de3 );
    end if;

end do:

# Final perturbation solution.
'u(theta)' = eval( eval( U(phi), phi = B * theta ) ) + O( epsilon^(n+1) );

# Angular precession in one revolution.
sigma := convert( series( 2 * Pi * (1/B-1), epsilon = 0, n + 1 ), polynom ):
epsilon := 3 * G * M / a / ( 1 - e^2 ) / c^2;
'sigma' = sigma;

# Precession per century.
xi := simplify( eval( sigma * alpha * beta, P ) ); # returns approximately 42.98


Maple Worksheet: Lindstedt-Poincare_Method.mw

I just wanted to let everyone know that the Call for Papers and Extended Abstracts deadline for the Maple Conference has been extended to June 14.

The papers and extended abstracts presented at the 2019 Maple Conference will be published in the Communications in Computer and Information Science Series from Springer. We welcome topics that fall into the following broad categories:

  • Maple in Education
  • Algorithms and Software
  • Applications of Maple

You can learn more about the conference or submit your paper or abstract here: 

https://www.maplesoft.com/mapleconference/Papers-and-Presentations.aspx

Hope to hear from you soon!

We’re excited to announce that we have just released a new version of MapleSim. The MapleSim 2019 family of products helps you get the answers you need from your models, with improved performance, increased modeling scope, and more ways to connect to your existing toolchain. Improvements include:
 

  • Faster simulation speeds, both within MapleSim and when using exported MapleSim models in other tools

  • More simulation options are now available when running models imported from other systems

  • Additional options for FMI connectivity, including support for variable-step solvers with imported FMUs, and exporting models using variable step solvers using the MapleSim FMI Connector add-on

  • Improved interactive analysis apps for Monte Carlo analysis, Optimization, and Parameter Sweep

  • Expanded modeling scope in hydraulics, electrical, multibody, and more, with new built-in components and support for more external Modelica libraries

  • New add-on library: MapleSim Engine Dynamics Library from Modelon provides specialized tools for modeling, simulating, and analyzing the performance of combustion engines

  • New add-on connector: The B&R MapleSim Connector gives automation projects a powerful, model-based ability to test and visualize control strategies from within B&R Automation Studio
     

See What’s New in MapleSim 2019 for more information about these and other improvements!

Submit your paper or extended abstract to the Maple Conference!

The papers and extended abstracts presented at the 2019 Maple Conference will be published in the Communications in Computer and Information Science Series from Springer. 

The deadline to submit is May 27, 2019. 

This conference is an amazing opportunity to contribute to the development of technology in academics. I hope that you, or your colleagues and associates, will consider making a contribution.

We welcome topics that fall into the following broad categories:

  • Maple in Education
  • Algorithms and Software
  • Applications of Maple

You can learn more about the conference or submit your paper or abstract here: 

https://www.maplesoft.com/mapleconference/Papers-and-Presentations.aspx

 

 

 

Maple 2019 has a new add-on package Maple Quantum Chemistry Toolbox from RDMChem for computing the energies and properties of molecules.  As a member of the team at RDMChem that developed the package, I would like to tell the story of its origins and provide a brief demonstration of the package.  

 

Thinking about Quantum Chemistry at Harvard

 

The story of the Maple Quantum Chemistry Toolbox begins with my graduate studies in Chemical Physics at Harvard University in the late 1990s.  Even in 1998 programs for computing the energies and properties of molecules were extremely complicated and nonintuitive.  Many of the existing programs had begun in the 1970s on computers whose programs would be recorded on punchcards.

Fig. 1: Used Punchcard by Pete Birkinshaw from Manchester, UK CC BY 2.0

 

Even today some of these programs have remnants of their early versions such as input files that must start on the second column to account for the margin of the now non-existent punchcards.  As a student, I made a bound copy of one of these manuals at a local Kinkos photocopy shop and later found myself in Harvard Yard, thinking that there must be a better way to present quantum chemistry computations.  The idea for a Maple-like package for quantum chemistry was born in that moment.

 

At the same time I was learning about something called the two-electron reduced density matrix (2-RDM).  The basic variable in quantum chemistry is the wave function which is the probability amplitude for finding each of the electrons in a molecule.  Because electrons are indistinguishable with pairwise interactions, the wave function contains much more information than is needed for computing the energies and electronic properties of molecules.  The energies and properties of any molecule with any number of electrons can be expressed as a function of a 2 electron matrix, the 2-RDM [1-3].  A quantum chemistry based on the 2-RDM, it was known, would have potentially significant advantages over wave function calculations in terms of accuracy and computational cost, especially for molecules far from the mean-field limit.  A 2-RDM approach to quantum chemistry became the focus of my Ph.D. thesis.

 

Representing Many Electrons with Only Two Electrons

 

The idea of using the 2-RDM in quantum chemistry can be attributed to four scientists: two physicists Kodi Husimi and Joseph Mayer, a chemist Per-Olov Lowdin, and a mathematician John Coleman [1-3].  In the early 1940s Husimi first published the idea in a Japanese physics journal, but in the midst of World War II the paper was not widely disseminated in the West.  In the summer of 1951 John Coleman, which attending a physics conference at Chalk River, realized that the ground-state energy of any atom or molecule could be expressed as functional of the 2-RDM, and similar ideas later occurred to Per-Olov Lowdin and Joseph Mayer who published their ideas in Physical Review in 1955.  It was soon recognized that computing the ground-state energy of an atom or molecule with the 2-RDM was potentially difficult because not every two-electron density matrix corresponds to an N-electron density matrix or wave function.  The search for the appropriate constraints on the 2-RDM, known as N-representability conditions, became known as the N-representability problem [1-3].  

 

Beginning in the late 1990s and early 2000s, Carmela Valdemoro and Diego Alcoba at the Consejo Superior de Investigaciones Científicas (Madrid, Spain), Hiroshi Nakatsuji, Koji Yasuda, and Maho Nakata at Kyoto University (Kyoto, Japan), Jerome Percus and Bastiaan Braams at the Courant Institute (New York, USA), John Coleman and Robert Erdahl at Queens University (Kingston, Canada), and my research group and I at The University of Chicago (Chicago, USA) began to make significant progress in the computation of the 2-RDM without computing the many-electron wave function [1-3].  Further contributions were made by Eric Cances and Claude Le Bris at CERMICS, Ecole Nationale des Ponts et Chaussées (Marne-la-Vallée, France), Paul Ayers at McMaster University (Hamilton, Canada), and Dimitri Van Neck at the University of Ghent (Ghent, Belgium) and their research groups.  By 2014 several powerful 2-RDM methods had emerged for the computation of molecules.  The Army Research Office (ARO) issued a proposal call for a company to develop a modern, built-from-scratch package for quantum chemistry that would contain two newly developed 2-RDM-based methods from our group: the parametric 2-RDM method [1] and the variational 2-RDM method with a fast algorithm for solving the semidefinite program [4,5,6].   The company RDMChem LLC was founded to work with the ARO to develop such a package built around RDMs, and hence, the name of the company RDMChem was selected as a hybrid of the RDM abbreviation for Reduced Density Matrices and the Chem colloquialism for Chemistry.  To achieve a really new design for an electronic structure package with access to numeric and symbolic computations as well as advanced visualizations, the team at RDMChem and I developed a partnership with Maplesoft to build something new that became the Maple Quantum Chemistry Package (or Toolbox), which was released with Maple 2019 on Pi Day.

 

Maple Quantum Chemistry Toolbox

 The Maple Quantum Chemistry Toolbox provides a powerful, parallel platform for quantum chemistry calculations that is directly integrated into the Maple 2019 environment.  It is optimized for both cutting-edge research as well as chemistry education.  The Toolbox can be used from the worksheet, document, or command-line interfaces.  Plus there is a Maplet interface for rapid exploration of molecules and their properties.  Figure 2 shows the Maplet interface being applied to compute the ground-state energy of 1,3-dibromobenzene by density functional theory (DFT) in a 6-31g basis set.           

Fig. 2: Maplet interface to the Quantum Chemistry Toolbox 2019, showing a density functional theory (DFT) calculation         

After entering a name into the text box labeled Name, the user can click on: (1) the button Web to import the geometry from an online database containing more than 96 million molecules,  (2) the button File to read the geometry from a standard XYZ file, or (3) the button Input to enter the geometry.  As soon the geometry is entered, the Maplet displays a 3D picture of the molecule in the window on the right of the options.  Dropdown menus allow the user to select the basis set, the electronic structure method, and a boolean for geometry optimization.  The user can click on the Compute button to perform the computation.  When the quantum computation completes, the total energy appears in the box labeled Total Energy.  The dropdown menu Analyze contains a list of data tables, plots, and animations that can be selected and then displayed by clicking the Analyze button.  The Maplet interface contains nearly all of the options available in the worksheet interface.   The Help Pages of the Toolbox include extensive curricula and lessons that can be used in undergraduate, graduate, and even high school chemistry courses.  Next we look at some sample calculations in the worksheet interface.     

 

Reproducing an Early 2-RDM Calculation

 

One of the earliest variational calculations of the 2-RDM was performed in 1975 by Garrod, Mihailović,  and  Rosina [1-3].  They minimized the electronic ground state of the 4-electron atom beryllium as a functional of only two electrons, the 2-RDM.  They imposed semidefinite constraints on the particle-particle (D), hole-hole (Q), and particle-hole (G) metric matrices.  They solved the resulting optimization problem of minimizing the energy as a linear function of the 2-RDM subject to the semidefinite constraints, known as a semidefinite program, by a cutting-plane algorithm.  Due to limitations of the cutting-plane algorithm and computers circa 1975, the calculation was a difficult one, likely taking a significant amount of computer time and memory.

 

With the Quantum Chemistry Toolbox we can use the command Variational2RDM to reproduce the calculation on a Windows laptop.  First, in a Maple 2019 worksheet we load the commands of the Add-on Quantum Chemistry Toolbox:

with(QuantumChemistry);

[AOLabels, ActiveSpaceCI, ActiveSpaceSCF, AtomicData, BondAngles, BondDistances, Charges, ChargesPlot, CorrelationEnergy, CoupledCluster, DensityFunctional, DensityPlot3D, Dipole, DipolePlot, Energy, FullCI, GeometryOptimization, HartreeFock, Interactive, Isotopes, MOCoefficients, MODiagram, MOEnergies, MOIntegrals, MOOccupations, MOOccupationsPlot, MOSymmetries, MP2, MolecularData, MolecularGeometry, NuclearEnergy, NuclearGradient, Parametric2RDM, PlotMolecule, Populations, RDM1, RDM2, ReadXYZ, SaveXYZ, SearchBasisSets, SearchFunctionals, SkeletalStructure, Thermodynamics, Variational2RDM, VibrationalModeAnimation, VibrationalModes, Video]

(1.1)

Then we define the atom (or molecule) using a Maple list of lists that we assign to the variable atom:

atom := [["Be",0,0,0]];

[["Be", 0, 0, 0]]

(1.2)

 

We can then perform the variational 2-RDM method with the Variational2RDM command to compute the ground-state energy and properties of beryllium in a minimal basis set like the one used by Rosina and his collaborators.  By default the method uses the D, Q, and G N-representability conditions and the minimal "sto-3g" basis set.  The calculation, which completes in seconds, contains a wealth of information in the form of a convenient Maple table that we assign to the variable data.

data := Variational2RDM(atom);

table(%id = 18446744313704784158)

(1.3)

 

The table contains the total ground-state energy of the beryllium atom in the atomic unit of energy (hartrees)

data[e_tot];

HFloat(-14.40370016681039)

(1.4)

 

We also have the atomic orbitals (AOs) employed in the calculation

data[aolabels];

Vector(5, {(1) = "0 Be 1s", (2) = "0 Be 2s", (3) = "0 Be 2px", (4) = "0 Be 2py", (5) = "0 Be 2pz"})

(1.5)

 

as well as the Mulliken populations of these orbitals

data[populations];

Vector(5, {(1) = 1.9995807710723152, (2) = 1.7913484714571852, (3) = 0.6969023822632789e-1, (4) = 0.6969026475511847e-1, (5) = 0.6969029119010149e-1})

(1.6)

 

We see that 2 electrons are located in the 1s orbital, 1.8 electrons in the 2s orbital, and about 0.2 electrons in the 2p orbitals.  By default the calculation also returns the 1-RDM

data[rdm1];

Matrix(5, 5, {(1, 1) = 1.9999258249189755, (1, 2) = -0.37784860208539793e-2, (1, 3) = 0., (1, 4) = 0., (1, 5) = 0., (2, 1) = -0.37784860208539793e-2, (2, 2) = 1.7910034176105256, (2, 3) = 0., (2, 4) = 0., (2, 5) = 0., (3, 1) = 0., (3, 2) = 0., (3, 3) = 0.6969023822632789e-1, (3, 4) = 0., (3, 5) = 0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = 0.6969026475511847e-1, (4, 5) = 0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = 0., (5, 5) = 0.6969029119010149e-1})

(1.7)

 

The eigenvalues of the 1-RDM are the natural orbital occupations

LinearAlgebra:-Eigenvalues(data[rdm1]);

Vector(5, {(1) = 1.9999941387490443+0.*I, (2) = 1.7909351037804568+0.*I, (3) = 0.6969023822632789e-1+0.*I, (4) = 0.6969026475511847e-1+0.*I, (5) = 0.6969029119010149e-1+0.*I})

(1.8)

 

We can display the density of the 2s-like 2nd natural orbital using the DensityPlot3D command providing the atom, the data, and the orbitalindex keyword

DensityPlot3D(atom,data,orbitalindex=2);

 

 

Similarly,  using the DensityPlot3D command, we can readily display the 2p-like 3rd natural orbital

DensityPlot3D(atom,data,orbitalindex=3);

 

 

By using Maple keyword arguments in the Variational2RDM command, we can readily change the basis set, use point-group symmetry, add active orbitals with or without self-consistent-field, change the N-representability conditions, as well as explore many other options.  Having reenacted one of the first variational 2-RDM calculations ever, let's examine a more complicated molecule.

 

Explosive TNT

 

We consider the molecule TNT that is used as an explosive. Using the command MolecularGeometry, we can import the experimental geometry of TNT from the online PubChem database.

mol := MolecularGeometry("TNT");

[["O", .5454, -3.514, 0.12e-2], ["O", .5495, 3.5137, 0.8e-3], ["O", 2.4677, -2.4539, -0.5e-3], ["O", 2.4705, 2.4513, 0.3e-3], ["O", -3.5931, -1.0959, 0.4e-3], ["O", -3.5922, 1.0993, 0.6e-3], ["N", 1.2142, -2.454, 0.2e-3], ["N", 1.217, 2.4527, 0], ["N", -2.9846, 0.15e-2, 0.1e-3], ["C", 1.2253, -0.6e-3, -0.9e-3], ["C", .5271, -1.2082, -0.8e-3], ["C", .5284, 1.2078, -0.8e-3], ["C", -1.5646, 0.8e-3, -0.4e-3], ["C", -.8678, -1.2074, -0.6e-3], ["C", -.8666, 1.2084, -0.6e-3], ["C", 2.7239, -0.16e-2, 0.11e-2], ["H", -1.4159, -2.1468, -0.3e-3], ["H", -1.4137, 2.1483, -0.3e-3], ["H", 3.1226, .2418, -.9891], ["H", 3.0863, .6934, .7662], ["H", 3.3154, -.8111, .4109]]

(1.9)

 

The command PlotMolecule generates a 3D ball-and-stick plot of the molecule

PlotMolecule(mol);

 

 

We perform a variational calculation of the 2-RDM of TNT in an active space of 10 electrons and 10 orbitals by setting the keyword active to the list [10,10].  The keyword casscf is set to true to optimize the active orbitals during the calculation.  The keyword basis is used to set the basis set to a minimal basis set sto-3g for illustration.   

data := Variational2RDM(mol, active=[10,10], casscf=true, basis="sto-3g");

table(%id = 18446744493271367454)

(1.10)

 

The ground-state energy of TNT in hartrees is

data[e_tot];

HFloat(-868.8629631593426)

(1.11)

 

Unlike beryllium, the electric dipole moment of TNT in debyes is nonzero

data[dipole];

Vector(3, {(1) = .5158925019252739, (2) = -0.5985274393363119e-1, (3) = .1277528280025474})

(1.12)

 

We can easily visualize the dipole moment relative to the molecule's ball-and-stick model with the DipolePlot command

DipolePlot(mol,method=Variational2RDM, active=[10,10], casscf=true, basis="sto-3g");

 

 

The 1-RDM is returned by default

data[rdm1];

_rtable[18446744313709602566]

(1.13)

 

The natural molecular-orbital (MO) occupations are the eigenvalues of the 1-RDM

data[mo_occ];

_rtable[18446744313709600150]

(1.14)

 

All of the occupations can be viewed at once by converting the Vector to a list

convert(data[mo_occ], list);

[HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(2.0), HFloat(1.9110133620349001), HFloat(1.8984139688344246), HFloat(1.6231436866358906), HFloat(1.6158489471020905), HFloat(1.6145310163161273), HFloat(0.38920731792133734), HFloat(0.387039366894289), HFloat(0.37786347287813526), HFloat(0.09734187094597906), HFloat(0.08559699476985069), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0)]

(1.15)

 

We can visualize these occupations with the MOOccupationsPlot command

MOOccupationsPlot(mol,method=Variational2RDM, active=[10,10], casscf=true, basis="sto-3g");

 

 

The occupations, we observe, show significant deviations from 0 and 2, indicating that the electrons have substantial correlation beyond the mean-field (Hartree-Fock) limit.  The blue lines indicate the first N/2 spatial orbitals where N is the total number of electrons while the red lines indicate the remaining spatial orbitals.  We can visualize the highest "occupied" molecular orbital (58) with the DensityPlot3D command

DensityPlot3D(mol,data, orbitalindex=58);

 

 

Similarly, we can visualize the lowest "unoccupied" molecular orbital (59) with the DensityPlot3D command

DensityPlot3D(mol,data, orbitalindex=59);

 

 

Comparison of orbitals 58 and 59 reveals an increase in the number of nodes (changes in the phase of the orbitals denoted by green and purple), which reflects an increase in the energy of the orbital.

 

Looking Ahead

 

The Maple Quantum Chemistry Toolbox 2019, an new Add-on for Maple 2019 from RDMChem, provides a easy-to-use, research-grade environment for the computation of the energies and properties of atoms and molecules.  In this blog we discussed its origins in graduate research at Harvard, its reproduction of an early 2-RDM calculation of beryllium, and its application to the explosive molecule TNT.  We have illustrated only some of the many features and electronic structure methods of the Maple Quantum Chemistry package.  There is much more chemistry and physics to explore.  Enjoy!    

 

Selected References

 

[1] D. A. Mazziotti, Chem. Rev. 112, 244 (2012). "Two-electron Reduced Density Matrix as the Basic Variable in Many-Electron Quantum Chemistry and Physics"

[2]  Reduced-Density-Matrix Mechanics: With Application to Many-Electron Atoms and Molecules (Adv. Chem. Phys.) ; D. A. Mazziotti, Ed.; Wiley: New York, 2007; Vol. 134.

[3] A. J. Coleman and V. I. Yukalov, Reduced Density Matrices: Coulson’s Challenge (Springer-Verlag,  New York, 2000).

[4] D. A. Mazziotti, Phys. Rev. Lett. 106, 083001 (2011). "Large-scale Semidefinite Programming for Many-electron Quantum Mechanics"

[5] A. W. Schlimgen, C. W. Heaps, and D. A. Mazziotti, J. Phys. Chem. Lett. 7, 627-631 (2016). "Entangled Electrons Foil Synthesis of Elusive Low-Valent Vanadium Oxo Complex"

[6] J. M. Montgomery and D. A. Mazziotti, J. Phys. Chem. A 122, 4988-4996 (2018). "Strong Electron Correlation in Nitrogenase Cofactor, FeMoco"

 

Download QCT2019_PrimesV17_05.05.19.mw

While googling around for Season 8 spoilers, I found data sets that can be used to create a character interaction network for the books in the A Song of Ice and Fire series, and the TV show they inspired, Game of Thrones.

The data sets are the work of Dr Andrew Beveridge, an associate professor at Macalaster College (check out his Network of Thrones blog).

You can create an undirected, weighted graph using this data and Maple's GraphTheory package.

Then, you can ask yourself really pressing questions like

  • Who is the most influential person in Westeros? How has their influence changed over each season (or indeed, book)?
  • How are Eddard Stark and Randyll Tarly connected?
  • What do eigenvectors have to do with the battle for the Iron Throne, anyway?

These two applications (one for the TV show, and another for the novels) have the answers, and more.

The graphs for the books tend to be more interesting than those for the TV show, simply because of the far broader range of characters and the intricacy of the interweaving plot lines.

Let’s look at some of the results.

This a small section of the character interaction network for the first book in the A Song of Ice and Fire series (this is the entire visualization - it's big, simply because of the shear number of characters)

The graph was generated by GraphTheory:-DrawGraph (with method = spring, which models the graph as a system of protons repelling each other, connected by springs).

The highlighted vertices are the most influential characters, as determined by their Eigenvector centrality (more on this later).

 

The importance of a vertex can be described by its centrality, of which there are several variants.

Eigenvector centrality, for example, is the dominant eigenvector of the adjacency matrix, and uses the number and importance of neighboring vertices to quantify influence.

This plot shows the 15 most influential characters in Season 7 of the TV show Game of Thrones. Jon Snow is the clear leader.

Here’s how the Eigenvector centrality of several characters change over the books in the A Song of Ice and Fire series.

A clique is a group of vertices that are all connected to every other vertex in the group. Here’s the largest clique in Season 7 of the TV show.

Game of Thrones has certainly motivated me to learn more about graph theory (yes, seriously, it has). It's such a wide, open field with many interesting real-world applications.

Enjoy tinkering!

First 9 10 11 12 13 14 15 Last Page 11 of 34