2 Star 5 Fork 1

libprima / prima

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README_mat.md 2.57 KB
一键复制 编辑 原始数据 按行查看 历史
zaikunzhang 提交于 2023-06-04 07:34 . 230604.073411.CST update README_mat

This is the README file for using PRIMA under MATLAB.

Prerequisites

PRIMA supports MATLAB R2018a and later releases. To use PRIMA, you need first set up the MEX of your MATLAB. The setup of MEX is a pure MATLAB usage problem and it has nothing to do with PRIMA.

To see whether your MEX is ready, run the following code in MATLAB:

mex('-setup', '-v', 'fortran'); mex('-v', fullfile(matlabroot, 'extern', 'examples', 'refbook', 'timestwo.F'));

If this completes successfully, then your MEX is ready. Otherwise, it is not, and you may try the setup_mex package at

https://github.com/equipez/setup_mex

It will help you to set MEX up on Windows or macOS (the setup of MEX is trivial on Linux). In case setup_mex does not work, you need to consult a local MATLAB expert or the technical support of MathWorks about "how to set up MEX", which is not part of PRIMA.

Installation

Download and decompress the source code package of PRIMA, or clone it from GitHub or Gitee. You will obtain a folder containing setup.m. Place this folder at the location where you want PRIMA to be installed. In MATLAB, change the directory to this folder, and execute the following command:

setup

If this command runs successfully, PRIMA is installed. You may execute the following command in MATLAB to verify the installation:

testprima

Usage

PRIMA provides a MATLAB function prima, which can solve general constrained or unconstrained optimization problems without using derivatives.

The prima function can automatically identify the type of your problem and then call one of Powell's solvers, namely COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. The user can also specify the solver by setting the solver field of the options passed to prima.

The prima function is designed to be compatible with the fmincon function available in the Optimization Toolbox of MATLAB. You can call prima in exactly the same way as calling fmincon.

For detailed syntax of prima, use the standard help command of MATLAB:

help prima

Uninstall

PRIMA can be uninstalled using the setup.m script by executing the following command in MATLAB:

setup uninstall

Contact

In case of problems, open a GitHub issue or contact Zaikun Zhang.

1
https://gitee.com/libprima/prima.git
git@gitee.com:libprima/prima.git
libprima
prima
prima
main

搜索帮助