MATLAB: Is it possible to use createpde for an ‘electromagnetic’ model in R2019b

Partial Differential Equation Toolbox

When trying to run the example command
model = createpde('electromagnetic','electrostatic')
from the doc
this works in R2021a, but throws an error in older releases, e.g.:
R2020b:
Error using createpde (line 74)
'electromagnetic' not supported. Supported physical models: 'thermal' and 'structural'.
How can electromagnetic problems be solved in older releases?

Best Answer

As mentioned in the Release Notes:
The structured workflow for 2D electromagnetic problems is a new feature in R2021a:
When using older releases one could build electromagnetics solutions (work the equations and boundary conditions) by hand using the general workflow:
Here's a related example:
In previous versions, you can also use the PDE Modeler app. The app is a bit outdated, but might work as a workaround - Electrostatic Potential in Air-Filled Frame: PDE Modeler App: