shakuntala

25 Reputation

4 Badges

8 years, 278 days

MaplePrimes Activity


These are questions asked by shakuntala

> restart; for j to nops(n) do sys := diff(f(eta), eta, eta, eta)+f(eta)*(diff(f(eta), eta, eta))+1-(diff(f(eta), eta))^2 = 0, (diff(diff(theta(eta), eta), eta))/pr+f(eta)*(diff(theta(eta), eta))-(diff(f(eta), eta))*theta(eta) = 0; bcs := f(0) = 0, (D(f))(0) = l+b*((D@@2)(f))(0), (D(f))(-.5) = 1, theta(0) = 1+s*(D(theta))(-.5), theta(2) = 0; n := [1, 2, 3, 4, 5, 6]; pr := .71; p := 0; q := 0; b := 0; l := 0; s := 0; L := [red, blue, orange]; R1 := 2*n[j]/(1+n[j]); R2 := 2*p/(1+n); p := proc (f1, th1, { output::name := 'number' }) local res1, fvals, thvals, res2; option remember; res1 := dsolve({sys, f(1) = 0, theta(0) = 1+th1, (D(f))(0) = f1, (D(theta))(0) = th1, ((D@@2)(f))(0) = f1-1}, numeric, :-output = listprocedure); fvals := (subs(res1, [seq(diff(f(eta), [`$`(eta, i)]), i = 0 .. 2)]))(0); thvals := (subs(res1, [seq(diff(theta(eta), [`$`(eta, i)]), i = 0 .. 1)]))(0); res2 := dsolve({sys, f(0) = fvals[1], theta(0) = thvals[1], theta(5) = 0, (D(f))(0) = fvals[2], (D(f))(5) = 1}, numeric, :-output = listprocedure); if output = 'number' then [fvals[3]-(subs(res2, diff(f(eta), `$`(eta, 2))))(0), thvals[2]-(subs(res2, diff(theta(eta), eta)))(0)] else res1, res2 end if end proc; p1 := proc (f1, th1) p(args)[1] end proc; p2 := proc (f1, th1) p(args)[2] end proc; p(.3, -.2); par := fsolve([p1, p2], [.3, -.2]); res1, res2 := p(op(par), output = xxx); plots:-display(plots:-odeplot(res1, [[eta, f(eta)], [eta, theta(eta)]]), plots:-odeplot(res2, [[eta, f(eta)], [eta, theta(eta)]])); plots:-display(plots:-odeplot(res1, [[eta, diff(f(eta), eta)], [eta, diff(theta(eta), eta)]]), plots:-odeplot(res2, [[eta, diff(f(eta), eta)], [eta, diff(theta(eta), eta)]])); plots:-display(plots:-odeplot(res1, [[eta, diff(f(eta), eta, eta)]]), plots:-odeplot(res2, [[eta, diff(f(eta), eta, eta)]])); plots:-display(plots:-odeplot(res1, [[eta, diff(f(eta), eta)]])); fplt[j] := plots[odeplot](res1, [eta, diff(diff(f(eta), eta), eta)], color = L[j], axes = boxed); tplt[j] := plots[odeplot](res1, [[eta, theta(eta)]], color = L[j], axes = boxed) end do;
> plots:-display([seq(fplt[j], j = 1 .. nops(n))]);


Dear Sir

In my above problem i trying to plot for set of values of n but in plot command it not executing , can you do this why it is not executing ??

 

> restart;
> n := [1, 2, 3, 4, 5]; pr := .71; p := 0; q := 0; b := 0; l := 0; s := 0;
> for j to nops(n) do R1 := 2*n[j]/(1+n[j]); R2 := 2*p/(1+n); sys := diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta))+1-(diff(f(eta), eta))^2 = 0, (diff(diff(theta(eta), eta), eta))/pr+f(eta)*(diff(theta(eta), eta))-R2*(diff(f(eta), eta))*theta(eta) = 0; bcs := f(0) = 0, (D(f))(0) = l+b*((D@@2)(f))(0), (D(f))(-.5) = 1, theta(0) = 1+s*(D(theta))(0), theta(-.5) = 0; proc (f1, th1, { output::name := 'number' }) local res1, fvals, thvals, res2; option remember; res1 := dsolve({sys, f(0) = 0, theta(0) = 1+th1, (D(f))(-2) = f1, (D(theta))(-2) = th1, ((D@@2)(f))(0) = f1-1}, numeric, :-output = listprocedure); fvals := (subs(res1, [seq(diff(f(eta), [`$`(eta, i)]), i = 0 .. 2)]))(0); thvals := (subs(res1, [seq(diff(theta(eta), [`$`(eta, i)]), i = 0 .. 1)]))(0); res2 := dsolve({sys, f(0) = fvals[1], theta(0) = thvals[1], theta(1) = 0, (D(f))(0) = fvals[2], (D(f))(1) = 0}, numeric, :-output = listprocedure); if output = 'number' then [fvals[3]-(subs(res2, diff(f(eta), `$`(eta, 2))))(0), thvals[2]-(subs(res2, diff(theta(eta), eta)))(0)] else res1, res2 end if end proc; p1 := proc (f1, th1) p(args)[1] end proc; p2 := proc (f1, th1) p(args)[2] end proc; p(.3, -.2); par := fsolve([p1, p2], [.3, -.2]); res1, res2 := p(op(par), output = xxx); plots:-display(plots:-odeplot(res1, [[eta, f(eta)], [eta, theta(eta)]]), plots:-odeplot(res2, [[eta, f(eta)], [eta, theta(eta)]])); plots:-display(plots:-odeplot(res1, [[eta, diff(f(eta), eta)], [eta, diff(theta(eta), eta)]]), plots:-odeplot(res2, [[eta, diff(f(eta), eta)], [eta, diff(theta(eta), eta)]])); plots:-display(plots:-odeplot(res1, [[eta, diff(f(eta), eta, eta)]]), plots:-odeplot(res2, [[eta, diff(f(eta), eta, eta)]])); fplt[j] := plots[odeplot](sol1, [eta, diff(diff(f(eta), eta), eta)], color = L[j], axes = boxed); tplt[j] := plots[odeplot](sol1, [[eta, theta(eta)]], color = L[j], axes = boxed) end do;


