Question: Changing the value of variable 'S' from 1 to 1.0 also change the solution -- Getting wrong solution

I wrote a small code to solve the equations. The problem is whenever i change the value of variable 'S' from 1 to 1.0 maple produces different solution. It means that i am only right solution for S=1. I can't get right solution other than S=1. I haven't faced this kind of problem before. Can anybody take a look? Is there something wrong with the code? Thanks!

restart:with(PDEtools):declare(f(eta),theta(eta),quiet):S:=1:
f(eta):=sum((q^i)*f[i](eta),i=0..16):
eqa:=simplify(diff(f(eta),eta,eta,eta)+(q*g*((f(eta)*diff(f(eta),eta,eta))-((diff(f(eta),eta))*(diff(f(eta),eta)))-(S*diff(f(eta),eta))-(((S*eta)/2)*diff(f(eta),eta,eta))))):
f[0](eta):=(alpha/2)*eta^2+eta:
for m from 1 to 8 do eq[m]:=coeff(eqa,q^m) end do:
for m from 1 to 8 do (simplify(int(int(int(((-1)*eq[m]),eta),eta),eta)+f[m](eta))):f[m](eta):=simplify(%) end do:
a1:=simplify(sum(f[n](eta),n=0..8)):
b1:=simplify(subs(eta=1,a1))=(S/2):b2:=simplify(subs(eta=1,diff(a1,eta,eta)))=0:
sys:={b1,b2}:solution:=fsolve(sys):s1:=solution[1]:s2:=solution[2]:
alpha:=rhs(s1);g:=rhs(s2);beta:=g^(1/2);
c1:=simplify(a1):c2:=diff(c1,eta,eta):c3:=subs(eta=0,c2)

 

Please Wait...