solve equations with vector parameter

1 view (last 30 days)
Heba Amin Saleh
Heba Amin Saleh on 23 Sep 2020
Answered: Nikhil Sonavane on 30 Sep 2020
I have to solve 5 equations with 5 unkown . these equations have vectors parameters and each unknown is expected to be vectors also. when i try to solve the equation the output of unkown is (0x1 sym)
X11=1;
X12=0;
X13=[0.0387,0.0794,0.1213,0.1643,0.2085,0.2539,0.3005,0.3483,0.3974,0.4477,0.4992,0.5519,0.6058,0.6607,0.7163,0.7722,0.8278];
X14=-1;
X15=0;
X21=0;
X22=1;
X23=[ 0.9993,0.9968,0.9926,0.9864,0.9780,0.9672,0.9538,0.9374,0.9176,0.8942,0.8665,0.8339,0.7956,0.7507,0.6978,0.6353,0.5610];
X24=0;
X25=-1;
X31=0;
X32=0;
X33=[31.5317,31.5317,31.5317,31.5317,31.5317,31.5317,31.5317,31.5317,31.5317,31.5317,31.5317,31.5317,31.5317,31.5317,31.5317,31.5317,31.5317];
X34=[32.2796,30.2166,28.0633,25.8279,23.5195,21.1478,18.7231,16.2560,13.7576,11.2389,8.7111,6.1851,3.6715,1.1805,-1.2782,-3.6956,-6.0637];
X35=-[38.1842,39.8366,41.3818,42.8126,44.1229,45.3075,46.3621,47.2836,48.0700,48.7205,49.2353,49.6160,49.8650,49.9861,49.9837,49.8632,49.6310];
X41=X34;
X42=-X35;
X43=[26.3486,26.3486,26.3486,26.3486,26.3486,26.3486,26.3486,26.3486,26.3486,26.3486,26.3486,26.3486,26.3486,26.3486,26.3486,26.3486,26.3486];
X44=0;
X45=0;
X51=[14.5000,15.9594,17.3780,18.7496,20.0686,21.3294,22.5273,23.6577,24.7169,25.7017,26.6097,27.4389,28.1885,28.8580,29.4478,29.9588,30.3928];
X52=-1*[28.0,27.1946,26.3108,25.3516,24.3208,23.2230,22.0629,20.8462,19.5787,18.2667,16.9167,15.5356,14.1301,12.7070,11.2730,9.8346,8.3982];
X53=0;
X54=-1*[14.50,13.3171,12.0937,10.8345,9.5447,8.2295,6.8948,5.5462,4.1897,2.8311,1.4763,0.1307,-1.2001,-2.5110,-3.7974,-5.0547,-6.2793];
X55=[22.0,22.7355,23.4092,24.018,24.5591,25.0305,25.4305,25.7583,26.0134,26.1961,26.3072,26.3483,26.3213,26.2287,26.0736,25.8592,25.5895];
z1=-1*[2.4818,2.5235,2.5716,2.6275,2.6926,2.7691,2.8596,2.9678,3.0989,3.2601,3.4621,3.7215,4.0655,4.5414,5.2402,6.3617,8.4471];
z2=[-2.0428,-2.1909,-2.3569,-2.5444,-2.7577,-3.0027,-3.2870,-3.6210,-4.0192,-4.5020,-5.0999,-5.8599,-6.8586,-8.2300,-10.2317,-13.4291,-19.3536];
z3=[-33.1082,-34.4209,-35.9295,-37.6723,-39.6983,-42.0711,-44.8749,-48.2233,-52.2738,-57.2515,-63.4889,-71.4998,-82.1215,-96.8185,-118.4038,-153.0558,-217.5021];
z4=[-136.6115,-139.4838,-143.2967,-148.2598,-154.6319,-162.7373,-172.9912,-185.9396,-202.3232,-223.1840,-250.0492,-285.2668,-332.6579,-398.9024,-496.8369,-654.6707,-948.8008];
z5=[8.9562,16.2057,24.0730,32.6428,42.0260,52.3699,63.8735,76.8111,91.5687,108.7046,129.0528,153.9109,185.4051,227.2661,286.6752,379.4241,548.2897];
syms y1 y2 y3 y4 y5
eq1= (X11*y1)+(X12*y2)+(X13*y3)+(X14*y4)+(X15*y5) == z1;
eq2= (X21*y1)+(X22*y2)+(X23*y3)+(X24*y4)+(X25*y5) == z2;
eq3= (X31*y1)+(X32*y2)+(X33*y3)+(X34*y4)+(X35*y5) == z3;
eq4= (X41*y1)+(X42*y2)+(X43*y3)+(X44*y4)+(X45*y5) == z4;
eq5= (X51*y1)+(X52*y2)+(X53*y3)+(X54*y4)+(X55*y5) == z5;
eq1=subs(eq1); eq2=subs(eq2); eq3=subs(eq3); eq4=subs(eq4); eq5=subs(eq5);
[y1,y2,y3,y4,y5] = vpasolve([eq1,eq2,eq3,eq4,eq5], [y1,y2,y3,y4,y5]);

Answers (1)

Nikhil Sonavane
Nikhil Sonavane on 30 Sep 2020
In my opinion, here vpsolve is not able to find a solution. When vpasolve cannot find a solution, it returns an empty object. Provide initial guess to help the solver finding a solution. For an example, see Provide Initial Guess to Find Solutions

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!