Incorrect output of a symbolic formula

2 views (last 30 days)
reincornator on 13 Oct 2021
Edited: reincornator on 13 Oct 2021
Hello. I am performing calculations using symbolic calculations. The result satisfies me. However, the final formula is output with an error. The variables following the equation refer to each other. In the image, I marked one of the examples with arrows.
The formula is correct, and when substituting values, the calculation is also correct. Only its display is incorrect.
clear;
syms S [2 2] matrix
syms V1 V2 [2 1] matrix
whos S
Name Size Bytes Class Attributes S 2x2 8 symmatrix
whos F_col1
Name Size Bytes Class Attributes F_col1 2x1 8 symmatrix
syms J [2 2] matrix
% 1
Ecol1_d1 = F_col1.'*J*Eref1;
Ecol1_d2 = F_col2.'*J*Eref1;
% 2
Ecol2_d1 = F_col1.'*J*Eref2;
Ecol2_d2 = F_col2.'*J*Eref2;
Eref1_HV = J\([F_col1 F_col2].'\[Ecol1_d1; Ecol1_d2]); % при J=J.'
Eref2_HV = J\([F_col1 F_col2].'\[Ecol2_d1; Ecol2_d2]); % при J=J.'
Eref_HV = [Eref1_HV Eref2_HV];
% Final formula
S_calc =
whos S_calc
Name Size Bytes Class Attributes S_calc 2x2 8 symmatrix
%%%% Result %%%
simplify(symmatrix2sym(S_calc))
ans =
Error:

Categories

Find more on Linear Algebra in Help Center and File Exchange

R2021b

Community Treasure Hunt

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

Start Hunting!