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.

coupling two structures in matlab - eigen-problem/Fourier transform

Please login with a confirmed email address before reporting spam

Hi all,

One month ago, many people asked any help to find Fourier's transform with respect one direction only. I have two answers but one of them need your contribution.

ANSWER 1 :

How do a Fourier's transform of a function with one variable ? : example : f(x) = |x|

source : Reference Guide (p 60 : elcplgenint)

clear fem
fem.geom = geom1([-10 10]);
fem.mesh = meshinit(fem, 'report', 'off', 'hmax',0.1);
fem.equ.gporter = 4;
fem.elem = {};

clear el
el.elem = 'elcplgenint';
el.g = {'1'};
el.var = {'G'};
clear src;
src.expr = {{'((abs(x))*exp(-i*dest(x)*x)'}};
src.iorders = {'4'};
el.src = {{{},src}};
clear dst;
dst.usage = {{'1'}};
el.geomdim = {{{},dst}};
fem.elem = {};
fem.elem = [fem.elem {el}];

fem.xmesh=meshextend(fem);
postplot(fem,'lindata','G','liny','G');

----> this script works

ANSWER 2 (to be completed !!) :

How do the x-Fourier's transform of the the eigen-solution \delta u_i(x,y) = \lambda u_i(x,y) (with 2d-geometry L-shaped where \delta is Laplacian's operator) :


%%% Solve Poisson's eigen-equation ---> u_i(x,y) (10 eigensolutions)
clear fem
fem.geom = poly2([-1 0 0 1 1 -1],[0 0 1 1 -1 -1]); %% L-shaped geometry
fem.mesh = meshinit(fem,'hmax',0.1);
fem.shape = 2;
fem.equ.c = 1; fem.equ.da = 1;
fem.bnd.h = 1;
fem.xmesh = meshextend(fem);
fem.sol = femeig(fem,'neigs',10);
[u,lambda] = femeig(fem,'neigs',1); %
postsurf(fem,'u','solnum',6)

%%% x-Fourier transform of the previous solutions u_i(x,y) --TF--> u_i(q,y) (by using the first script)
clear el
el.elem = 'elcplgenint';
el.g = {'1'};
el.var = {'G'};
clear src;
src.expr = {{'u(1,:)*exp(-i*dest(x)*x)'}};
src.iorders = {'4'};
el.src = {{{},src}};
clear dst;
dst.usage = {{'1'}};
el.geomdim = {{{},dst}};
fem.elem = {};
fem.elem = [fem.elem {el}];
postsurf(fem,'G')

Unfortunately, the x-Fourier's transform is not found. Here the error message :

??? Java exception occurred:
Exception:
com.femlab.jni.FlNativeException: Failed to evaluate expression
Messages:
Failed to evaluate expression
- Expression: G

Failed to evaluate variable
- Variable: G
- Geometry: 1
- Subdomain: 1

Undefined post expression


Stack trace:

at evaltree.cpp, row 866, ()
at xevalutil.cpp, row 2612, ()
at xmodel_post.cpp, row 810, ()

at com.femlab.xmesh.Xmesh.postEval(Native Method)

at com.femlab.xmesh.Xmesh.postEval(Unknown Source)

at com.femlab.post.PostServer.a(Unknown Source)

at com.femlab.post.PostPlot.elemPlot(Unknown Source)


Error in ==> postplot at 885
plotMesh = com.femlab.post.PostPlot.elemPlot(postServer,prop,plotSDim,evalEDim,normalType);

Error in ==> postsurf at 53
hh=postplot(fem,...

Error in ==> eigen_problem at 27
postsurf(fem,'G')


How modify the previous script to perform the x-Fourier's transform of u_i ? Maybe have you an answer ?

Thank you for all !

Grace





0 Replies Last Post 2010年12月28日 GMT-5 04:54
COMSOL Moderator

Hello grace ternart

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

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.