Videos > Creating and Plotting Named Expressions with the Field Calculator in Maxwell
Dec 2, 2023

Creating and Plotting Named Expressions with the Field Calculator in Maxwell

Hello everyone and welcome to today's video. In this session, we'll explore how to create and plot named expressions using the fields calculator in Maxwell. In our previous videos, we used the magnetostatic solver to visualize magnetic fields and took an in-depth look at the fields calculator. This time, we'll be using the electrostatic solver to practice some of our named expressions.

Setting Up the Simulation

The capacitor we'll be using is a built-in example. You can find it by navigating to:

  • Desktop tab
  • Click "Open Examples"
  • Select "Maxwell" > "General"
  • Find it in the "Electrostatic" folder

Remember to save it in a different location once you open it. This capacitor uses PEC for the plates and vacuum for the dielectric. To make it more interesting, I'll change the plates to aluminum and the dielectric to polyethylene. Once finished, go ahead and run the simulation.

Using the Fields Calculator

The fields calculator helps us verify Maxwell's results. We'll create a named expression to manually evaluate capacitance using the formula:

  1. Find values for permittivity, area, and distance.
  2. Create variables in the field calculator.

Starting with permittivity, locate it in the materials properties box. Use the measure tool to find the distance between the plates, and create a planar non-model object for the area.

Creating Named Expressions

Let's open the fields calculator. The first named expression we'll create is the scalar version of our geometry element:

  1. Create a scalar with the value of 1.
  2. Pull in the geometry (non-model object named "area").
  3. Integrate to find the area.

Save this as a named expression "A". It will appear at the bottom of our named expressions list.

Calculating Capacitance

Next, we'll work on the numerator:

  1. Pull in constant epsilon naught.
  2. Multiply with project variables (e.g., ER).
  3. Divide by distance to find capacitance.

Evaluate to check the result: 12.451 picofarads. This matches our simulation results.

Handling Multiple Dielectrics

To verify Maxwell's ability to handle multiple dielectrics, we'll split them vertically or stack them. We'll start by recalling the equations and splitting the dielectrics down the middle.

Split Dielectrics

  1. Copy "A" to the stack and multiply by epsilon naught.
  2. Divide by distance to get basic capacitance: 5.53 picofarads.
  3. Save as named expression "C0".
  4. Multiply "C0" by the average of two dielectric constants.

Result: 18.123 picofarads.

Stacked Dielectrics

  1. Use "C0" and multiply ER1 and ER2 together.
  2. Add ER1 and ER2, then divide by the first value.

Result: 16.348 picofarads.

Using Named Expressions in Parametric Analysis

We'll use the named expression "CT" in a parametric analysis to plot capacitance as we sweep the second dielectric permittivity over a range of values. After running the simulation, create a fields report and plot "CT".

Conclusion

This tutorial demonstrated how to create and use named expressions in Maxwell's fields calculator. We hope this helps you better understand the tool. Stay tuned for our next video on transient solvers. Thank you for watching. This has been Ian from Ozen Engineering, Inc.

[This was auto-generated. There may be mispellings.]

Hello everyone and welcome to today's video where we'll take a look at how to create and plot named expressions using the field calculator in Maxwell. In the last videos we used the magnetostatic solver to visualize magnetic fields and then we took a thorough look at the field calculator.

This time we'll be using the electrostatic solver while we practice some of our named expressions. The capacitor we'll be using is another built-in example.

You can find it by making sure you're on the desktop tab, clicking open examples, Maxwell, general, and it'll be the only one in the electrostatic folder. Just remember to save it in another location once you open it. This capacitor uses PEC for the plates and values.

This capacitor is used to store the vacuum for the dielectric. This is boring so I'm going to make the plates aluminum and the dielectric polyethylene. Once finished go ahead and run the simulation.

A nice thing about the field calculator is how it can help us feel confident in Maxwell's ability to provide the results that you would expect to see. Here's an example.

The simulation we just ran is going to give us capacitance values already but with the field calculator we can verify that the values or the order of magnitude are accurate.

We'll do this by creating a named expression that manually evaluates the capacitance using the simple formula that we all have memorized and definitely didn't need to look up. We'll start by finding the values for permittivity, area, and distance, and creating variables in the field calculator.

Starting with permittivity, this is just in the materials properties box. Next, I'll go ahead and use the measure tool to find the distance between the two plates and finally I'll create a planar non-model object for the area we're now ready to start working in the field calculator.

Let's open it up. I think the first named expression that we should make is the scalar version of our geometry element, similar to how we did in the previous video.

So if you'll recall, we need to first create a value, a scalar with the value of 1, and then we can pull in our geometry, which in this case is the non-model object that I named area, and then we're going to integrate this. If you evaluate it, you can see that this is the area that we need.