Dear Sir

In this above problem it showing that error as  Error, cannot split rhs for multiple assignment please can you tell why it is showing like this  ?? and where i did multiple assignments ??

Dear sir

 

In my ode problem i do not know that how to set range (eta) from -2 to 2 please can  you help me.

> restart;
> with(plots);
> n := [0, .5, 1, 5]; pr := .71; p := 0; l := [1, 2, 3]; b := 0; s := 0; L := [green, blue, black, gold];
                         [green, blue, black, gold]
> R1 := 2*n/(n+1);
                              2 [0, 0.5, 1, 5]
                             ------------------
                             [0, 0.5, 1, 5] + 1
for j from 1 to nops(l) do; for j from 1 to nops(n) do        R1 := 2*n[j]/(1+n[j]);        R2 := 2*p/(1+n[j]); sol1 := dsolve([diff(diff(diff(f(eta),eta),eta),eta)+f(eta)*diff(diff(f(eta),eta),eta)+R1*(1-diff(f(eta),eta)^2) = 0, (1/pr)*diff(diff(theta(eta),eta),eta)+f(eta)*diff(theta(eta),eta)-R2*diff(f(eta),eta)*theta(eta) = 0, f(0) = 0, (D(f))(0) = l+b*((D@@2)(f))(0), (D(f))(-2) =1, theta(0) = 1+s*(D(theta))(0), theta(-2) = 0], numeric, method = bvp); fplt[j]:= plots[odeplot](sol1,[eta,diff(diff(f(eta),eta),eta)],color=["blue","black","orange"]);         tplt[j]:= plots[odeplot](sol1, [eta,theta(eta)],color=L[j]); fplt[j]:= plots[odeplot](sol1,[eta,diff(f(eta),eta)],color=L[j]);      od:od:

 


Error, (in dsolve/numeric/bvp) unable to store 'Limit([eta, 2*eta, 3*eta]+eta^2*[.250000000000000, .500000000000000, .750000000000000]-.250000000000000*eta^2, eta = -2., left)' when datatype=float[8]
> plots:-display([seq(fplt[j], j = 1 .. nops(n))], color = [green, red], [seq(fplt[j], j = 1 .. nops(l))]);

> sol1(0);

Dear sir

In the  above problem i tried to write a nested program but its not executing and showing the error as Error, (in dsolve/numeric/bvp) unable to store 'Limit([eta, 2*eta, 3*eta]+eta^2*, i want the plot range from -2 to 2 but taking only 0 to -2 ,and -2.5 to 3 but taking only 0 to 1

> restart;
> with(plots);
> pr := .72; p := 0; n := [2, 3, 4, 5]; s := 1; a := .2; b := 1;
> R1 := 2*n/(n+1);
                               2 [2, 3, 4, 5]
                              ----------------
                              [2, 3, 4, 5] + 1
> R2 := 2*p/(n+1);
                                      0
>
>
> for j to nops(n) do R1 := 2*n[j]/(1+n[j]); R2 := 2*p/(1+n[j]); sol1 := dsolve([diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta))+R1*(1-(diff(f(eta), eta))^2) = 0, diff(diff(theta(eta), eta), eta)+pr*s^f(eta)*(diff(theta(eta), eta))+R2*pr*s*(diff(f(eta), eta))*theta(eta)+2*(a*(diff(f(eta), eta))+b*theta(eta))/(n[j]-1) = 0, f(0) = 0, (D(f))(0) = 1+b*((D@@2)(f))(0), (D(f))(5) = 0, theta(0) = 1+s*(D(theta))(0), theta(5) = 0], numeric, method = bvp); fplt[j] := plots[odeplot](sol1, [eta, diff(diff(f(eta), eta), eta)], axes = boxed); tplt[j] := plots[odeplot](sol1, [[eta, theta(eta)]], axes = boxed) end do;
>
> plots:-display([seq(fplt[j], j = 1 .. nops(n))]);

 

> plots:-display([seq(tplt[j], j = 1 .. nops(n))]);

 

 

Dear sir

In the above problem graph, i am getting all the lines are in same color then how to identify the lines of different values like n=2,3,4,5,6(or can we set different color for different values of n for each line)

1 2 3 4 5 Page 4 of 5