Diese Website verwendet Cookies, um einwandfrei zu funktionieren und Ihr Erlebnis zu verbessern. Mit der weiteren Nutzung unserer Website erklären Sie sich mit der Verwendung von Cookies einverstanden.

**Discussion Closed** This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

## How to calculate a value between two points?

Posted 12.02.2010, 13:14 GMT-5 AC/DC & Electromagnetics, Geometry Version 4.2a, Version 5.0 20 Replies

Please login with a confirmed email address before reporting spam

I have modelled a simple 2D electric potential plot of a dielectric between two plates with a void in the middle. I want to know the voltage between across the void. I can get the plots on individual points on teh void but am unclear how the points are specified?

Does anyone know how to specify the function: voltage_diff = voltage at point 1 - voltage at point 2?

Thanks, David.

Please login with a confirmed email address before reporting spam

You want to know the pd between two points inside your empty space? are those points already defined in your geometry, or you have to choose two position p1 and p2 when you are post-processing??

Please login with a confirmed email address before reporting spam

Thanks for responding.

I'm trying to determine the potential difference between boundary 6 and 5. I want to use the result to change the permittivity of the void.

For example, the current potential on boundary 6 is 650V and boundary 5 is 348V, so the difference is 308V. I want to be able to use that 308V in the initial problem. So if the difference is say >350V (by increasing the source voltage, in over-voltage condition) change the permittivity of the void.

I have attached the model for reference.

I have done a similar expression for the total potential as it is "V" is comsol, but I can't work out how to define Vdiff?

Thanks, David

Attachments:

Please login with a confirmed email address before reporting spam

After reading some more on the topic and having a look through other discussions on the forum, I have found how to do this.

It is under - 'options, integration coupled variable, boundary variables'. I setup two variables for potential (at boundary 6 and 5) and then in global expressions wrote an expression for the difference.

I hope this helps others.

David.

Please login with a confirmed email address before reporting spam

there ae w tricks you can use to get the difference of some dimension between TWO boundaries (or points), (you can expand it to more thn two by similarity but it becomes heavy)

1) select the two boundaries or points (let us assume index 6 and 8)

2) postprocess or calculate lets us say the voltage V by the formula V*(-1)^(dom==8)

this corresponds to the value of V for domain=6 - (minus) V for the domain=8

typically if you want to know the voltage drop across two boundaries you derfine an integration vable

Area = int(1) the integration of 1 along the area (you can also define a multiple AREA by using the formula (dom==dom) insterad of "1" and then slecting the source and destination items t the regions where you want to calculate the Area.

Then You calculate ans integration coupling variable

V/Area*(-1)^(dom==8) for domains 6 and 8 selected and you want the diffce V"6" - V"8"

is it clear ;)

check "dom" in your doc

Good luck

Ivar

Please login with a confirmed email address before reporting spam

What I can't do is sum or difference values between different points.

For instance, if I want to add the amplitudes of the x displacements of two points resulting from a frequency response analysis:

I'd like something like u_amp_smsld_pt1 - u_amp_smsld_pt2 but I don't know how to specify the pt1 or pt2 locations.

I've looked at Point Expressions and Global Expressions and Integration couplings and I'm still lost.

-Jeff

Please login with a confirmed email address before reporting spam

there are a couple of ways depends on what you want and how you define the points. Ther is the "gap" variable in contact processing, but COMSOl is defining the master point for you from the "slave" location and the surface normal.

Then you have, when you know the point(s) you are looking for, the Integration - Coupling Variable - Point Variable with the dest() operator.

if you have a point let us say index "7" and you want to know its "y" distance (or "v" or ...) from the point "6" you select the point "7" define the "Point Variable" Dy with the equation y-dest(y) you deselect the "global" tick and select the destination tab: where you select the point "6" as the destination.

You solve or update your model if already solved, you use the Postprocessing Point evaluation, you select the destination point (where the variable Dy is "only" defined) ad you evaluate "Dy"

