Wednesday, April 13, 2011

I have been asked several times how did I generated the Coil in FEMLAB. I created the coil in MATLAB and then imported it as an object in FEMLAB. I was able to dig out the code and here it is for those who might still be interested.

function g = coil(h,r,s,n)% Create a Coil Line Geometry Object%% Usage:% g = coil(h,r,s,n)%% Arguments:% h : height% r : radius% s : number of windings% n : number of line segments per winding% if n is not specified a spline is used to construct the coil%% Example:% g = coil(0.1, 0.05, 5)% geomplot(g)%% The coil is imported into FEMLAB by using the% File->Import->Geometry Objects menu