Is there any function other than Fsolve to solve systems of nonlinear equations ????

6 views (last 30 days)
I am trying to solve the following system of 3 nonlinear equations:
XYZ(1)-A*(B*XYZ(2)^P1-C*XYZ(2)^P2)^(1/2)=0
XYZ(1)*F+G-XYZ(1)*XYZ(3)*H-I*XYZ(3)=0
XYZ(1)+E-D*XYZ(2)*XYZ(3)^(-1/2)=0
Where A,B,C,D,E,F,G,H,I,P1 and P2 are variables and X,Y and Z are the 3 unknowns to find.
I have tried using the function Fsolve with an m-file but the results were not good enough.
Is there any other function to solve this system ?????
  3 Comments
kamal kiki
kamal kiki on 4 May 2012
I mean with the result is not good enough that when A,B,C,D,E,F,G,H,I,P1 and P2 are varying, the results X and Z are varying but Y is varying just slightly with the value of Y staying in a value near the value of the guess for Y.
In the Matlab command window I received many copies of the messages below:
F =
1.0e+007 *
-0.0000
4.1437
-0.0000
F =
1.0e+007 *
-0.0000
4.1437
-0.0000
F =
1.0e+007 *
-0.0000
4.1437
-0.0000
F =
1.0e+007 *
-0.0000
4.1437
-0.0000
F =
1.0e+007 *
-0.0000
4.1005
-0.0000
F =
1.0e+007 *
-0.0000
4.1005
-0.0000
F =
1.0e+007 *
-0.0000
4.1005
-0.0000
F =
1.0e+007 *
-0.0000
4.1005
-0.0000
F =
1.0e+007 *
-0.0000
3.9925
-0.0000
F =
1.0e+007 *
-0.0000
3.9925
-0.0000
F =
1.0e+007 *
-0.0000
3.9925
-0.0000
F =
1.0e+007 *
-0.0000
3.9925
-0.0000
F =
1.0e+007 *
-0.0000
3.7219
-0.0000
F =
1.0e+007 *
-0.0000
3.7219
-0.0000
F =
1.0e+007 *
-0.0000
3.7219
-0.0000
F =
1.0e+007 *
-0.0000
3.7219
-0.0000
F =
1.0e+007 *
-0.0000
3.0421
-0.0000
F =
1.0e+007 *
-0.0000
3.0421
-0.0000
F =
1.0e+007 *
-0.0000
3.0421
-0.0000
F =
1.0e+007 *
-0.0000
3.0421
-0.0000
F =
1.0e+007 *
-0.0000
1.3128
0.0000
F =
1.0e+007 *
-0.0000
1.3128
0.0000
F =
1.0e+007 *
-0.0000
1.3128
0.0000
F =
1.0e+007 *
-0.0000
1.3128
0.0000
F =
1.0e+005 *
-0.0008
-2.0227
0.0005
F =
1.0e+005 *
-0.0008
-2.0227
0.0005
F =
1.0e+005 *
-0.0008
-2.0227
0.0005
F =
1.0e+005 *
-0.0008
-2.0227
0.0005
F =
-77.4861
-156.1355
52.1712
F =
-77.4861
-156.9031
52.1712
F =
-77.4861
-156.1355
52.1712
F =
-77.4861
-157.4616
52.1712
F =
-77.3037
191.7743
52.0492
F =
-77.4412
11.9387
52.1405
F =
-77.4412
11.1710
52.1405
F =
-77.4412
11.9387
52.1405
F =
-77.4412
10.6123
52.1405
F =
-77.3271
74.6309
52.0642
F =
-77.4128
4.6669
52.1215
F =
-77.4128
3.8992
52.1215
F =
-77.4128
4.6669
52.1215
F =
-77.4128
3.3404
52.1215
F =
-77.3844
4.6495
52.1024
F =
-77.3844
3.8818
52.1024
F =
-77.3844
4.6495
52.1024
F =
-77.3844
3.3228
52.1024
F =
-77.3559
4.6339
52.0832
F =
-77.3559
3.8662
52.0832
F =
-77.3559
4.6339
52.0832
F =
-77.3559
3.3071
52.0832
F =
-77.3273
4.6189
52.0641
F =
-77.3273
3.8513
52.0641
F =
-77.3273
4.6189
52.0641
F =
-77.3273
3.2920
52.0641
F =
-77.2987
4.6033
52.0448
F =
-77.2987
3.8356
52.0448
F =
-77.2987
4.6033
52.0448
F =
-77.2987
3.2762
52.0448
F =
-77.2700
4.5882
52.0256
F =
-77.2700
3.8205
52.0256
F =
-77.2700
4.5882
52.0256
F =
-77.2700
3.2609
52.0256
F =
-77.2412
4.5736
52.0062
F =
-77.2412
3.8059
52.0062
F =
-77.2412
4.5736
52.0062
F =
-77.2412
3.2461
52.0062
F =
-77.2124
4.5585
51.9869
F =
-77.2124
3.7907
51.9869
F =
-77.2124
4.5585
51.9869
F =
-77.2124
3.2308
51.9869
F =
-77.1835
4.5435
51.9675
F =
-77.1835
3.7758
51.9675
F =
-77.1835
4.5435
51.9675
F =
-77.1835
3.2157
51.9675
F =
-77.1545
4.5280
51.9480
F =
-77.1545
3.7603
51.9480
F =
-77.1545
4.5280
51.9480
F =
-77.1545
3.2001
51.9480
F =
-77.1255
4.5135
51.9285
F =
-77.1255
3.7458
51.9285
F =
-77.1255
4.5135
51.9285
F =
-77.1255
3.1854
51.9285
F =
-77.0964
4.4985
51.9090
F =
-77.0964
3.7307
51.9090
F =
-77.0964
4.4985
51.9090
F =
-77.0964
3.1702
51.9090
F =
-77.0672
4.4838
51.8894
F =
-77.0672
3.7160
51.8894
F =
-77.0672
4.4838
51.8894
F =
-77.0672
3.1554
51.8894
F =
-77.0380
4.4688
51.8697
F =
-77.0379
3.7011
51.8697
F =
-77.0380
4.4688
51.8697
F =
-77.0380
3.1403
51.8697
F =
-77.0086
4.4537
51.8500
F =
-77.0086
3.6859
51.8500
F =
-77.0086
4.4537
51.8500
F =
-77.0086
3.1249
51.8500
F =
-76.9793
4.4389
51.8303
F =
-76.9793
3.6712
51.8303
F =
-76.9793
4.4389
51.8303
F =
-76.9793
3.1101
51.8303
F =
-76.9498
4.4247
51.8105
F =
-76.9498
3.6569
51.8105
F =
-76.9498
4.4247
51.8105
F =
-76.9498
3.0956
51.8105
F =
-76.9203
4.4093
51.7907
F =
-76.9203
3.6416
51.7907
F =
-76.9203
4.4093
51.7907
F =
-76.9203
3.0801
51.7907
F =
-76.8907
4.3948
51.7708
F =
-76.8907
3.6271
51.7708
F =
-76.8907
4.3948
51.7708
F =
-76.8907
3.0655
51.7708
F =
-76.8611
4.3804
51.7509
F =
-76.8610
3.6126
51.7509
F =
-76.8611
4.3804
51.7509
F =
-76.8611
3.0509
51.7509
F =
-76.8313
4.3651
51.7310
F =
-76.8313
3.5973
51.7310
F =
-76.8313
4.3651
51.7310
F =
-76.8313
3.0354
51.7310
F =
-76.8015
4.3508
51.7109
F =
-76.8015
3.5830
51.7109
F =
-76.8015
4.3508
51.7109
F =
-76.8015
3.0210
51.7109
F =
-76.7717
4.3365
51.6909
F =
-76.7717
3.5687
51.6909
F =
-76.7717
4.3365
51.6909
F =
-76.7717
3.0065
51.6909
F =
-76.7418
4.3221
51.6708
F =
-76.7418
3.5543
51.6708
F =
-76.7418
4.3221
51.6708
F =
-76.7418
2.9919
51.6708
F =
-76.7118
4.3071
51.6506
F =
-76.7118
3.5393
51.6506
F =
-76.7118
4.3071
51.6506
F =
-76.7118
2.9769
51.6506
F =
-76.6817
4.2928
51.6305
F =
-76.6817
3.5251
51.6305
F =
-76.6817
4.2928
51.6304
F =
-76.6817
2.9624
51.6305
F =
-76.6516
4.2781
51.6102
F =
-76.6516
3.5103
51.6102
F =
-76.6516
4.2781
51.6102
F =
-76.6516
2.9475
51.6102
F =
-76.6214
4.2639
51.5899
F =
-76.6214
3.4961
51.5899
F =
-76.6214
4.2639
51.5899
F =
-76.6214
2.9332
51.5899
F =
-76.5911
4.2494
51.5696
F =
-76.5911
3.4816
51.5696
F =
-76.5911
4.2494
51.5696
F =
-76.5911
2.9185
51.5696
F =
-76.5608
4.2350
51.5492
F =
-76.5608
3.4672
51.5492
F =
-76.5608
4.2350
51.5492
F =
-76.5608
2.9040
51.5492
F =
-76.5304
4.2208
51.5288
F =
-76.5304
3.4530
51.5288
F =
-76.5304
4.2208
51.5288
F =
-76.5304
2.8896
51.5288
F =
-76.4999
4.2067
51.5083
F =
-76.4999
3.4389
51.5083
F =
-76.4999
4.2067
51.5083
F =
-76.4999
2.8754
51.5083
F =
-76.4693
4.1921
51.4878
F =
-76.4693
3.4243
51.4878
F =
-76.4693
4.1921
51.4878
F =
-76.4693
2.8606
51.4878
F =
-76.4387
4.1781
51.4673
F =
-76.4387
3.4102
51.4673
F =
-76.4387
4.1781
51.4673
F =
-76.4387
2.8464
51.4673
F =
-76.4081
4.1640
51.4466
F =
-76.4081
3.3962
51.4467
F =
-76.4081
4.1640
51.4466
F =
-76.4081
2.8322
51.4467
F =
-76.3773
4.1498
51.4260
F =
-76.3773
3.3820
51.4260
F =
-76.3773
4.1498
51.4260
F =
-76.3773
2.8179
51.4260
F =
-76.3465
4.1359
51.4053
F =
-76.3465
3.3680
51.4053
F =
-76.3465
4.1359
51.4053
F =
-76.3465
2.8037
51.4053
F =
-76.3156
4.1215
51.3846
F =
-76.3156
3.3536
51.3846
F =
-76.3156
4.1215
51.3846
F =
-76.3156
2.7892
51.3846
F =
-76.2847
4.1079
51.3638
F =
-76.2847
3.3400
51.3638
F =
-76.2847
4.1079
51.3638
F =
-76.2847
2.7755
51.3638
F =
-76.2537
4.0935
51.3429
F =
-76.2537
3.3256
51.3429
F =
-76.2537
4.0935
51.3429
F =
-76.2537
2.7609
51.3429
F =
-76.2226
4.0792
51.3220
F =
-76.2226
3.3113
51.3220
F =
-76.2226
4.0792
51.3220
F =
-76.2226
2.7464
51.3220
F =
-76.1914
4.0657
51.3011
F =
-76.1914
3.2978
51.3011
F =
-76.1914
4.0657
51.3011
F =
-76.1914
2.7328
51.3011
F =
-76.1602
4.0518
51.2801
F =
-76.1602
3.2839
51.2801
F =
-76.1602
4.0518
51.2801
F =
-76.1602
2.7188
51.2801
F =
-76.1289
4.0378
51.2591
F =
-76.1289
3.2699
51.2591
F =
-76.1289
4.0378
51.2591
F =
-76.1289
2.7046
51.2591
F =
-76.0975
4.0243
51.2381
F =
-76.0975
3.2564
51.2381
F =
-76.0975
4.0243
51.2381
F =
-76.0975
2.6909
51.2381
F =
-76.0661
4.0101
51.2169
F =
-76.0661
3.2422
51.2170
F =
-76.0661
4.0101
51.2169
F =
-76.0661
2.6766
51.2170
F =
-76.0346
3.9964
51.1958
F =
-76.0346
3.2285
51.1958
F =
-76.0346
3.9964
51.1958
F =
-76.0346
2.6628
51.1958
F =
-76.0031
3.9827
51.1746
F =
-76.0031
3.2148
51.1746
F =
-76.0031
3.9827
51.1746
F =
-76.0031
2.6489
51.1746
F =
-75.9714
3.9689
51.1533
F =
-75.9714
3.2010
51.1533
F =
-75.9714
3.9689
51.1533
F =
-75.9714
2.6349
51.1533
F =
-75.9397
3.9552
51.1320
F =
-75.9397
3.1873
51.1320
F =
-75.9397
3.9552
51.1320
F =
-75.9397
2.6211
51.1320
F =
-75.9080
3.9416
51.1107
F =
-75.9080
3.1736
51.1107
F =
-75.9080
3.9416
51.1107
F =
-75.9080
2.6073
51.1107
F =
-75.8761
3.9281
51.0893
F =
-75.8761
3.1602
51.0893
F =
-75.8761
3.9281
51.0893
F =
-75.8761
2.5937
51.0893
F =
-75.8442
3.9145
51.0679
F =
-75.8442
3.1466
51.0679
F =
-75.8442
3.9145
51.0679
F =
-75.8442
2.5800
51.0679
F =
-75.8123
3.9008
51.0464
F =
-75.8123
3.1329
51.0464
F =
-75.8123
3.9008
51.0464
F =
-75.8123
2.5661
51.0464
F =
-75.7802
3.8879
51.0249
F =
-75.7802
3.1200
51.0249
F =
-75.7802
3.8879
51.0249
F =
-75.7802
2.5530
51.0249
F =
-75.7481
3.8737
51.0033
F =
-75.7481
3.1058
51.0033
F =
-75.7481
3.8737
51.0033
F =
-75.7481
2.5387
51.0033
F =
-75.7159
3.8605
50.9817
F =
-75.7159
3.0925
50.9817
F =
-75.7159
3.8605
50.9817
F =
-75.7159
2.5253
50.9817
F =
-75.6837
3.8469
50.9600
F =
-75.6837
3.0790
50.9600
F =
-75.6837
3.8469
50.9600
F =
-75.6837
2.5116
50.9600
F =
-75.6514
3.8335
50.9383
F =
-75.6514
3.0655
50.9383
F =
-75.6514
3.8335
50.9383
F =
-75.6514
2.4981
50.9383
F =
-75.6190
3.8202
50.9166
F =
-75.6190
3.0522
50.9166
F =
-75.6190
3.8202
50.9166
F =
-75.6190
2.4846
50.9166
F =
-75.5866
3.8066
50.8948
F =
-75.5865
3.0387
50.8948
F =
-75.5866
3.8066
50.8948
F =
-75.5866
2.4709
50.8948
F =
-75.5540
3.7934
50.8729
F =
-75.5540
3.0254
50.8729
F =
-75.5540
3.7934
50.8729
F =
-75.5540
2.4575
50.8729
F =
-75.5215
3.7799
50.8510
F =
-75.5214
3.0119
50.8510
F =
-75.5215
3.7799
50.8510
F =
-75.5215
2.4439
50.8510
F =
-75.4888
3.7666
50.8291
F =
-75.4888
2.9986
50.8291
F =
-75.4888
3.7666
50.8291
F =
-75.4888
2.4304
50.8291
F =
-75.4561
3.7536
50.8071
F =
-75.4561
2.9856
50.8071
F =
-75.4561
3.7536
50.8071
F =
-75.4561
2.4173
50.8071
F =
-75.4233
3.7406
50.7851
F =
-75.4233
2.9726
50.7851
F =
-75.4233
3.7406
50.7851
F =
-75.4233
2.4041
50.7851
Maximum number of function evaluations reached:
increase options.MaxFunEvals.
Walter Roberson
Walter Roberson on 6 May 2012
Do not post duplicate questions: doing so leads to duplicated efforts, and to confusion and resentment in the volunteers who answer questions, and leads to extra work for the editors who have to merge the copies of the questions together.

