How to solve the two equations numerically in which tabular data is also to be loaded?

I have two equations as;
(D-0.025)^1.5 * J(c) = 0.0025;
c = 0.5 - 0.01/D;
Where J(c) is the particular value of J corresponding to value of c.
There is table (c vs J) to be loaded in which values of "J" (2nd column) corresponding to "c" (1st column) are given as under
Table = [0.1 0.1156; 0.2 0.1590; 0.3 0.1892; 0.4 0.2117; 0.5 0.2288; 0.6 0.2416; 0.7 0.2505]
My problem: 1. I want to find optimal value of "D" and "J".
Also Note that its not important that the value of D exist in the table; so i also need to interpolate the value of "D"(existing in between two cells) and corresponding "J" value.

 Accepted Answer

You can rewrite the interpolation as a polynomial of degree 6; it works out as
- (25*x^6)/12 + (145*x^5)/24 - (359*x^4)/48 + (499*x^3)/96 - (239*x^2)/100 + (10583*x)/12000 + 117/2500
You can then substitute that into your equations, converting all of your floating point values to rationals.
The system you get can then be solved in terms of a value that is the primary root of a degree 15 polynomial,
R = root([512 -15616 222208 -1962496 12118592 -56160800 203296128 -579497504 1277765482 -2115195465 2460287016 -1208021246 11455984710 -86217800113 215987875056 -180007884864])
D = (1/10)*(86016*R^14-2476544*R^13+32687360*R^12-257504256*R^11+1311552000*R^10-4612323392*R^9+12775515552*R^8-33673493056*R^7+86104656976*R^6-190723241666*R^5+393335706409*R^4+1248605641188*R^3-12283484659202*R^2+31089547519966*R-25920766050455)/(136192*R^14-3095552*R^13+19046656*R^12+161221632*R^11-3087622016*R^10+19694850944*R^9-63486597472*R^8+88752422720*R^7+101264091972*R^6-913631183772*R^5-936427888987*R^4+34659208386904*R^3-152565699173910*R^2+279861195719556*R-190086479566579)
c = (1/10)*(15616*R^14-444416*R^13+5887488*R^12-48474368*R^11+280804000*R^10-1219776768*R^9+4056482528*R^8-10222123856*R^7+19036759185*R^6-24602870160*R^5+13288233706*R^4-137471816520*R^3+1120831401469*R^2-3023830250784*R+2700118272960)/(3840*R^14-109312*R^13+1444352*R^12-11774976*R^11+66652256*R^10-280804000*R^9+914832576*R^8-2317990016*R^7+4472179187*R^6-6345586395*R^5+6150717540*R^4-2416042492*R^3+17183977065*R^2-86217800113*R+107993937528)
The values are approximately D = 0.07782594605604250, c = .3715081472598230

9 Comments

