solve system of 6

% Define symbolic variables
syms g alpha1 alpha2 sigma c b s1 s2 beta2 E1 U
% Use 0.5 instead of 0.1e1 ./ 0.2e1 for clarity
g_plus_half = g + 0.5;
g_minus_half = g – 0.5;
row1 = [2, 2, 2*besselk(g_plus_half, alpha1), 2*besselk(g_plus_half, alpha2), 2*besseli(g_plus_half, alpha1), 2*besseli(g_plus_half, alpha2)];
row2 = [-7, 2, …
(-3*alpha1*besselk(g_minus_half, alpha1) – besselk(g_plus_half, alpha1)*sigma – 7*besselk(g_plus_half, alpha1)), …
(-3*alpha2*besselk(g_minus_half, alpha2) – besselk(g_plus_half, alpha2)*sigma – 7*besselk(g_plus_half, alpha2)), …
(3*alpha1*besseli(g_minus_half, alpha1) – besseli(g_plus_half, alpha1)*sigma – 7*besseli(g_plus_half, alpha1)), …
(3*alpha2*besseli(g_minus_half, alpha2) – besseli(g_plus_half, alpha2)*sigma – 7*besseli(g_plus_half, alpha2))];
% Simplified row3
term1 = (alpha1^2 * c + alpha1^2 – sigma) / (2*c);
term2 = (alpha2^2 * c + alpha2^2 – sigma) / (2*c);
row3 = [0, 0, …
term1 * (besselk(g_plus_half, alpha1)*beta2*s1*s2 + alpha1*beta2*s1*besselk(g_minus_half, alpha1) + 2*besselk(g_plus_half, alpha1)*beta2*s1 + besselk(g_plus_half, alpha1)), …
term2 * (besselk(g_plus_half, alpha2)*beta2*s1*s2 + alpha2*beta2*s1*besselk(g_minus_half, alpha2) + 2*besselk(g_plus_half, alpha2)*beta2*s1 + besselk(g_plus_half, alpha2)), …
term1 * (besseli(g_plus_half, alpha1)*beta2*s1*s2 – alpha1*beta2*s1*besseli(g_minus_half, alpha1) + 2*besseli(g_plus_half, alpha1)*beta2*s1 + besseli(g_plus_half, alpha1)), …
term2 * (besseli(g_plus_half, alpha2)*beta2*s1*s2 – alpha2*beta2*s1*besseli(g_minus_half, alpha2) + 2*besseli(g_plus_half, alpha2)*beta2*s1 + besseli(g_plus_half, alpha2))];
row4 = [2/(b^3), 2, 2*besselk(g_plus_half, b*alpha1)*b^(-1.5), 2*besselk(g_plus_half, b*alpha2)*b^(-1.5), 2*besseli(g_plus_half, b*alpha1)*b^(-1.5), 2*besseli(g_plus_half, b*alpha2)*b^(-1.5)];
row5 = [-1/(b^3), 2, …
-(alpha1*besselk(g_minus_half, b*alpha1)*b + besselk(g_plus_half, b*alpha1))*b^(-1.5), …
-(alpha2*besselk(g_minus_half, b*alpha2)*b + besselk(g_plus_half, b*alpha2))*b^(-1.5), …
-(-besseli(g_minus_half, b*alpha1)*alpha1*b + besseli(g_plus_half, b*alpha1))*b^(-1.5), …
-(-besseli(g_minus_half, b*alpha2)*alpha2*b + besseli(g_plus_half, b*alpha2))*b^(-1.5)];
row6 = [0, 0, …
(alpha1^2*b^2*c + alpha1^2*b^2 – b^2*sigma) * besselk(g_plus_half, b*alpha1) / (2*c) * b^(-2.5), …
(alpha2^2*b^2*c + alpha2^2*b^2 – b^2*sigma) * besselk(g_plus_half, b*alpha2) / (2*c) * b^(-2.5), …
(alpha1^2*b^2*c + alpha1^2*b^2 – b^2*sigma) * besseli(g_plus_half, b*alpha1) / (2*c) * b^(-2.5), …
(alpha2^2*b^2*c + alpha2^2*b^2 – b^2*sigma) * besseli(g_plus_half, b*alpha2) / (2*c) * b^(-2.5)];
% Assemble matrix
A = [row1; row2; row3; row4; row5; row6];
% Rename ‘b’ to ‘rhs’ to avoid conflict
rhs = [-U; U; 0; 0; 0; 0];
% Solve symbolically
sol = linsolve(A, rhs);% Define symbolic variables
syms g alpha1 alpha2 sigma c b s1 s2 beta2 E1 U
% Use 0.5 instead of 0.1e1 ./ 0.2e1 for clarity
g_plus_half = g + 0.5;
g_minus_half = g – 0.5;
row1 = [2, 2, 2*besselk(g_plus_half, alpha1), 2*besselk(g_plus_half, alpha2), 2*besseli(g_plus_half, alpha1), 2*besseli(g_plus_half, alpha2)];
row2 = [-7, 2, …
(-3*alpha1*besselk(g_minus_half, alpha1) – besselk(g_plus_half, alpha1)*sigma – 7*besselk(g_plus_half, alpha1)), …
(-3*alpha2*besselk(g_minus_half, alpha2) – besselk(g_plus_half, alpha2)*sigma – 7*besselk(g_plus_half, alpha2)), …
(3*alpha1*besseli(g_minus_half, alpha1) – besseli(g_plus_half, alpha1)*sigma – 7*besseli(g_plus_half, alpha1)), …
(3*alpha2*besseli(g_minus_half, alpha2) – besseli(g_plus_half, alpha2)*sigma – 7*besseli(g_plus_half, alpha2))];
% Simplified row3
term1 = (alpha1^2 * c + alpha1^2 – sigma) / (2*c);
term2 = (alpha2^2 * c + alpha2^2 – sigma) / (2*c);
row3 = [0, 0, …
term1 * (besselk(g_plus_half, alpha1)*beta2*s1*s2 + alpha1*beta2*s1*besselk(g_minus_half, alpha1) + 2*besselk(g_plus_half, alpha1)*beta2*s1 + besselk(g_plus_half, alpha1)), …
term2 * (besselk(g_plus_half, alpha2)*beta2*s1*s2 + alpha2*beta2*s1*besselk(g_minus_half, alpha2) + 2*besselk(g_plus_half, alpha2)*beta2*s1 + besselk(g_plus_half, alpha2)), …
term1 * (besseli(g_plus_half, alpha1)*beta2*s1*s2 – alpha1*beta2*s1*besseli(g_minus_half, alpha1) + 2*besseli(g_plus_half, alpha1)*beta2*s1 + besseli(g_plus_half, alpha1)), …
term2 * (besseli(g_plus_half, alpha2)*beta2*s1*s2 – alpha2*beta2*s1*besseli(g_minus_half, alpha2) + 2*besseli(g_plus_half, alpha2)*beta2*s1 + besseli(g_plus_half, alpha2))];
row4 = [2/(b^3), 2, 2*besselk(g_plus_half, b*alpha1)*b^(-1.5), 2*besselk(g_plus_half, b*alpha2)*b^(-1.5), 2*besseli(g_plus_half, b*alpha1)*b^(-1.5), 2*besseli(g_plus_half, b*alpha2)*b^(-1.5)];
row5 = [-1/(b^3), 2, …
-(alpha1*besselk(g_minus_half, b*alpha1)*b + besselk(g_plus_half, b*alpha1))*b^(-1.5), …
-(alpha2*besselk(g_minus_half, b*alpha2)*b + besselk(g_plus_half, b*alpha2))*b^(-1.5), …
-(-besseli(g_minus_half, b*alpha1)*alpha1*b + besseli(g_plus_half, b*alpha1))*b^(-1.5), …
-(-besseli(g_minus_half, b*alpha2)*alpha2*b + besseli(g_plus_half, b*alpha2))*b^(-1.5)];
row6 = [0, 0, …
(alpha1^2*b^2*c + alpha1^2*b^2 – b^2*sigma) * besselk(g_plus_half, b*alpha1) / (2*c) * b^(-2.5), …
(alpha2^2*b^2*c + alpha2^2*b^2 – b^2*sigma) * besselk(g_plus_half, b*alpha2) / (2*c) * b^(-2.5), …
(alpha1^2*b^2*c + alpha1^2*b^2 – b^2*sigma) * besseli(g_plus_half, b*alpha1) / (2*c) * b^(-2.5), …
(alpha2^2*b^2*c + alpha2^2*b^2 – b^2*sigma) * besseli(g_plus_half, b*alpha2) / (2*c) * b^(-2.5)];
% Assemble matrix
A = [row1; row2; row3; row4; row5; row6];
% Rename ‘b’ to ‘rhs’ to avoid conflict
rhs = [-U; U; 0; 0; 0; 0];
% Solve symbolically
sol = linsolve(A, rhs); % Define symbolic variables
syms g alpha1 alpha2 sigma c b s1 s2 beta2 E1 U
% Use 0.5 instead of 0.1e1 ./ 0.2e1 for clarity
g_plus_half = g + 0.5;
g_minus_half = g – 0.5;
row1 = [2, 2, 2*besselk(g_plus_half, alpha1), 2*besselk(g_plus_half, alpha2), 2*besseli(g_plus_half, alpha1), 2*besseli(g_plus_half, alpha2)];
row2 = [-7, 2, …
(-3*alpha1*besselk(g_minus_half, alpha1) – besselk(g_plus_half, alpha1)*sigma – 7*besselk(g_plus_half, alpha1)), …
(-3*alpha2*besselk(g_minus_half, alpha2) – besselk(g_plus_half, alpha2)*sigma – 7*besselk(g_plus_half, alpha2)), …
(3*alpha1*besseli(g_minus_half, alpha1) – besseli(g_plus_half, alpha1)*sigma – 7*besseli(g_plus_half, alpha1)), …
(3*alpha2*besseli(g_minus_half, alpha2) – besseli(g_plus_half, alpha2)*sigma – 7*besseli(g_plus_half, alpha2))];
% Simplified row3
term1 = (alpha1^2 * c + alpha1^2 – sigma) / (2*c);
term2 = (alpha2^2 * c + alpha2^2 – sigma) / (2*c);
row3 = [0, 0, …
term1 * (besselk(g_plus_half, alpha1)*beta2*s1*s2 + alpha1*beta2*s1*besselk(g_minus_half, alpha1) + 2*besselk(g_plus_half, alpha1)*beta2*s1 + besselk(g_plus_half, alpha1)), …
term2 * (besselk(g_plus_half, alpha2)*beta2*s1*s2 + alpha2*beta2*s1*besselk(g_minus_half, alpha2) + 2*besselk(g_plus_half, alpha2)*beta2*s1 + besselk(g_plus_half, alpha2)), …
term1 * (besseli(g_plus_half, alpha1)*beta2*s1*s2 – alpha1*beta2*s1*besseli(g_minus_half, alpha1) + 2*besseli(g_plus_half, alpha1)*beta2*s1 + besseli(g_plus_half, alpha1)), …
term2 * (besseli(g_plus_half, alpha2)*beta2*s1*s2 – alpha2*beta2*s1*besseli(g_minus_half, alpha2) + 2*besseli(g_plus_half, alpha2)*beta2*s1 + besseli(g_plus_half, alpha2))];
row4 = [2/(b^3), 2, 2*besselk(g_plus_half, b*alpha1)*b^(-1.5), 2*besselk(g_plus_half, b*alpha2)*b^(-1.5), 2*besseli(g_plus_half, b*alpha1)*b^(-1.5), 2*besseli(g_plus_half, b*alpha2)*b^(-1.5)];
row5 = [-1/(b^3), 2, …
-(alpha1*besselk(g_minus_half, b*alpha1)*b + besselk(g_plus_half, b*alpha1))*b^(-1.5), …
-(alpha2*besselk(g_minus_half, b*alpha2)*b + besselk(g_plus_half, b*alpha2))*b^(-1.5), …
-(-besseli(g_minus_half, b*alpha1)*alpha1*b + besseli(g_plus_half, b*alpha1))*b^(-1.5), …
-(-besseli(g_minus_half, b*alpha2)*alpha2*b + besseli(g_plus_half, b*alpha2))*b^(-1.5)];
row6 = [0, 0, …
(alpha1^2*b^2*c + alpha1^2*b^2 – b^2*sigma) * besselk(g_plus_half, b*alpha1) / (2*c) * b^(-2.5), …
(alpha2^2*b^2*c + alpha2^2*b^2 – b^2*sigma) * besselk(g_plus_half, b*alpha2) / (2*c) * b^(-2.5), …
(alpha1^2*b^2*c + alpha1^2*b^2 – b^2*sigma) * besseli(g_plus_half, b*alpha1) / (2*c) * b^(-2.5), …
(alpha2^2*b^2*c + alpha2^2*b^2 – b^2*sigma) * besseli(g_plus_half, b*alpha2) / (2*c) * b^(-2.5)];
% Assemble matrix
A = [row1; row2; row3; row4; row5; row6];
% Rename ‘b’ to ‘rhs’ to avoid conflict
rhs = [-U; U; 0; 0; 0; 0];
% Solve symbolically
sol = linsolve(A, rhs); solve system MATLAB Answers — New Questions

​

Leave a Reply

Your email address will not be published. Required fields are marked *