Welcome to PyFemtet's documentation! ==================================== .. |Femtet| raw:: html muratasoftware.com .. |Python| raw:: html python.org Abstract ---------- **PyFemtet provides extensions for Femtet, a CAE software developed by Murata Software.** - PyFemtet is an open-source library and can be used free of charge for both non-commercial and commercial purposes. - This library is provided "as is" and without warranty of any kind. - A license is required to use the Femtet main body. PyFemtet does not alter the license of the Femtet main body in any way. - Please contact Murata Software for a trial version of Femtet for evaluation purposes. - --> |Femtet| .. important:: **To users of PyFemtet 0.x** In PyFemtet v1, many functions and arguments have been changed to improve user-friendliness and development efficiency. Please refer to the following page for details. :doc:`pages/migration_to_v1` Main Features of PyFemtet ---------------------------- PyFemtet is a library that provides functionality using the Python macro interface of Femtet. Currently, the only feature of PyFemtet is design parameter optimization, which is implemented as a subpackage ``pyfemtet.opt``. The optimization feature by ``pyfemtet.opt`` has the following characteristics: - Single-objective and multi-objective optimization - Real-time progress display with process monitoring - Parallel computation with multiple instances of Femtet - Result output in easy-to-analyze csv format for Excel and other tools Examples -------------------------------- .. grid:: 2 .. grid-item-card:: Inductance of a solenoid coil :link: examples/gau_ex08/gau_ex08 :link-type: doc :text-align: center .. image:: examples/gau_ex08/gau_ex08.png :scale: 50 +++ In magnetic field analysis, the self-inductance of a finite-length solenoid coil is set to a specific value. .. grid-item-card:: Resonant frequency of a circular patch antenna :link: examples/her_ex40/her_ex40 :link-type: doc :text-align: center .. image:: examples/her_ex40/her_ex40.png :scale: 50 +++ In electromagnetic wave analysis, the resonant frequency of a circular patch antenna is set to a specific value. .. tip:: There are more examples in the :doc:`pages/examples` section. Simple API ---------------------------- Below is an example of multi-objective optimization. You can set up the problem with ``add_parameter()`` and ``add_objective()``, and then execute it with ``optimize()``. For everything else, you can use the regular Femtet macro script. For more detailed examples, please check the :doc:`pages/usage` section. .. code-block:: python from pyfemtet.opt import FEMOpt def max_displacement(Femtet): dx, dy, dz = Femtet.Gogh.Galileo.GetMaxDisplacement() return dy def volume(Femtet): w = Femtet.GetVariableValue('w') d = Femtet.GetVariableValue('d') h = Femtet.GetVariableValue('h') return w * d * h if __name__ == '__main__': femopt = FEMOpt() femopt.add_parameter('w', 10, 2, 20) femopt.add_parameter('d', 10, 2, 20) femopt.add_objective(max_displacement, name='max_displacement', direction=0) femopt.add_objective(volume, name='volume', direction='minimize') femopt.optimize(n_trials=20) Table of Contents ------------------------ .. toctree:: :maxdepth: 2 Home pages/installation pages/migration_to_v1 pages/examples pages/advanced_examples pages/script_builder pages/usage pages/api pages/LICENSE