Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
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.
importing a coil geometry from matlab to comsol
Posted 2011年3月2日 GMT-5 13:35 Low-Frequency Electromagnetics, RF & Microwave Engineering, Geometry, Mesh, Modeling Tools & Definitions, Parameters, Variables, & Functions Version 4.1 2 Replies
Please login with a confirmed email address before reporting spam
HI friends.
I am very much new to comsol. I am working on my thesis. Its on a 1000 turn coil generating rf frequencies. The problem is I have to import this 1000 turns coil geometry from matlab to comsol. I wrote a program which gives me n turns in matlab. But I am having trouble with importing it in to comsal. here is ma matlab program.
close all
clear all
%W=
%w=
N=10;
p=3/N;
w=p/2;
%g=P-w;
x0=1;
y0=1;
z=[1,1];
Cx=w;
Cy=w;
a1=2;
b1=11;
P(1,1)=x0+a1+Cx;
P(1,2)=y0;
i=1;
for j=2:4:4*N+1
P(j,1)=x0+a1+Cx+(i-1)*p;
P(j,2)=y0+(i-1)*p+b1+Cy;
%hold on
P(j+1,1)=x0-(a1+Cx+(i-1)*p);
P(j+1,2)=y0+b1+Cy+(i-1)*p;
%line(P(j),P(j+1))
%hold on
P(j+2,1)=x0-((a1+Cx)+(i-1)*p);
P(j+2,2)=y0-((b1+Cy)+(i-1)*p);
%line(P(j+1),P(j+2))
%hold on
P(j+3,1)=x0+(a1+Cx)+i*p;
P(j+3,2)=y0-((b1+Cy)+(i-1)*p);
%line(P(j+2),P(j+3))
i=i+1;
P;
end
for j=1:1:4*N
plot([P(j,1),P(j+1,1)],[P((j),2),P((j+1),2)])
hold on
end
now the problem is I can not figure it out how to import this in to comsol mainly how to change this program to the sintax used by the comsol..... can any one please help me in this.
sorry for the inconvenience...
thanking you all
I am very much new to comsol. I am working on my thesis. Its on a 1000 turn coil generating rf frequencies. The problem is I have to import this 1000 turns coil geometry from matlab to comsol. I wrote a program which gives me n turns in matlab. But I am having trouble with importing it in to comsal. here is ma matlab program.
close all
clear all
%W=
%w=
N=10;
p=3/N;
w=p/2;
%g=P-w;
x0=1;
y0=1;
z=[1,1];
Cx=w;
Cy=w;
a1=2;
b1=11;
P(1,1)=x0+a1+Cx;
P(1,2)=y0;
i=1;
for j=2:4:4*N+1
P(j,1)=x0+a1+Cx+(i-1)*p;
P(j,2)=y0+(i-1)*p+b1+Cy;
%hold on
P(j+1,1)=x0-(a1+Cx+(i-1)*p);
P(j+1,2)=y0+b1+Cy+(i-1)*p;
%line(P(j),P(j+1))
%hold on
P(j+2,1)=x0-((a1+Cx)+(i-1)*p);
P(j+2,2)=y0-((b1+Cy)+(i-1)*p);
%line(P(j+1),P(j+2))
%hold on
P(j+3,1)=x0+(a1+Cx)+i*p;
P(j+3,2)=y0-((b1+Cy)+(i-1)*p);
%line(P(j+2),P(j+3))
i=i+1;
P;
end
for j=1:1:4*N
plot([P(j,1),P(j+1,1)],[P((j),2),P((j+1),2)])
hold on
end
now the problem is I can not figure it out how to import this in to comsol mainly how to change this program to the sintax used by the comsol..... can any one please help me in this.
sorry for the inconvenience...
thanking you all
2 Replies Last Post 2011年3月9日 GMT-5 15:57