sund0002

34 Reputation

5 Badges

14 years, 274 days

MaplePrimes Activity


These are replies submitted by sund0002

Book2fuji.xlsI attached the excel datasheet, what i hope is the addition of new script (for the least mean square) will have mimimum change to my early script if possible. thanks very much.

Book2fuji.xlsI attached the excel datasheet, what i hope is the addition of new script (for the least mean square) will have mimimum change to my early script if possible. thanks very much.

@epostma Thank you , that really worked. My next question is, if the raw data is in a text file, other than data pasted into excel, how can i import the the two columns of data and do the similar calculation?

The text file is attached.

[0, 0, 0]
Voltage_1 (1) Current_1 (1)
+2.084844E-03 -1.539501E-11
+1.008272E+00 +7.418045E-11
+2.011296E+00 +1.585834E-10
+3.014516E+00 +1.257579E-10
+4.020737E+00 +2.020622E-10
+5.023648E+00 -3.412362E-10
+6.029697E+00 +2.513342E-10
+7.032315E+00 +3.255611E-10
+8.035268E+00 +3.394107E-10
+9.041428E+00 +3.818043E-10
+1.004472E+01 +4.562043E-10
+1.105100E+01 +4.380012E-10
+1.205396E+01 +5.275512E-10
+1.305708E+01 +5.432970E-10
+1.406483E+01 +5.276273E-10
+1.506946E+01 +6.537230E-10
+1.607708E+01 +6.253311E-10
+1.708189E+01 +6.786694E-10
+1.808636E+01 +7.734090E-10
+1.909399E+01 +7.188969E-10
+2.009796E+01 +8.154436E-10
+2.110552E+01 +8.443801E-10
+2.210992E+01 +8.323715E-10
+2.311463E+01 +9.201229E-10
+2.412242E+01 +9.434690E-10
+2.512681E+01 +9.467329E-10
+2.613430E+01 +1.026297E-09
+2.713788E+01 +1.027425E-09
+2.814094E+01 +1.081861E-09
+2.914716E+01 +1.104920E-09
+3.015059E+01 +1.149720E-09
+3.115689E+01 +1.187300E-09
+3.215979E+01 +1.194762E-09
+3.316206E+01 +1.281394E-09
+3.416844E+01 +1.272261E-09
+3.517138E+01 +1.313611E-09
+3.617774E+01 +1.350934E-09
+3.718106E+01 +1.376551E-09
+3.818390E+01 +1.418130E-09
+3.919014E+01 +1.438968E-09
+4.019356E+01 +1.490174E-09
+4.120135E+01 +1.501460E-09
+4.220589E+01 +1.542701E-09
+4.321032E+01 +1.631221E-09
+4.421856E+01 +1.586070E-09
+4.522297E+01 +1.658848E-09
+4.623064E+01 +1.680928E-09
+4.723482E+01 +1.709814E-09
+4.823924E+01 +1.743627E-09
+4.924712E+01 +1.771964E-09
+5.025191E+01 +1.835478E-09
+5.125978E+01 +1.828984E-09
+5.226424E+01 +1.882634E-09
+5.326856E+01 +1.903358E-09
+5.427532E+01 +1.940393E-09
+5.527833E+01 +2.000310E-09
+5.628459E+01 +1.992549E-09
+5.728799E+01 +2.045119E-09
+5.829089E+01 +2.074110E-09
+5.929705E+01 +2.098845E-09
+6.029957E+01 +2.164577E-09
+6.130585E+01 +2.147180E-09
+6.230881E+01 +2.221673E-09
+6.331161E+01 +2.239644E-09
+6.431828E+01 +2.267571E-09
+6.532126E+01 +2.320259E-09
+6.632753E+01 +2.334645E-09
+6.733103E+01 +2.393130E-09
+6.833547E+01 +2.417708E-09
+6.934323E+01 +2.450630E-09
+7.034802E+01 +2.513887E-09
+7.135586E+01 +2.511066E-09
+7.236015E+01 +2.575965E-09
+7.336453E+01 +2.586032E-09
+7.437182E+01 +2.625925E-09
+7.537621E+01 +2.670396E-09
+7.638396E+01 +2.678521E-09
+7.738876E+01 +2.742605E-09
+7.839320E+01 +2.758925E-09
+7.940083E+01 +2.798763E-09
+8.040511E+01 +2.830322E-09
+8.141190E+01 +2.852047E-09
+8.241486E+01 +2.917546E-09
+8.341785E+01 +2.912237E-09
+8.442462E+01 +2.983217E-09
+8.542754E+01 +2.997299E-09
+8.643378E+01 +3.022519E-09
+8.743640E+01 +3.087845E-09
+8.843938E+01 +3.069886E-09
+8.944573E+01 +3.141736E-09
+9.044861E+01 +3.160345E-09
+9.145533E+01 +3.209532E-09
+9.245837E+01 +3.236400E-09
+9.346133E+01 +3.260430E-09
+9.446838E+01 +3.298672E-09
+9.547298E+01 +3.321157E-09
+9.648089E+01 +3.375022E-09
+9.748582E+01 +3.391351E-09
+9.849041E+01 +3.431033E-09
+9.949830E+01 +3.466451E-09
+1.005094E+02 +3.488209E-09
+1.015135E+02 +3.550148E-09
+1.025213E+02 +3.551365E-09
+1.035258E+02 +3.610483E-09
+1.045307E+02 +3.638411E-09
+1.055386E+02 +3.654279E-09
+1.065431E+02 +3.726503E-09
+1.075509E+02 +3.760037E-09
+1.085540E+02 +3.789975E-09
+1.095571E+02 +3.828623E-09
+1.105633E+02 +3.867659E-09
+1.115666E+02 +3.896050E-09
+1.125729E+02 +3.932743E-09
+1.135759E+02 +3.954641E-09
+1.145784E+02 +4.000641E-09
+1.155848E+02 +4.024017E-09
+1.165877E+02 +4.064768E-09
+1.175939E+02 +4.091123E-09
+1.185974E+02 +4.127495E-09
+1.196004E+02 +4.160992E-09
+1.206066E+02 +4.204411E-09
+1.216104E+02 +4.235071E-09
+1.226180E+02 +4.267085E-09
+1.236225E+02 +4.309237E-09
+1.246272E+02 +4.349013E-09
+1.256350E+02 +4.362656E-09
+1.266394E+02 +4.393559E-09
+1.276471E+02 +4.445208E-09
+1.286510E+02 +4.456242E-09
+1.296553E+02 +4.497115E-09
+1.306629E+02 +4.522762E-09
+1.316676E+02 +4.560603E-09
+1.326753E+02 +4.601392E-09
+1.336796E+02 +4.629670E-09
+1.346840E+02 +4.664936E-09
+1.356903E+02 +4.689888E-09
+1.366933E+02 +4.735350E-09
+1.376994E+02 +4.737821E-09
+1.387028E+02 +4.804353E-09
+1.397056E+02 +4.812088E-09
+1.407118E+02 +4.882349E-09
+1.417142E+02 +4.894210E-09
+1.427205E+02 +4.963868E-09
+1.437234E+02 +4.959156E-09
+1.447267E+02 +5.026900E-09
+1.457328E+02 +5.064036E-09
+1.467359E+02 +5.118719E-09
+1.477421E+02 +5.129789E-09
+1.487458E+02 +5.191246E-09
+1.497500E+02 +5.209259E-09
+1.507576E+02 +5.276312E-09
+1.517622E+02 +5.279829E-09
+1.527697E+02 +5.356369E-09
+1.537740E+02 +5.384279E-09
+1.547781E+02 +5.438773E-09
+1.557852E+02 +5.460422E-09
+1.567894E+02 +5.488222E-09
+1.577969E+02 +5.520811E-09
+1.588014E+02 +5.570371E-09
+1.598057E+02 +5.575345E-09
+1.608132E+02 +5.651877E-09
+1.618172E+02 +5.663252E-09
+1.628235E+02 +5.732052E-09
+1.638265E+02 +5.776316E-09
+1.648294E+02 +5.752269E-09
+1.658361E+02 +5.834192E-09
+1.668389E+02 +5.814748E-09
+1.678452E+02 +5.885950E-09
+1.688477E+02 +5.909764E-09
+1.698506E+02 +5.983261E-09
+1.708569E+02 +6.006442E-09
+1.718603E+02 +6.047213E-09
+1.728665E+02 +6.078885E-09
+1.738695E+02 +6.126250E-09
+1.748725E+02 +6.152331E-09
+1.758798E+02 +6.178037E-09
+1.768842E+02 +6.230961E-09
+1.778917E+02 +6.249762E-09
+1.788967E+02 +6.297768E-09
+1.799009E+02 +6.315666E-09
+1.809086E+02 +6.385553E-09
+1.819125E+02 +6.397836E-09
+1.829201E+02 +6.417491E-09
+1.839245E+02 +6.451984E-09
+1.849288E+02 +6.506398E-09
+1.859369E+02 +6.551122E-09
+1.869411E+02 +6.598350E-09
+1.879488E+02 +6.630926E-09
+1.889529E+02 +6.699431E-09
+1.899559E+02 +6.729825E-09
+1.909622E+02 +6.771036E-09
+1.919652E+02 +6.801712E-09
+1.929721E+02 +6.839246E-09
+1.939751E+02 +6.881621E-09
+1.949782E+02 +6.878314E-09
+1.959839E+02 +6.941617E-09
+1.969870E+02 +6.947759E-09
+1.979935E+02 +7.026036E-09
+1.989969E+02 +7.056673E-09
+2.000001E+02 +7.109488E-09

