
Filter by Topic
Release
Popular Topics
 List all discussions
How to calculate a value between two points?
Thread index  Previous thread  Next thread  Start a new discussion 
February 12, 2010 6:14pm UTC
How to calculate a value between two points?
Hello,
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.
Reply  Reply with Quote  Send private message  Report Abuse
February 12, 2010 7:34pm UTC in response to David Smith
Re: How to calculate a value between two points?
Hi,
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 postprocessing??
Reply  Reply with Quote  Send private message  Report Abuse
February 12, 2010 8:42pm UTC in response to R. F. Hamou
Re: How to calculate a value between two points?
Hello,
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 overvoltage 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
Reply  Reply with Quote  Send private message  Report Abuse
February 14, 2010 11:38am UTC in response to David Smith
Re: How to calculate a value between two points?
Hi Comsol Users,
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.
Reply  Reply with Quote  Send private message  Report Abuse
February 15, 2010 8:11am UTC in response to David Smith
Re: How to calculate a value between two points?
Hi
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
Reply  Reply with Quote  Send private message  Report Abuse
April 8, 2010 9:24pm UTC in response to Ivar Kjelberg
Re: How to calculate a value between two points?
I found this thread while looking for how to evaluate a displacement difference between two points on a body. I can plot a point's displacement in x, y or z, and I can plot the sum of x, y and z and even the root mean square of x, y and z. But I can only do this for a single point. (Or several single points.)
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
Reply  Reply with Quote  Send private message  Report Abuse
April 9, 2010 6:46am UTC in response to Jeff Lastofka
Re: How to calculate a value between two points?
Hi
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 ydest(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
Reply  Reply with Quote  Send private message  Report Abuse
April 9, 2010 5:11pm UTC in response to Ivar Kjelberg
Re: How to calculate a value between two points?
Ivar,
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 xdest(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
Reply  Reply with Quote  Send private message  Report Abuse
April 9, 2010 5:45pm UTC in response to Jeff Lastofka
Re: How to calculate a value between two points?
Ivar,
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
Reply  Reply with Quote  Send private message  Report Abuse
April 10, 2010 1:16am UTC in response to Jeff Lastofka
Re: How to calculate a value between two points?
Hi
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
Reply  Reply with Quote  Send private message  Report Abuse
October 4, 2011 10:57am UTC in response to Ivar Kjelberg
Re: How to calculate a value between two points?
Hi
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
Reply  Reply with Quote  Send private message  Report Abuse
October 4, 2011 12:00pm UTC in response to Mustafa Alam
Re: How to calculate a value between two points?
Hi
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
Reply  Reply with Quote  Send private message  Report Abuse
October 4, 2011 3:48pm UTC in response to Ivar Kjelberg
Re: How to calculate a value between two points?
Hi Ivar
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 ydest(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
Reply  Reply with Quote  Send private message  Report Abuse
October 4, 2011 6:40pm UTC in response to Mustafa Alam
Re: How to calculate a value between two points?
Hi
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 uUproj 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
Reply  Reply with Quote  Send private message  Report Abuse
October 5, 2011 11:08pm UTC in response to Ivar Kjelberg
Re: How to calculate a value between two points?
Hi Ivar
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
Reply  Reply with Quote  Send private message  Report Abuse
February 8, 2012 4:28pm UTC in response to Mustafa Alam
Re: How to calculate a value between two points?
Hi
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
Reply  Reply with Quote  Send private message  Report Abuse
June 24, 2012 1:47am UTC in response to Ivar Kjelberg
Re: How to calculate a value between two points?
I have the same issue, but don't follow this explanation. I can find the voltage at two points defined in my model, but don't see how to automatically output their difference to the table.
Reply  Reply with Quote  Send private message  Report Abuse
June 24, 2012 6:23am UTC in response to Jonathan Nyquist
Re: How to calculate a value between two points?
Hi
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
Reply  Reply with Quote  Send private message  Report Abuse
August 30, 2012 10:07pm UTC in response to Ivar Kjelberg
Re: How to calculate a value between two points?
Dear Friends,
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
Reply  Reply with Quote  Send private message  Report Abuse
April 4, 2013 4:26pm UTC in response to Ivar Kjelberg
Re: How to calculate a value between two points?
Could you please explain how you would calculate the potential difference between two points in your domain that are not defined in the geometry. I would like to calculate the difference in potential between two points that are not points defined in the geometry, but they exist in the domain. I can evaluate the voltage at the two points individually by defining a cut point 3D and doing a point evaluation. How can I get the difference in the voltage between the two points without subtracting them manually.
Thanks
Reply  Reply with Quote  Send private message  Report Abuse
April 4, 2013 9:22pm UTC in response to Ram B
Re: How to calculate a value between two points?
Hi
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
Reply  Reply with Quote  Send private message  Report Abuse
Rules and guidelines