Maple 17 Questions and Posts

These are Posts and Questions associated with the product, Maple 17

If I calculate the integral:

z:=exp(I*t)

evalf(Int(z^(1/2)*(diff(z, t)), t = 0 .. 2*Pi))

I get -1.33333333*I

If I calculate

int(z^(1/2)*(diff(z, t)), t = 0 .. 2*Pi)

I get -4/3

so where is the I coming from? Am I doing sth  something   wrong?

I might add: if I calculate the same for z:=0.5+exp(I*t) I get 0 and -I*0.4714....

so what is going different here?


 

restart

with(student)

NULL

G := S(t)*L(t)

S(t)*L(t)

(1)

m := 10

S[lambda] := sum(S[b]*lambda^b, b = 0 .. m); L[lambda] := sum(L[b]*lambda^b, b = 0 .. m); G[lambda] := subs(S(t) = S[lambda], G); G[lambda] := subs(L(t) = L[lambda], G[lambda]); G := G[lambda]; s := expand(G, lambda); ft := unapply(s, lambda); for i from 0 while i <= m do A1[i] := ((D@@i)(ft))(0)/factorial(i); print(A[i] = A1[i]) end do

A[0] = S[0]*L[0]

 

A[1] = L[0]*S[1]+L[1]*S[0]

 

A[2] = L[0]*S[2]+L[1]*S[1]+L[2]*S[0]

 

A[3] = L[0]*S[3]+L[1]*S[2]+L[2]*S[1]+L[3]*S[0]

 

A[4] = L[0]*S[4]+L[1]*S[3]+L[2]*S[2]+L[3]*S[1]+L[4]*S[0]

 

A[5] = L[0]*S[5]+L[1]*S[4]+L[2]*S[3]+L[3]*S[2]+L[4]*S[1]+L[5]*S[0]

 

A[6] = L[0]*S[6]+L[1]*S[5]+L[2]*S[4]+L[3]*S[3]+L[4]*S[2]+L[5]*S[1]+L[6]*S[0]

 

A[7] = S[5]*L[2]+S[2]*L[5]+S[1]*L[6]+S[0]*L[7]+S[4]*L[3]+S[3]*L[4]+S[6]*L[1]+S[7]*L[0]

 

A[8] = S[2]*L[6]+S[0]*L[8]+S[8]*L[0]+S[4]*L[4]+S[1]*L[7]+S[3]*L[5]+S[6]*L[2]+S[5]*L[3]+S[7]*L[1]

 

A[9] = S[6]*L[3]+S[9]*L[0]+S[4]*L[5]+S[2]*L[7]+S[3]*L[6]+S[8]*L[1]+S[0]*L[9]+S[1]*L[8]+S[7]*L[2]+S[5]*L[4]

 

A[10] = S[0]*L[10]+S[10]*L[0]+S[1]*L[9]+S[6]*L[4]+S[7]*L[3]+S[3]*L[7]+S[2]*L[8]+S[4]*L[6]+S[9]*L[1]+S[5]*L[5]+S[8]*L[2]

(2)

s[n+1] := (1-f)*alpha*(int(v__n, t = 0 .. t))-beta*c*(int(A__n, t = 0 .. t))-(`&theta;__1`+a+Pi)*(int(s__n, t = 0 .. t))

v[n+1] := `&theta;__1`*(int(s__n, t = 0 .. t))-((1-f)*alpha+f*`&theta;__2`+a+Pi)*(int(v__n, t = 0 .. t))

e[n+1] := `&beta;c`*(int(A__n, t = 0 .. t))-(delta+a+Pi)*(int(e__n, t = 0 .. t))

i[n+1] := delta*(int(e__n, t = 0 .. t))-(eta+a+Pi)*(int(i__n, t = 0 .. t))

r[n+1] := eta*(int(i__n, t = 0 .. t))+`f&theta;__2`*(int(v__n, t = 0 .. t))-(a+Pi)*(int(r__n, t = 0 .. t))

for n from 0 to 4 do  end do

NULL

(1-f)*alpha*v__n*t-beta*c*s__0*i__0*t-(`&theta;__1`+a+Pi)*s__n*t

(3)

