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.

error message

Please login with a confirmed email address before reporting spam

Error: 1092
An error occurred when opening the M-file.
Loaded data will be incomplete.

Failed to evaluate variable jacobian

Details:
Exception:
com.femlab.util.FlException: An error occurred when opening the m-file .Loaded data will be incomplete.#Failed to evaluate variable jacobian
Messages:
An error occurred when opening the m-file .Loaded data will be incomplete.#Failed to evaluate variable jacobian

Stack trace:
at com.femlab.gui.FlProgressThread.a(Unknown Source)
at com.femlab.gui.FlProgressThread.run(Unknown Source)
at com.femlab.util.j.run(Unknown Source)
at com.femlab.util.ae.run(Unknown Source)


Can someone tell me how to sovle this problem?

5 Replies Last Post 2010/04/01 5:44 GMT-4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/03/31 15:22 GMT-4
Hi

I read from that that you file did not fully respect the COMSOL format and some info such as boundary conditions or function definitions, or even the geoemtry did not read in correctly, or got offset.

If you cannot evaluate the Jacobian then the equations inputs are not coherent.

Try to go over your M file, and your BC definitions within COMSOL, probably you will see somethig missing there, or you have typically an unwanted <CR> in the middle of a line in your matlab file

Good luck
Ivar
Hi I read from that that you file did not fully respect the COMSOL format and some info such as boundary conditions or function definitions, or even the geoemtry did not read in correctly, or got offset. If you cannot evaluate the Jacobian then the equations inputs are not coherent. Try to go over your M file, and your BC definitions within COMSOL, probably you will see somethig missing there, or you have typically an unwanted in the middle of a line in your matlab file Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/03/31 21:01 GMT-4
Dear Ivar,
I have checked up my m file for many times,but I can't find where is wrong.
Now I sent you my m file,can you help me to check it up?
Dear Ivar, I have checked up my m file for many times,but I can't find where is wrong. Now I sent you my m file,can you help me to check it up?


Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/04/01 2:38 GMT-4
Hi