Download 200-1.1.txt

@epostma 

is it something with the array?



restart:with(Statistics):  with(ExcelTools): Data := Import("c:\\my folder\\Book1.xls");

(1)

V, C := Data[.., 1], Data[.., 2];

(2)

answer1 := Fit(a*x^n+b*x+c, V, C, x);

(3)

p1 := plot(answer1, x = 0 .. 10);

(4)

with(plots):

pp:=pointplot(V,C,symbolsize=5, color=green);

Error, (in plot/options2d) unexpected option: Array(1..18, {(1) = 0.2605711e-11, (2) = 0.1622541e-9, (3) = 0.3040835e-9, (4) = 0.4290568e-9, (5) = 0.5583454e-9, (6) = 0.6814651e-9, (7) = 0.8124977e-9, (8) = 0.924913e-9, (9) = 0.1050371e-8, (10) = 0.1166342e-8, (11) = 0.128928e-8, (12) = 0.1399596e-8, (13) = 0.1526009e-8, (14) = 0.1632007e-8, (15) = 0.1759492e-8, (16) = 0.1865016e-8, (17) = 0.1988457e-8, (18) = 0.2096325e-8})

 

display(pp,p1);

Error, (in plots:-display) expecting plot structure but received: pp

 

 

@epostma 

is it something with the array?



