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 scripting error

Andrea Mazzalai
Good evening

I am trying to script my model. It's basically a piezoelectric cantilever with connected an external load resistor through the SPICE circuit component. I want to see what happens as a function of the load resistor value.

What I did was tweaking the history m-file adding a for loop changing the resistor value.

When I try to run it I get the following error:

--- quote ---
Error in ==> resistorscantest at 44
g400=flbinary('g400','draw',flbinaryfile);
--- end quote ----

Indeed once the history file is saved, on top of it it's written:

--- quote ---
% Some geometry objects are stored in a separate file.
% The name of this file is given by the variable 'flbinaryfile'.
--- end quote ----

But the flbinaryfile is not defined:

--- quote ---
flbinaryfile='';
--- end quote ----

And indeed no other files than the original model file and its history file are present in the folder. I tried to modify manually that line inserting the model mph file name but it doesn't work.


Am I doing some mistake?

2 Replies Last Post Feb 2, 2011, 3:19 AM EST
Posted: 7 years ago Feb 1, 2011, 3:43 PM EST
Hi

it might be tat COMSOL has put the mphbin in its "default" directory the COMSOL installation root folder. Otherwise my workaround in such situations is to save the geoemtry from te COMSOL GUI, and correct the matlab file to point to the correct filename

--
Good luck
Ivar
Hi it might be tat COMSOL has put the mphbin in its "default" directory the COMSOL installation root folder. Otherwise my workaround in such situations is to save the geoemtry from te COMSOL GUI, and correct the matlab file to point to the correct filename -- Good luck Ivar

Andrea Mazzalai
Posted: 7 years ago Feb 2, 2011, 3:19 AM EST
Hello,

I manually exported the geometry and edit the .m file accordingly and it worked. Now I can continue debugging...


Many thanks
Hello, I manually exported the geometry and edit the .m file accordingly and it worked. Now I can continue debugging... Many thanks

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.