SMath Studio Forum
»
SMath Studio
»
Samples
»
A function for finding constrained minimum
Rank: Member Groups: Registered
Joined: 27/08/2013(UTC) Posts: 19 Was thanked: 9 time(s) in 5 post(s)
|
Attached is a snippet function for calculating the constrained minimum of a scalar function J(x) of several variables. More specifically it solves the problem: minimize J(x) in the domain xm <= x <= xMsubject to: g(x)>=0; (a vector function of m potentially nonlinear inequality constraints) A*x = b; ( r linear equality constraints, A being an rxn matrix) The algorithm has been adapted from this article (in particular from eqn. (7) on page 4): http://www.ajbasweb.com/ajbas/2011/894-909.pdf. Edited by user 13 September 2013 01:44:41(UTC)
| Reason: Not specified
|
2 users thanked mb10 for this useful post.
|
on 12/09/2013(UTC), on 12/09/2013(UTC)
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,988 Was thanked: 1126 time(s) in 723 post(s)
|
I attached a version with function arguments. In the definition, the formal parameter is a function name with the numbers of arguments given, in the call the actual parameter is the function with an UNDEFINED variable as dummy argument, Thus, minimize(J(x), g(x), x ... won't work because x is bound to the initial values vector. |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Member Groups: Registered
Joined: 27/08/2013(UTC) Posts: 19 Was thanked: 9 time(s) in 5 post(s)
|
@ Martin Kraska:
With your changes (and changing the names in the body of the algorithm as well), it seems to work fine now, and I will soon update both files accordingly.
Thank you very much for your explanations!
mb
|
|
|
|
Rank: Member Groups: Registered
Joined: 27/08/2013(UTC) Posts: 19 Was thanked: 9 time(s) in 5 post(s)
|
The attachments in the first post have been updated according to the suggestions of M. Kraska.
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Samples
»
A function for finding constrained minimum
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.