## Maple Code for Adomian Decomposition Method...

Pls do we have any Maple code for Adomian Decomposition Method?

## Method of Multiple Scales ...

So, I'm trying to delelop an algorithm for the method of multiple scales. Starting with a simple ODE:

After scaling, it should be written in the form:

A proto-algorithm would be:

restart;
ode := diff(x(t), `\$`(t, 2))+x(t) = 0;
i_ini := 1; i_fin := 3; j_ini := 0; j_fin := 2;
PDEtools:-dchange({t = sum(epsilon^j*T[j], j = j_ini .. j_fin), x(t) = sum(epsilon^i*X[i](T[1]), i = i_ini .. i_fin)}, ode, [{T[0], T[1], T[2]}, {X[1], X[2], X[3]}])

It is not working, though. Could anyone help me out?

## Why am I getting exprseq instead of array?...

Dear all,

I have a procedure in Maple. Input is a list. The procedure should add to a list the list [6,5,4,3,2,1] and find if there are repetitions in this new list. After, if there are repetitions, it should return [NO, initial list] and if there are no repetitions, it should find how many elements of the first 5 are larger than the 6th element and return this number together with the sorted list - [6,5,4,3,2,1] in reverse order. (It sounds a bit strange but it's actually computing some sheaf cohomologies).

The problem is, when there are repetitions, the procedure returns an array, and if there are no repetitions, it returns exprseq. I would like both to be an array. Where's the mistake?

For example, coh([4, 0, 0, 0, 0, 4]) is an array and coh([0, 0, 0, 0, 0, 12]) is exprseq.

Here's the text of the program:

restart;
with(combinat);
with(ListTools);
n:=6;

coh := proc (L::list)

Hm := Array([0, 0]);

b := 0;

M := L+[6, 5, 4, 3, 2, 1];

a := evalb(ListTools:-FindRepetitions(M) = []);

if a = false then Hm := Array(['NO', L]) else

for i to 5 do if M[i] < M[6] then b := b+1

end if;

end do;

K := sort(M);

KK := K+[-1, -2, -3, -4, -5, -6];

for j to n do

M[j] := KK[n-j+1]

end do;

Hm[1] := b;

Hm[2] := M;

print(Hm)

end if

end proc

## An error in if statement...

Dear all,

I use the following statment (without numerical values)

if        IT<20     then        IT:=IT+1

if    ZUM<(0.1)^(8);    IT=20;         else;

for i from 1 to 10   do                               YU[i]:=U[i];                  od;

for i from 2 to 9 do                           DU1:=YU[i+1]- YU[i-1];        od:

end if;

ZUM:=U[1]-YU[1];

end if;

the following error occur

where is the problem.

## How do i write a "if...then" function in Maple?...

Hi all, I'm using text box and push button to create my user interface for my system. I  wish to use a if..then function to check some condition, if the condition is true then do statement and print out in the text box. When is key coding in the push button and click the push button, then if ...then function not working and the result that not suitable for the condition also have been printed out in text box.So,can someone help my to solve the problem?

Here in the coding i did

use DocumentTools in

Do (C = %txtC);
Do (p = %txtpk1);
Do (q = %txtpk2);
Do (d = %txtpk3);
Do (A1 = %txtA1);
Do (A2 = %txtA2);
Do (w = `mod`((C*d), A2));
Do (mp = `mod`(w^((p+1)*(1/4)), p));
Do (mq = `mod`(w^((q+1)*(1/4)), q));
Do (hl = `mod`((mp-mq)/p, q));
Do (h2 = `mod`((-mp-mq)/p, q));
Do (m1 = mp+(hl*p));
Do (m2 = mp+(h2*p));
Do (m3 = (p*q)-m1);
Do (m4 = (p*q)-m2);
if m1 <= 2^(2*k-1) then t1 := (C+(-A1*(m1^2)))/A2 end if;
Do (t1);
if m2 <= 2^(2*k-1) then t2 := (C+(-A1*(m2^2)))/A2 end if;
Do (t2);
if m3 <= 2^(2*k-1) then t3 := (C+(-A1*(m3^2)))/A2 end if;
Do (t3);
if m4 <= 2^(2*k-1) then t4 := (C+(-A1*(m4^2)))/A2 end if;
Do (t4);

Do (%txtw = w);
Do (%txtm1 = m1);
Do (%txtm2 = m2);
Do (%txtm3 = m3);
Do (%txtm4 = m4);
Do (%txtt1 = t1);
Do (%txtt2 = t2);
Do (%txtt3 = t3);
Do (%txtt4 = t4);
end use;

Thabk you.

## Formatted printing of matrix multiplication...

Hi, I'm trying to show some matrix multiplication and show the pre-evaulated expression as well as the result.

m1 := Matrix([[1, 2], [3, 4]]);
m2 := Matrix([[5, 6], [7, 8]]);
print(m1, m2 = Multiply(m1, m2))

What I'd really like is for the comma in the printed expression (on the left hand side) to be replaced by a multiplication or dot sign.  Hopefully thanks in advance.

## How to do a coding on stability region of diagonal...

hello everyone. i wanna ask. how to do a coding of stability region on diagonally implicit Runge-Kutta for order 3 and order 4? Thank you in advanced :)

