non linear equation, fminsearch, to find unknown parameters

4 views (last 30 days)
hi
Please some one help me in finding the unknown parameters from the given data by using fminsearch or any other method. and i am new to matlab
T=[940 915 909 898 895 888 879 873 854 851 848 840 823 798 791 773 758 748 731 727 723 706 700 698 673 659 648 623 598 597 587 583 573 940 915 909 898 895 888 879 873 854 851 848 840 823 798 791 773 758 748 731 727 723 706 700 698 673 659 648 623 598 597 587 583 573 940 915 909 898 895 888 879 873 854 851 848 840 823 798 791 773 758 748 731 727 723 706 700 698 673 659 648 623 598 597 587 583 573 940 915 909 898 895 888 879 873 854 851 848 840 823 798 791 773 758 748 731 727 723 706 700 698 673 659 648 623 598 597 587 583 573 940 915 909 898 895 888 879 873 854 851 848 840 823 798 791 773 758 748 731 727 723 706 700 698 673 659 648 623 598 597 587 583 573 940 915 909 898 895 888 879 873 854 851 848 840 823 798 791 773 758 748 731 727 723 706 700 698 673 659 648 623 598 597 587 583 573 940 915 909 898 895 888 879 873 854 851 848 840 823 798 791 773 758 748 731 727 723 706 700 698 673 659 648 623 598 597 587 583 573 940 915 909 898 895 888 879 873 854 851 848 840 823 798 791 773 758 748 731 727 723 706 700 698 673 659 648 623 598 597 587 583 573 940 915 909 898 895 888 879 873 854 851 848 840 823 798 791 773 758 748 731 727 723 706 700 698 673 659 648 623 598 597 587 583 573 940 915 909 898 895 888 879 873 854 851 848 840 823 798 791 773 758 748 731 727 723 706 700 698 673 659 648 623 598 597 587 583 573]
t=[1150 1200 1212 1234 1240 1254 1272 1284 1322 1328 1334 1350 1384 1434 1448 1484 1514 1534 1568 1576 1584 1618 1630 1634 1684 1712 1734 1784 1834 1836 1856 1864 1884 575 600 606 617 620 627 636 642 661 664 667 675 692 717 724 742 757 767 784 788 792 809 815 817 842 856 867 892 917 918 928 932 942 191.6666667 200 202 205.6666667 206.6666667 209 212 214 220.3333333 221.3333333 222.3333333 225 230.6666667 239 241.3333333 247.3333333 252.3333333 255.6666667 261.3333333 262.6666667 264 269.6666667 271.6666667 272.3333333 280.6666667 285.3333333 289 297.3333333 305.6666667 306 309.3333333 310.6666667 314 115 120 121.2 123.4 124 125.4 127.2 128.4 132.2 132.8 133.4 135 138.4 143.4 144.8 148.4 151.4 153.4 156.8 157.6 158.4 161.8 163 163.4 168.4 171.2 173.4 178.4 183.4 183.6 185.6 186.4 188.4 82.14285714 85.71428571 86.57142857 88.14285714 88.57142857 89.57142857 90.85714286 91.71428571 94.42857143 94.85714286 95.28571429 96.42857143 98.85714286 102.4285714 103.4285714 106 108.1428571 109.5714286 112 112.5714286 113.1428571 115.5714286 116.4285714 116.7142857 120.2857143 122.2857143 123.8571429 127.4285714 131 131.1428571 132.5714286 133.1428571 134.5714286 57.5 60 60.6 61.7 62 62.7 63.6 64.2 66.1 66.4 66.7 67.5 69.2 71.7 72.4 74.2 75.7 76.7 78.4 78.8 79.2 80.9 81.5 81.7 84.2 85.6 86.7 89.2 91.7 91.8 92.8 93.2 94.2 38.33333333 40 40.4 41.13333333 41.33333333 41.8 42.4 42.8 44.06666667 44.26666667 44.46666667 45 46.13333333 47.8 48.26666667 49.46666667 50.46666667 51.13333333 52.26666667 52.53333333 52.8 53.93333333 54.33333333 54.46666667 56.13333333 57.06666667 57.8 59.46666667 61.13333333 61.2 61.86666667 62.13333333 62.8 23 24 24.24 24.68 24.8 25.08 25.44 25.68 26.44 26.56 26.68 27 27.68 28.68 28.96 29.68 30.28 30.68 31.36 31.52 31.68 32.36 32.6 32.68 33.68 34.24 34.68 35.68 36.68 36.72 37.12 37.28 37.68 14.375 15 15.15 15.425 15.5 15.675 15.9 16.05 16.525 16.6 16.675 16.875 17.3 17.925 18.1 18.55 18.925 19.175 19.6 19.7 19.8 20.225 20.375 20.425 21.05 21.4 21.675 22.3 22.925 22.95 23.2 23.3 23.55 9.583333333 10 10.1 10.28333333 10.33333333 10.45 10.6 10.7 11.01666667 11.06666667 11.11666667 11.25 11.53333333 11.95 12.06666667 12.36666667 12.61666667 12.78333333 13.06666667 13.13333333 13.2 13.48333333 13.58333333 13.61666667 14.03333333 14.26666667 14.45 14.86666667 15.28333333 15.3 15.46666667 15.53333333 15.7]
xe=[0 1.6 3.54 5.43 6.82 10.06 14.22 17 56.09 62.26 68.43 73.09 83 90 91.05 93.75 96.09 97.65 99.55 100 100 100 100 100 100 100 100 100 100 100 100 100 100 0 0.5 0.71 2 2.96 5.2 8.08 10 40.4 45.2 50 59.23 78.84 87.5 88.87 92.41 94.56 96 98.6 98.7 98.9 99.5 99.7 99.75 100 100 100 100 100 100 100 100 100 0 0 0.08 0.11 0.15 0.32 0.73 1 6.57 7.45 8.33 21.66 50 87 88.68 93 95.9 97.84 99.5 100 100 100 100 100 100 100 100 100 100 100 100 100 100 0 0 0 0 0 0 0.67 1.12 13.19 15.09 17 27.24 49 75.7 80.38 92.4 95.85 98.15 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 0 0 0 0 0 0 0 2.18 9.07 10.16 11.25 17.55 30.95 67.4 72.27 84.78 90.16 93.75 98.81 100 100 100 100 100 100 100 100 100 100 100 100 100 100 0 0 0 0 0 0 0 0 4.3 6.1 12.2 17.67 29.3 59.4 65.66 81.74 88.08 92.3 96.32 97.26 98.21 100 100 100 100 100 100 100 100 100 100 100 100 0 0 0 0 0 0 0 0 0 0.82 1.64 3.12 6.25 23.1 30.63 50 66.56 77.6 85.79 87.71 89.64 93.85 95.34 95.83 98.64 100 100 100 100 100 100 100 100 0 0 0 0 0 0 0 0 0 0.6 6.3 12.57 19.3 31.52 36.7 50 58.4 64 72.36 74.33 76.3 83.58 86.14 87 95 96.86 98.33 100 100 100 100 100 100 0 0 0 0 0 0 0 0 0 0 0 0 1.8 6.74 9.53 16.7 25.43 31.25 45.36 48.68 52 66.08 71.04 72.7 87 91.4 94.85 98.9 99.96 100 100 100 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.67 5.95 11.92 15.9 26.44 28.92 31.4 51.13 58.09 60.41 82 86.86 90.67 95.37 99.3 99.36 100 100 100]
CR=[0.5:0.363:120]
xc=(k^n*((1515-T)/CR).^n+a)/(1+k^n*((1515-T)/CR).^n)
f=sqrt((xe-xc)/xe)^2
f is the objective function to find the unknown parameters k n and a

Answers (1)

Star Strider
Star Strider on 21 May 2019
I am not certain what you are doing.
I altered your code slightly:
xc = @(k,n,a) (k.^n.*((1515-T)./CR).^n+a)./(1+k.^n.*((1515-T)./CR).^n);
fxc = @(b) xc(b(1),b(2),b(3));
f = @(b) norm((xe-fxc(b)));
B = fminsearch(f, rand(3,1)*1E-2)
figure
plot(CR,xe)
hold on
plot(CR,xc(B(1),B(2),B(3)))
hold off
grid
My best parameter estimates (and they do not create a good fit to all your data) are:
B =
135.4160e-003
-14.3616e+000
66.8550e+000
A better approach might be to use the ga (genetic algorithm) function to estimate these parameters. This problem is well within the scope of fminsearch (and is likely quite appropriate for it), however this is not an easy function to fit. I have no idea what the function is or what the constraints are on the parameters.
I will stop here and wish you luck with it!

Community Treasure Hunt

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

Start Hunting!