Error on Symbolic calculation : “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.
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.
v1 = [393 393 393 393 393 393 393 393 393 393 ; 3850 4340 4760 5320 5740 6160 6580 7140 7980 8960];
v2 = [408 408 408 408 408 408 408 408 408 408 ; 3300 3720 4080 4560 4920 5280 5640 6120 6840 7680];
v3 = [423 423 423 423 423 423 423 423 423 423 ; 2750 3100 3400 3800 4100 4400 4700 5100 5700 6400];
syms B; % parameter Beta
syms BB; % parameter B
syms C;
%————- equation 1 ————-%
a1_v1 = 0;
a1_v2 = 0;
a1_v3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
a1_v1 = N*log(v1(i+1,j)/C/exp(BB/v1(i,j))) + a1_v1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
a1_v2 = N*log(v2(i+1,j)/C/exp(BB/v2(i,j))) + a1_v2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
a1_v3 = N*log(v3(i+1,j)/C/exp(BB/v3(i,j))) + a1_v3;
end
a2_v1 = 0;
a2_v2 = 0;
a2_v3 = 0;
i = 1; % "Stress Lv. 1" in the third term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
a2_v1 = N*(v1(i+1,j)/C/exp(BB/v1(i,j)))^B*log(v1(i+1,j)/C/exp(BB/v1(i,j))) + a2_v1;
end
i = 1; % "Stress Lv. 2" in the third term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
a2_v2 = N*(v2(i+1,j)/C/exp(BB/v2(i,j)))^B*log(v2(i+1,j)/C/exp(BB/v2(i,j))) + a2_v2;
end
i = 1; % "Stress Lv. 3" in the third term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
a2_v3 = N*(v3(i+1,j)/C/exp(BB/v3(i,j)))^B*log(v3(i+1,j)/C/exp(BB/v3(i,j))) + a2_v3;
end
a1 = a1_v1 + a1_v2 + a1_v3;
a2 = a2_v1 + a2_v2 + a2_v3;
N = numel(v1(1,:)) + numel(v2(1,:))+ numel(v3(1,:)); % the first term of ∂Λ/∂β(equation 1)
one = N/B + a1 – a2;
%————- equation 2 ————-%
b1_v1 = 0;
b1_v2 = 0;
b1_v3 = 0;
i = 1; % "Stress Lv. 1" in the first term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
b1_v1 = N/v1(i,j) + b1_v1;
end
i = 1; % "Stress Lv. 2" in the first term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
b1_v2 = N/v2(i,j) + b1_v2;
end
i = 1; % "Stress Lv. 3" in the first term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
b1_v3 = N/v3(i,j) + b1_v3;
end
b2_v1 = 0;
b2_v2 = 0;
b2_v3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
b2_v1 = N/v1(i,j)*(v1(i+1,j)/C/exp(BB/v1(i,j)))^B+b2_v1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
b2_v2 = N/v2(i,j)*(v2(i+1,j)/C/exp(BB/v2(i,j)))^B+b2_v2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
b2_v3 = N/v3(i,j)*(v3(i+1,j)/C/exp(BB/v3(i,j)))^B+b2_v3;
end
b1 = b1_v1 + b1_v2 + b1_v3;
b2 = b2_v1 + b2_v2 + b2_v3;
two = B*(- b1 + b2);
%————- equation 3 ————-%
c1 = 0;
c2 = 0;
c3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂C(equation 3)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
c1 = N*(v1(i+1,j)/C/exp(BB/v1(i,j)))^B+c1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂C(equation 3)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
c2 = N*(v2(i+1,j)/C/exp(BB/v2(i,j)))^B+c2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂C(equation 3)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
c3 = N*(v3(i+1,j)/C/exp(BB/v3(i,j)))^B+c3;
end
N = numel(v1(1,:)) + numel(v2(1,:)) + numel(v3(1,:)); % the first term of ∂Λ/∂C(equation 3)
three = B/C*(- N + (c1 + c2 + c3));
eqns = [one == 0, two == 0, three == 0];
vars = [B BB C];
answer = solve(eqns, vars);
vpa(answer.B)
vpa(answer.BB)
vpa(answer.C)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.
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.
v1 = [393 393 393 393 393 393 393 393 393 393 ; 3850 4340 4760 5320 5740 6160 6580 7140 7980 8960];
v2 = [408 408 408 408 408 408 408 408 408 408 ; 3300 3720 4080 4560 4920 5280 5640 6120 6840 7680];
v3 = [423 423 423 423 423 423 423 423 423 423 ; 2750 3100 3400 3800 4100 4400 4700 5100 5700 6400];
syms B; % parameter Beta
syms BB; % parameter B
syms C;
%————- equation 1 ————-%
a1_v1 = 0;
a1_v2 = 0;
a1_v3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
a1_v1 = N*log(v1(i+1,j)/C/exp(BB/v1(i,j))) + a1_v1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
a1_v2 = N*log(v2(i+1,j)/C/exp(BB/v2(i,j))) + a1_v2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
a1_v3 = N*log(v3(i+1,j)/C/exp(BB/v3(i,j))) + a1_v3;
end
a2_v1 = 0;
a2_v2 = 0;
a2_v3 = 0;
i = 1; % "Stress Lv. 1" in the third term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
a2_v1 = N*(v1(i+1,j)/C/exp(BB/v1(i,j)))^B*log(v1(i+1,j)/C/exp(BB/v1(i,j))) + a2_v1;
end
i = 1; % "Stress Lv. 2" in the third term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
a2_v2 = N*(v2(i+1,j)/C/exp(BB/v2(i,j)))^B*log(v2(i+1,j)/C/exp(BB/v2(i,j))) + a2_v2;
end
i = 1; % "Stress Lv. 3" in the third term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
a2_v3 = N*(v3(i+1,j)/C/exp(BB/v3(i,j)))^B*log(v3(i+1,j)/C/exp(BB/v3(i,j))) + a2_v3;
end
a1 = a1_v1 + a1_v2 + a1_v3;
a2 = a2_v1 + a2_v2 + a2_v3;
N = numel(v1(1,:)) + numel(v2(1,:))+ numel(v3(1,:)); % the first term of ∂Λ/∂β(equation 1)
one = N/B + a1 – a2;
%————- equation 2 ————-%
b1_v1 = 0;
b1_v2 = 0;
b1_v3 = 0;
i = 1; % "Stress Lv. 1" in the first term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
b1_v1 = N/v1(i,j) + b1_v1;
end
i = 1; % "Stress Lv. 2" in the first term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
b1_v2 = N/v2(i,j) + b1_v2;
end
i = 1; % "Stress Lv. 3" in the first term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
b1_v3 = N/v3(i,j) + b1_v3;
end
b2_v1 = 0;
b2_v2 = 0;
b2_v3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
b2_v1 = N/v1(i,j)*(v1(i+1,j)/C/exp(BB/v1(i,j)))^B+b2_v1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
b2_v2 = N/v2(i,j)*(v2(i+1,j)/C/exp(BB/v2(i,j)))^B+b2_v2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
b2_v3 = N/v3(i,j)*(v3(i+1,j)/C/exp(BB/v3(i,j)))^B+b2_v3;
end
b1 = b1_v1 + b1_v2 + b1_v3;
b2 = b2_v1 + b2_v2 + b2_v3;
two = B*(- b1 + b2);
%————- equation 3 ————-%
c1 = 0;
c2 = 0;
c3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂C(equation 3)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
c1 = N*(v1(i+1,j)/C/exp(BB/v1(i,j)))^B+c1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂C(equation 3)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
c2 = N*(v2(i+1,j)/C/exp(BB/v2(i,j)))^B+c2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂C(equation 3)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
c3 = N*(v3(i+1,j)/C/exp(BB/v3(i,j)))^B+c3;
end
N = numel(v1(1,:)) + numel(v2(1,:)) + numel(v3(1,:)); % the first term of ∂Λ/∂C(equation 3)
three = B/C*(- N + (c1 + c2 + c3));
eqns = [one == 0, two == 0, three == 0];
vars = [B BB C];
answer = solve(eqns, vars);
vpa(answer.B)
vpa(answer.BB)
vpa(answer.C) 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.
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.
v1 = [393 393 393 393 393 393 393 393 393 393 ; 3850 4340 4760 5320 5740 6160 6580 7140 7980 8960];
v2 = [408 408 408 408 408 408 408 408 408 408 ; 3300 3720 4080 4560 4920 5280 5640 6120 6840 7680];
v3 = [423 423 423 423 423 423 423 423 423 423 ; 2750 3100 3400 3800 4100 4400 4700 5100 5700 6400];
syms B; % parameter Beta
syms BB; % parameter B
syms C;
%————- equation 1 ————-%
a1_v1 = 0;
a1_v2 = 0;
a1_v3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
a1_v1 = N*log(v1(i+1,j)/C/exp(BB/v1(i,j))) + a1_v1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
a1_v2 = N*log(v2(i+1,j)/C/exp(BB/v2(i,j))) + a1_v2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
a1_v3 = N*log(v3(i+1,j)/C/exp(BB/v3(i,j))) + a1_v3;
end
a2_v1 = 0;
a2_v2 = 0;
a2_v3 = 0;
i = 1; % "Stress Lv. 1" in the third term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
a2_v1 = N*(v1(i+1,j)/C/exp(BB/v1(i,j)))^B*log(v1(i+1,j)/C/exp(BB/v1(i,j))) + a2_v1;
end
i = 1; % "Stress Lv. 2" in the third term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
a2_v2 = N*(v2(i+1,j)/C/exp(BB/v2(i,j)))^B*log(v2(i+1,j)/C/exp(BB/v2(i,j))) + a2_v2;
end
i = 1; % "Stress Lv. 3" in the third term of ∂Λ/∂β(equation 1)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
a2_v3 = N*(v3(i+1,j)/C/exp(BB/v3(i,j)))^B*log(v3(i+1,j)/C/exp(BB/v3(i,j))) + a2_v3;
end
a1 = a1_v1 + a1_v2 + a1_v3;
a2 = a2_v1 + a2_v2 + a2_v3;
N = numel(v1(1,:)) + numel(v2(1,:))+ numel(v3(1,:)); % the first term of ∂Λ/∂β(equation 1)
one = N/B + a1 – a2;
%————- equation 2 ————-%
b1_v1 = 0;
b1_v2 = 0;
b1_v3 = 0;
i = 1; % "Stress Lv. 1" in the first term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
b1_v1 = N/v1(i,j) + b1_v1;
end
i = 1; % "Stress Lv. 2" in the first term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
b1_v2 = N/v2(i,j) + b1_v2;
end
i = 1; % "Stress Lv. 3" in the first term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
b1_v3 = N/v3(i,j) + b1_v3;
end
b2_v1 = 0;
b2_v2 = 0;
b2_v3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
b2_v1 = N/v1(i,j)*(v1(i+1,j)/C/exp(BB/v1(i,j)))^B+b2_v1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
b2_v2 = N/v2(i,j)*(v2(i+1,j)/C/exp(BB/v2(i,j)))^B+b2_v2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂B(equation 2)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
b2_v3 = N/v3(i,j)*(v3(i+1,j)/C/exp(BB/v3(i,j)))^B+b2_v3;
end
b1 = b1_v1 + b1_v2 + b1_v3;
b2 = b2_v1 + b2_v2 + b2_v3;
two = B*(- b1 + b2);
%————- equation 3 ————-%
c1 = 0;
c2 = 0;
c3 = 0;
i = 1; % "Stress Lv. 1" in the second term of ∂Λ/∂C(equation 3)
for j = 1:(numel(v1(i, :)))
N = numel(v1(i,j));
c1 = N*(v1(i+1,j)/C/exp(BB/v1(i,j)))^B+c1;
end
i = 1; % "Stress Lv. 2" in the second term of ∂Λ/∂C(equation 3)
for j = 1:(numel(v2(i, :)))
N = numel(v2(i,j));
c2 = N*(v2(i+1,j)/C/exp(BB/v2(i,j)))^B+c2;
end
i = 1; % "Stress Lv. 3" in the second term of ∂Λ/∂C(equation 3)
for j = 1:(numel(v3(i, :)))
N = numel(v3(i,j));
c3 = N*(v3(i+1,j)/C/exp(BB/v3(i,j)))^B+c3;
end
N = numel(v1(1,:)) + numel(v2(1,:)) + numel(v3(1,:)); % the first term of ∂Λ/∂C(equation 3)
three = B/C*(- N + (c1 + c2 + c3));
eqns = [one == 0, two == 0, three == 0];
vars = [B BB C];
answer = solve(eqns, vars);
vpa(answer.B)
vpa(answer.BB)
vpa(answer.C) vpa, equation, 0-by-1, threeparameteres, solve, stresslevel MATLAB Answers — New Questions