Muhammad Usman XJTU

MaplePrimes Activity


These are questions asked by Muhammad Usman XJTU

Hi, I am new to MAPLE and trying to solve the given BVP using shooting method but after defining the expression in u0 and u1, the code didn't compute the numerical value, and so that the whole code won't run exactly.
Please help me out to figure out the problem. I am looking for the answer. (NOTE: I copied this code from the web and it run so fine with the example but when I changed it according to me, it give me errors.)
The code is given below:
Thanks


restart;
with(DEtools);
with(plots);
dpdexi := 2;
K := 0.2;
epsilon := 0.0001;
                       epsilon := 0.0001
ode1 := (diff(phi(eta), eta) + epsilon*K*diff(phi(eta), eta)^3)/(1 + epsilon*diff(phi(eta), eta)^2) = dpdexi*eta;
bc1 := phi(0) = 0, phi(1) = 0;
a := 0;
b := 1;
ic1 := bc1[1], D(phi)(a) = alpha;
constraint := lhs(bc1[2]) - rhs(bc1[2]);
constraint = 0;
a0 := 0;
u0 := eval(constraint, phi(b) = PHIb(eval({ic1, ode1}, alpha = a0), phi(eta), b));
a1 := 0.01;
u1 := eval(constraint, phi(b) = PHIb(eval({ic1, ode1}, alpha = a1), phi(eta), b));
while fnormal(u1 - u0) <> 0 do
    z := solve(u1 = (u1 - u0)*(a1 - x)/(a1 - a0), x);
    a0, a1 := a1, z;
    u0, u1 := u1, eval(constraint, u(b) = Ub(eval({ic1, ode1}, alpha = z), u(x), b));
end do;
alpha_opt1 := z;
shoot_sol1 := evalf(dsolve(eval({ic1, ode1}, alpha = alpha_opt1), u(x), implicit));
infolevel[dsolve] := 3;
exact_sol1 := combine(dsolve({bc1, ode1}, u(x)));
infolevel[dsolve] := 0;
plot([rhs(exact_sol1), rhs(shoot_sol1)], x = 0 .. 1, color = [BLACK, RED], thickness = [5, 2], legend = ['exact', 'shooting'], title = "Figure 17.3");
evalf(eval(rhs(shoot_sol1), x = 1));
Page 1 of 1