"for n:=0, n=1, n=2, n=3, n=4:  `s__1, ``s__2__`, `s__3, ``s__4`,  `i__1`, `i__2, ``i__3`, `i__4`,   `r__1`, `r__2`, `r__3, ``r__4`:"

Error, unterminated for loop

"for n:=0, n=1, n=2, n=3, n=4:  `s__1, ` `s__2__`, `s__3, __3__, s__4`, `i__1__`, `i__2, ` `i__3`, `i__4`, `r__1`, `r__2`, `r__3, ` `r__4`:"

 

"and s(t)=`s__1_`+`s__2 __`+ `s__3, `+`s__4`,"

i(t) = i__1+`i__2, `+i__3+i__4, r(t) = r__1+r__2+r__3_+r__4

"but A[n]:=(1)/(n!) [((&DifferentialD;)^(n))/(&DifferentialD; lambda^(n)) ((&sum;)`s__k`lambda^(k))((&sum;)`i__k`lambda^(k)) ]() ? ()|() ? (lambda=0)"

Error, missing numerator

Typesetting:-mambiguous(Typesetting:-mrow(Typesetting:-mi("but", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mo("&InvisibleTimes;", accent = "false", fence = "false", largeop = "false", lspace = "0.0em", mathvariant = "normal", movablelimits = "false", rspace = "0.0em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-msub(Typesetting:-mi("A", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mi("n", fontstyle = "italic", mathcolor = "#c800c8", mathvariant = "italic", placeholder = "true"), subscriptshift = "0"), Typesetting:-mo("&Assign;", accent = "false", fence = "false", largeop = "false", lspace = "0.2777778em", mathvariant = "normal", movablelimits = "false", rspace = "0.2777778em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mfrac(Typesetting:-mn("1", mathvariant = "normal"), Typesetting:-mrow(Typesetting:-mi("n", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mo("&excl;", accent = "false", fence = "false", largeop = "false", lspace = "0.1111111em", mathvariant = "normal", movablelimits = "false", rspace = "0.1111111em", separator = "false", stretchy = "false", symmetric = "false")), bevelled = "false", denomalign = "center", linethickness = "1", numalign = "center"), Typesetting:-mo("&InvisibleTimes;", accent = "false", fence = "false", largeop = "false", lspace = "0.0em", mathvariant = "normal", movablelimits = "false", rspace = "0.0em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-msup(Typesetting:-mo("&DifferentialD;", accent = "unset", fence = "unset", largeop = "unset", lspace = "0.0em", mathvariant = "normal", movablelimits = "unset", rspace = "0.0em", separator = "unset", stretchy = "unset", symmetric = "unset"), Typesetting:-mi("n", fontstyle = "italic", mathvariant = "italic"), superscriptshift = "0"), Typesetting:-mrow(Typesetting:-mo("&DifferentialD;", accent = "unset", fence = "unset", largeop = "unset", lspace = "0.0em", mathvariant = "normal", movablelimits = "unset", rspace = "0.0em", separator = "unset", stretchy = "unset", symmetric = "unset"), Typesetting:-mo("&InvisibleTimes;", accent = "false", fence = "false", largeop = "false", lspace = "0.0em", mathvariant = "normal", movablelimits = "false", rspace = "0.0em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-msup(Typesetting:-mi("&lambda;", fontstyle = "normal", mathvariant = "normal"), Typesetting:-mi("n", fontstyle = "italic", mathvariant = "italic"), superscriptshift = "0")), bevelled = "false", denomalign = "center", linethickness = "1", numalign = "center"), Typesetting:-mo("&InvisibleTimes;", accent = "false", fence = "false", largeop = "false", lspace = "0.0em", mathvariant = "normal", movablelimits = "false", rspace = "0.0em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-munderover(Typesetting:-mo("&sum;", accent = "unset", fence = "unset", largeop = "true", lspace = "0.0em", mathvariant = "normal", movablelimits = "true", rspace = "0.1666667em", separator = "unset", stretchy = "true", symmetric = "unset"), Typesetting:-mrow(Typesetting:-mi("k", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mo("&equals;", accent = "false", fence = "false", largeop = "false", lspace = "0.2777778em", mathvariant = "normal", movablelimits = "false", rspace = "0.2777778em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mn("0", mathvariant = "normal")), Typesetting:-mn("4", mathvariant = "normal"), accent = "false", accentunder = "false"), Typesetting:-mi("`s__k`"), Typesetting:-msup(Typesetting:-mi("&lambda;", fontstyle = "normal", mathvariant = "normal"), Typesetting:-mi("k", fontstyle = "italic", mathvariant = "italic"), superscriptshift = "0")), mathvariant = "normal"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-munderover(Typesetting:-mo("&sum;", accent = "unset", fence = "unset", largeop = "true", lspace = "0.0em", mathvariant = "normal", movablelimits = "true", rspace = "0.1666667em", separator = "unset", stretchy = "true", symmetric = "unset"), Typesetting:-mrow(Typesetting:-mi("k", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mo("&equals;", accent = "false", fence = "false", largeop = "false", lspace = "0.2777778em", mathvariant = "normal", movablelimits = "false", rspace = "0.2777778em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mn("0", mathvariant = "normal")), Typesetting:-mn("4", mathvariant = "normal"), accent = "false", accentunder = "false"), Typesetting:-mi("`i__k`"), Typesetting:-msup(Typesetting:-mi("&lambda;", fontstyle = "normal", mathvariant = "normal"), Typesetting:-mi("k", fontstyle = "italic", mathvariant = "italic"), superscriptshift = "0")), mathvariant = "normal"), Typesetting:-mo("&InvisibleTimes;", accent = "false", fence = "false", largeop = "false", lspace = "0.0em", mathvariant = "normal", movablelimits = "false", rspace = "0.0em", separator = "false", stretchy = "false", symmetric = "false")), open = "&lsqb;", close = "&rsqb;", mathvariant = "normal"), Typesetting:-mfrac(Typesetting:-mambiguous(Typesetting:-merror("?"), Typesetting:-merror("missing numerator")), Typesetting:-mphantom(Typesetting:-mrow(Typesetting:-mi("x", fontstyle = "italic", mathvariant = "italic"), Typesetting:-mo("&equals;", accent = "unset", fence = "unset", largeop = "unset", lspace = "0.2777778em", mathvariant = "normal", movablelimits = "unset", rspace = "0.2777778em", separator = "unset", stretchy = "unset", symmetric = "unset"), Typesetting:-mi("a", fontstyle = "italic", mathvariant = "italic")), constraints = "height-only"), bevelled = "false", denomalign = "center", linethickness = "0", numalign = "center"), Typesetting:-mo("&verbar;", accent = "unset", fence = "unset", largeop = "unset", lspace = "0.1111111em", mathvariant = "normal", movablelimits = "unset", rspace = "0.1111111em", separator = "unset", stretchy = "true", symmetric = "unset"), Typesetting:-mfrac(Typesetting:-mphantom(Typesetting:-mi("f(x)", fontstyle = "italic", mathvariant = "italic"), constraints = "height-only"), Typesetting:-mrow(Typesetting:-mi("&lambda;", fontstyle = "normal", mathvariant = "normal"), Typesetting:-mo("&equals;", accent = "false", fence = "false", largeop = "false", lspace = "0.2777778em", mathvariant = "normal", movablelimits = "false", rspace = "0.2777778em", separator = "false", stretchy = "false", symmetric = "false"), Typesetting:-mn("0", mathvariant = "normal")), bevelled = "false", denomalign = "center", linethickness = "0", numalign = "center")))

 

``

"Pls how can I write this Maple code to help me generate `s__1` ,`s__2__ _` ` ___` `s__3 `,`s__4` ; `i__1 `, `i__2__` ,`i__3 `, `i__4`  and `r__1 `, `r__2` , `r__3 `,`r__4`  and finally generate                       "

"s(t)=`s__1_`+`s__2 __`+ `s__3, `+`s__4`,"

"i(t)=`i__1`+ `i__2, `+`i__3`+ `i__4`,   r(t)= `r__1`+ `r__2`+ `r__3_`+`r__4`:  "?""

``

NULL

NULL


 

Download Adomian.Elisha2.mw
 

restart

with(student)

NULL

G := S(t)*L(t)

S(t)*L(t)

(1)

m := 10

S[lambda] := sum(S[b]*lambda^b, b = 0 .. m); L[lambda] := sum(L[b]*lambda^b, b = 0 .. m); G[lambda] := subs(S(t) = S[lambda], G); G[lambda] := subs(L(t) = L[lambda], G[lambda]); G := G[lambda]; s := expand(G, lambda); ft := unapply(s, lambda); for i from 0 while i <= m do A1[i] := ((D@@i)(ft))(0)/factorial(i); print(A[i] = A1[i]) end do

A[0] = S[0]*L[0]

 

A[1] = L[0]*S[1]+L[1]*S[0]

 

A[2] = L[0]*S[2]+L[1]*S[1]+L[2]*S[0]

 

A[3] = L[0]*S[3]+L[1]*S[2]+L[2]*S[1]+L[3]*S[0]

 

A[4] = L[0]*S[4]+L[1]*S[3]+L[2]*S[2]+L[3]*S[1]+L[4]*S[0]

 

A[5] = L[0]*S[5]+L[1]*S[4]+L[2]*S[3]+L[3]*S[2]+L[4]*S[1]+L[5]*S[0]

 

A[6] = L[0]*S[6]+L[1]*S[5]+L[2]*S[4]+L[3]*S[3]+L[4]*S[2]+L[5]*S[1]+L[6]*S[0]

 

A[7] = S[5]*L[2]+S[2]*L[5]+S[1]*L[6]+S[0]*L[7]+S[4]*L[3]+S[3]*L[4]+S[6]*L[1]+S[7]*L[0]

 

A[8] = S[2]*L[6]+S[0]*L[8]+S[8]*L[0]+S[4]*L[4]+S[1]*L[7]+S[3]*L[5]+S[6]*L[2]+S[5]*L[3]+S[7]*L[1]

 

A[9] = S[6]*L[3]+S[9]*L[0]+S[4]*L[5]+S[2]*L[7]+S[3]*L[6]+S[8]*L[1]+S[0]*L[9]+S[1]*L[8]+S[7]*L[2]+S[5]*L[4]

 

A[10] = S[0]*L[10]+S[10]*L[0]+S[1]*L[9]+S[6]*L[4]+S[7]*L[3]+S[3]*L[7]+S[2]*L[8]+S[4]*L[6]+S[9]*L[1]+S[5]*L[5]+S[8]*L[2]

(2)

s[n+1] := (1-f)*alpha*(int(v__n, t = 0 .. t))-beta*c*(int(A__n, t = 0 .. t))-(`&theta;__1`+a+Pi)*(int(s__n, t = 0 .. t))

v[n+1] := `&theta;__1`*(int(s__n, t = 0 .. t))-((1-f)*alpha+f*`&theta;__2`+a+Pi)*(int(v__n, t = 0 .. t))

e[n+1] := `&beta;c`*(int(A__n, t = 0 .. t))-(delta+a+Pi)*(int(e__n, t = 0 .. t))

i[n+1] := delta*(int(e__n, t = 0 .. t))-(eta+a+Pi)*(int(i__n, t = 0 .. t))

r[n+1] := eta*(int(i__n, t = 0 .. t))+`f&theta;__2`*(int(v__n, t = 0 .. t))-(a+Pi)*(int(r__n, t = 0 .. t))

for n from 0 to 4 do  end do

NULL

(1-f)*alpha*v__n*t-beta*c*s__0*i__0*t-(`&theta;__1`+a+Pi)*s__n*t

(3)

"for n:=0, n=1, n=2, n=3, n=4:  `s__1, ``s__2__`, `s__3, ``s__4`,  `i__1`, `i__2, ``i__3`, `i__4`,   `r__1`, `r__2`, `r__3, ``r__4`:"

Error, unterminated for loop

"for n:=0, n=1, n=2, n=3, n=4:  `s__1, ` `s__2__`, `s__3, __3__, s__4`, `i__1__`, `i__2, ` `i__3`, `i__4`, `r__1`, `r__2`, `r__3, ` `r__4`:"

 

"and s(t)=`s__1_`+`s__2 __`+ `s__3, `+`s__4`,"

i(t) = i__1+`i__2, `+i__3+i__4, r(t) = r__1+r__2+r__3_+r__4

"but A[n]:=(1)/(n!) [((&DifferentialD;)^(n))/(&DifferentialD; lambda^(n)) ((&sum;)`s__k`lambda^(k))((&sum;)`i__k`lambda^(k)) ]() ? ()|() ? (lambda=0)"

Error, missing numerator