I recently had the pleasure of attending the Medical Device Innovation Conference (MDIC), which included interesting talks about computer modeling and simulation, as well as the impact of AI on regulatory workflows. It was inspiring to see the work that people are doing with the COMSOL Multiphysics® software, and I received some technical questions about implementing CEM43 thermal dose calculations in the software. It turns out that this topic is a great way to highlight the synergy between AI and COMSOL®. Let’s learn more!
Medical Devices and Electromagnetic Heating
When designing a medical device that has the possibility of interacting with electromagnetic fields, engineers have to consider that localized tissue heating is a risk factor. In 2024, the FDA published a draft guidance document that references the CEM43 thermal dose model as one way to assess device safety.

COMSOL colleagues Pushkar Wadagbalkar (middle), Mao Mao (right), and myself (left) at the Medical Device Innovation Conference (MDIC) in Maryland.
From the point of view of medical device design, the heating of tissue can either be the purpose of the device or an unwanted side effect. For instance, heating can be desirable in RF and microwave ablation therapies, where the purpose is to damage a tumor. However, in other cases, unwanted heating can arise around metal implants when they are exposed to the time-varying electromagnetic fields that are present in an MRI. Since people with implants are, unfortunately, more likely to need an MRI scan, this complication is a significant concern for the implant designer. Here, I will look at this situation in more detail and discuss how the use of AI can help.
First, though, let’s look at a bit of background on the modeling of such situations. If you want to build a computational model of an implant, the workflow in COMSOL Multiphysics® is straightforward. You’ll usually want to begin with importing data of the region of the body around the implant. This data can either be in the CAD or STL format, but note that the latter sometimes requires cleanup. You can also read in grid-based (voxel) data representing the distribution of material properties. Or, if you’re working with smaller datasets, it’s also possible to do image segmentation entirely within COMSOL Multiphysics®.
From there, you combine the model of the body with the model of your device and the surrounding MRI coil. A good example to start with is our RF Implant Heating in MRI tutorial model, which considers the heating of a metallic part within a gel phantom.
Other suggested resources:
If you’re entirely new to using COMSOL® for this application area, there’s also a great series of training videos you can watch.
To understand all of the options for coupling an electromagnetic model to a thermal model, see this article: “Setting Up and Solving Electromagnetic Heating Problems“.
These resources will help you get started with building a model to predict temperature rise over time due to electromagnetic heating.
Computing Thermal Dose and Using AI
Once the temperature fields over time are known, you will want to evaluate thermal damage. This step is where you can use the CEM43 thermal dose calculation — and this is where I turned to AI for help. I inserted a well-crafted prompt for ChatGPT® into the Chatbot window in COMSOL Multiphysics®, and the results told me that the CEM43 is defined as the following time integral:
where R=0.25 for T<43^\circ C, and R=0.5 for T\ge 43^\circ C. This equation was already surprising to me, as some sources present this calculation in terms of a summation, rather than an integral. At this point, I was already pleasantly surprised that ChatGPT® was able to make such an intuitive leap.
Asking the Chatbot window how to implement the thermal dose calculation in a COMSOL Multiphysics® model.
What completely amazed me was what happened next: The Chatbot window asked if I wanted instructions on how to implement this equation in COMSOL Multiphysics®! Well, of course I said yes, and what I got back was both a detailed description of the modeling as well as some sample code. I’ll paraphrase the description here, but note that the exact answer I got was surprisingly more detailed and of very high quality:
To implement the spatially resolved CEM43 dose calculation, add a domain integration using the Domain ODEs and DAEs interface, and enter an ODE that defines an initial condition and integrand, which are solved in parallel with your thermal model, using either the fully coupled or the segregated solution approach. Make sure to change from the default COMSOL Multiphysics® units of seconds to units of minutes, since this dose calculation represents minute equivalents at 43°C.
From there, ChatGPT® also offered to write some sample code for me, and although it did a pretty good job of that as well, I did still have to do some fine-tuning of the resultant code to make sure it worked within the context of the model I was working with.
At this point, though, I was almost on the verge of an existential crisis: Within seconds, ChatGPT® had produced the kind of reply that would take me perhaps half a day to write up and verify. But then I took a second look at the suggested implementation and realized that ChatGPT® had only told me half the story. There are actually multiple ways to integrate in time within COMSOL Multiphysics®, and you could also evaluate the same integral using the timeint operator.
In fact, the entire CEM43 dose calculation can be reduced to a single line:
timeint(0,t,(0.25*(1+(T>43[degC])))^((43[degC]-T)[1/K]),'nointerp')
This equation can be used for results evaluation in any model where a variable named T exists for the temperature field — just keep in mind to change the units to minutes. The advantage of this approach, over using a Domain ODEs and DAEs interface, is that it’s very easy to implement and will not affect the time steps that the solver takes. The limitation is that it can’t be used as part of a feedback condition, such as within a control loop. The preferred approach depends on your modeling objectives.
Another way to implement the CEM43 thermal dose calculation in a COMSOL Multiphysics® model: After the calculation is reduced to a single line, it’s added to the Expression field.
Next Step for Getting Modeling Support
To make the conversation more widely relevant, let’s ask another question: Should COMSOL Multiphysics® users ask ChatGPT® their questions or contact COMSOL Technical Support? Well, currently, the answer is both. ChatGPT® is certainly a great resource and can give you an answer in seconds. But you do need to ask exactly the right question, in exactly the right way, and you will often have to apply some creative interpretation to the results.
Bringing it back full circle to the MDIC community, our advice to you would be to experiment as much as possible with AI. AI will occasionally have something very useful to say and can provide guidance and hints at new directions. However, be careful, and treat AI as a distant colleague. It rarely provides exact examples to start from and cannot see all the pitfalls and alternatives. At least for now…
ChatGPT is a trademark of OpenAI, Inc.

Comments (0)