Logical False before subs then Logical True?
Show older comments
I am trying to verify if 2 equations are symbolically equivalent. I did a logical check and it return false. When I solve these equations in terms of S/K by using a variable substitution, i.e. Z=S/K -> K=S*K, the logical is true. I can't seem to figure out why this is so.
syms S K r_x Z D
Solution=solve(0 == -S*(r_x)^2 + 2*(K+S)*r_x -S,r_x )
Expanded_Solution=expand(Solution(2,1))
%Sections=children(Expanded_Solution)
D=1 + (K/S) - sqrt( (1+(K/S))^2 -1)
Boolen_check_1=logical(D == Expanded_Solution)
% Z=K/S --> K = Z*S
new_1=subs(Expanded_Solution,K, (Z*S) )
new_2=subs(D,K, (Z*S))
trial_1=solve(new_1 - r_x == 0, Z)
trial_2=solve(new_2 - r_x == 0, Z)
Boolen_check_2 = logical(trial_1 == trial_2)
Accepted Answer
More Answers (1)
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!