Mathematica vs. Comsol for finite element analysis?

I can give a specific opinion on the comparison. The specificity is that I am not at all a specialist in numerical methods, but rather a user in this area, a physicist who needs to solve equations.

First about strong features of Comsol with respect to Mathematica (MMA).

  • The strongest feature of Comsol is that it has a nonlinear solver, while MMA still does not. In MMA it can only be overcome for time dependent PDEs when the MethodOfLines can be used. A nonlinear FEM solver has been added in Version 12.0. An overview capabilities of the nonlinear solver can be found here, some of the examples are explained in more detail here. For the exact details of the implementation of the nonlinear solver look here. What may also be of interest are the verification tests for the nonlinear solver found here.

  • Further, Comsol has a number of solvers, and in addition to them a number of preconditioners. On one hand, this makes it more flexible, but on the other hand for a user like I am who has no idea on which solver/preconditioner to use in what case - it transforms the life into a nightmare.

  • Comsol is able to solve integral and integro-differential equations. This, however, requires to apply a trick that one can hardly find in its documentation.

  • Comsol has an automatic meshing system, so one does not need to program the mesh. In addition, there are ways to refine the mesh in some regions or at some boundaries. This makes it very convenient for engineering problems with a complex domain and many internal boundaries, especially in 3D. The last version offers a nice feature of defining the mesh according to a function. That is, one introduces a function depending on coordinates, that gives the spatial mesh size dependence.

    MMA, on the other hand, requires programming a mesh, except for some simple cases. However, for scientific, rather than engineering problems, with a rather simple domain, it may be even better since gives one more control.

    Comsol has tools to build a domain, though it requires some training and experience. This is, however, not a very strong advancement, since for engineering problems the domains built with those tools are not very realistic. On the other hand, the scientific problems rarely require complex domains. However, Comsol supports importing a CAD file.

  • Comsol organises yearly conferences. During these conferences, there is a group of Comsol engineers present in the lobby, whom anyone can ask any his question. Typically I went from them away with a good answer.

Now about drawbacks.

  • Comsol has a rather poor post processing possibilities in comparison with MMA.

    Even more, Comsol is organized such, as if the plot obtained from the solution is regarded as a final result. However, if one needs this solution to be used in some further calculations, Comsol has very limited possibilities. For example, it can integrate the solution over a domain or a boundary, define its extremums or a mean value.

    Previously I used to solve a problem in Comsol (when MMA did not solve PDEs and also after it started since my equations are nonlinear) and to export the solutions into MMA to work with it further. Now, if I can, I prefer to solve the problem in MMA from the very beginning and to work in MMA further with the solution. This does not always work for nonlinear equations.

  • Comsol has no dynamic interactivity of MMA, which limits its possibilities. In MMA, in contrast, one can mesh and/or solve equations dynamically while, say, moving a slider. This I use sometimes. This possibility can be, however, limited if the solution requires too much time.

    Comsol has, however, a feature of a parametric sweep. That is, it solves the problem with a few parameters running according to predefined lists and one gets a set of solutions as the result.

  • Comsol has an awful help. It is not written for users. It is written for developers. I only rarely was able to find the answer to my questions in it.

    Comsol has lots of items in the menu, but their names are often given using some jargon. One does not understand, what they do when he sees them in menu. Given the incomprehensible help, without an external help one can hardly use all the power of Comsol, except for the case when he is a Comsol specialist.

    Lots of Comsol features are hidden somewhere in its multiple menus, but one (a) does not know about the existence of these features and (b) even if he knows that the feature exists he will often not find it without external help. I even do not compare it with the help of MMA.

  • Comsol has a model library. This is a gallery of solved problems in all areas covered by Comsol, and one can read a pdf file on it and download a working model. However, each such a text (containing several tens of pages) writes:

    "Press this button, type in this into that input field, now press that button and so on until the end".

    No explanation of why this button should be pressed, and what one goes to do when pressing this button, and why this should be in the input field. One needs to guess himself. To follow all these steps takes you, at least, half a day. And you get from this only 1-2 useful features. But you get them, and there is no other way to learn those features.

That are my impressions. I keep using both of them.

Edit: To address the question of @user21 on the Comsol pricing.

Comsol consists of a main body entitled "Comsol Multiphysics" and about 36 modules.

Multiphysics contains several basic things. One cannot run Comsol without this package. It generally enables one to simulate everything, provided the user is able to formulate all equations and boundary conditions (BCs) himself, though their implementation may require many skills and knowledge of the numeric methods and approaches from him.

However, the modules include specific equations and BCs dedicated to some field of physics or chemistry. Some of the BCs are common for differential equations, others may be only known to people making a simulation in this field, or in one of its specific domains.

To give one example, the Radio Frequency module contains such BCs as a Port for simulating a field coming from or scattered to infinity, or Perfect Electric Conductor BCs to simulate a thin metallic electrode as a 2D, rather than a 3D object or Impedance BCs to simulate such electrodes provided the thickness of the metal boundary exceeds the skin thickness. There are many other such specific BCs.