I have only 3.5a and cannot read in a m file into comsol, but by opening it in Matalb (linked to COMSOL, I can run it and I get the following error message for your .m file (inside matlab):

===========================
com.femlab.jni.FlNativeException: Failed to evaluate expression
Messages:
Failed to evaluate expression
- Expression: d(tEx-tEx_per1_rfw*exp(-j*((kperx_rfw)*(((rdst1x_g1_rfw)-(rsrc1x_g1_rfw)))+(kpery_rfw)*(((rdst1y_g1_rfw)-(rsrc1y_g1_rfw)))+(kperz_rfw)*(((rdst1z_g1_rfw)-(rsrc1z_g1_rfw))))),tEx_per1_rfw)

Failed to evaluate variable
- Variable: kperx_rfw
- Defined as: kx

Failed to evaluate variable
- Variable: kx
- Defined as: ((k+k1)*b)

Failed to evaluate variable
- Variable: k
- Geometry: 1
- Boundary: 12
==============================

Such a message must be read from buttom to top in Matlab (in my GUI v3.5a it has benn inversed as I get the same message, so it is easier to understand): on geometry 1, boundary 12 there is a variable "k" not defines, that is used to define "kx", chaining to "kperx_rfw" an into the more complete expression given first in the list which is the equation of the vaiable "bnd1_rfw", respectively "bnd2_rfw".

When I import the "fem" structure from matlab to COMSOL (v3.5a) an I inspect your boundary conditions of BC "12" I see the "k" being probably the k-vector for the Floquet periodicity. But when I go to the "physics - Equation systems _ boundary settings - Variables tab" I find no "k" defined therein, so the vector must have another internal name.

One usefull way to check your variables names is to do a "Solve - get initial conditions" which populates the matrices and allows you to do a first check of coherehnce of your formulas in the mode (not everything as you get no error for that) but thereafter you can check your geometric chracterisitics: volume mass ... and you can integrate variables by a "Postprocessing Boundary integration", select boundary 12 and write variable "k". The error message is the same sothat name is not defined.

By the way as you are using the Floquet BC's I noticed that you have not turned on the "solver advance tab" "Use Hermitian transpose of constraint matrix and in symmetry detection". The RF user guide tells you to turn it on, even if COMSOL has not done it for you.

As I do not know the name of the variable "k" in this case I tried (logically k_rfw without more success) so its back to the doc. There an indexed search on the pdf files with the name "floquet" gives only RFUG.PDF without more info therein either.
So I come to that "k" is not used as such i.e. defined as a variable (it's a vector so anyhow it need 3 components) but the equation above is written out on the GUI using "k" so its probably only used there and not exported.

So I'm stuck here, next step for me would be to study your model in detail to understand it fully (I have just run it so far), and identify why you whant "k" on your global expression linkled to the "bnd.kper" floquet vector that for me a fist though does not make sense.

So perhaps you can continue from here ?

Hope it has brought you further on the way
Good luck
Ivar
Hi I have only 3.5a and cannot read in a m file into comsol, but by opening it in Matalb (linked to COMSOL, I can run it and I get the following error message for your .m file (inside matlab): =========================== com.femlab.jni.FlNativeException: Failed to evaluate expression Messages: Failed to evaluate expression - Expression: d(tEx-tEx_per1_rfw*exp(-j*((kperx_rfw)*(((rdst1x_g1_rfw)-(rsrc1x_g1_rfw)))+(kpery_rfw)*(((rdst1y_g1_rfw)-(rsrc1y_g1_rfw)))+(kperz_rfw)*(((rdst1z_g1_rfw)-(rsrc1z_g1_rfw))))),tEx_per1_rfw) Failed to evaluate variable - Variable: kperx_rfw - Defined as: kx Failed to evaluate variable - Variable: kx - Defined as: ((k+k1)*b) Failed to evaluate variable - Variable: k - Geometry: 1 - Boundary: 12 ============================== Such a message must be read from buttom to top in Matlab (in my GUI v3.5a it has benn inversed as I get the same message, so it is easier to understand): on geometry 1, boundary 12 there is a variable "k" not defines, that is used to define "kx", chaining to "kperx_rfw" an into the more complete expression given first in the list which is the equation of the vaiable "bnd1_rfw", respectively "bnd2_rfw". When I import the "fem" structure from matlab to COMSOL (v3.5a) an I inspect your boundary conditions of BC "12" I see the "k" being probably the k-vector for the Floquet periodicity. But when I go to the "physics - Equation systems _ boundary settings - Variables tab" I find no "k" defined therein, so the vector must have another internal name. One usefull way to check your variables names is to do a "Solve - get initial conditions" which populates the matrices and allows you to do a first check of coherehnce of your formulas in the mode (not everything as you get no error for that) but thereafter you can check your geometric chracterisitics: volume mass ... and you can integrate variables by a "Postprocessing Boundary integration", select boundary 12 and write variable "k". The error message is the same sothat name is not defined. By the way as you are using the Floquet BC's I noticed that you have not turned on the "solver advance tab" "Use Hermitian transpose of constraint matrix and in symmetry detection". The RF user guide tells you to turn it on, even if COMSOL has not done it for you. As I do not know the name of the variable "k" in this case I tried (logically k_rfw without more success) so its back to the doc. There an indexed search on the pdf files with the name "floquet" gives only RFUG.PDF without more info therein either. So I come to that "k" is not used as such i.e. defined as a variable (it's a vector so anyhow it need 3 components) but the equation above is written out on the GUI using "k" so its probably only used there and not exported. So I'm stuck here, next step for me would be to study your model in detail to understand it fully (I have just run it so far), and identify why you whant "k" on your global expression linkled to the "bnd.kper" floquet vector that for me a fist though does not make sense. So perhaps you can continue from here ? Hope it has brought you further on the way Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/04/01 3:40 GMT-4
Thank you all the same.But I think you didn't know what I want to do.Now I sent you a m file which I used to calculate the bands of 2D photonic crystal.It is OK.But when I want to turn to the bands of 3D photonic crystal which I have sent you before.There is some problem you see.
Can you look into the problem and help me again?
Thank you all the same.But I think you didn't know what I want to do.Now I sent you a m file which I used to calculate the bands of 2D photonic crystal.It is OK.But when I want to turn to the bands of 3D photonic crystal which I have sent you before.There is some problem you see. Can you look into the problem and help me again?


Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/04/01 5:44 GMT-4
Hi

Well if I take your m_fil.m and modify it accordingly:

% Multiphysics
fem=multiphysics(fem);
kk1=0;
kk=0; <<<<<<<<<<<<<<<<< added <<<
n=1;
bands=4;
for kk1=0:0.02:1
% Global expressions
fem.globalexpr = {'a','360E-9[m]', ...
'b','pi/a', ...
'k1',kk1, ...
'k',kk, ... <<<<<<<<<<<<<<<<<<<<<<<< added <<<<
'kx','(k1+k)*b', ...
};

By similarity with your 2D.m for me it runs now (finally)
(in matlab 7.1.0.183 (R14) Service Pack 3, with comsol dll's for V3.5a)
and I get an error in the plot file (vector length incompatibility) so by changing the first plot x value to plot(0:0.02:1.02,f(i, .... I get something out, but it looks indeed more like noise than smooth band-gaps.

Now by launching COMSOL and importing "fem" as calculated the display looks very mesh dependent. So indeed something is wrong, but it solves for me.

Going further into your model, you do not have the same boundary conditions on your 2D and 3D model lateral sides (apart the Floquet conditions on 1-12) should these not be similar in the two ? And how to define correctly the top/bottom surfaces ?. In 3D they are all perfect electric conductors, in 2D Periodic continuity for the lateral ones, default 2D mode on top/bottom which is ? (have to llok it up).

Finally, I beleive one should select eigenvalue and not eigenfrequency, but this is a COOMSOL GUI issue for the presentation as you are in the Matlab mode and use the eigenvalues it is not the most important.

So I need to go bck to my theory to find out what happens to the top/bottom surfaces in 2D mode w.r.t 3D mode.

Sorry cannot do more for the moment
Ivar

Hi Well if I take your m_fil.m and modify it accordingly: % Multiphysics fem=multiphysics(fem); kk1=0; kk=0;

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.