how to optimize an input variable to a function to obtain a set point output variable?
2 次查看(过去 30 天)
显示 更早的评论
T_in_IC1 = 35;
T_in_DIC = 80;
T_in_a = 120;
[T_out_IC1,T_a_out_IC1] = IC1(m_w1,T_in_IC1,T_in_a);
T_a_in_IC2 = 23*T_a_out_IC1^0.5;
[T_out_IC2,T_a_out_IC2] = IC2(m_w1,T_out_IC1,T_a_in_IC2);
T_a_in_AC = 23*T_a_out_IC2^0.5;
[T_out_DIC] = DIC(m_w2,T_in_DIC,T_a_out_AC);
T_in_AC = T_out_DIC*(m_w1/(m_w1+m_w2)) + T_out_IC2*(m_w1/(m_w1+m_w2));
m_tot = m_w1 +m_w2;
[T_out_AC,T_a_out_AC] = AC(m_tot,T_in_AC, T_a_in_AC);
T_out_AC_sp = 90;
Diff = T_out_AC_sp - T_out_AC;
Basically, I want to write a code which gives me that value of m_tot for which Diff = 0, or close to 0; Also note that the input variables to AC are dependent on IC1,IC2, AND DIC. Also, one of the input to DIC1 is dependent on the output of AC
0 个评论
回答(1 个)
Yogananda Jeppu
2017-10-1
Hi I am not sure I fully understand the question. What are IC1(), IC2() etc. They could be some complicated functions. You can look at fminsearch for any optimization. It works very help. Try the help for this function.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Nonlinear Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!