필터 지우기
필터 지우기

How to compute derivative of product with mupad?

조회 수: 1 (최근 30일)
Yün Han
Yün Han 2011년 9월 16일
Hi,
I was wondering how to compute the derivative of the product below in mupad. The expression below is in latex.
\[ L = \prod_{i=1}^{n}\frac{R_i}{1+R_i} \]
Thanks in advance!
Y-L

채택된 답변

Walter Roberson
Walter Roberson 2011년 9월 16일
Is R_i indicating the i'th value of R, R(i) in MATLAB notation?
If so, then at the MuPad level, you would want
diff(product(R[i]/(1+R[i]), i = 1 .. n), V)
where V is the variable that you wish to differentiate with respect to.
If you are intending that your R[i] be expressions in a variable and you intend to differentiate with respect to that variable, then
simplify(diff(product(R[i](x)/(1+R[i](x)), i = 1 .. n), x))
Please note that the above is in MuPad language, not MATLAB directly. You would need to evalin(symengine,'....') or something similar to evaluate it at the MATLAB level.
  댓글 수: 4
Walter Roberson
Walter Roberson 2011년 9월 16일
Note that it is normal for the derivative of a product to be a sum.
Do you want to compute the partial derivative of L with respect to each of R[1], R[2], and so on??
That would be written as
diff(product(R[i]/(1+R[i]), i = 1 .. n), R[i] $ i = 1 .. n)
and the result simplifies to product(1/(1+R[i])^2, i=1..n)
Walter Roberson
Walter Roberson 2011년 9월 16일
In the diff() call, the second argument onwards are the variables to compute the partial derivative with respect to
diff(expression,x,y,x)
for example would calculate with respect to x first, then y, then x.
The $ notation above expands to the list R[1], R[2], ... R[n]

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MuPAD에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by