I need a script in which table values can be loaded and constant values can be modified
Will the table c values (first column) be constant? Will there always be the same number (7) ?
Assuming that the c values (first column of the table) will always be 0.1 through 0.7, and calling the j values from the table as y1 through y7, then
for the system
eqn := [(D-C11)^3/2*J(c) = C12, c = C21-C22/D]
then
c = ((R^2+C11)*C21-C22)/(R^2+C11)
D = R^2 + C11
where R = root(p) where
p = [(25000*y1-150000*y2+375000*y3-500000*y4+375000*y5-150000*y6+25000*y7)*C21^6+(-67500*y1+390000*y2-937500*y3+1200000*y4-862500*y5+330000*y6-52500*y7)*C21^5+(73750*y1-405000*y2+926250*y3-1130000*y4+776250*y5-285000*y6+43750*y7)*C21^4+(-41625*y1+213000*y2-457125*y3+528000*y4-346875*y5+123000*y6-18375*y7)*C21^3+(12760*y1-58935*y2+116700*y3-127250*y4+80400*y5-27735*y6+4060*y7)*C21^2+(-2007*y1+7911*y2-14235*y3+14760*y4-9045*y5+3057*y6-441*y7)*C21+126*y1-378*y2+630*y3-630*y4+378*y5-126*y6+18*y7, 0, 150000*C11*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^6+((-405000*y1+2340000*y2-5625000*y3+7200000*y4-5175000*y5+1980000*y6-315000*y7)*C11-150000*C22*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7))*C21^5+((442500*y1-2430000*y2+5557500*y3-6780000*y4+4657500*y5-1710000*y6+262500*y7)*C11+337500*(y1-(52/9)*y2+(125/9)*y3-(160/9)*y4+(115/9)*y5-(44/9)*y6+(7/9)*y7)*C22)*C21^4+((-249750*y1+1278000*y2-2742750*y3+3168000*y4-2081250*y5+738000*y6-110250*y7)*C11-295000*(y1-(324/59)*y2+(741/59)*y3-(904/59)*y4+(621/59)*y5-(228/59)*y6+(35/59)*y7)*C22)*C21^3+((76560*y1-353610*y2+700200*y3-763500*y4+482400*y5-166410*y6+24360*y7)*C11+124875*(y1-(568/111)*y2+(1219/111)*y3-(1408/111)*y4+(25/3)*y5-(328/111)*y6+(49/111)*y7)*C22)*C21^2+((-12042*y1+47466*y2-85410*y3+88560*y4-54270*y5+18342*y6-2646*y7)*C11-25520*(y1-(11787/2552)*y2+(5835/638)*y3-(12725/1276)*y4+(2010/319)*y5-(5547/2552)*y6+(7/22)*y7)*C22)*C21+(756*y1-2268*y2+3780*y3-3780*y4+2268*y5-756*y6+108*y7)*C11+2007*(y1-(879/223)*y2+(4745/669)*y3-(1640/223)*y4+(1005/223)*y5-(1019/669)*y6+(49/223)*y7)*C22, -18*C12, 375000*C11^2*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^6-750000*(((27/20)*y1-(39/5)*y2+(75/4)*y3-24*y4+(69/4)*y5-(33/5)*y6+(21/20)*y7)*C11+C22*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7))*C11*C21^5+((1106250*y1-6075000*y2+13893750*y3-16950000*y4+11643750*y5-4275000*y6+656250*y7)*C11^2+1687500*(y1-(52/9)*y2+(125/9)*y3-(160/9)*y4+(115/9)*y5-(44/9)*y6+(7/9)*y7)*C22*C11+375000*C22^2*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7))*C21^4+((-624375*y1+3195000*y2-6856875*y3+7920000*y4-5203125*y5+1845000*y6-275625*y7)*C11^2-1475000*(y1-(324/59)*y2+(741/59)*y3-(904/59)*y4+(621/59)*y5-(228/59)*y6+(35/59)*y7)*C22*C11-675000*(y1-(52/9)*y2+(125/9)*y3-(160/9)*y4+(115/9)*y5-(44/9)*y6+(7/9)*y7)*C22^2)*C21^3+((191400*y1-884025*y2+1750500*y3-1908750*y4+1206000*y5-416025*y6+60900*y7)*C11^2+624375*(y1-(568/111)*y2+(1219/111)*y3-(1408/111)*y4+(25/3)*y5-(328/111)*y6+(49/111)*y7)*C22*C11+442500*(y1-(324/59)*y2+(741/59)*y3-(904/59)*y4+(621/59)*y5-(228/59)*y6+(35/59)*y7)*C22^2)*C21^2+((-30105*y1+118665*y2-213525*y3+221400*y4-135675*y5+45855*y6-6615*y7)*C11^2-127600*(y1-(11787/2552)*y2+(5835/638)*y3-(12725/1276)*y4+(2010/319)*y5-(5547/2552)*y6+(7/22)*y7)*C22*C11-124875*(y1-(568/111)*y2+(1219/111)*y3-(1408/111)*y4+(25/3)*y5-(328/111)*y6+(49/111)*y7)*C22^2)*C21+(1890*y1-5670*y2+9450*y3-9450*y4+5670*y5-1890*y6+270*y7)*C11^2+10035*(y1-(879/223)*y2+(4745/669)*y3-(1640/223)*y4+(1005/223)*y5-(1019/669)*y6+(49/223)*y7)*C22*C11+12760*(y1-(11787/2552)*y2+(5835/638)*y3-(12725/1276)*y4+(2010/319)*y5-(5547/2552)*y6+(7/22)*y7)*C22^2, -108*C11*C12, ((500000*y1-3000000*y2+7500000*y3-10000000*y4+7500000*y5-3000000*y6+500000*y7)*C21^6+(-1350000*y1+7800000*y2-18750000*y3+24000000*y4-17250000*y5+6600000*y6-1050000*y7)*C21^5+(1475000*y1-8100000*y2+18525000*y3-22600000*y4+15525000*y5-5700000*y6+875000*y7)*C21^4+(-832500*y1+4260000*y2-9142500*y3+10560000*y4-6937500*y5+2460000*y6-367500*y7)*C21^3+(255200*y1-1178700*y2+2334000*y3-2545000*y4+1608000*y5-554700*y6+81200*y7)*C21^2+(-40140*y1+158220*y2-284700*y3+295200*y4-180900*y5+61140*y6-8820*y7)*C21+2520*y1-7560*y2+12600*y3-12600*y4+7560*y5-2520*y6+360*y7)*C11^3-1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^5+(-(9/4)*y1+13*y2-(125/4)*y3+40*y4-(115/4)*y5+11*y6-(7/4)*y7)*C21^4+((7/6)*y7+(59/30)*y1-(54/5)*y2+(247/10)*y3-(452/15)*y4+(207/10)*y5-(38/5)*y6)*C21^3+(-(333/400)*y1+(213/50)*y2-(3657/400)*y3+(264/25)*y4-(111/16)*y5+(123/50)*y6-(147/400)*y7)*C21^2+((319/1875)*y1-(3929/5000)*y2+(389/250)*y3-(509/300)*y4+(134/125)*y5-(1849/5000)*y6+(203/3750)*y7)*C21-(603/10000)*y5+(1019/50000)*y6-(147/50000)*y7-(949/10000)*y3-(669/50000)*y1+(2637/50000)*y2+(123/1250)*y4)*C22*C11^2+1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^4+(-(7/5)*y7-(9/5)*y1+(52/5)*y2-25*y3+32*y4-23*y5+(44/5)*y6)*C21^3+((59/50)*y1-(162/25)*y2+(741/50)*y3-(452/25)*y4+(621/50)*y5-(114/25)*y6+(7/10)*y7)*C21^2+(-(333/1000)*y1+(213/125)*y2-(3657/1000)*y3+(528/125)*y4-(111/40)*y5+(123/125)*y6-(147/1000)*y7)*C21+(134/625)*y5-(1849/25000)*y6+(203/18750)*y7+(389/1250)*y3+(319/9375)*y1-(3929/25000)*y2-(509/1500)*y4)*C22^2*C11-500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^3+(-(27/20)*y1+(39/5)*y2-(75/4)*y3+24*y4-(69/4)*y5+(33/5)*y6-(21/20)*y7)*C21^2+((59/100)*y1-(81/25)*y2+(741/100)*y3-(226/25)*y4+(621/100)*y5-(57/25)*y6+(7/20)*y7)*C21-(111/160)*y5+(123/500)*y6-(147/4000)*y7-(3657/4000)*y3-(333/4000)*y1+(213/500)*y2+(132/125)*y4)*C22^3, -270*C11^2*C12, ((375000*y1-2250000*y2+5625000*y3-7500000*y4+5625000*y5-2250000*y6+375000*y7)*C21^6+(-1012500*y1+5850000*y2-14062500*y3+18000000*y4-12937500*y5+4950000*y6-787500*y7)*C21^5+(1106250*y1-6075000*y2+13893750*y3-16950000*y4+11643750*y5-4275000*y6+656250*y7)*C21^4+(-624375*y1+3195000*y2-6856875*y3+7920000*y4-5203125*y5+1845000*y6-275625*y7)*C21^3+(191400*y1-884025*y2+1750500*y3-1908750*y4+1206000*y5-416025*y6+60900*y7)*C21^2+(-30105*y1+118665*y2-213525*y3+221400*y4-135675*y5+45855*y6-6615*y7)*C21+1890*y1-5670*y2+9450*y3-9450*y4+5670*y5-1890*y6+270*y7)*C11^4-1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^5+(-(9/4)*y1+13*y2-(125/4)*y3+40*y4-(115/4)*y5+11*y6-(7/4)*y7)*C21^4+((7/6)*y7+(59/30)*y1-(54/5)*y2+(247/10)*y3-(452/15)*y4+(207/10)*y5-(38/5)*y6)*C21^3+(-(333/400)*y1+(213/50)*y2-(3657/400)*y3+(264/25)*y4-(111/16)*y5+(123/50)*y6-(147/400)*y7)*C21^2+((319/1875)*y1-(3929/5000)*y2+(389/250)*y3-(509/300)*y4+(134/125)*y5-(1849/5000)*y6+(203/3750)*y7)*C21-(603/10000)*y5+(1019/50000)*y6-(147/50000)*y7-(949/10000)*y3-(669/50000)*y1+(2637/50000)*y2+(123/1250)*y4)*C22*C11^3+2250000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^4+(-(7/5)*y7-(9/5)*y1+(52/5)*y2-25*y3+32*y4-23*y5+(44/5)*y6)*C21^3+((59/50)*y1-(162/25)*y2+(741/50)*y3-(452/25)*y4+(621/50)*y5-(114/25)*y6+(7/10)*y7)*C21^2+(-(333/1000)*y1+(213/125)*y2-(3657/1000)*y3+(528/125)*y4-(111/40)*y5+(123/125)*y6-(147/1000)*y7)*C21+(134/625)*y5-(1849/25000)*y6+(203/18750)*y7+(389/1250)*y3+(319/9375)*y1-(3929/25000)*y2-(509/1500)*y4)*C22^2*C11^2-1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^3+(-(27/20)*y1+(39/5)*y2-(75/4)*y3+24*y4-(69/4)*y5+(33/5)*y6-(21/20)*y7)*C21^2+((59/100)*y1-(81/25)*y2+(741/100)*y3-(226/25)*y4+(621/100)*y5-(57/25)*y6+(7/20)*y7)*C21-(111/160)*y5+(123/500)*y6-(147/4000)*y7-(3657/4000)*y3-(333/4000)*y1+(213/500)*y2+(132/125)*y4)*C22^3*C11+375000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^2+(-(9/10)*y1+(26/5)*y2-(25/2)*y3+16*y4-(23/2)*y5+(22/5)*y6-(7/10)*y7)*C21+(59/300)*y1-(27/25)*y2+(247/100)*y3-(226/75)*y4+(207/100)*y5-(19/25)*y6+(7/60)*y7)*C22^4, -360*C11^3*C12, ((150000*y1-900000*y2+2250000*y3-3000000*y4+2250000*y5-900000*y6+150000*y7)*C21^6+(-405000*y1+2340000*y2-5625000*y3+7200000*y4-5175000*y5+1980000*y6-315000*y7)*C21^5+(442500*y1-2430000*y2+5557500*y3-6780000*y4+4657500*y5-1710000*y6+262500*y7)*C21^4+(-249750*y1+1278000*y2-2742750*y3+3168000*y4-2081250*y5+738000*y6-110250*y7)*C21^3+(76560*y1-353610*y2+700200*y3-763500*y4+482400*y5-166410*y6+24360*y7)*C21^2+(-12042*y1+47466*y2-85410*y3+88560*y4-54270*y5+18342*y6-2646*y7)*C21+756*y1-2268*y2+3780*y3-3780*y4+2268*y5-756*y6+108*y7)*C11^5-750000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^5+(-(9/4)*y1+13*y2-(125/4)*y3+40*y4-(115/4)*y5+11*y6-(7/4)*y7)*C21^4+((7/6)*y7+(59/30)*y1-(54/5)*y2+(247/10)*y3-(452/15)*y4+(207/10)*y5-(38/5)*y6)*C21^3+(-(333/400)*y1+(213/50)*y2-(3657/400)*y3+(264/25)*y4-(111/16)*y5+(123/50)*y6-(147/400)*y7)*C21^2+((319/1875)*y1-(3929/5000)*y2+(389/250)*y3-(509/300)*y4+(134/125)*y5-(1849/5000)*y6+(203/3750)*y7)*C21-(603/10000)*y5+(1019/50000)*y6-(147/50000)*y7-(949/10000)*y3-(669/50000)*y1+(2637/50000)*y2+(123/1250)*y4)*C22*C11^4+1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^4+(-(7/5)*y7-(9/5)*y1+(52/5)*y2-25*y3+32*y4-23*y5+(44/5)*y6)*C21^3+((59/50)*y1-(162/25)*y2+(741/50)*y3-(452/25)*y4+(621/50)*y5-(114/25)*y6+(7/10)*y7)*C21^2+(-(333/1000)*y1+(213/125)*y2-(3657/1000)*y3+(528/125)*y4-(111/40)*y5+(123/125)*y6-(147/1000)*y7)*C21+(134/625)*y5-(1849/25000)*y6+(203/18750)*y7+(389/1250)*y3+(319/9375)*y1-(3929/25000)*y2-(509/1500)*y4)*C22^2*C11^3-1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^3+(-(27/20)*y1+(39/5)*y2-(75/4)*y3+24*y4-(69/4)*y5+(33/5)*y6-(21/20)*y7)*C21^2+((59/100)*y1-(81/25)*y2+(741/100)*y3-(226/25)*y4+(621/100)*y5-(57/25)*y6+(7/20)*y7)*C21-(111/160)*y5+(123/500)*y6-(147/4000)*y7-(3657/4000)*y3-(333/4000)*y1+(213/500)*y2+(132/125)*y4)*C22^3*C11^2+750000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^2+(-(9/10)*y1+(26/5)*y2-(25/2)*y3+16*y4-(23/2)*y5+(22/5)*y6-(7/10)*y7)*C21+(59/300)*y1-(27/25)*y2+(247/100)*y3-(226/75)*y4+(207/100)*y5-(19/25)*y6+(7/60)*y7)*C22^4*C11-150000*C22^5*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21-(9/20)*y1+(13/5)*y2-(25/4)*y3+8*y4-(23/4)*y5+(11/5)*y6-(7/20)*y7), -270*C11^4*C12, ((25000*y1-150000*y2+375000*y3-500000*y4+375000*y5-150000*y6+25000*y7)*C21^6+(-67500*y1+390000*y2-937500*y3+1200000*y4-862500*y5+330000*y6-52500*y7)*C21^5+(73750*y1-405000*y2+926250*y3-1130000*y4+776250*y5-285000*y6+43750*y7)*C21^4+(-41625*y1+213000*y2-457125*y3+528000*y4-346875*y5+123000*y6-18375*y7)*C21^3+(12760*y1-58935*y2+116700*y3-127250*y4+80400*y5-27735*y6+4060*y7)*C21^2+(-2007*y1+7911*y2-14235*y3+14760*y4-9045*y5+3057*y6-441*y7)*C21+126*y1-378*y2+630*y3-630*y4+378*y5-126*y6+18*y7)*C11^6-150000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^5+(-(9/4)*y1+13*y2-(125/4)*y3+40*y4-(115/4)*y5+11*y6-(7/4)*y7)*C21^4+((7/6)*y7+(59/30)*y1-(54/5)*y2+(247/10)*y3-(452/15)*y4+(207/10)*y5-(38/5)*y6)*C21^3+(-(333/400)*y1+(213/50)*y2-(3657/400)*y3+(264/25)*y4-(111/16)*y5+(123/50)*y6-(147/400)*y7)*C21^2+((319/1875)*y1-(3929/5000)*y2+(389/250)*y3-(509/300)*y4+(134/125)*y5-(1849/5000)*y6+(203/3750)*y7)*C21-(603/10000)*y5+(1019/50000)*y6-(147/50000)*y7-(949/10000)*y3-(669/50000)*y1+(2637/50000)*y2+(123/1250)*y4)*C22*C11^5+375000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^4+(-(7/5)*y7-(9/5)*y1+(52/5)*y2-25*y3+32*y4-23*y5+(44/5)*y6)*C21^3+((59/50)*y1-(162/25)*y2+(741/50)*y3-(452/25)*y4+(621/50)*y5-(114/25)*y6+(7/10)*y7)*C21^2+(-(333/1000)*y1+(213/125)*y2-(3657/1000)*y3+(528/125)*y4-(111/40)*y5+(123/125)*y6-(147/1000)*y7)*C21+(134/625)*y5-(1849/25000)*y6+(203/18750)*y7+(389/1250)*y3+(319/9375)*y1-(3929/25000)*y2-(509/1500)*y4)*C22^2*C11^4-500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^3+(-(27/20)*y1+(39/5)*y2-(75/4)*y3+24*y4-(69/4)*y5+(33/5)*y6-(21/20)*y7)*C21^2+((59/100)*y1-(81/25)*y2+(741/100)*y3-(226/25)*y4+(621/100)*y5-(57/25)*y6+(7/20)*y7)*C21-(111/160)*y5+(123/500)*y6-(147/4000)*y7-(3657/4000)*y3-(333/4000)*y1+(213/500)*y2+(132/125)*y4)*C22^3*C11^3+375000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^2+(-(9/10)*y1+(26/5)*y2-(25/2)*y3+16*y4-(23/2)*y5+(22/5)*y6-(7/10)*y7)*C21+(59/300)*y1-(27/25)*y2+(247/100)*y3-(226/75)*y4+(207/100)*y5-(19/25)*y6+(7/60)*y7)*C22^4*C11^2-150000*C22^5*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21-(9/20)*y1+(13/5)*y2-(25/4)*y3+8*y4-(23/4)*y5+(11/5)*y6-(7/20)*y7)*C11+25000*C22^6*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7), -108*C11^5*C12, 0]
If the c values will not always be 0.1 through 0.7 but there are still a fixed number of them, then it is possible to precompute formulae such as these.... just might be a bit long.
If the number of entries might vary then you will need to go through the steps of creating the interpolating polynomial and solving.
Hello Walter; Going by your method, I used the following script (as attached), along with Table.mat (attached) but got error in script. I have also used the actual formula (i.e. values of C11, C21 & C22 are changed). Moreover as this is an example taken from a book so the answers obtained are D = 0.06041; c = 0.438; J(c) = 0.218
Now whenever I will use this example in my problem, i will only be changing C11, C21, C22 values. The equations will remain same and Table.mat values will also remain same.
load Table.mat
y1 = T(1,2); y2 = T(2,2); y3 = T(3,2); y4 = T(4,2); y5 = T(5,2); y6 = T(6,2); y7 = T(7,2);
%[(D-C11)^3/2*J(c) = C12, c = C21-C22/D]
C11 = 0.0075;
C12 = 0.002654;
C21 = 0.5;
C22 = 0.00375;
p = [(25000*y1-150000*y2+375000*y3-500000*y4+375000*y5-150000*y6+25000*y7)*C21^6+(-67500*y1+390000*y2-937500*y3+1200000*y4-862500*y5+330000*y6-52500*y7)*C21^5+(73750*y1-405000*y2+926250*y3-1130000*y4+776250*y5-285000*y6+43750*y7)*C21^4+(-41625*y1+213000*y2-457125*y3+528000*y4-346875*y5+123000*y6-18375*y7)*C21^3+(12760*y1-58935*y2+116700*y3-127250*y4+80400*y5-27735*y6+4060*y7)*C21^2+(-2007*y1+7911*y2-14235*y3+14760*y4-9045*y5+3057*y6-441*y7)*C21+126*y1-378*y2+630*y3-630*y4+378*y5-126*y6+18*y7, 0, 150000*C11*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^6+((-405000*y1+2340000*y2-5625000*y3+7200000*y4-5175000*y5+1980000*y6-315000*y7)*C11-150000*C22*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7))*C21^5+((442500*y1-2430000*y2+5557500*y3-6780000*y4+4657500*y5-1710000*y6+262500*y7)*C11+337500*(y1-(52/9)*y2+(125/9)*y3-(160/9)*y4+(115/9)*y5-(44/9)*y6+(7/9)*y7)*C22)*C21^4+((-249750*y1+1278000*y2-2742750*y3+3168000*y4-2081250*y5+738000*y6-110250*y7)*C11-295000*(y1-(324/59)*y2+(741/59)*y3-(904/59)*y4+(621/59)*y5-(228/59)*y6+(35/59)*y7)*C22)*C21^3+((76560*y1-353610*y2+700200*y3-763500*y4+482400*y5-166410*y6+24360*y7)*C11+124875*(y1-(568/111)*y2+(1219/111)*y3-(1408/111)*y4+(25/3)*y5-(328/111)*y6+(49/111)*y7)*C22)*C21^2+((-12042*y1+47466*y2-85410*y3+88560*y4-54270*y5+18342*y6-2646*y7)*C11-25520*(y1-(11787/2552)*y2+(5835/638)*y3-(12725/1276)*y4+(2010/319)*y5-(5547/2552)*y6+(7/22)*y7)*C22)*C21+(756*y1-2268*y2+3780*y3-3780*y4+2268*y5-756*y6+108*y7)*C11+2007*(y1-(879/223)*y2+(4745/669)*y3-(1640/223)*y4+(1005/223)*y5-(1019/669)*y6+(49/223)*y7)*C22, -18*C12, 375000*C11^2*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^6-750000*(((27/20)*y1-(39/5)*y2+(75/4)*y3-24*y4+(69/4)*y5-(33/5)*y6+(21/20)*y7)*C11+C22*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7))*C11*C21^5+((1106250*y1-6075000*y2+13893750*y3-16950000*y4+11643750*y5-4275000*y6+656250*y7)*C11^2+1687500*(y1-(52/9)*y2+(125/9)*y3-(160/9)*y4+(115/9)*y5-(44/9)*y6+(7/9)*y7)*C22*C11+375000*C22^2*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7))*C21^4+((-624375*y1+3195000*y2-6856875*y3+7920000*y4-5203125*y5+1845000*y6-275625*y7)*C11^2-1475000*(y1-(324/59)*y2+(741/59)*y3-(904/59)*y4+(621/59)*y5-(228/59)*y6+(35/59)*y7)*C22*C11-675000*(y1-(52/9)*y2+(125/9)*y3-(160/9)*y4+(115/9)*y5-(44/9)*y6+(7/9)*y7)*C22^2)*C21^3+((191400*y1-884025*y2+1750500*y3-1908750*y4+1206000*y5-416025*y6+60900*y7)*C11^2+624375*(y1-(568/111)*y2+(1219/111)*y3-(1408/111)*y4+(25/3)*y5-(328/111)*y6+(49/111)*y7)*C22*C11+442500*(y1-(324/59)*y2+(741/59)*y3-(904/59)*y4+(621/59)*y5-(228/59)*y6+(35/59)*y7)*C22^2)*C21^2+((-30105*y1+118665*y2-213525*y3+221400*y4-135675*y5+45855*y6-6615*y7)*C11^2-127600*(y1-(11787/2552)*y2+(5835/638)*y3-(12725/1276)*y4+(2010/319)*y5-(5547/2552)*y6+(7/22)*y7)*C22*C11-124875*(y1-(568/111)*y2+(1219/111)*y3-(1408/111)*y4+(25/3)*y5-(328/111)*y6+(49/111)*y7)*C22^2)*C21+(1890*y1-5670*y2+9450*y3-9450*y4+5670*y5-1890*y6+270*y7)*C11^2+10035*(y1-(879/223)*y2+(4745/669)*y3-(1640/223)*y4+(1005/223)*y5-(1019/669)*y6+(49/223)*y7)*C22*C11+12760*(y1-(11787/2552)*y2+(5835/638)*y3-(12725/1276)*y4+(2010/319)*y5-(5547/2552)*y6+(7/22)*y7)*C22^2, -108*C11*C12, ((500000*y1-3000000*y2+7500000*y3-10000000*y4+7500000*y5-3000000*y6+500000*y7)*C21^6+(-1350000*y1+7800000*y2-18750000*y3+24000000*y4-17250000*y5+6600000*y6-1050000*y7)*C21^5+(1475000*y1-8100000*y2+18525000*y3-22600000*y4+15525000*y5-5700000*y6+875000*y7)*C21^4+(-832500*y1+4260000*y2-9142500*y3+10560000*y4-6937500*y5+2460000*y6-367500*y7)*C21^3+(255200*y1-1178700*y2+2334000*y3-2545000*y4+1608000*y5-554700*y6+81200*y7)*C21^2+(-40140*y1+158220*y2-284700*y3+295200*y4-180900*y5+61140*y6-8820*y7)*C21+2520*y1-7560*y2+12600*y3-12600*y4+7560*y5-2520*y6+360*y7)*C11^3-1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^5+(-(9/4)*y1+13*y2-(125/4)*y3+40*y4-(115/4)*y5+11*y6-(7/4)*y7)*C21^4+((7/6)*y7+(59/30)*y1-(54/5)*y2+(247/10)*y3-(452/15)*y4+(207/10)*y5-(38/5)*y6)*C21^3+(-(333/400)*y1+(213/50)*y2-(3657/400)*y3+(264/25)*y4-(111/16)*y5+(123/50)*y6-(147/400)*y7)*C21^2+((319/1875)*y1-(3929/5000)*y2+(389/250)*y3-(509/300)*y4+(134/125)*y5-(1849/5000)*y6+(203/3750)*y7)*C21-(603/10000)*y5+(1019/50000)*y6-(147/50000)*y7-(949/10000)*y3-(669/50000)*y1+(2637/50000)*y2+(123/1250)*y4)*C22*C11^2+1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^4+(-(7/5)*y7-(9/5)*y1+(52/5)*y2-25*y3+32*y4-23*y5+(44/5)*y6)*C21^3+((59/50)*y1-(162/25)*y2+(741/50)*y3-(452/25)*y4+(621/50)*y5-(114/25)*y6+(7/10)*y7)*C21^2+(-(333/1000)*y1+(213/125)*y2-(3657/1000)*y3+(528/125)*y4-(111/40)*y5+(123/125)*y6-(147/1000)*y7)*C21+(134/625)*y5-(1849/25000)*y6+(203/18750)*y7+(389/1250)*y3+(319/9375)*y1-(3929/25000)*y2-(509/1500)*y4)*C22^2*C11-500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^3+(-(27/20)*y1+(39/5)*y2-(75/4)*y3+24*y4-(69/4)*y5+(33/5)*y6-(21/20)*y7)*C21^2+((59/100)*y1-(81/25)*y2+(741/100)*y3-(226/25)*y4+(621/100)*y5-(57/25)*y6+(7/20)*y7)*C21-(111/160)*y5+(123/500)*y6-(147/4000)*y7-(3657/4000)*y3-(333/4000)*y1+(213/500)*y2+(132/125)*y4)*C22^3, -270*C11^2*C12, ((375000*y1-2250000*y2+5625000*y3-7500000*y4+5625000*y5-2250000*y6+375000*y7)*C21^6+(-1012500*y1+5850000*y2-14062500*y3+18000000*y4-12937500*y5+4950000*y6-787500*y7)*C21^5+(1106250*y1-6075000*y2+13893750*y3-16950000*y4+11643750*y5-4275000*y6+656250*y7)*C21^4+(-624375*y1+3195000*y2-6856875*y3+7920000*y4-5203125*y5+1845000*y6-275625*y7)*C21^3+(191400*y1-884025*y2+1750500*y3-1908750*y4+1206000*y5-416025*y6+60900*y7)*C21^2+(-30105*y1+118665*y2-213525*y3+221400*y4-135675*y5+45855*y6-6615*y7)*C21+1890*y1-5670*y2+9450*y3-9450*y4+5670*y5-1890*y6+270*y7)*C11^4-1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^5+(-(9/4)*y1+13*y2-(125/4)*y3+40*y4-(115/4)*y5+11*y6-(7/4)*y7)*C21^4+((7/6)*y7+(59/30)*y1-(54/5)*y2+(247/10)*y3-(452/15)*y4+(207/10)*y5-(38/5)*y6)*C21^3+(-(333/400)*y1+(213/50)*y2-(3657/400)*y3+(264/25)*y4-(111/16)*y5+(123/50)*y6-(147/400)*y7)*C21^2+((319/1875)*y1-(3929/5000)*y2+(389/250)*y3-(509/300)*y4+(134/125)*y5-(1849/5000)*y6+(203/3750)*y7)*C21-(603/10000)*y5+(1019/50000)*y6-(147/50000)*y7-(949/10000)*y3-(669/50000)*y1+(2637/50000)*y2+(123/1250)*y4)*C22*C11^3+2250000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^4+(-(7/5)*y7-(9/5)*y1+(52/5)*y2-25*y3+32*y4-23*y5+(44/5)*y6)*C21^3+((59/50)*y1-(162/25)*y2+(741/50)*y3-(452/25)*y4+(621/50)*y5-(114/25)*y6+(7/10)*y7)*C21^2+(-(333/1000)*y1+(213/125)*y2-(3657/1000)*y3+(528/125)*y4-(111/40)*y5+(123/125)*y6-(147/1000)*y7)*C21+(134/625)*y5-(1849/25000)*y6+(203/18750)*y7+(389/1250)*y3+(319/9375)*y1-(3929/25000)*y2-(509/1500)*y4)*C22^2*C11^2-1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^3+(-(27/20)*y1+(39/5)*y2-(75/4)*y3+24*y4-(69/4)*y5+(33/5)*y6-(21/20)*y7)*C21^2+((59/100)*y1-(81/25)*y2+(741/100)*y3-(226/25)*y4+(621/100)*y5-(57/25)*y6+(7/20)*y7)*C21-(111/160)*y5+(123/500)*y6-(147/4000)*y7-(3657/4000)*y3-(333/4000)*y1+(213/500)*y2+(132/125)*y4)*C22^3*C11+375000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^2+(-(9/10)*y1+(26/5)*y2-(25/2)*y3+16*y4-(23/2)*y5+(22/5)*y6-(7/10)*y7)*C21+(59/300)*y1-(27/25)*y2+(247/100)*y3-(226/75)*y4+(207/100)*y5-(19/25)*y6+(7/60)*y7)*C22^4, -360*C11^3*C12, ((150000*y1-900000*y2+2250000*y3-3000000*y4+2250000*y5-900000*y6+150000*y7)*C21^6+(-405000*y1+2340000*y2-5625000*y3+7200000*y4-5175000*y5+1980000*y6-315000*y7)*C21^5+(442500*y1-2430000*y2+5557500*y3-6780000*y4+4657500*y5-1710000*y6+262500*y7)*C21^4+(-249750*y1+1278000*y2-2742750*y3+3168000*y4-2081250*y5+738000*y6-110250*y7)*C21^3+(76560*y1-353610*y2+700200*y3-763500*y4+482400*y5-166410*y6+24360*y7)*C21^2+(-12042*y1+47466*y2-85410*y3+88560*y4-54270*y5+18342*y6-2646*y7)*C21+756*y1-2268*y2+3780*y3-3780*y4+2268*y5-756*y6+108*y7)*C11^5-750000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^5+(-(9/4)*y1+13*y2-(125/4)*y3+40*y4-(115/4)*y5+11*y6-(7/4)*y7)*C21^4+((7/6)*y7+(59/30)*y1-(54/5)*y2+(247/10)*y3-(452/15)*y4+(207/10)*y5-(38/5)*y6)*C21^3+(-(333/400)*y1+(213/50)*y2-(3657/400)*y3+(264/25)*y4-(111/16)*y5+(123/50)*y6-(147/400)*y7)*C21^2+((319/1875)*y1-(3929/5000)*y2+(389/250)*y3-(509/300)*y4+(134/125)*y5-(1849/5000)*y6+(203/3750)*y7)*C21-(603/10000)*y5+(1019/50000)*y6-(147/50000)*y7-(949/10000)*y3-(669/50000)*y1+(2637/50000)*y2+(123/1250)*y4)*C22*C11^4+1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^4+(-(7/5)*y7-(9/5)*y1+(52/5)*y2-25*y3+32*y4-23*y5+(44/5)*y6)*C21^3+((59/50)*y1-(162/25)*y2+(741/50)*y3-(452/25)*y4+(621/50)*y5-(114/25)*y6+(7/10)*y7)*C21^2+(-(333/1000)*y1+(213/125)*y2-(3657/1000)*y3+(528/125)*y4-(111/40)*y5+(123/125)*y6-(147/1000)*y7)*C21+(134/625)*y5-(1849/25000)*y6+(203/18750)*y7+(389/1250)*y3+(319/9375)*y1-(3929/25000)*y2-(509/1500)*y4)*C22^2*C11^3-1500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^3+(-(27/20)*y1+(39/5)*y2-(75/4)*y3+24*y4-(69/4)*y5+(33/5)*y6-(21/20)*y7)*C21^2+((59/100)*y1-(81/25)*y2+(741/100)*y3-(226/25)*y4+(621/100)*y5-(57/25)*y6+(7/20)*y7)*C21-(111/160)*y5+(123/500)*y6-(147/4000)*y7-(3657/4000)*y3-(333/4000)*y1+(213/500)*y2+(132/125)*y4)*C22^3*C11^2+750000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^2+(-(9/10)*y1+(26/5)*y2-(25/2)*y3+16*y4-(23/2)*y5+(22/5)*y6-(7/10)*y7)*C21+(59/300)*y1-(27/25)*y2+(247/100)*y3-(226/75)*y4+(207/100)*y5-(19/25)*y6+(7/60)*y7)*C22^4*C11-150000*C22^5*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21-(9/20)*y1+(13/5)*y2-(25/4)*y3+8*y4-(23/4)*y5+(11/5)*y6-(7/20)*y7), -270*C11^4*C12, ((25000*y1-150000*y2+375000*y3-500000*y4+375000*y5-150000*y6+25000*y7)*C21^6+(-67500*y1+390000*y2-937500*y3+1200000*y4-862500*y5+330000*y6-52500*y7)*C21^5+(73750*y1-405000*y2+926250*y3-1130000*y4+776250*y5-285000*y6+43750*y7)*C21^4+(-41625*y1+213000*y2-457125*y3+528000*y4-346875*y5+123000*y6-18375*y7)*C21^3+(12760*y1-58935*y2+116700*y3-127250*y4+80400*y5-27735*y6+4060*y7)*C21^2+(-2007*y1+7911*y2-14235*y3+14760*y4-9045*y5+3057*y6-441*y7)*C21+126*y1-378*y2+630*y3-630*y4+378*y5-126*y6+18*y7)*C11^6-150000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^5+(-(9/4)*y1+13*y2-(125/4)*y3+40*y4-(115/4)*y5+11*y6-(7/4)*y7)*C21^4+((7/6)*y7+(59/30)*y1-(54/5)*y2+(247/10)*y3-(452/15)*y4+(207/10)*y5-(38/5)*y6)*C21^3+(-(333/400)*y1+(213/50)*y2-(3657/400)*y3+(264/25)*y4-(111/16)*y5+(123/50)*y6-(147/400)*y7)*C21^2+((319/1875)*y1-(3929/5000)*y2+(389/250)*y3-(509/300)*y4+(134/125)*y5-(1849/5000)*y6+(203/3750)*y7)*C21-(603/10000)*y5+(1019/50000)*y6-(147/50000)*y7-(949/10000)*y3-(669/50000)*y1+(2637/50000)*y2+(123/1250)*y4)*C22*C11^5+375000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^4+(-(7/5)*y7-(9/5)*y1+(52/5)*y2-25*y3+32*y4-23*y5+(44/5)*y6)*C21^3+((59/50)*y1-(162/25)*y2+(741/50)*y3-(452/25)*y4+(621/50)*y5-(114/25)*y6+(7/10)*y7)*C21^2+(-(333/1000)*y1+(213/125)*y2-(3657/1000)*y3+(528/125)*y4-(111/40)*y5+(123/125)*y6-(147/1000)*y7)*C21+(134/625)*y5-(1849/25000)*y6+(203/18750)*y7+(389/1250)*y3+(319/9375)*y1-(3929/25000)*y2-(509/1500)*y4)*C22^2*C11^4-500000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^3+(-(27/20)*y1+(39/5)*y2-(75/4)*y3+24*y4-(69/4)*y5+(33/5)*y6-(21/20)*y7)*C21^2+((59/100)*y1-(81/25)*y2+(741/100)*y3-(226/25)*y4+(621/100)*y5-(57/25)*y6+(7/20)*y7)*C21-(111/160)*y5+(123/500)*y6-(147/4000)*y7-(3657/4000)*y3-(333/4000)*y1+(213/500)*y2+(132/125)*y4)*C22^3*C11^3+375000*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21^2+(-(9/10)*y1+(26/5)*y2-(25/2)*y3+16*y4-(23/2)*y5+(22/5)*y6-(7/10)*y7)*C21+(59/300)*y1-(27/25)*y2+(247/100)*y3-(226/75)*y4+(207/100)*y5-(19/25)*y6+(7/60)*y7)*C22^4*C11^2-150000*C22^5*((y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7)*C21-(9/20)*y1+(13/5)*y2-(25/4)*y3+8*y4-(23/4)*y5+(11/5)*y6-(7/20)*y7)*C11+25000*C22^6*(y1-6*y2+15*y3-20*y4+15*y5-6*y6+y7), -108*C11^5*C12, 0];
R = roots(p);
R(imag(R)~=0) = [];
c = ((R.^2+C11)*C21-C22)./(R.^2+C11);
D = R.^2 + C11;
c =
0
0.437814699046697
D =
0.0075
0.0603036399681657
The D value varies slightly from your expected value. The c is the same within round-off.
Oh great, thankyou Walter, There is only a little more favour I want. As you can see from Table.mat that the values of D and corresponding J are more than 7 so can you provide the polynomial equation for all those values. it will be very kind of you. Thanks
N = size(T,1);
y = sym('y', [N, 1]);
interp_poly = poly2sym( polyfit(T(:,1), y, N-1), 'x' );
interp_poly would then be the same for each table that has the same T(:,1) values. However, it would have to be processed further to against the equations with solve() to get solutions.
Thanks Walter, for the solution.... It somehow solved my purpose....

