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 Assign a Electric Potential to a Point(!) by using Comsol Livelink Matlab

Please login with a confirmed email address before reporting spam

Hello guys,

I read almost all comsol livelink user's guide, and had a research online about it but i dont see anything about that.

I created a 2D model in Matlab Livelink. And in my geometry, i have square, array and a point. I just want to assign a voltage value to that spesific point but all the time it directly assign to the boundary. The number of point is 12 and when i wrote pot1 = ec.feature.create('pot1','ElectricPotential', 1); pot1.selection.set(12); this, it shows 12th boundary. I look after the syntax for usage of set, create, feature but i dont have any information. I find https://www.comsol.com/blogs/manually-work-entity-numbers-selections/ https://www.comsol.com/blogs/automatically-handling-selections-comsol-multiphysics/ this series but it didnt answer my question actually. When i create entity and try to use for example domain, it didnt work like what i expected to see. Any thoughts please?


2 Replies Last Post 5 déc. 2018, 14:31 UTC−5
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 5 déc. 2018, 03:34 UTC−5

Hi

The way you find the answer to this question is to perform the actions you wish to include in your code in the Comsol user interface and save the model as an M-file. Looking at the M-file you'll learn the syntax for settings the potential in a point.

Answer: The number 1 in this line: pot1 = ec.feature.create('pot1','ElectricPotential', 1); Should be 0 (zero) for points.

-------------------
Lars Gregersen
Comsol Denmark
Hi The way you find the answer to this question is to perform the actions you wish to include in your code in the Comsol user interface and save the model as an M-file. Looking at the M-file you'll learn the syntax for settings the potential in a point. Answer: The number 1 in this line: pot1 = ec.feature.create('pot1','ElectricPotential', 1); Should be 0 (zero) for points.

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 5 déc. 2018, 14:31 UTC−5

Hi

The way you find the answer to this question is to perform the actions you wish to include in your code in the Comsol user interface and save the model as an M-file. Looking at the M-file you'll learn the syntax for settings the potential in a point.

Answer: The number 1 in this line: pot1 = ec.feature.create('pot1','ElectricPotential', 1); Should be 0 (zero) for points.

Dear Lars Gregersen,

God bless you! Thank you so much.

>Hi > >The way you find the answer to this question is to perform the actions you wish to include in your code in the Comsol user interface and save the model as an M-file. Looking at the M-file you'll learn the syntax for settings the potential in a point. > >Answer: >The number 1 in this line: >pot1 = ec.feature.create('pot1','ElectricPotential', 1); >Should be 0 (zero) for points. Dear Lars Gregersen, God bless you! Thank you so much.

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.