Question

Right now, I have a code that models a transformer plant (Let's call it TP1) that gives out two outputs 'x' and 'y' given the two physical dimension 'a' and 'b' over a range of transformation ratio.

There are couple different ways to configure that plant, so within the plant model is simple selection criteria that chooses one setting over the others such that both input and output is maximized. (So I have no a priori knowledge of what equations 'a' and 'b' will go through to produce 'x' or 'y')

There is another transformer (TP2) that produces output 'x2' and 'y2' for just one physical dimension 'c'

Following is the optimization I am trying to do:

Goal: Given established TP2, Design TP1 such that it minimizes a+b while x >= x2, and y>=y2 for given range of transformation ratio.

I am lost on how to implement fmincon (or any other optimization method) to to do this task, especially since my model TP1 is very numerical based. (I do not know whether config1 or 2 is better for certain transformation ratio before numercially solving it) I appreciate your advice in advance.

Était-ce utile?

La solution

fmincon is the right tool:

  • Your unknown is a 2-element vector [a; b]
  • You need to supply a starting point guess X0 for [a; b]
  • Your cost function FUN is simply a function that returns a+b
  • You have two non-linear constraints and need to write a function for NONLCON

Your NONLCON function should:

  • Accept the 2-element vector [a; b] as an input
  • Evalute your model, TP1
  • Return for C (first return value) a 2-element vector [x-x2; y-y2]
  • Return empty for the second return value Ceq

You may also want to specify upper and lower bounds for your [a; b] vector.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top