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.

Comsol with Simulink little help

Please login with a confirmed email address before reporting spam

I would like some help here! I would be gratefull!


softwares:
Comsol Multiphysics 3.4
Matlab 7.8.0 (R2009a)

I have studied Chapter 9 from model library

PROCESS
i start comsol with matlab

my Comsol model: -> structural mechanics -> plain stress
i draw a rectangular with fixed left side and a 'load' at right side.
I mesh it and solve it.
In options->constants i put load = 100

i try to export it in simulink
i check block type as General dynamic

my comsol subsystem has 1 input (load) and 1 output(y displacement in node 4)

I go to matlab and open the simulink

when typing the structure name to Comsol Multiphysics Subsystem (simsct)

- i have warning msg-
Warning: Calling MEX-file 'C:\COMSOL34\multiphysics\ml74\flgetarray.dll'.
MEX-files with .dll extensions will not execute in a future version of MATLAB.
Warning: Calling MEX-file 'C:\COMSOL34\multiphysics\ml74\flsetarray.dll'.
MEX-files with .dll extensions will not execute in a future version of MATLAB.

Anyway i continue (i want to see what happens next)

my simulink circuit

constant (or sine wave (tests) ) -> comsol -> scope

Simulation diagnostics

1)model error:
Java exception occurred: Exception: com.femlab.jni.FlNativeException: Matrix is zero Messages: Matrix is zero Stack trace: at linearization.cpp, row 1970, () at com.femlab.solver.Linearization.newMatResSolve(Native Method) at com.femlab.solver.Linearization.newMatResSolve(Unknown Source)

2) Block error:
Error in 'untitled/COMSOL Multiphysics Subsystem/S-Function' while executing M-File S-function 'femsfun', flag = 1 (derivatives), at time 0. MATLAB error message: Java exception occurred: Exception: com.femlab.jni.FlNativeException: Matrix is zero Messages: Matrix is zero Stack trace: at linearization.cpp, row 1970, () at com.femlab.solver.Linearization.newMatResSolve(Native Method) at com.femlab.solver.Linearization.newMatResSolve(Unknown Source)

AND matlab warning
Warning: Unable to determine a fixed step size based on the sample times in the model 'untitled', because the model does
not have any discrete sample times. Picking a fixed step size of (0.2) based on simulation start and stop times. You can
disable this diagnostic by explicitly specifying a fixed step size in the Solver pane of the Configuration Parameters
dialog box, or setting the 'Automatic solver parameter selection' diagnostic to 'none' in the Solver group on the
Diagnostics pane of the Configuration Parameters dialog box.


Best regards
Hope for light


2 Replies Last Post 1 oct. 2010, 06:46 UTC−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 1 oct. 2010, 02:17 UTC−4
Hi

I cannot help a lot, but I can suggest to use more compatible matlab Comsol version, such as a 2007 version of matlab that is slightly older than FEMLAB 3.4 you will certainly get rid of several warning messages so then it would be easier o concentrate on the essential ones, as this might not be enough to solve your issue.

You have always the options too, to switch to comsol 4 and a matlab 2010

--
Good luck
Ivar
Hi I cannot help a lot, but I can suggest to use more compatible matlab Comsol version, such as a 2007 version of matlab that is slightly older than FEMLAB 3.4 you will certainly get rid of several warning messages so then it would be easier o concentrate on the essential ones, as this might not be enough to solve your issue. You have always the options too, to switch to comsol 4 and a matlab 2010 -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 1 oct. 2010, 06:46 UTC−4
Dear Ivar,
Thanks a lot for your responce.
I will try to use comsol 4 and matlab '10, or matlab 07 and comsol 3.4

If there are some other suggestions about what is wrong with my model as described above pls enlighten me.

Thanks in advance
Dear Ivar, Thanks a lot for your responce. I will try to use comsol 4 and matlab '10, or matlab 07 and comsol 3.4 If there are some other suggestions about what is wrong with my model as described above pls enlighten me. Thanks in advance

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.