JenaRRM

25 Reputation

One Badge

2 years, 292 days

MaplePrimes Activity


These are questions asked by JenaRRM

Dear Sir/Madam,

Greetings of the day.

If I am considering the value of "gam=0.5,0.7,0.9" in the code other than 1, I am unbale to draw figure using this code. Also, I can not evaluate the values of  A1[200]; A1[400]; A1[600]; A1[800]; A1[1000]. It is showing float undefined.

Please help me in this regard. Thanks in advance

restart 

 

   

f1 := proc (y, t) options operator, arrow; y*sin(t) end proc

NULL

y[0] := .3678794412

h := 0.1e-2; alpha := proc (t) options operator, arrow; .97+0.3e-1*cos((1/10)*t) end proc; gam := .5
NULLNULL

 
for n from 0 to 999 do t[n] := n*h end do

for n from 0 to 0 do y[n+1] := y[n]+h^alpha(t[n])*f1(y[n], t[n])/GAMMA(alpha(t[n])+1) end do

.3678794412

(1)

for n to 999 do y[n+1] := y[0]+gam*h^alpha(t[n])*(sum(t[j]^(gam-1)*((n+1-j)^alpha(t[n])*(n-j+2+alpha(t[n]))-(n-j)^alpha(t[n])*(n-j+2+2*alpha(t[n])))*f1(y[j], t[j])-t[j-1]^(gam-1)*((n+1-j)^(alpha(t[n])+1)-(n-j)^alpha(t[n])*(n-j+1+alpha(t[n])))*f1(y[j-1], t[j-1]), j = 1 .. n))/GAMMA(2+alpha(t[n])) end do

A1[1] := .3678794412

for i to 1000 do A1[i+1] := y[i] end do

NULL

NULL

L := [seq((i-1)*h, i = 1 .. 1001)]NULLNULLNULLNULL

  A1 := [seq(A1[i], i = 1 .. 1001)] 

plot(L, A1, color = red)

 

NULL

A1[200]; A1[400]; A1[600]; A1[800]; A1[1000]

Float(undefined)

 

Float(undefined)

 

Float(undefined)

 

Float(undefined)

 

Float(undefined)

(2)

NULL

``

Download Plot_undefined.mw

ans:=6 *a[0]+2 *k^2 *b[1]*x^2 *y+k^2 *b[1] *y *lambda+6* k^2 *b[2]* x^3 *y-c *b[1] *x* y-2* c* b[2] *x^2 *y-c *b[2] *y *lambda+(6 *b[2]^2 *x^4 *lambda)/(lambda^2 *sigma+mu^2)+(6 *b[2]^2 *x^2 *lambda^2)/(lambda^2 *sigma+mu^2)+(6 *b[1]^2 *lambda* x^2)/(lambda^2 *sigma+mu^2)-12 *a[0] *b[2] *x *y-12* (a[1] . x)* b[2] *x* y-12* (a[2] . (x^2)) *b[2] *x* y+(6 *b[1]^2 *lambda^2)/(lambda^2 *sigma+mu^2)+k^2 *(a[1] . (-2 *x* (mu* y-x^2-lambda)-mu *x* y))+2 *k^2* (a[2] . ((mu* y-x^2-lambda)^2+x* (-2 *x (mu* y-x^2-lambda)-mu *x* y)))+c (a[1] . (mu *y-x^2-lambda))+2 *c (a[2] . (x *(mu *y-x^2-lambda)))+5* k^2 *b[2] *x *y *lambda-(c *b[2] *lambda^2 *mu)/(lambda^2 *sigma+mu^2)+(12 *b[1] *lambda *b[2] *x^3)/(lambda^2 *sigma+mu^2)+(12 *b[1] *lambda^2 *b[2] *x)/(lambda^2 *sigma+mu^2)-(12 *b[1]^2 *lambda *mu* y)/(lambda^2 *sigma+mu^2)+(k^2 *b[1] *lambda^2 *mu)/(lambda^2* sigma+mu^2)-12 *a[0] *b[1] *y-12* (a[1] . x) *b[1] *y-12* (a[2] . (x^2)) b[1] *y-6 *a[0]^2-12 *a[0] *(a[1] . x)-12 *a[0]* (a[2] . (x^2))-6* (a[1] . x)^2-12* (a[1] . x) *(a[2] . (x^2))-6* (a[2] . (x^2))^2-(2 *k^(2)* b[1] *lambda* mu^2 *y)/(lambda^2 *sigma+mu^2)+(k^2 *b[1] *lambda *mu *x^2)/(lambda^2 *sigma+mu^2)+(6* k^2 *b[2] *lambda *mu *x^3)/(lambda^2 *sigma+mu^2)+(6* k^2 *b[2] *lambda^2 *mu *x)/(lambda^2 *sigma+mu^2)+(2* c *b[2] *lambda *mu^2* y)/(lambda^2 *sigma+mu^2)-(c *b[2] *lambda* mu* x^2)/(lambda^2 *sigma+mu^2)-(12 *b[2]^2 *x^2 *lambda* mu* y)/(lambda^2 *sigma+mu^2)-(12* k^2 *b[2] *lambda* mu^2 *x *y)/(lambda^2 *sigma+mu^2)-(24 *b[1] *lambda *b[2] *x *mu* y)/(lambda^2 *sigma+mu^2)+6* (a[1] . x)+6* (a[2] . (x^2))+6 *b[2] *x *y+6 *b[1] *y;


P1 := coeff(coeff(ans, x, 4), y, 0);


Error, unable to compute coeff

Sometime, answer is coming sometine not.

2. Also, if one wants to substitute the value of x^2=t^2+5, in x^3 then why it is giving the ans.

Thank you very much!

Page 1 of 1