how to check if Zin==Yin in this case?
thank you in advance

답변 (2개)

Walter Roberson
Walter Roberson 2022년 2월 23일

0 개 추천

You can try
simplify(Zin == Yin)
or
simplify(Zin - Yin)
but you might need to
isAlways(Zin == Yin)
Note: if isAlways tells you that it could not decide, then it still might be equal, but not necessarily.

댓글 수: 2

grace lim
grace lim 2022년 2월 23일
so in this case, are they equal?when i key in simplify(Zin==Yin)
AndresVar
AndresVar 2022년 2월 23일
편집: AndresVar 2022년 2월 23일
@grace lim it doesn't seem to be always true
I don't know what are the conditions for your variables but you can see for example if y11,y12,y21,y22 and yL all equal 1 then it is not equal
syms y11 y12 y21 y22 yL
Zin = 1/y11+y12/y11^2/(y11*y22-y12*y21+1/yL);
Yin = y11-y12*y21/(y22+yL);
eq = Zin==Yin % equation to prove
eq = 
simplify(eq) % did not return symtrue
ans = 
%isAlways(eq) % returned false 'unable to prove'
%simplify(Zin-Yin) % did not return 0
% an example when equations is true
eqTest = subs(eq,[y11 y12 y21],[1 0 1])
eqTest = 
simplify(eqTest) % returns symtrue
ans = 
symtrue
%isAlways(eqTest) % returned true
%simplify(lhs(eqTest)-rhs(eqTest)) % returned 0, equation was true
% an example when equation is false
eqTest = subs(eq,[y11 y12 y21 y22 yL],[1 1 1 1 1])
eqTest = 
simplify(eqTest)
ans = 
symfalse

댓글을 달려면 로그인하십시오.

Andile
Andile 2026년 2월 19일

0 개 추천

A=[1 2;3 7]
A = 2×2
1 2 3 7
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
Syms:detA
det(A)
ans = 1.0000

댓글 수: 1

Maybe
A=[1 2;3 7]
A = 2×2
1 2 3 7
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
det(sym(A))
ans = 
1
det(A)
ans = 1.0000

댓글을 달려면 로그인하십시오.

카테고리

태그

질문:

2022년 2월 23일

댓글:

2026년 2월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by