[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [femm] Automation



Hi,

There is a way to do what you want, using Lua scripting, but it takes a bit
of setting up initially.

I have several models, mostly motors, whereby I step the armature along with
respect to the stator, calculating the force as I go. The results of the
force calculation get appended to a file, then I use Matlab to plot it.

Basically what I do is parameterise my model into several parameters which
completely define the model, so that after assigning values to each
parameter I can call a Lua script which reads in the parameters and draws
the model. The same script assigns block properties (including correctly
phased current blocks for coils), meshes the model and saves it to a
temp.fem file name before solving.

In full, I have a controlling script which does the following:-

Step 1:	Define the simulation. Define parameter values, and which ones will
vary over the simulation etc.
Write a parameter file.

Step 2:	Open the data file and write some header info, such as model type,
number of simulations etc. then close the data file again.

Step 3:	Do a For loop that completes a series of individual simulations by
calling 2 Lua scripts.
The first script reads in the parameter file, creates the model file as
described above, saves it to a model file and solves the model. It then
calls the second script to extract the force, and then exits.

The second script does the following:
Reads in the parameter file. Amongst the variables calculated from my
model parameters are co-ordinates of points that define an acceptable
integration path for force calculation. I also have several key points,
again defined by variables, that I extract flux densities from so that I can
collect information about saturations or flux reversals in important areas.
This force and flux information is then written to the data file in append
mode along with the current model parameters, before exiting the
postprocessor.

Back in the control script, I then increment a parameter and create a new
parameter file, ready for the next loop.

At the end of the loop I delete the solution files generated by triangle to
clean up a bit, and am left with a single data file containing header
information, and rows of parameter information and the forces and flux
densities I calculated. One row for each simulation point.


You can plot results using Excel, Matlab (or the free Scilab which is
great!) or anything that can read a text file.

I have used this method for simulations up to 600 points long (even a matrix
of 20 x 30 solutions). The only snag I get is that somewhere in the code
there is a gradual build up of memory not released, and Femm hangs after
about 600 or so simulation points.

It takes a while to set up, but if you want detailed simulations over a
parameter range it works very well.

It is possible to automate this using active X controls, so that the
controlling script is written in your language of choice (Matlab, Visual
Basic etc.). Femm and Lua then run in the background and your front end
can have a pictorial view of the model you are using. I am (have been)
working on implementing the controls into the code, but I don't have time to
finish it at the moment. Anyone else doing something similar?


Finlay Evans.


----Original Message-----
From: agnaldo@xxxxxxxxxx [mailto:agnaldo@xxxxxxxxxx]
Sent: 22 May 2002 17:14
To: femm@xxxxxxxxxxxxxxx
Subject: [femm] Automation


Hi people!
Does anybody know how to perform force calculations in an automatic way
using 
femm?
I mean something like a command that would allow the automatic variation of 
distance between two blocks, force calculation and graphic presentation.
Is there any possibility?

Agnaldo




Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



------------------------------------------------------------------------
This email and any attachments are confidential and are for the
use of the addressee only. If you are not the addressee, you must not
use or disclose the contents to any other person. Please immediately
notify the sender and delete the email. Statements and opinions
expressed here may not represent those of the company.
Email correspondence is monitored by the company.

The parent company of the Renishaw Group is Renishaw plc, registered
in England no. 1106260. Registered Office: New Mills, Wotton-under-Edge
Gloucestershire, GL12 8JR, United Kingdom. Tel +44 (0) 1453 524524
-----------------------------------------------------------------------