Sign in to comment.

Answers (3)

Taniadi
Taniadi on 3 May 2012
I agree with Friedrich, to test, you can see the value of your equations using: [yout, fval ] = fsolve('function',guess). where fval is the value of your function. If it is small enough near zero, fsolve is good.
another way maybe is to write another M-file using another numerical method. I don't know if there is another function in MATLAB for solving system of nonlinear eqs other than fsolve.
  2 Comments
kamal kiki
kamal kiki on 4 May 2012
Unfortunately I can not test the results because I am using Fsolve in a simumlink "MATLAB Function" block: the inputs to this block are the values of A,B,C,D,E,F,G,H,I,P1 and P2 which are varying with time and the outputs of this block are the values of the results X,Y and Z which are also varying with time.
Walter Roberson
Walter Roberson on 6 May 2012
So add a couple of lines to the Function block to cross-check the accuracy of the result. Display the results to the command window if you need to.

Sign in to comment.


Sargondjani
Sargondjani on 7 May 2012
the problem certainly has not converged as y is still jumping up and down, so there is some problem...
for a start, you should supply the Jacobian, because that will help the problem to converge
second: are you sure that there is only one unique solution to the problem??

Walter Roberson
Walter Roberson on 7 May 2012
Maple believes there is no solution to those equations. If you could supply specific test values for each of the variables, I could try again.
  6 Comments