Some of the modules are necessary to support, say, CAD files import and such, or for combining Comsol with MatLab. The list of modules one finds here.

If one buys several modules, he is enabled to combine equations and BCs of one field with those of another field. It is because of this property Comsol is generally called "Multiphysics".

One buys separately the Multiphysics package and optionally one or several Modules. The prices vary. We have bought it recently and the current price for the Multiphysics (this includes the license for one computer) was about €9000, while the price of the modules varies between €5000 and €10000. Instead of the Multiphysics, we bought a license enabling multiple co-workers to work from the server which costs €20000.

Edit 2: Addressing the question of @Alexander Erlich. The way to import data from Comsol to MMA:

  1. After the result of a simulation has been obtained, go to Model Builder/Results/Export>Right Click and choose “Data” from the dynamic menu. The new item entitled “Data 1” (or “Data 2”, if Data 1 already existed and so on) appears under the node Model Builder/Results/Export. If there are several nodes entitled “Data N” the one freshly appeared will be marked.

  2. Go to the Settings page entitled “Data”.

  3. Specify where the data set is taken from (typically, the last solution chosen from the fall-down list. Specify how the time moment is selected (typically, from the Stored output times) and choose the time moment from which the solution to take.

  4. Under the "Expression" give the expression that should be calculated on the basis of the data. For example, if the function u(x,y) is the only dependent variable in the problem, and we want to have the data containing this function, we specify u. If we need, say, the square of its gradient, we specify ux^2+uy^2.

  5. Under Output specify a) Points to evaluate -> to “Take from data set”, b) Data format –> “Spread sheet” c) To specify the Fileneme, click on Browse and choose the trajectory and the filename in the dialog. The dialog offers extensions text, data, and CSV. Choose date.

  6. In the Advanced subsection uncheck “Include header”.

  7. One may and may not uncheck “Full precision”. If it is unchecked the file is much faster to operate in Mathematica. It is recommended.

  8. Press the button “Export” on the top of the Settings page. Done

The file may be imported into Mathematica in a usual way. One should take care

a) To export in the .dat or csv format and

b) To use the command Import (rather than ReadFile)

Edit: Since the time I have written this answer I have written a book: "Comsol: tips and tricks" where I collected all tricks on Comsol that I learned during these years. It is in a pdf form, and I willingly send it anyone who wants. Only give me your e-mail address.


I have not specifically used COMSOL, but can speak to other FEA and CFD solvers that I use including ANSYS, LS_DYNA, ABAQUS, Fluent, CFX, etc.

If you are doing engineering simulation of anything other than very simple problems (like the kinds you program in college classes) then a commercial package is vital.

Speed is probably the least important difference, though these vendors do invest a huge amount in improving performance for parallel processors, and I think you would see a large difference if you compared them to Mathematica on a cluster.

The big differences are the all the physics, constitutive models for material behavior, turbulence models, adaptive meshing algorithms and thousands of other details that are built into the FEA/CFD software that make it possible to simulate real world behavior, and the thousands of validation cases to make sure all those models represent reality.

I have used these packages to simulate boat crashes, rubber seals, multiphase flow of steel with phase change and hundreds of other problems that I couldn't practically use Mathematica for.

Most of these packages support user defined features, so you can extend their functionality with your own programming.

Some of the issues noted for COMSOL, like poor documentation and help, are not issues with other software. However they are all specialist tools. I typically figure that a new graduate with a master's in an engineering analysis field needs about 5 years working with experienced mentors to become proficient and 10 years or more before they are ready to work independently on challenging problems.

The cost ranges, but the high-end software are about an order of magnitude more expensive than Mathematica.


I have used both Mathematica and Comsol Multiphysics (formerly FEMLAB) for decades to solve practical problems. Mathematica is my go-to mathematics application because of versatility. I go to Comsol when: 1. There is a geometry more complicated than a box, cylinder, or sphere. Comsol uses consecutive solid geometry to build up shapes including the ability to import from CAD programs. New features in Mathematica allow building up more complicated structures, but it requires building an expression for the shape rather than constructing it out of geometric operations. 2. I need access to the material property database in Comsol. Mathematica has some chemical properties but is weak on things like diffusion, thermal conductivity, and viscosity.
3. I need problem specific tools that Comsol can provide, such as turbulence, electromagnetic modeling, or multiphysics. Multiphysics is essentially the coupling of different phenomena, for example thermal conductivity coupled with fluid flow.

Mathematica is considerably less expensive than Comsol Multiphysics, and has a notebook interface that makes constructing reports much easier. I will often import Comsol results into Mathematica for post processing.

Mathematica DOES solve non-linear problems; I have used it in modeling chemical reaction systems which can be very nonlinear. Mathematica does use state-of-the-art solvers for general problems, but Comsol has some more sophisticated solvers for many disciplines: fluid flow and electromagnetics in particular. The new FEM functions in Mathematica appear to have mesh construction tools that are just as good as Comsol, but I have not tried them extensively.