11 views (last 30 days)

I am trying to calculate the value of a variable in a summation term. Could any of you share some leads about the coding technique in Matlab? My equation looks like:

,

in which I know the values of Y, and z. I am looking for an idea and methodology to calculate the values of the variable .

KALYAN ACHARJYA
on 21 Jun 2020

Edited: KALYAN ACHARJYA
on 21 Jun 2020

Please try any issue let me know

David Goodmanson
on 5 Jul 2020

Edited: David Goodmanson
on 5 Jul 2020

Hi Bharath,

suppose the sum involving q is done over a dummy index j instead of i. It appears that Y and y are vectors of the same length so the expression is

Yi = sum{j=1,N} qj*xj*yi/(1+xj^2*yi^2)

or in matrix notation

Y = M*q where M(i,j) = xj*yi/(1+xj^2*yi^2)

You don't say how the length of Y and y compare to N, but if that length is >= N, then a least squares solution for q is just

q = M\Y.

David Goodmanson
on 6 Jul 2020

I will assume here that vectors Y and y have the same length as each other (if not then I don't understand the equation at all). But assuming Y and y are the same length, the key is that the entire expression is linear in q, so that a minimal q can be determined with standard linear algebra.

Assume that Y and y have length A. Then as I mentioned before, this can be put into matrix multiplication form,

Y = M*q

where Y is Ax1, q is Nx1 and M is AxN. This expression has A equations and N unknowns which are the elements of q.

If A=N there is an exact solution for q (assuming that matix M is nonsingular, which seems likely). If A>N there are more equations than unknowns and q = M\Y solves for q in the least squares sense. If A< N there are more unknowns than equations and q is not determined completely but can vary somewhat.

Opportunities for recent engineering grads.

Apply Today
## 12 Comments

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_907363

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_907363

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_907402

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_907402

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_907417

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_907417

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_907432

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_907432

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_908224

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_908224

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_908692

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_908692

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_908728

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_908728

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_908767

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_908767

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_909394

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_909394

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_925004

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_925004

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_935825

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_935825

## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_936692

⋮## Direct link to this comment

https://uk.mathworks.com/matlabcentral/answers/552064-calculating-the-contributing-terms-of-a-summation-equation#comment_936692

Sign in to comment.