Hope this helps

Good luck

Ivar

Please login with a confirmed email address before reporting spam

I sort of got the technique to work and learned some stuff about integration variables in the process. It does seem fairly difficult to remember and setup. Maybe with time it will be easier.

EDIT - I think I figured this out below

I'm getting the undeformed distance between the two points on the model instead of the deformed distance, even though I update the model or rerun the simulation before checking the result.

I'm just taking the x coordinate of a point and subtracting the x coordinate of a second point, using the scheme you taught me. I made a 1" cube and I'm deflecting it .1" (stuck in inches here in the 19th century USA.....) and I get a difference of 1" instead of the .9" I expect. My deformed result display shows the .1" deflection, but the x-dest(x) integration coupling doesn't pick that up.

Any clues? Thanks for your help so far.

EDIT - I just realized I should try u instead of x. oops, I'll bet that will do it.

-Jeff

Please login with a confirmed email address before reporting spam

It works like you said it would. I just had to remember to use u instead of x. Sorry about the confusing previous post.

-Jeff

Please login with a confirmed email address before reporting spam

istnt it nicer to find the solution yourself ;)

I have it a similar situation for another thread, that make me weake up at 3oclock in the night to sort it out.

By the way, if you turn the "Create frame on" (physics - properties) you can also use x2 and y2

Have fun Comsoling

Ivar

Please login with a confirmed email address before reporting spam

I am working on a parallel plate capacitor where both the plates are vibrating. I want to find the distance between two parallel plate point by point and integrate the distance to the whole surface. I have done one simulation on vibration(prescribed displacement in solid mechanics) and also can find the displacement of one plate surface and integrate it on the same surface . But I don’t know how to find distance between two points on two plates. Can any body help me??

I am using V 4.2

Please login with a confirmed email address before reporting spam

check the Definition Model Couplings (v4) and related help/doc. Probably the Boundary Similarity should do, if not one of the others ;)

--

Good luck

Ivar

Please login with a confirmed email address before reporting spam

thansk for the quick reply but i dont know how to use the boundary similarity or extrusion parameters.In the help file it is written how we can define the parametere but not how to use them.Is there any good example availabe anywhere?

I have seen the example here www.comsol.com/community/forums/general/thread/9347/ but i am yet to understand fullythe" -myForce/intop1(1)*genproj1(v[1/m])/intop2(1)*1[m^2]/(0.38237[um]) ". Can you please explain a little. I dont understand how you have used the integration operators here.

and I have another issue in your prvious you have said

"if you have a point let us say index "7" and you want to know its "y" distance (or "v" or ...) from the point "6" you select the point "7" define the "Point Variable" Dy with the equation y-dest(y) you deselect the "global" tick and select the destination tab: where you select the point "6" as the destination."

Here where I will select the destination tab and deselect the global tab.

thanks

Mustafa

Please login with a confirmed email address before reporting spam

there are a few important things to understand with COMSOL, I did not find it obvious in the beginning, but by now I'm rather used to it ;)

this is that when you say "(u,v,w) you motly thing about 3 values for a point, but in fact (u,v,w) by itself is not defined, thies is 3dim field you should rather read (u(x,y,z),v(x,y,z),w(x,y,z)) (still depending on th physics its with uppercase x,y,z to refer to the correct frame). so when you select a boundary, let's say a line in 2D then "u" means "u(x,y) or u(s) where s is a valiable going from 0 to 1 along the boundry/line

Try it out with your point: get a model up, solve it or at least compute the dependent variables (= initiate initial conditions and populate all solution matrices for the starting point) then plot a point, select you point 7 and type "u". You will get a table with one entry the value u(P) where the point P is defining the x,y,z coordinates where u is calculated. If you now select 2 or 3 points, you will get that many entries in your table.