Sign in to comment.

More Answers (2)

First you have to make a function that interpolates your data so that the function can be evaluated at any point. Load the c and J values into your workspace, then define
fun = @(xq)interp1(c,J,xq)
I didn't completely understand whether you have two functions that need to be interpolated or not; if so, then make a second function fun2 that interpolates your other function (D?). Now you can use standard equation-solving functions such as fzero or fsolve (from Optimization Toolbox™) to solve your equation or equations.
It is possible that you would want to use a smooth interpolation method in interp1. If so, see the interp1 function reference page.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

1 Comment

Hello Alan,
Sorry i think i wasn't much clear in my question. I have the two equations
(D-0.025)^1.5 * J(c) = 0.0025 and
c = 0.5 - 0.01/D
on which trial and error method needs to be applied as following:
Step1: value of D needs to be assumed...
Step2: value of c will then be calculated from 2nd equation...
Step3: From the table (as mentioned above) corresponding value of J w.r.t c calculated in step 2 needs to be found (here if calculated value of c in step2 is not in the table then value of c and corresponding J needs to interpolated)
Step4: Put the values of D and J(c) in equation 1 (value of J corresponding to c is written as J(c)).
Step5: If in 1st equation, LHS = RHS then the values of D and J(c) are finalised otherwise repeat again from step1.
Thanks hope i made myself clear now

Sign in to comment.

Kindly provide the answer to the question, i need it in my project

Community Treasure Hunt

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

Start Hunting!