Solving symbolic system of equations returns conditions that exactly match equations
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am attempting to symbolically solve a system of 6 unique equations for 6 unknowns (ii, II, mi, ni, b, B). When I attempt to solve the equation, MATLAB returns a set of parameters and conditions that exactly match my system of specified equations and assumptions. It seems to have merely returned my system of equations to me without solving anything. For example, the first condition listed in the solution equals eq1, the second condition equals equation 6, and so on. The full set of conditions is reproduced below. What am I doing wrong? Any advice would be appreciated.
% Symbols and Assumptions
syms d M f s m t k N a b B ii II ni mi fe positive
assume(s>1 & k>s+1);
assume(t>1);
assume(m>1);
% Specifying Equations
eq1 = b * ii^(s-1) - f == 0;
eq2 = B * m^(1 - s) * (II)^(s - 1) - f - d == 0;
eq3 = b * (m * t)^(1 - s) * (ni)^(s - 1) - d == 0;
eq4 = B * (m * t)^(1 - s) * (mi)^(s - 1) - d == 0;
eq5 = a * (s-1) / (k - (s-1)) * (f * ii^(-k) + d * (N-1) * ni^(-k) + d * M * mi^(-k)) == fe;
eq6 = a * (s-1) / (k - (s-1)) * ((f + d) * II^(-k) + d * N * ni^(-k) + d * (M-1) * mi^(-k)) == fe;
% Solve Equation
eqns = [eq1, eq2, eq3, eq4, eq5, eq6];
unks = [ii, II, mi, ni, b, B];
sol = solve(eqns, unks, 'ReturnConditions', true)
Condition 1 matches eq1: z2*z3^(s - 1) - f == 0
Condition 2 matches eq6: (a*(s - 1)*((d + f)/z1^k + (d*(M - 1))/z4^k + (N*d)/z5^k))/(k - s + 1) - fe == 0
Condition 3 matches eq5: (a*(s - 1)*(f/z3^k + (d*(N - 1))/z5^k + (M*d)/z4^k))/(k - s + 1) - fe == 0
Condition 4 matches eq2: m^(1 - s)*z*z1^(s - 1) - f - d == 0
Condition 5 matches eq3: z*z4^(s - 1)*(m*t)^(1 - s) - d == 0
Condition 6 matches eq4: z2*z5^(s - 1)*(m*t)^(1 - s) - d == 0
Conditions 7-12 match positivity assumptions: 0 < z & 0 < z1 & 0 < z2 & 0 < z3 & 0 < z4 & 0 < z5
5 Commenti
Risposte (1)
Sai Teja G
il 21 Ago 2023
Hi James,
I understand that you are solving the equations using ‘solve()’ function.
The conditions you mentioned are not an exact match to the equations; instead, they are substituted by variables within the 'solve()' function and simplified accordingly. For example -
Condition 2 - (a*(s - 1)*((d + f)/z1^k + (d*(M - 1))/z4^k + (N*d)/z5^k))/(k - s + 1) - fe == 0
eq6 - a * (s-1) / (k - (s-1)) * ((f + d) * II^(-k) + d * N * ni^(-k) + d * (M-1) * mi^(-k)) == fe;
If you attempt to substitute specific values for variables instead of symbols, you will obtain the corresponding values for your answer variables.
Hope it helps!
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!