I'm going to pop that off the stack and we're going to save this. We're going to name it just A and click OK. Next, we're going to work out that numerator.

We'll go ahead and pull in constant epsilon not and we're going to pull in function is where all the project variables that you've created are going to be, so for me that's this ER, and I'll multiply them together.

Next, we're going to pull in the area because we had to create variables that we needed to run, and we're going to divide them. Then, we're going to multiply all the guys. We'll have all our functions here, these numbers that we gave them.

So I'll stop the examples that you need to set and add them, so I make sure that all of that will never be available. Times that you approve a new function, we can correct what you have to do, and we'll do this up here at the top as the named expressions.

I'm going to click copy to stack and again multiply. Next, we need to give, let's see, function again the distance. We're now ready to click divide. If you'll recall, this is going to divide the second register by the first register, which is what we want.

And let's evaluate this to see where we're at. 1.245 times 10 to the minus 11. So this is 12.451 picofarads. Let's now compare this against the results. 12.451 picofarads. This is great, but let's say we aren't quite convinced.

We want to know if Maxwell can handle multiple dielectrics, either split vertically or stacked on top of each other. We can verify this just as easily. We'll start by, once again, simply recalling the equations. We are, after all, studious engineers who still have each of these equations memorized.

But I'll display them in the corner just in case. So I'll start by finding another dielectric for our project. And then I'll spare you having to watch every single step while I split these two dielectrics down the middle, both length and width-wise.

After solving the two new models, we're ready to open up our field calculator again. We already have A. I'm going to copy this to the stack and multiply it by epsilon naught. And, of course, divide it by our distance. At this point, we can check if this makes sense.

Yeah, I'd say it does. 5.53 picofarads. This is the just basic capacitance value when there's no dielectric presence. We need this for both of the equations we're going to be using. So I'm going to save this as a named expression. Or let's get rid of weights. There, we're going to have microfarads.

And the real disintegrations of the situation 이거 and so on. Oh, God. That's bad. No. desal Oğlum. Absolutely. Only if we do unlike what Said cuz. If this makes sense, I'd say it does. 5.53 picofarads. This is the just basic capacitance value when there's no dielectric presence.

We need this for both of the equations we're going to be using. So I'm going to save this as a named expression.

I'm going to pop off our eval and click Add and call it C 0. The last thing we need to do for this simulation with the split dielectrics is multiply this value of C0 by the average of the two dielectric constants.

So the function has both of them, ER1, ER 2. We need to sum these together and divide by 2. Grab a scale with the value 2, divide. We'll check this real fast. Looks right. Pop that off the stack, add in C0 and multiply. And we're left with 18.123 picofarads. Let's check this. 18.123 picofarads.

Nice. We'll repeat that exact same process over here with the stacked dielectrics. We just did the split. There we are. Open up the field calculator. We already have C 0. So what we're going to start with, function.

Here's our ER1, our ER 2. We're going to multiply these together and then multiply those by 2. Now we need ER1 and ER 2. Add those together. And we need to divide those from... Our first value. Now let's check this out. Evaluate. That looks right to me.

Going to pop that off, add in our C0 and multiply. Evaluate that. We have 16.34 picofarads. Let's check that out. 16.348 picofarads. 16. 348. Nice. To show you how you can use named expressions outside of the field calculator, we're going to use this. Let's grab this named expression.

So I'm going to pop the evaluation off the stack and add this. We'll call this CT, as in C theoretical. Click OK. And it has been added to our named expressions. We're ready to use it. Click Done. I'm going to use our new named expression in a parametric model.

So for this example, I'm going to use this one. Expression in a parametric analysis. The idea here is I want to plot CT when I sweep, in this instance, the value of our second dielectric permittivity over a wide range of numbers, and I want to, you know, graph that CT and watch it change.

So let me start this parametric analysis. And with that simulation complete, we're now ready to plot this. So I'm going to come to results and create a fields report, rectangular plot, and my CT is ready for us. I didn't sweep ER1, I swept ER2, and we're good. Let's plot this.

And what we can see here is a graph of our theoretical capacitance as we sweep one of our permittivity values. So this is how you plot one of your own named expressions. We used lots of named expressions, you know, in the process of getting here. I hope that this is helpful.

I hope that you have a better handle on how to use named expressions, how to create them, and a better handle on just the field calculator in general now. I'm going to put out one more video on the field calculator that covers the transient solvers, so make sure you're subscribed for that.

And then we're going to move on to some more exciting topics. Thank you so much for watching. This has been Ian from Ozen Engineering. I'll catch you next time.