Erron on Symbolic calculation [Case 2] : “Empty sym : 0-by-1”
I need the help of people who have excellent talents in calculating using Matlab.
The equations to be implemented through Matlab coding is as follows.
Answer) β = 5.874395, A = 0.000060, b = 0.280599, φ = 5630.329851
The results to be obtained through this coding is written in "Answer) ~" above.
And, the data related to this problem(or eqution) is below.
I have tried with the following coding but kept getting the same results as the title. I would like to get helpful advice on this part.
I would appreciate it if you could give me a guide on the solution or error cause.
clear all
clc
th1 = [378 378 378 378; 0.4 0.4 0.4 0.4; 310 316 329 411]; % [V_i ; U_i ; T_i]
th2 = [378 378 378 378; 0.8 0.8 0.8 0.8; 190 208 230 298];
th3 = [398 398 398 398; 0.4 0.4 0.4 0.4; 108 123 166 200];
syms B;
syms A;
syms phi;
syms b;
%————- equation 1 ————-%
a1_th1 = 0;
a1_th2 = 0;
a1_th3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
a1_th1 = N*(1-(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B)*(log(th1(i+2,j)/A)-(phi/th1(i,j)+b/th1(i+1,j))) + a1_th1 ;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
a1_th2 = N*(1-(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B)*(log(th2(i+2,j)/A)-(phi/th2(i,j)+b/th2(i+1,j))) + a1_th2 ;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
a1_th3 = N*(1-(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B)*(log(th3(i+2,j)/A)-(phi/th3(i,j)+b/th3(i+1,j))) + a1_th3 ;
end
a1 = a1_th1 + a1_th2 + a1_th3;
N = numel(th1(1,:)) + numel(th2(1,:)) + numel(th3(1,:)); % ∂Λ/∂β first term
one = N/B + a1;
% vpa(one,3);
%————- equation 2 ————-%
b1 = 0;
b2 = 0;
b3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂A(equation 2)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
b1 = N*(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B+b1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂A(equation 2)
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
b2 = N*(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B+b2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂A(equation 2)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
b3 = N*(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B+b3;
end
N = numel(th1(1,:)) + numel(th2(1,:)) + numel(th3(1,:)); % ∂Λ/∂A first term
two = -B/A*(N + (b1 + b2 + b3));
% vpa(two,3);
%————- equation 3 ————-%
c1 = 0;
c2 = 0;
c3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂φ(equation 3)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
c1 = N/th1(i,j)*(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B+c1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂φ(equation 3)
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
c2 = N/th2(i,j)*(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B+c2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂φ(equation 3)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
c3 = N/th3(i,j)*(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B+c3;
end
N_c1 = 0;
N_c2 = 0;
N_c3 = 0;
i = 1;
for j = 1:(numel(th1(i, :)))
N_c1 = numel(th1(i,j))/th1(i,j)+N_c1; % "Stress Lv. 1" in the first term of ∂Λ/∂φ(equation 3)
end
i = 1;
for j = 1:(numel(th2(i, :)))
N_c2 = numel(th2(i,j))/th2(i,j)+N_c2; % "Stress Lv. 2" in the first term of ∂Λ/∂φ(equation 3)
end
i = 1;
for j = 1:(numel(th3(i, :)))
N_c3 = numel(th3(i,j))/th3(i,j)+N_c3; % "Stress Lv. 3" in the first term of ∂Λ/∂φ(equation 3)
end
N_c = N_c1 + N_c2 + N_c3; % ∂Λ/∂φ first term
three = -B*(N_c – (c1 + c2 + c3));
% vpa(three,3);
%————- equation 3 ————-%
d1 = 0;
d2 = 0;
d3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂b(equation 4)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
d1 = N/th1(i+1,j)*(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B+d1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂b(equation 4)"
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
d2 = N/th2(i+1,j)*(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B+d2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂b(equation 4)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
d3 = N/th3(i+1,j)*(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B+d3;
end
N_d1 = 0;
N_d2 = 0;
N_d3 = 0;
i = 1;
for j = 1:(numel(th1(i, :)))
N_d1 = numel(th1(i,j))/th1(i+1,j)+N_d1; % "Stress Lv. 1" in the first term of ∂Λ/∂b(equation 4)
end
i = 1;
for j = 1:(numel(th2(i, :)))
N_d2 = numel(th2(i,j))/th2(i+1,j)+N_d2; % "Stress Lv. 2" in the first term of ∂Λ/∂b(equation 4)
end
i = 1;
for j = 1:(numel(th3(i, :)))
N_d3 = numel(th3(i,j))/th3(i+1,j)+N_d3; % "Stress Lv. 3" in the first term of ∂Λ/∂b(equation 4)
end
N_d = N_d1 + N_d2 + N_d3; % ∂Λ/∂b first term
four = -B*(N_d – (d1 + d2 + d3));
% vpa(four,3);
[B, A, phi, b] = solve(one,two,three,four,’Real’,true)
% eqns = [one == 0, two == 0, three == 0, four == 0];
% vars = [B, A, phi, b];
% [solB, solA, solphi, solb] = solve(eqns, vars, ‘Real’, true)I need the help of people who have excellent talents in calculating using Matlab.
The equations to be implemented through Matlab coding is as follows.
Answer) β = 5.874395, A = 0.000060, b = 0.280599, φ = 5630.329851
The results to be obtained through this coding is written in "Answer) ~" above.
And, the data related to this problem(or eqution) is below.
I have tried with the following coding but kept getting the same results as the title. I would like to get helpful advice on this part.
I would appreciate it if you could give me a guide on the solution or error cause.
clear all
clc
th1 = [378 378 378 378; 0.4 0.4 0.4 0.4; 310 316 329 411]; % [V_i ; U_i ; T_i]
th2 = [378 378 378 378; 0.8 0.8 0.8 0.8; 190 208 230 298];
th3 = [398 398 398 398; 0.4 0.4 0.4 0.4; 108 123 166 200];
syms B;
syms A;
syms phi;
syms b;
%————- equation 1 ————-%
a1_th1 = 0;
a1_th2 = 0;
a1_th3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
a1_th1 = N*(1-(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B)*(log(th1(i+2,j)/A)-(phi/th1(i,j)+b/th1(i+1,j))) + a1_th1 ;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
a1_th2 = N*(1-(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B)*(log(th2(i+2,j)/A)-(phi/th2(i,j)+b/th2(i+1,j))) + a1_th2 ;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
a1_th3 = N*(1-(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B)*(log(th3(i+2,j)/A)-(phi/th3(i,j)+b/th3(i+1,j))) + a1_th3 ;
end
a1 = a1_th1 + a1_th2 + a1_th3;
N = numel(th1(1,:)) + numel(th2(1,:)) + numel(th3(1,:)); % ∂Λ/∂β first term
one = N/B + a1;
% vpa(one,3);
%————- equation 2 ————-%
b1 = 0;
b2 = 0;
b3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂A(equation 2)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
b1 = N*(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B+b1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂A(equation 2)
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
b2 = N*(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B+b2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂A(equation 2)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
b3 = N*(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B+b3;
end
N = numel(th1(1,:)) + numel(th2(1,:)) + numel(th3(1,:)); % ∂Λ/∂A first term
two = -B/A*(N + (b1 + b2 + b3));
% vpa(two,3);
%————- equation 3 ————-%
c1 = 0;
c2 = 0;
c3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂φ(equation 3)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
c1 = N/th1(i,j)*(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B+c1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂φ(equation 3)
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
c2 = N/th2(i,j)*(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B+c2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂φ(equation 3)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
c3 = N/th3(i,j)*(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B+c3;
end
N_c1 = 0;
N_c2 = 0;
N_c3 = 0;
i = 1;
for j = 1:(numel(th1(i, :)))
N_c1 = numel(th1(i,j))/th1(i,j)+N_c1; % "Stress Lv. 1" in the first term of ∂Λ/∂φ(equation 3)
end
i = 1;
for j = 1:(numel(th2(i, :)))
N_c2 = numel(th2(i,j))/th2(i,j)+N_c2; % "Stress Lv. 2" in the first term of ∂Λ/∂φ(equation 3)
end
i = 1;
for j = 1:(numel(th3(i, :)))
N_c3 = numel(th3(i,j))/th3(i,j)+N_c3; % "Stress Lv. 3" in the first term of ∂Λ/∂φ(equation 3)
end
N_c = N_c1 + N_c2 + N_c3; % ∂Λ/∂φ first term
three = -B*(N_c – (c1 + c2 + c3));
% vpa(three,3);
%————- equation 3 ————-%
d1 = 0;
d2 = 0;
d3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂b(equation 4)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
d1 = N/th1(i+1,j)*(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B+d1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂b(equation 4)"
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
d2 = N/th2(i+1,j)*(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B+d2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂b(equation 4)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
d3 = N/th3(i+1,j)*(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B+d3;
end
N_d1 = 0;
N_d2 = 0;
N_d3 = 0;
i = 1;
for j = 1:(numel(th1(i, :)))
N_d1 = numel(th1(i,j))/th1(i+1,j)+N_d1; % "Stress Lv. 1" in the first term of ∂Λ/∂b(equation 4)
end
i = 1;
for j = 1:(numel(th2(i, :)))
N_d2 = numel(th2(i,j))/th2(i+1,j)+N_d2; % "Stress Lv. 2" in the first term of ∂Λ/∂b(equation 4)
end
i = 1;
for j = 1:(numel(th3(i, :)))
N_d3 = numel(th3(i,j))/th3(i+1,j)+N_d3; % "Stress Lv. 3" in the first term of ∂Λ/∂b(equation 4)
end
N_d = N_d1 + N_d2 + N_d3; % ∂Λ/∂b first term
four = -B*(N_d – (d1 + d2 + d3));
% vpa(four,3);
[B, A, phi, b] = solve(one,two,three,four,’Real’,true)
% eqns = [one == 0, two == 0, three == 0, four == 0];
% vars = [B, A, phi, b];
% [solB, solA, solphi, solb] = solve(eqns, vars, ‘Real’, true) I need the help of people who have excellent talents in calculating using Matlab.
The equations to be implemented through Matlab coding is as follows.
Answer) β = 5.874395, A = 0.000060, b = 0.280599, φ = 5630.329851
The results to be obtained through this coding is written in "Answer) ~" above.
And, the data related to this problem(or eqution) is below.
I have tried with the following coding but kept getting the same results as the title. I would like to get helpful advice on this part.
I would appreciate it if you could give me a guide on the solution or error cause.
clear all
clc
th1 = [378 378 378 378; 0.4 0.4 0.4 0.4; 310 316 329 411]; % [V_i ; U_i ; T_i]
th2 = [378 378 378 378; 0.8 0.8 0.8 0.8; 190 208 230 298];
th3 = [398 398 398 398; 0.4 0.4 0.4 0.4; 108 123 166 200];
syms B;
syms A;
syms phi;
syms b;
%————- equation 1 ————-%
a1_th1 = 0;
a1_th2 = 0;
a1_th3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
a1_th1 = N*(1-(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B)*(log(th1(i+2,j)/A)-(phi/th1(i,j)+b/th1(i+1,j))) + a1_th1 ;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
a1_th2 = N*(1-(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B)*(log(th2(i+2,j)/A)-(phi/th2(i,j)+b/th2(i+1,j))) + a1_th2 ;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
a1_th3 = N*(1-(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B)*(log(th3(i+2,j)/A)-(phi/th3(i,j)+b/th3(i+1,j))) + a1_th3 ;
end
a1 = a1_th1 + a1_th2 + a1_th3;
N = numel(th1(1,:)) + numel(th2(1,:)) + numel(th3(1,:)); % ∂Λ/∂β first term
one = N/B + a1;
% vpa(one,3);
%————- equation 2 ————-%
b1 = 0;
b2 = 0;
b3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂A(equation 2)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
b1 = N*(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B+b1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂A(equation 2)
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
b2 = N*(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B+b2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂A(equation 2)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
b3 = N*(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B+b3;
end
N = numel(th1(1,:)) + numel(th2(1,:)) + numel(th3(1,:)); % ∂Λ/∂A first term
two = -B/A*(N + (b1 + b2 + b3));
% vpa(two,3);
%————- equation 3 ————-%
c1 = 0;
c2 = 0;
c3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂φ(equation 3)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
c1 = N/th1(i,j)*(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B+c1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂φ(equation 3)
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
c2 = N/th2(i,j)*(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B+c2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂φ(equation 3)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
c3 = N/th3(i,j)*(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B+c3;
end
N_c1 = 0;
N_c2 = 0;
N_c3 = 0;
i = 1;
for j = 1:(numel(th1(i, :)))
N_c1 = numel(th1(i,j))/th1(i,j)+N_c1; % "Stress Lv. 1" in the first term of ∂Λ/∂φ(equation 3)
end
i = 1;
for j = 1:(numel(th2(i, :)))
N_c2 = numel(th2(i,j))/th2(i,j)+N_c2; % "Stress Lv. 2" in the first term of ∂Λ/∂φ(equation 3)
end
i = 1;
for j = 1:(numel(th3(i, :)))
N_c3 = numel(th3(i,j))/th3(i,j)+N_c3; % "Stress Lv. 3" in the first term of ∂Λ/∂φ(equation 3)
end
N_c = N_c1 + N_c2 + N_c3; % ∂Λ/∂φ first term
three = -B*(N_c – (c1 + c2 + c3));
% vpa(three,3);
%————- equation 3 ————-%
d1 = 0;
d2 = 0;
d3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂b(equation 4)
for j = 1:(numel(th1(i, :)))
N = numel(th1(i,j));
d1 = N/th1(i+1,j)*(th1(i+2,j)/A*exp(-(phi/th1(i,j)+b/th1(i+1,j))))^B+d1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂b(equation 4)"
for j = 1:(numel(th2(i, :)))
N = numel(th2(i,j));
d2 = N/th2(i+1,j)*(th2(i+2,j)/A*exp(-(phi/th2(i,j)+b/th2(i+1,j))))^B+d2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂b(equation 4)
for j = 1:(numel(th3(i, :)))
N = numel(th3(i,j));
d3 = N/th3(i+1,j)*(th3(i+2,j)/A*exp(-(phi/th3(i,j)+b/th3(i+1,j))))^B+d3;
end
N_d1 = 0;
N_d2 = 0;
N_d3 = 0;
i = 1;
for j = 1:(numel(th1(i, :)))
N_d1 = numel(th1(i,j))/th1(i+1,j)+N_d1; % "Stress Lv. 1" in the first term of ∂Λ/∂b(equation 4)
end
i = 1;
for j = 1:(numel(th2(i, :)))
N_d2 = numel(th2(i,j))/th2(i+1,j)+N_d2; % "Stress Lv. 2" in the first term of ∂Λ/∂b(equation 4)
end
i = 1;
for j = 1:(numel(th3(i, :)))
N_d3 = numel(th3(i,j))/th3(i+1,j)+N_d3; % "Stress Lv. 3" in the first term of ∂Λ/∂b(equation 4)
end
N_d = N_d1 + N_d2 + N_d3; % ∂Λ/∂b first term
four = -B*(N_d – (d1 + d2 + d3));
% vpa(four,3);
[B, A, phi, b] = solve(one,two,three,four,’Real’,true)
% eqns = [one == 0, two == 0, three == 0, four == 0];
% vars = [B, A, phi, b];
% [solB, solA, solphi, solb] = solve(eqns, vars, ‘Real’, true) symbolic, emptysym, 0-by-1, temperature-humidity, partialdifferentiation MATLAB Answers — New Questions