Struct solution with x
Show older comments
Hello everyone,
I am working with an equation on which the following conditions apply:
assume(b>0)
assume(a>0)
assume(a, 'real')
assume(b, 'real')
When solving the equation with returnconditions = true, i am getting the following result:
ans =
struct with fields:
a: [1×1 sym]
parameters: [1×1 sym]
conditions: [1×1 sym]
Which in turn becomes:
struct.a = x
struct.parameters = x
struct.conditions =
in(x, 'real') & x ~= - (144535293678694037036996263388468*b)/550769126706406357900905808352195 - (32414720195132252810133684333137447606333932928886786234467989994^(1/2)*b*1i)/1101538253412812715801811616704390 & x ~= (32414720195132252810133684333137447606333932928886786234467989994^(1/2)*b*1i)/1101538253412812715801811616704390 - (144535293678694037036996263388468*b)/550769126706406357900905808352195 & x ~= 0 & (10680255103650670499995359170034131163219897411919919799173673439*b^3*x^5)/79837633165635972006615589284779352945345712957526101491630344520 - (55070065378198770734782937112491826444689537731357326839658245779*b^7*x)/1596752663312719440132311785695587058906914259150522029832606890400 - (52682521843631337410187030198853895179031908261767012193429299817*b^6*x^2)/239512899496907916019846767854338058836037138872578304474891033560 - (722821513198866414051031018767030783537554023560957917135176630303*b^5*x^3)/958051597987631664079387071417352235344148555490313217899564134240 - (94638163488239999525893552205606732378719408740871677041354524807*b^4*x^4)/95805159798763166407938707141735223534414855549031321789956413424 - (37596530622524706251454733767005997636263743780709487221228539*b^8)/16461367663017726186931049337067907823782621228355897214769143200 + (133756038408178157507705834783100115363513651202789647077864673153*b^2*x^6)/239512899496907916019846767854338058836037138872578304474891033560 + (90789175570872107684921442791045770758473169184763116518350393177*b*x^7)/79837633165635972006615589284779352945345712957526101491630344520 + x^8 == 0
I have no idea how to interpret this solution, can anyone help me with this?
Thank you in advance
5 Comments
Vladimir Sovkov
on 30 Jan 2020
Edited: Vladimir Sovkov
on 30 Jan 2020
Besides, assumtions of ...>0 already implies that the value is real, no need to specify it once more.
Rik
on 30 Jan 2020
Your second remark is not true:
a=(1+1j);%create a complex variable
clc
a>0 %returns true
The documentation explains the < only looks at the real part of complex numbers.
Vladimir Sovkov
on 30 Jan 2020
My second remark is true.
Try without assumptions
clear all
syms x
double(solve(x^2+1i==0,x))
ans =
-0.707106781186548 + 0.707106781186548i
0.707106781186548 - 0.707106781186548i
and with the assumtion
clear all
syms x
assume(x>0)
double(solve(x^2+1i==0,x))
ans =
0×1 empty double column vector
Rik
on 30 Jan 2020
Strange. This must be an exception in the sym toolbox, which I don't have access to at this moment, so I can't run your code myself.
Roy Cornelissen
on 30 Jan 2020
Answers (0)
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!