The "trick" how to make a difference, is to generate a new variable (lets say Uproj) defined on a point, line, boundary or domain by a mapping function and projected on the resulting domain, boundary, edge ... then you might select a point P and ask for u-Uproj where the mapping function maps the point P to the desired point P' where u is also fetched. (in your formula its probably the genproj() operator, but without it's definition it is difficult to understand.

The intop1(1) is typically a volume or area, or length calculation of a selected domain, boundary or edge respectively, intop1(1) means sum over selected Elements of the integration over all dimensions of each selected Entity of 1*dx*dy*dz (corrected to the right dimension 3,2,or 1

--

Good luck

Ivar

Please login with a confirmed email address before reporting spam

Many thanks for the quick reply. I have seen your reply and have some question.

1. You have written

"The "trick" how to make a difference, is to generate a new variable (lets say Uproj) defined on a point, line, boundary or domain by a mapping function and projected on the resulting domain, boundary, edge "-the main problem is that there are some mapping function called linear extrusion or general projection but I dont know how to use them and I didnt find any example to work on it.

2. "The intop1(1) is typically a volume or area, or length calculation of a selected domain, boundary or edge respectively, intop1(1) means sum over selected Elements of the integration over all dimensions of each selected Entity of 1*dx*dy*dz (corrected to the right dimension 3,2,or 1"

--- This thing is still not clear to me. intop(1)- what I know that intop is a integration operator over some selected domain or boundary or line. Suppose, in my model I have used intop1(D1) where D1 is a variable. intop1 (D) will find the integration of the variable on a boundary, which I have selected in the definition of the integration operator. But what I have seen in the model www.comsol.com/community/forums/general/thread/9347/ that "1" is not a name of any boundary, domain or edge and obviously it is not a variable.

I am attaching my model. Can you please take a look at it? I want to find the capacitance between two plates by using mapping function.

thanks

Mustafa

Attachments:

Please login with a confirmed email address before reporting spam

I am recently installed COMSOL to a new computer. Here I can not select domain from the graphics mode, is this a computer problem, or for software any special option I haven't used.

Thanks

Please login with a confirmed email address before reporting spam

Please login with a confirmed email address before reporting spam

if you have the points (at least one) defined in your geometry, you can define an integration operator and integrate on the point to load the actual value at this location, and selected time if aplicable into a global variable (Define variables...) and then in your table integrate on the other point and take the voltage difference with your global variable value (which has been made independent of x,y,z,t).

It's logic, once you think it over, but slightly complicated, I agree. It comes from the fact that most variables are fields dependent on (x,y,z,t...) and you need to have a way to define the (x,y,z,t...) arguments, which is done via the point integration and the coordinates of your selected point

--

Good luck

Ivar

Please login with a confirmed email address before reporting spam

I have almost a similar problem.

I am modeling two phase flow, and I want to monitor the distance between the droplet's surface and the wetting wall. If this wall (Boundary) has the ID of 3, how can I define a conditional variable that tells COMSOL this distance?

I was thinking of using "dom" function for both droplet and the boundary, but I have no idea how to implement it! I appreciate your help.

Thank you

--

Sean

Please login with a confirmed email address before reporting spam

Thanks

Please login with a confirmed email address before reporting spam

to read them out individually as you have done is possible but you cannot laod them ino any variables anduse them again, without passing via Matlab or Excel (with livelink or Cut & Paste)

The only way I know about is o add the points in the geometry as "hard point" or part of a line , better an edge cut up or part of an internal surface. Then you can deifne variables in the Model Definition Variables node and work with these. To get a given value of a field at a single point define a coupling integration operator as a point integration on that single point, and equate

my_var1 = intop1(my_field_variable)

There are also the more complex and powerfull extrusion and projection operators that allows to read values from one entitiy (domain, boundary, edge point(s) ) and map them onto other entities of the model

--

Good luck

Ivar

Note that while COMSOL employees may participate in the discussion forum, COMSOL^{®} software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.