huhiyy

68 Reputation

2 Badges

16 years, 114 days

MaplePrimes Activity


These are answers submitted by huhiyy

this is my last answer ,do you have other better method to do it. > with(stats): > Xvalues:=[1,2,3,4]; > Yvalues:=[0,6,14,24]; > eq_fit:= fit[leastsquare[[x,y], y=a*x^2+b*x+c, {a,b,c}]]([Xvalues, Yvalues]); > eq1:=y=a*x^2+b*x+c; > eq2:=(lhs(eq1)-rhs(eq1))^2; > ssa[0]:=0; > for i from 1 to 4 do > sa[i]:=subs(y=Yvalues[i],x=Xvalues[i],eq2): > ssa[i]:=ssa[i-1]+sa[i]: > end do; > eq3:=simplify(ssa[4]); > sx1:=diff(eq3,a): > sx2:=diff(eq3,b): > sx3:=diff(eq3,c): > sxall:=solve({sx1,sx2,sx3},{a,b,c}); sxall := {a = 1, b = 3, c = -4}
alec, i have the procedure changed,but computer also evaluating more time and no answer give. could you give me the other sugguestion? View 1984_equation .mw on MapleNet or Download 1984_equation .mw
View file details
Thanks all kinds of people who give me the suggestion. the original equation from the least square. http://www.efunda.com/math/leastsquares/lstsqr2dcurve.cfm i need to calculate the Expanding the equations, they have the (x1,y1),(x2,y2),(x3,y3),(x4,y4)......To obtain the least square error, the unknown coefficients. i know the maple have the command of "leastsquare",but the problem for me i have 4-parameter,(D(D(x1)),D(x1),x1,t),(D(D(x2)),D(x2),x2,t),........ so i calculate by myself. regards huhiyy
first addition one time, then addition the y and z. then substitute y1 and z1 in to the eq1 got the result. > restart; > x1:=[1,2,3,4,5,6,7,8,9]; x1 := [1, 2, 3, 4, 5, 6, 7, 8, 9] > y1:=[9,8,7,6,5,4,3,2,1]; y1 := [9, 8, 7, 6, 5, 4, 3, 2, 1] > z1:=[4,5,6,3,2,1,9,8,7]; z1 := [4, 5, 6, 3, 2, 1, 9, 8, 7] > eq1:=add(x*y+y*z+z*x+a,x=x1); eq1 := 45 y + 45 z + 9 a + 9 y z > y2:=add(y,y=y1); y2 := 45 > z2:=add(z,z=z1); z2 := 45 > eq2:=subs(y=y2,z=z2,eq1); eq2 := 22275 + 9 a
thank you very much! you are very kind.
Page 1 of 1