restart:with(Statistics):  with(ExcelTools): Data := Import("c:\\my folder\\Book1.xls");

(1)

V, C := Data[.., 1], Data[.., 2];

(2)

answer1 := Fit(a*x^n+b*x+c, V, C, x);

(3)

p1 := plot(answer1, x = 0 .. 10);

(4)

with(plots):

pp:=pointplot(V,C,symbolsize=5, color=green);

Error, (in plot/options2d) unexpected option: Array(1..18, {(1) = 0.2605711e-11, (2) = 0.1622541e-9, (3) = 0.3040835e-9, (4) = 0.4290568e-9, (5) = 0.5583454e-9, (6) = 0.6814651e-9, (7) = 0.8124977e-9, (8) = 0.924913e-9, (9) = 0.1050371e-8, (10) = 0.1166342e-8, (11) = 0.128928e-8, (12) = 0.1399596e-8, (13) = 0.1526009e-8, (14) = 0.1632007e-8, (15) = 0.1759492e-8, (16) = 0.1865016e-8, (17) = 0.1988457e-8, (18) = 0.2096325e-8})

 

display(pp,p1);

Error, (in plots:-display) expecting plot structure but received: pp

 

 

Sorry erik for my stupid questions, but for people like me who never learnt programming (nor could find anyone to help me physically around me), i do struggle to even understand the message Maple returns. Anyway, thank you for your patience, and bear with me for more questions.  please see the code below, i put in with(Statistics) and with(plots) but there are still errors.

with(Statistics);  with(ExcelTools); Data := Import("c:\\my folder\\Book1.xls");

(1)

V, C := Data[.., 1], Data[.., 2];

(2)

 

 

 

answer1 := Fit(a*x^n+b*x+c, V, C, x);

(3)

p1 := plot(answer1, x = 0 .. 10);

(4)

with(plots):

pp := pointplot(V,C,symbolsize=5,color=green);

Error, `:=` unexpected

 

 

display(pp,p1);

Error, (in plots:-display) expecting plot structure but received: pp



Download excel_to_vector_comp.mw

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Sorry erik for my stupid questions, but for people like me who never learnt programming (nor could find anyone to help me physically around me), i do struggle to even understand the message Maple returns. Anyway, thank you for your patience, and bear with me for more questions.  please see the code below, i put in with(Statistics) and with(plots) but there are still errors.

with(Statistics);  with(ExcelTools); Data := Import("c:\\my folder\\Book1.xls");

(1)

V, C := Data[.., 1], Data[.., 2];

(2)

 

 

 

answer1 := Fit(a*x^n+b*x+c, V, C, x);

(3)

p1 := plot(answer1, x = 0 .. 10);

(4)

with(plots):

pp := pointplot(V,C,symbolsize=5,color=green);

Error, `:=` unexpected

 

 

display(pp,p1);

Error, (in plots:-display) expecting plot structure but received: pp



Download excel_to_vector_comp.mw

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

@epostma 

 

I tried the suggested and code attached,


with(ExcelTools); Data := Import("c:\\my folder\\Book1.xls");

(1)

V, C := Data[.., 1], data[.., 2];

(2)

 

  pp:=pointplot(V,C,symbolsize=5,color=green): 

answer1 := Fit(a*x^n+b*x+c, V, C, x);

(3)

p1 := plot(ans1, x = 0 .. 200);

(4)

display(pp, p1);

(5)

 

 



Download excel_to_vector_comp.mw

 

 

it did not give me what i used to have from copying and pasting data from excel (see working_plot_and_fit.mw)

Please let me know what i need to modify.

@epostma 

 

I tried the suggested and code attached,


with(ExcelTools); Data := Import("c:\\my folder\\Book1.xls");

(1)

V, C := Data[.., 1], data[.., 2];

(2)

 

  pp:=pointplot(V,C,symbolsize=5,color=green): 

answer1 := Fit(a*x^n+b*x+c, V, C, x);

(3)

p1 := plot(ans1, x = 0 .. 200);

(4)

display(pp, p1);

(5)

 

 



Download excel_to_vector_comp.mw

 

 

it did not give me what i used to have from copying and pasting data from excel (see working_plot_and_fit.mw)

Please let me know what i need to modify.

working_plot_and_fit.mw  @epostma 

Erik, i tried the code you suggested, but it still did not return to me the plot,nor the fitted parameters... see attached.

 

Also, how can i, , import directly from excel columns into the vectors V and C?instead of pasting columns of data into the bracket after vector?

working_plot_and_fit.mw

 

working_plot_and_fit.mw   @epostma 

Erik, i tried the code you suggested, but it still did not return to me the plot,nor the fitted parameters... see attached.

 

Also, how can i, , import directly from excel columns into the vectors V and C?instead of pasting columns of data into the bracket after vector?

working_plot_and_fit.mw

 

working_plot_and_fit.mw   @epostma 

Erik, i tried the code you suggested, but it still did not return to me the plot,nor the fitted parameters... see attached.

 

Also, how can i, , import directly from excel columns into the vectors V and C?instead of pasting columns of data into the bracket after vector?

working_plot_and_fit.mw

 

working_plot_and_fit.mw   @epostma 

Erik, i tried the code you suggested, but it still did not return to me the plot,nor the fitted parameters... see attached.

 

Also, how can i, , import directly from excel columns into the vectors V and C?instead of pasting columns of data into the bracket after vector?

working_plot_and_fit.mw

 


thank you. The previous problem has been solved more or less, i then paste columns of data from my excel (so far still did not figure out how to read directly from excel columns into the Vector).

then i tried the following:

ans1 := Fit(a*x^n+bx+c, V, C, x);

which returned an answer with a and b values

but when i tried

ans2 := Fit(a*x^n+b*x+c, V, C, x, output = [parametervalues, residualsumofsquares]);

to get the Rsquared value, the a and b values are different. please see attached. and i dont know how to plot out ans 2.


restart: with(plots); with(Statistics);

(1)

 

V:= Vector(200, {(1) = 0.984e-3, (2) = 1.01, (3) = 2.01, (4) = 3.01, (5) = 4.02, (6) = 5.02, (7) = 6.03, (8) = 7.03, (9) = 8.03, (10) = 9.04, (11) = 10.0, (12) = 11.1, (13) = 12.1, (14) = 13.1, (15) = 14.1, (16) = 15.1, (17) = 16.1, (18) = 17.1, (19) = 18.1, (20) = 19.1, (21) = 20.1, (22) = 21.1, (23) = 22.1, (24) = 23.1, (25) = 24.1, (26) = 25.1, (27) = 26.1, (28) = 27.1, (29) = 28.1, (30) = 29.1, (31) = 30.2, (32) = 31.2, (33) = 32.2, (34) = 33.2, (35) = 34.2, (36) = 35.2, (37) = 36.2, (38) = 37.2, (39) = 38.2, (40) = 39.2, (41) = 40.2, (42) = 41.2, (43) = 42.2, (44) = 43.2, (45) = 44.2, (46) = 45.2, (47) = 46.2, (48) = 47.2, (49) = 48.2, (50) = 49.2, (51) = 50.3, (52) = 51.3, (53) = 52.3, (54) = 53.3, (55) = 54.3, (56) = 55.3, (57) = 56.3, (58) = 57.3, (59) = 58.3, (60) = 59.3, (61) = 60.3, (62) = 61.3, (63) = 62.3, (64) = 63.3, (65) = 64.3, (66) = 65.3, (67) = 66.3, (68) = 67.3, (69) = 68.3, (70) = 69.3, (71) = 70.3, (72) = 71.4, (73) = 72.4, (74) = 73.4, (75) = 74.4, (76) = 75.4, (77) = 76.4, (78) = 77.4, (79) = 78.4, (80) = 79.4, (81) = 80.4, (82) = 81.4, (83) = 82.4, (84) = 83.4, (85) = 84.4, (86) = 85.4, (87) = 86.4, (88) = 87.4, (89) = 88.4, (90) = 89.4, (91) = 90.4, (92) = 91.5, (93) = 92.5, (94) = 93.5, (95) = 94.5, (96) = 95.5, (97) = 96.5, (98) = 97.5, (99) = 98.5, (100) = 99.5, (101) = 101., (102) = 102., (103) = 103., (104) = 104., (105) = 105., (106) = 106., (107) = 107., (108) = 108., (109) = 109., (110) = 110., (111) = 111., (112) = 112., (113) = 113., (114) = 114., (115) = 115., (116) = 116., (117) = 117., (118) = 118., (119) = 119., (120) = 120., (121) = 121., (122) = 122., (123) = 123., (124) = 124., (125) = 125., (126) = 126., (127) = 127., (128) = 128., (129) = 129., (130) = 130., (131) = 131., (132) = 132., (133) = 133., (134) = 134., (135) = 135., (136) = 136., (137) = 137., (138) = 138., (139) = 139., (140) = 140., (141) = 141., (142) = 142., (143) = 143., (144) = 144., (145) = 145., (146) = 146., (147) = 147., (148) = 148., (149) = 149., (150) = 150., (151) = 151., (152) = 152., (153) = 153., (154) = 154., (155) = 155., (156) = 156., (157) = 157., (158) = 158., (159) = 159., (160) = 160., (161) = 161., (162) = 162., (163) = 163., (164) = 164., (165) = 165., (166) = 166., (167) = 167., (168) = 168., (169) = 169., (170) = 170., (171) = 171., (172) = 172., (173) = 173., (174) = 174., (175) = 175., (176) = 176., (177) = 177., (178) = 178., (179) = 179., (180) = 180., (181) = 181., (182) = 182., (183) = 183., (184) = 184., (185) = 185., (186) = 186., (187) = 187., (188) = 188., (189) = 189., (190) = 190., (191) = 191., (192) = 192., (193) = 193., (194) = 194., (195) = 195., (196) = 196., (197) = 197., (198) = 198., (199) = 199., (200) = 200.});

(2)

C := Vector(Vector(200, {(1) = -0.477e-10, (2) = 0.133e-8, (3) = 0.275e-8, (4) = 0.423e-8, (5) = 0.579e-8, (6) = 0.724e-8, (7) = 0.860e-8, (8) = 0.102e-7, (9) = 0.117e-7, (10) = 0.132e-7, (11) = 0.148e-7, (12) = 0.165e-7, (13) = 0.180e-7, (14) = 0.197e-7, (15) = 0.213e-7, (16) = 0.230e-7, (17) = 0.247e-7, (18) = 0.261e-7, (19) = 0.281e-7, (20) = 0.298e-7, (21) = 0.315e-7, (22) = 0.336e-7, (23) = 0.352e-7, (24) = 0.369e-7, (25) = 0.388e-7, (26) = 0.410e-7, (27) = 0.428e-7, (28) = 0.444e-7, (29) = 0.462e-7, (30) = 0.482e-7, (31) = 0.501e-7, (32) = 0.527e-7, (33) = 0.546e-7, (34) = 0.565e-7, (35) = 0.585e-7, (36) = 0.603e-7, (37) = 0.619e-7, (38) = 0.641e-7, (39) = 0.660e-7, (40) = 0.679e-7, (41) = 0.700e-7, (42) = 0.720e-7, (43) = 0.742e-7, (44) = 0.764e-7, (45) = 0.791e-7, (46) = 0.813e-7, (47) = 0.836e-7, (48) = 0.855e-7, (49) = 0.878e-7, (50) = 0.898e-7, (51) = 0.921e-7, (52) = 0.939e-7, (53) = 0.959e-7, (54) = 0.979e-7, (55) = 0.999e-7, (56) = 0.102e-6, (57) = 0.105e-6, (58) = 0.106e-6, (59) = 0.108e-6, (60) = 0.111e-6, (61) = 0.113e-6, (62) = 0.115e-6, (63) = 0.117e-6, (64) = 0.119e-6, (65) = 0.121e-6, (66) = 0.123e-6, (67) = 0.126e-6, (68) = 0.128e-6, (69) = 0.131e-6, (70) = 0.132e-6, (71) = 0.135e-6, (72) = 0.138e-6, (73) = 0.139e-6, (74) = 0.142e-6, (75) = 0.144e-6, (76) = 0.146e-6, (77) = 0.148e-6, (78) = 0.150e-6, (79) = 0.153e-6, (80) = 0.155e-6, (81) = 0.158e-6, (82) = 0.159e-6, (83) = 0.162e-6, (84) = 0.164e-6, (85) = 0.166e-6, (86) = 0.169e-6, (87) = 0.171e-6, (88) = 0.174e-6, (89) = 0.176e-6, (90) = 0.178e-6, (91) = 0.181e-6, (92) = 0.183e-6, (93) = 0.186e-6, (94) = 0.188e-6, (95) = 0.190e-6, (96) = 0.193e-6, (97) = 0.195e-6, (98) = 0.197e-6, (99) = 0.200e-6, (100) = 0.202e-6, (101) = 0.204e-6, (102) = 0.207e-6, (103) = 0.209e-6, (104) = 0.211e-6, (105) = 0.214e-6, (106) = 0.216e-6, (107) = 0.218e-6, (108) = 0.221e-6, (109) = 0.224e-6, (110) = 0.226e-6, (111) = 0.229e-6, (112) = 0.231e-6, (113) = 0.233e-6, (114) = 0.236e-6, (115) = 0.239e-6, (116) = 0.241e-6, (117) = 0.244e-6, (118) = 0.246e-6, (119) = 0.249e-6, (120) = 0.251e-6, (121) = 0.253e-6, (122) = 0.256e-6, (123) = 0.259e-6, (124) = 0.262e-6, (125) = 0.265e-6, (126) = 0.267e-6, (127) = 0.270e-6, (128) = 0.273e-6, (129) = 0.276e-6, (130) = 0.277e-6, (131) = 0.280e-6, (132) = 0.283e-6, (133) = 0.286e-6, (134) = 0.289e-6, (135) = 0.292e-6, (136) = 0.294e-6, (137) = 0.297e-6, (138) = 0.299e-6, (139) = 0.302e-6, (140) = 0.305e-6, (141) = 0.308e-6, (142) = 0.309e-6, (143) = 0.313e-6, (144) = 0.316e-6, (145) = 0.318e-6, (146) = 0.322e-6, (147) = 0.324e-6, (148) = 0.326e-6, (149) = 0.330e-6, (150) = 0.333e-6, (151) = 0.336e-6, (152) = 0.338e-6, (153) = 0.341e-6, (154) = 0.343e-6, (155) = 0.346e-6, (156) = 0.349e-6, (157) = 0.352e-6, (158) = 0.355e-6, (159) = 0.358e-6, (160) = 0.360e-6, (161) = 0.362e-6, (162) = 0.365e-6, (163) = 0.369e-6, (164) = 0.371e-6, (165) = 0.374e-6, (166) = 0.376e-6, (167) = 0.379e-6, (168) = 0.382e-6, (169) = 0.385e-6, (170) = 0.388e-6, (171) = 0.391e-6, (172) = 0.393e-6, (173) = 0.396e-6, (174) = 0.400e-6, (175) = 0.402e-6, (176) = 0.405e-6, (177) = 0.408e-6, (178) = 0.409e-6, (179) = 0.412e-6, (180) = 0.416e-6, (181) = 0.419e-6, (182) = 0.423e-6, (183) = 0.426e-6, (184) = 0.428e-6, (185) = 0.431e-6, (186) = 0.435e-6, (187) = 0.438e-6, (188) = 0.440e-6, (189) = 0.443e-6, (190) = 0.444e-6, (191) = 0.449e-6, (192) = 0.452e-6, (193) = 0.454e-6, (194) = 0.458e-6, (195) = 0.461e-6, (196) = 0.463e-6, (197) = 0.467e-6, (198) = 0.470e-6, (199) = 0.473e-6, (200) = 0.475e-6}));

