how to write a constraint function for optimtool???

  • Follow


HiHi,

I use the optimtool to fit equations, I need to make sure the end of equation1 is close to the end of equation2. How I should write the constraint function? I am facing difficulty because the constraint is NOT the optimtool input. It is a part of the calcaution in the minimization process. Please help.

====================================
Example:
Use optimtool to select a1,b1,a2,b2

min 
abs(sin(1:10)-y1)+abs(sin(11:20)-y2)

where
y1 = a1*(1:10)+b1   
y2 = a2*(11:20) + b2 

***subject to 
y1(10)-y2(1)<0.1           <============ My main challenge 
0
Reply Marco 12/1/2010 11:00:23 PM


0 Replies
1125 Views

(page loaded in 0.008 seconds)




Reply: