最小化包含积分的函数
有谁知道如何在 MATLAB 中最小化包含积分的函数?该函数如下所示:
L = Int(t=0,t=T)[(AR-x)dt], A is a system parameter and R and x are related through:
dR/dt = axRY - bR, where a and b are constants.
dY/dt = -xRY
我在某处读到可以组合使用 fminbnd 和quad,但我无法使其工作。有什么建议吗?
Does anyone know how to minimize a function containing an integral in MATLAB? The function looks like this:
L = Int(t=0,t=T)[(AR-x)dt], A is a system parameter and R and x are related through:
dR/dt = axRY - bR, where a and b are constants.
dY/dt = -xRY
I read somewhere that I can use fminbnd and quad in combination but I am not able to make it work. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许您可以提供积分的更多详细信息,例如
[AR-x)dt]
中缺少的括号在哪里?x
是否依赖于t
,或者我们可以整合dR/dt = axR - bR
得到R=C* exp((a*xb)*t)
?无论如何,要回答有关fminbnd
和quad
的问题,您可以设置A,C,T,a,b,xmin
和 < code>xmax (最后两个是您要查找最小值的范围)并使用:这将找到使积分最小化的
x
。Perhaps you could give more details of your integral, e.g. where is the missing bracket in
[AR-x)dt]
? Is there any dependence ofx
ont
, or can we integratedR/dt = axR - bR
to giveR=C*exp((a*x-b)*t)
? In any case, to answer your question onfminbnd
andquad
, you could setA,C,T,a,b,xmin
andxmax
(the last two are the range you want to look for the min over) and use:This finds
x
that minimizes the integral.如果我没有理解错的话,你正试图最小化对 t 的尊重:
那么你只需要找到以下的零:
这只是数学,而不是 matlab ;)
If i didn't get it wrong you are trying to minimize respect to t:
well then you just need to find the zeros of:
This is just math, not matlab ;)
以下是对方程的一些处理,可能会有所帮助。
结合你给出的第二个和第三个方程,
现在如果我们求解右侧的 R 并将其代入你给出的第一个方程,我们得到
现在我们可以对第一项进行积分,得到:
所以现在所有关于 R 和Y 是端点。事实上,您也可以定义一个新函数 Z,它等于 Y + R。然后您会得到
下一部分,我对此不太有信心。x 相对于 t 的积分将给出一些在 t 处计算的函数= 0 且 t = T。我们将调用该函数 X 来给出:
该方程对于所有 T 都成立,因此如果愿意,我们可以将 T 设置为 t。
另外,我们可以将很多常量组合在一起,并将它们称为 C 来给出
where
所以我不确定还能做什么,但我已经证明 x(t) 的积分与 Z( t) = R(t) + Y(t)。在我看来,有很多方程可以解决这个问题。还有人知道从这里该去哪里吗?我的数学有问题吗?
Here's some manipulation of your equations that might help.
Combining the second and third equations you gave gives
Now if we solve for R on the righthand side and plug it into the first equation you gave we get
Now we can integrate the first term to get:
So now all that matters with regards to R and Y are the endpoints. In fact, you may as well define a new function, Z which equals Y + R. Then you get
This next part I'm not as confident in. The integral of x with respect to t will give some function which is evaluated at t = 0 and t = T. This function we will call X to give:
This equation holds true for all T, so we can set T to t if we want to.
Also, we can group a lot of the constants together and call them C to give
where
So I'm not sure what else to do with this, but I've shown that the integral of x(t) is linearly related to Z(t) = R(t) + Y(t). It seems to me that there are many equations that solve this. Anyone else see where to go from here? Any problems with my math?