matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -
i solve system of equations symbolically beta1
, beta2
, , beta3
. defined variables follows , set equation system:
w1 = sym('w1', 'real'); w2 = sym('w2', 'real'); me1 = sym('me1', 'real'); me2 = sym('me2', 'real'); btm1 = sym('btm1', 'real'); btm2 = sym('btm2', 'real'); mom1 = sym('mom1', 'real'); mom2 = sym('mom2', 'real'); gamma = sym('gamma', 'real'); t = sym('t', 'real'); beta1 = sym('beta1', 'real'); beta2 = sym('beta2', 'real'); beta3 = sym('beta3', 'real'); nt = sym('nt', 'real'); r1 = sym('r1', 'real'); r2 = sym('r2', 'real'); syms e1 e2 e3 real b = [1/t * (1 + ( w1 + 1/nt * beta1 * me1 + beta2 * btm1 + beta3 * mom1 ) *r1 ) ^(-gamma) * ( 1/nt * me1 * r1 ) + 1/t * (1 + ( w2 + 1/nt * beta1 * me2 + beta2 * btm2 + beta3 * mom2 ) *r2 ) ^(-gamma) * ( 1/nt * me2 * r2 ) 1/t * (1 + ( w1 + 1/nt * beta1 * me1 + beta2 * btm1 + beta3 * mom1 ) *r1 ) ^(-gamma) * ( 1/nt * btm1 * r1 ) + 1/t * (1 + ( w2 + 1/nt * beta1 * me2 + beta2 * btm2 + beta3 * mom2 ) *r2 ) ^(-gamma) * ( 1/nt * btm2 * r2 ) 1/t * (1 + ( w1 + 1/nt * beta1 * me1 + beta2 * btm1 + beta3 * mom1 ) *r1 ) ^(-gamma) * ( 1/nt * mom1 * r1 ) + 1/t * (1 + ( w2 + 1/nt * beta1 * me2 + beta2 * btm2 + beta3 * mom2 ) *r2 ) ^(-gamma) * ( 1/nt * mom2 * r2 )];
now want result , empty sym: 0-by-1
:
res = solve(b-[e1 e2 e3]', beta1, beta2, beta3, 'ignoreanalyticconstraints', true); simplify(res.beta1) ans = empty sym: 0-by-1
i expected solve issue using 'ignoreanalyticconstraints'
proposed in this stackoverflow question. can me?
the 'ignoreanalyticconstraints'
option not magic allows 1 solve symbolic system analytically. didn't mention in question (a idea in future), running code in r2015a result in warning message:
warning: cannot find explicit solution.
from documentation solve
:
if solve returns empty object, no solutions exist. if solve returns empty object warning, solutions might exist solve did not find solutions.
it unlikely general analytic solutions exist system arbitrary parameters. if explicitly set of parameters specific values (e.g., small integers) may find few solutions. using assumptions
can sometimes.
Comments
Post a Comment