(3)

pp:=pointplot(V,C,symbolsize=5,color=green):

ans1 := Fit(a*x^n+bx+c, V, C, x);

(4)

p1:=plot(ans1,x=0..200):

 

display(pp, p1);

ans2 := Fit(a*x^n+b*x+c, V, C, x, output = [parametervalues, residualsumofsquares]);

(5)

p2 := plot(ans2,x = 0 .. 200):

Error, (in plot) incorrect first argument [[a = -0.866020202046765230e-4, b = 0.866016113659728544e-4, c = 0.808246478962801220e-8, n = .999994059782185806], 0.98788619110050e-15]

display(pp, p2);

Error, (in plots:-display) expecting plot structure but received: p2



Download working_plot_and_fit.mw

working_plot_and_fit.mw

@epostma 

 

 

 


thank you. The previous problem has been solved more or less, i then paste columns of data from my excel (so far still did not figure out how to read directly from excel columns into the Vector).

then i tried the following:

ans1 := Fit(a*x^n+bx+c, V, C, x);

which returned an answer with a and b values

but when i tried

ans2 := Fit(a*x^n+b*x+c, V, C, x, output = [parametervalues, residualsumofsquares]);

to get the Rsquared value, the a and b values are different. please see attached. and i dont know how to plot out ans 2.


restart: with(plots); with(Statistics);

(1)

 