Walter Roberson
Walter Roberson on 9 May 2012
Simulation 1: you run into round-off problems that prevent you from finding an exact solution. To 10 digits, the solution is
X = 35.44161536, Y = 68798.38215, Z = 622.0811574
Simulation 2: you run into much worse round-off problems. To 10 digits the solution is
X = 49.36060688, Y = 1.359808683*10^5, Z = 1182.292856
I think about the most efficient way to handle this is to solve the last two equations for X and Y (yielding X and Y expressed entirely in terms of Z), and substituting those in to the first equation, yielding an expression in Z that must be equal to 0. You can then do a one-dimensional solver. You do need to be careful, though, as the expression goes imaginary below around 570, and again above around 5E8. The upper bound is easy to find, but the lower bound is tricky to establish; there is a first-order lower bound around 270 that is much easier to establish (values below the first-order lower-bound are certain to be imaginary; the actual lower bound depends on the fine balancing of exponentials.)
The expression to solve one-dimensionally in Z comes out as
(-A*(F-Z*H)*(B*(((I-E*H)*Z-G+E*F)*Z^(1/2)/(D*(F-Z*H)))^P1-C*(((I-E*H)*Z-G+E*F)*Z^(1/2)/(D*(F-Z*H)))^P2)^(1/2)-G+I*Z)/(F-Z*H)
Do be careful in the use of "I" as symbolic packages tend to treat "I" as the imaginary constant.
kamal kiki
kamal kiki on 9 May 2012
Thank you very much Walter Roberson,
May be there is a mistake in the data that I have entered as input to the model.
I will keep trying.

Sign in to comment.

Categories

Find more on Systems of Nonlinear Equations in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!