Solving an equation with terms that require double summation and products
Show older comments
I need to solve the following equation.

I wrote the following code based on the above equation, but I believe I have made a mistake as the final answer is large.
I have attached the *.mat file for reference.
Any assistance would be much appreciated.
% Condition number for the optimal distribution of the hole-drilling depth increments, base on the "Integral Method" for the non-uniform hole-drilling residual stress measurement technique
% Determination of the condition number for the optimal distribution of the hole-drilling depth increments,
% base on the "Integral Method" for the non-uniform hole-drilling residual stress measurement technique.
% The following equation as referenced from this source (see below) is used
% for this determination.
% https://link.springer.com/article/10.1007/BF02331114
% Develop the terms of the equation
% The individual terms of the equation will be developed individually and then brought together.
% Loading the files
% Loading the required variables.
% Loading of the required *.mat file and then the variable.
anp = load("191231_GS_0295_10.mat","aij");
aij = anp.aij
% Length of array
N = length(aij)
% Summation of matrix
aij_2 = aij^2
y1 = sum(aij_2(:))
% Product of the matrix
aii = diag(aij)
aii_2 = aii.^2
% Product of the square of the diagonal of the matrix
y2 = 4*prod(aii_2,"all")
% The complete equation is as follows:
K_A = (y1 + (y1.^2-y2).^0.5)./y2
Accepted Answer
More Answers (1)
David Goodmanson
on 19 Jan 2020
Edited: David Goodmanson
on 19 Jan 2020
Hi GS, try
aij_2 = aij.^2
Since y1 and y2 are scalars, there are three dots in the last equation that you can drop. I usually do this because it's neater and provides an extra clue to what the variables are. That's a net savings of two dots, which you can use in another equation sometime.
1 Comment
GS76
on 20 Jan 2020
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!