V:= Vector(200, {(1) = 0.984e-3, (2) = 1.01, (3) = 2.01, (4) = 3.01, (5) = 4.02, (6) = 5.02, (7) = 6.03, (8) = 7.03, (9) = 8.03, (10) = 9.04, (11) = 10.0, (12) = 11.1, (13) = 12.1, (14) = 13.1, (15) = 14.1, (16) = 15.1, (17) = 16.1, (18) = 17.1, (19) = 18.1, (20) = 19.1, (21) = 20.1, (22) = 21.1, (23) = 22.1, (24) = 23.1, (25) = 24.1, (26) = 25.1, (27) = 26.1, (28) = 27.1, (29) = 28.1, (30) = 29.1, (31) = 30.2, (32) = 31.2, (33) = 32.2, (34) = 33.2, (35) = 34.2, (36) = 35.2, (37) = 36.2, (38) = 37.2, (39) = 38.2, (40) = 39.2, (41) = 40.2, (42) = 41.2, (43) = 42.2, (44) = 43.2, (45) = 44.2, (46) = 45.2, (47) = 46.2, (48) = 47.2, (49) = 48.2, (50) = 49.2, (51) = 50.3, (52) = 51.3, (53) = 52.3, (54) = 53.3, (55) = 54.3, (56) = 55.3, (57) = 56.3, (58) = 57.3, (59) = 58.3, (60) = 59.3, (61) = 60.3, (62) = 61.3, (63) = 62.3, (64) = 63.3, (65) = 64.3, (66) = 65.3, (67) = 66.3, (68) = 67.3, (69) = 68.3, (70) = 69.3, (71) = 70.3, (72) = 71.4, (73) = 72.4, (74) = 73.4, (75) = 74.4, (76) = 75.4, (77) = 76.4, (78) = 77.4, (79) = 78.4, (80) = 79.4, (81) = 80.4, (82) = 81.4, (83) = 82.4, (84) = 83.4, (85) = 84.4, (86) = 85.4, (87) = 86.4, (88) = 87.4, (89) = 88.4, (90) = 89.4, (91) = 90.4, (92) = 91.5, (93) = 92.5, (94) = 93.5, (95) = 94.5, (96) = 95.5, (97) = 96.5, (98) = 97.5, (99) = 98.5, (100) = 99.5, (101) = 101., (102) = 102., (103) = 103., (104) = 104., (105) = 105., (106) = 106., (107) = 107., (108) = 108., (109) = 109., (110) = 110., (111) = 111., (112) = 112., (113) = 113., (114) = 114., (115) = 115., (116) = 116., (117) = 117., (118) = 118., (119) = 119., (120) = 120., (121) = 121., (122) = 122., (123) = 123., (124) = 124., (125) = 125., (126) = 126., (127) = 127., (128) = 128., (129) = 129., (130) = 130., (131) = 131., (132) = 132., (133) = 133., (134) = 134., (135) = 135., (136) = 136., (137) = 137., (138) = 138., (139) = 139., (140) = 140., (141) = 141., (142) = 142., (143) = 143., (144) = 144., (145) = 145., (146) = 146., (147) = 147., (148) = 148., (149) = 149., (150) = 150., (151) = 151., (152) = 152., (153) = 153., (154) = 154., (155) = 155., (156) = 156., (157) = 157., (158) = 158., (159) = 159., (160) = 160., (161) = 161., (162) = 162., (163) = 163., (164) = 164., (165) = 165., (166) = 166., (167) = 167., (168) = 168., (169) = 169., (170) = 170., (171) = 171., (172) = 172., (173) = 173., (174) = 174., (175) = 175., (176) = 176., (177) = 177., (178) = 178., (179) = 179., (180) = 180., (181) = 181., (182) = 182., (183) = 183., (184) = 184., (185) = 185., (186) = 186., (187) = 187., (188) = 188., (189) = 189., (190) = 190., (191) = 191., (192) = 192., (193) = 193., (194) = 194., (195) = 195., (196) = 196., (197) = 197., (198) = 198., (199) = 199., (200) = 200.});

(2)

