Prev: How to delete an element from cell
Next: FEM
From: diana van dijk on 7 Jun 2010 23:07 Hi, In my fmincon optimization of 2 control variables and 3 state variables I would like to keep one of the optimized control variables fixed for several loops, while the other control variable is still optimized in each loop. To be more specific, say the control vars are A and B and the state vars are x,y,z. Then: for x=1:X for y=1:Y for z=1:Z A(x,y,z) = ... B(x,y,(z?)) = ... end end end Let's say z=years: if z=2 I want A to be optimized in z=1 and keep it fixed during z=1 and z=2. If z=3 I want A to be fixed during z=1, z=2, z=3. Etc. But, at the same time I want B to be optimized in each year, so in z=1, z=2, z=3 etc. So far I have been able to fix A for z-years, by looping A over z. I haven't been able to figure out, however, how to let B loop over z as well, without fixing it for z-years. Is there a way to implement this in a loop or maybe through an equality constraint in the fmincon optimization? Any suggestion on how to implement this is appreciated! Diana
|
Pages: 1 Prev: How to delete an element from cell Next: FEM |