## differential equation...

i want to solve this equation,

y''(x)=5*exp(-10/y'(x)) on ]0,15[ with y(0)=0,y(15)=2

can any one help me ? thank you

## How to avoid error in ODE?...

Hi, I'm trying to solve this ode:
restart; with(plots); with(DEtools);

l := t -> 0.5*tanh(0.5*t);

deq := diff(f(t), t)*l(t)*(diff(f(t), t, t)*l(t)+9.8*sin(f(t)))+diff(l(t), t)*(diff(f(t), t)^2*l(t)-9.8*cos(f(t))+4*(l(t)-0.5)) = 0;

sol := dsolve({deq, f(0) = 0, D(f)(0) = 0.1}, f(t), numeric);

but getting an error:

Error, (in dsolve/numeric/checksing) ode system has a removable singularity at t=0. Initial data is restricted to {f(t) = 1.77632183122019}

How can I possibly fix this?

## The Series function...

The image is an extract from the help page on the function "series" my question is in regard to how a method is selected, ie either it be a taylor or laurent series expansion, or as it defines in the passage attached "a more generalised series".

im just curious to know what procedure maple uses to make this choice when the series function is called, and im also finding it hard to replicate and understand the procedure of computing coeffiecents as described in the extract for a generalised series.

Thanks.

## fsolve returns unevaluated ...

i have set of equations and variable that i want to solve them using fsolve, but after about 20mintues of computations, fsolve retrun these set unevaluated, could anyone help?

 > restart:with(linalg):with(LinearAlgebra):with(orthopoly):Digits:=40: M:=3: N:=2: l:=2: for m from 0 to M-1 do L[m]:=unapply(P(m,t),t); end do: for n from 1 to N do; for m from 0 to M-1 do; BB[n,m]:=unapply(piecewise((n-1)/N<=t and t
 > ############################################# k:=Matrix(2,2,[[t*s^2,t*s^2],[s*t^2,s*t^2]]):
 >
 >
 >
 >
 >
 >
 >
 >
 >
 > ######################################
 > for i from 1 to 2 do; for j from 1 to 2 do; T[i,j]:=Matrix(N*M,N*M): for n from 1 to M*N do; for m from 1 to M*N do; T[i,j](n,m):=evalf(int(int(B[n]*k(i,j)*BS[m],t=0..1),s=0..1)): end do: end do: od: od: evalm(T[1,1]): evalm(T[1,2]): evalm(T[2,1]): evalm(T[2,2]):
 >
 >
 > ########################################## X[1]:=Matrix(M*N,1): for n from 1 to M*N do; X[1](n,1):=Y[n,1]: od: evalm(X[1]): #### yadet bashe k dar in mesal majhulat y1,y2 ####ba bordarhaye X1, X2 neshun dadi...darvaghe ####dar mesale avale maghale 2ta y dashti k bayad moadele ash ro hal mikardi...
 >
 > X[2]:=Matrix(M*N,1): for n from 1 to M*N do; X[2](n,1):=yY[n,1]: od: evalm(X[2]):
 > U[1,1]:=Matrix(M*N,1): for n from 1 to M*N do; U[1,1](n,1):=u[n,1]: od: evalm(U[1,1]):
 > U[1,2]:=Matrix(M*N,1): for n from 1 to M*N do; U[1,2](n,1):=uU[n,1]: od:
 > evalm(U[1,2]): Transpose(U[1,2]):
 > U[2,1]:=Matrix(N*M,1): for n from 1 to M*N do; U[2,1](n,1):=w[n,1]: od: evalm(U[2,1]):
 > U[2,2]:=Matrix(M*N,1): for n from 1 to M*N do; U[2,2](n,1):=wW[n,1]: od: evalm(U[2,2]):
 >
 > z[1]:=Matrix(1,M*N): z[2]:=Matrix(1,M*N): for i from 1 to 2 do; Z[i]:=Transpose(A)-add(Transpose(U[i,j]).T[i,j], j=1..2); evalm(Z[i]): z[i]:=Z[i]-convert(p[i],Matrix): od: evalm(z[1]): ############## z[1](1,2):
 > ########################################## for s from 1 to M*N do; t:=((2*s)-1)/(2*M*N); ff[1,1]:=eval(VectorMatrixMultiply(Transpose(X[1]),eval(B,t=((2*s)-1)/(2*M*N)))); F[1,s]:=multiply(ff[1,1],ff[1,1]); expand(%): H[1,s]:=VectorMatrixMultiply(Transpose(U[1,1]),eval(B,t=((2*s)-1)/(2*M*N))); hh[1,s]:=F[1,s]-H[1,s][1]; od:
 >
 > ff[1,1]:
 > F[1,1]:
 > H[1,1]:
 > hh[1,2]:
 >
 > for s from 1 to M*N do; t:=((2*s)-1)/(2*M*N); ff[2,1]:=eval(VectorMatrixMultiply(Transpose(X[1]),eval(B,t=((2*s)-1)/(2*M*N)))); G[1,s]:=multiply(ff[2,1],ff[2,1]); expand(%): J[1,s]:=VectorMatrixMultiply(Transpose(U[2,1]),eval(B,t=((2*s)-1)/(2*M*N))); JJ[1,s]:=G[1,s]-J[1,s][1]; od: JJ[1,1]: JJ[1,2]:
 > for s from 1 to M*N do; t:=((2*s)-1)/(2*M*N); ff[1,2]:=eval(VectorMatrixMultiply(Transpose(X[2]),eval(B,t=((2*s)-1)/(2*M*N)))); GG[1,s]:=multiply(ff[1,2],ff[1,2]); expand(%): g[1,s]:=VectorMatrixMultiply(Transpose(U[1,2]),eval(B,t=((2*s)-1)/(2*M*N))); gg[1,s]:=GG[1,s]-g[1,s][1]; od: gg[1,1]: gg[1,2]:
 > for s from 1 to M*N do; t:=((2*s)-1)/(2*M*N); ff[2,2]:=eval(VectorMatrixMultiply(Transpose(X[2]),eval(B,t=((2*s)-1)/(2*M*N)))); DD[1,s]:=multiply(ff[2,2],ff[2,2]); expand(%): d[1,s]:=VectorMatrixMultiply(Transpose(U[2,2]),eval(B,t=((2*s)-1)/(2*M*N))); dd[1,s]:=DD[1,s]-d[1,s][1]; od: dd[1,1]: dd[1,2]:
 > eqq[1]:=seq(hh[1,s],s=1..M*N):
 > eqq[2]:=seq(gg[1,s],s=1..M*N):
 >
 > eqq[3]:=seq(JJ[1,s],s=1..M*N):
 > eqq[4]:=seq(dd[1,s],s=1..M*N): eqq[5]:=seq(z[1](1,s),s=1..M*N): eqq[6]:=seq(z[2](1,s),s=1..M*N):
 > eq:=seq(eqq[s],s=1..M*N):
 > var[1]:=seq(X[1](s,1),s=1..M*N): var[2]:=seq(X[2](s,1),s=1..M*N): var[3]:=seq(U[1,1](s,1),s=1..M*N): var[4]:=seq(U[1,2](s,1),s=1..M*N): var[5]:=seq(U[2,1](s,1),s=1..M*N): var[6]:=seq(U[2,2](s,1),s=1..M*N):
 > EQ:=Matrix(36,1):
 > for i to 6 do EQ(6*i-5,1):=hh[1,i]; EQ(6*i-4,1):=gg[1,i]; EQ(6*i-3,1):=JJ[1,i]; EQ(6*i-2,1):=dd[1,i]; EQ(6*i-1,1):=z[1](1,i); EQ(6*i,1):=z[2](1,i); od:
 > indets(EQ);
 (1)
 >
 >
 > Var:=[seq](var[s],s=1..M*N);
 (2)
 >
 >
 >
 >
 > for i to 36 do EQQ[i]:=simplify(expand(subs([seq](indets(EQ)[i]=AA[i],i=1..36),EQ[i][1])=0)); od;
 (3)
 > fsolve({seq}(EQQ[i],i=1..36),{seq}(AA[i],i=1..36));
 (4)
 >

## Rotate 2-D plot around x-axis...

Hello

I have question. How can I rotate this 2-D plot and create 3-D plot?

plot(exp(-(x-3)^2*cos(4*(x-3))),x=1..5)

Thank you.

## Creating a list of Matrices...

I need to create a list of matrices.

with(LinearAlgebra):
interface(rtablesize=50);
E:=[E1,E2,E3]:
P:=[0,1,2]:
N:=3:
B:=[1,2,3]:
for b from 1 to 12 by 5 do
B:=(i,j)->
if i=b+P[a] and j=b+P[a] then E[a]
elif i=b+P[a] and j=b+N+2+P[a] then -E[a]
elif i=b+P[a]+N+2 and j=b+P[a] then -E[a]
elif i=b+P[a]+N+2 and j=b+P[a]+N+2 then E[a]
else 0:
end if:
end do;
H:=[seq(B[b],b=1..12,5)];

It isn't indexing the first and second variable, only the last one was indexed.

## get approximately function of plot...

hi my friend. i want to find a approximately function of this plot. how i can get this. and i have numerical value in this excel

## How do i Copied Tutor contents in worksheet in Map...

Hello,

How do i Copied Tutor contents in worksheet in Maple ?

Thanks

 1 2 3 4 5 6 7 Last Page 3 of 1263
﻿