C := Vector(Vector(200, {(1) = -0.477e-10, (2) = 0.133e-8, (3) = 0.275e-8, (4) = 0.423e-8, (5) = 0.579e-8, (6) = 0.724e-8, (7) = 0.860e-8, (8) = 0.102e-7, (9) = 0.117e-7, (10) = 0.132e-7, (11) = 0.148e-7, (12) = 0.165e-7, (13) = 0.180e-7, (14) = 0.197e-7, (15) = 0.213e-7, (16) = 0.230e-7, (17) = 0.247e-7, (18) = 0.261e-7, (19) = 0.281e-7, (20) = 0.298e-7, (21) = 0.315e-7, (22) = 0.336e-7, (23) = 0.352e-7, (24) = 0.369e-7, (25) = 0.388e-7, (26) = 0.410e-7, (27) = 0.428e-7, (28) = 0.444e-7, (29) = 0.462e-7, (30) = 0.482e-7, (31) = 0.501e-7, (32) = 0.527e-7, (33) = 0.546e-7, (34) = 0.565e-7, (35) = 0.585e-7, (36) = 0.603e-7, (37) = 0.619e-7, (38) = 0.641e-7, (39) = 0.660e-7, (40) = 0.679e-7, (41) = 0.700e-7, (42) = 0.720e-7, (43) = 0.742e-7, (44) = 0.764e-7, (45) = 0.791e-7, (46) = 0.813e-7, (47) = 0.836e-7, (48) = 0.855e-7, (49) = 0.878e-7, (50) = 0.898e-7, (51) = 0.921e-7, (52) = 0.939e-7, (53) = 0.959e-7, (54) = 0.979e-7, (55) = 0.999e-7, (56) = 0.102e-6, (57) = 0.105e-6, (58) = 0.106e-6, (59) = 0.108e-6, (60) = 0.111e-6, (61) = 0.113e-6, (62) = 0.115e-6, (63) = 0.117e-6, (64) = 0.119e-6, (65) = 0.121e-6, (66) = 0.123e-6, (67) = 0.126e-6, (68) = 0.128e-6, (69) = 0.131e-6, (70) = 0.132e-6, (71) = 0.135e-6, (72) = 0.138e-6, (73) = 0.139e-6, (74) = 0.142e-6, (75) = 0.144e-6, (76) = 0.146e-6, (77) = 0.148e-6, (78) = 0.150e-6, (79) = 0.153e-6, (80) = 0.155e-6, (81) = 0.158e-6, (82) = 0.159e-6, (83) = 0.162e-6, (84) = 0.164e-6, (85) = 0.166e-6, (86) = 0.169e-6, (87) = 0.171e-6, (88) = 0.174e-6, (89) = 0.176e-6, (90) = 0.178e-6, (91) = 0.181e-6, (92) = 0.183e-6, (93) = 0.186e-6, (94) = 0.188e-6, (95) = 0.190e-6, (96) = 0.193e-6, (97) = 0.195e-6, (98) = 0.197e-6, (99) = 0.200e-6, (100) = 0.202e-6, (101) = 0.204e-6, (102) = 0.207e-6, (103) = 0.209e-6, (104) = 0.211e-6, (105) = 0.214e-6, (106) = 0.216e-6, (107) = 0.218e-6, (108) = 0.221e-6, (109) = 0.224e-6, (110) = 0.226e-6, (111) = 0.229e-6, (112) = 0.231e-6, (113) = 0.233e-6, (114) = 0.236e-6, (115) = 0.239e-6, (116) = 0.241e-6, (117) = 0.244e-6, (118) = 0.246e-6, (119) = 0.249e-6, (120) = 0.251e-6, (121) = 0.253e-6, (122) = 0.256e-6, (123) = 0.259e-6, (124) = 0.262e-6, (125) = 0.265e-6, (126) = 0.267e-6, (127) = 0.270e-6, (128) = 0.273e-6, (129) = 0.276e-6, (130) = 0.277e-6, (131) = 0.280e-6, (132) = 0.283e-6, (133) = 0.286e-6, (134) = 0.289e-6, (135) = 0.292e-6, (136) = 0.294e-6, (137) = 0.297e-6, (138) = 0.299e-6, (139) = 0.302e-6, (140) = 0.305e-6, (141) = 0.308e-6, (142) = 0.309e-6, (143) = 0.313e-6, (144) = 0.316e-6, (145) = 0.318e-6, (146) = 0.322e-6, (147) = 0.324e-6, (148) = 0.326e-6, (149) = 0.330e-6, (150) = 0.333e-6, (151) = 0.336e-6, (152) = 0.338e-6, (153) = 0.341e-6, (154) = 0.343e-6, (155) = 0.346e-6, (156) = 0.349e-6, (157) = 0.352e-6, (158) = 0.355e-6, (159) = 0.358e-6, (160) = 0.360e-6, (161) = 0.362e-6, (162) = 0.365e-6, (163) = 0.369e-6, (164) = 0.371e-6, (165) = 0.374e-6, (166) = 0.376e-6, (167) = 0.379e-6, (168) = 0.382e-6, (169) = 0.385e-6, (170) = 0.388e-6, (171) = 0.391e-6, (172) = 0.393e-6, (173) = 0.396e-6, (174) = 0.400e-6, (175) = 0.402e-6, (176) = 0.405e-6, (177) = 0.408e-6, (178) = 0.409e-6, (179) = 0.412e-6, (180) = 0.416e-6, (181) = 0.419e-6, (182) = 0.423e-6, (183) = 0.426e-6, (184) = 0.428e-6, (185) = 0.431e-6, (186) = 0.435e-6, (187) = 0.438e-6, (188) = 0.440e-6, (189) = 0.443e-6, (190) = 0.444e-6, (191) = 0.449e-6, (192) = 0.452e-6, (193) = 0.454e-6, (194) = 0.458e-6, (195) = 0.461e-6, (196) = 0.463e-6, (197) = 0.467e-6, (198) = 0.470e-6, (199) = 0.473e-6, (200) = 0.475e-6}));

(3)

pp:=pointplot(V,C,symbolsize=5,color=green):

ans1 := Fit(a*x^n+bx+c, V, C, x);

(4)

p1:=plot(ans1,x=0..200):

 

display(pp, p1);

ans2 := Fit(a*x^n+b*x+c, V, C, x, output = [parametervalues, residualsumofsquares]);

(5)

p2 := plot(ans2,x = 0 .. 200):

Error, (in plot) incorrect first argument [[a = -0.866020202046765230e-4, b = 0.866016113659728544e-4, c = 0.808246478962801220e-8, n = .999994059782185806], 0.98788619110050e-15]

display(pp, p2);

Error, (in plots:-display) expecting plot structure but received: p2



Download working_plot_and_fit.mw

working_plot_and_fit.mw

@epostma 

 

 

 

1 2 Page 1 of 2