## 564 Reputation

7 years, 156 days

## another way,using do loop !...

 > restart:
 > a[0]:=1:for n to 10 do a[n]:=a[0]+a[n-1];od:a[4];
 (1)
 >

## your boundary conditions are incorrect !...

you should change your boundary conditons. u can see here,i changed time range every thing it possibe,but it does not solve and says that your boundary conditions does not match input boundary conditions.

 > restart:
 > pde:=diff(u(t,x),t\$2)=diff(u(t,x),x\$2)-sin(u(t,x));
 > f:=unapply(x^2,x);
 > IBC := {u(0,x)=f(x),u(t,-50)=0,D[2](u)(t, 50)=0,D[1](u)(0, x)=-diff(f(x),x)};
 >
 > pds := pdsolve(pde, IBC,time=t,range=0..1, numeric,timestep=0.01, spacestep= 0.1);
 >
 >
 > p1 := pds:-plot(t = 0);
 > p2 := pds:-plot(t = 1/10);
 > p3 := pds:-plot(t = 1/2);
 > p4 := pds:-plot(t = 1);
 > p5 := pds:-plot(t = 2);
 > plots[display]({p1, p2, p3, p4, p5}, title = `Sine Gordaon at t=0,0.1,0.5,1,2`);
 >
 >
 >

 >
 >
 >
 (1)
 >
 >
 (2)
 >
 (3)
 >

## solve using assume !...

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 (7)
 >

your problem is that u have set m=4, but your a has three elements, and thus your vector is out of range !

set n=3

 >
 >
 >
 (1)
 >
 (2)
 >

## one way, using Equate...

u can do sth like this :

example.mw

restart:
A:=Matrix(3,[[1,2,3],[4,8,6],[7,8,9]]);
X:=Vector(3,symbol=x);
F:=Vector(3,[8,8,9]);
Equate(X,A^(-1).F);

## after closing the program,everything res...

Each time you close maple software,it clears internal memory,just like you use restart command in maple.
as maple help page :
After restart, the variable assignment, loaded package, interface verboseproc variable, and typesetting rules are reset.  The interface elision and typesetting variables remain.for more information,see ?restart

for example :

 > restart:
 > f:=52;
 (1)
 > f;
 (2)
 > interface(typesetting = standard);
 (3)
 > restart:
 > f;
 (4)
 > interface(typesetting);
 (5)
 >

## what do u want exactly?...

what do u want exactly? u can use select if  u want to select expressions including something.maybe u want to see these links also :

http://www.mapleprimes.com/questions/148812-How-To-Factor-X-In-This-Expression-

http://www.mapleprimes.com/questions/151261-Problem-With-Collect

 > restart:
 > eq:=(1/20)*t[1]^2*(diff(phi(x), x, x))^2*((t[1]+t[2])^5-t[1]^5)/(t[2]^2*E[T])+(1/8)*t[1]^2*(diff(phi(x), x, x))^2*(-2*t[1]-2*t[2])*((t[1]+t[2])^4-t[1]^4)/(t[2]^2*E[T])+(1/3*((1/4)*t[1]^2*(diff(phi(x), x, x))^2*(t[1]+t[2])^2/(t[2]^2*E[T])+(1/4)*t[1]^2*(diff(phi(x), x, x))^2*(-2*t[1]-2*t[2])^2/(t[2]^2*E[T])+(1/2)*t[1]*(diff(phi(x), x, x))*((-cos(a)^2*nu[A]/E[A]-sin(a)^2*nu[T]/E[T])*t[1]*phi(x)/t[2]+(-sin(a)^2*nu[A]/E[A]-cos(a)^2*nu[T]/E[T])*t[1]*eta(x)/t[2]+(1/2)*t[1]*(diff(phi(x), x, x))*(t[1]+t[2])^2/(E[T]*t[2])+2*cos(a)*sin(a)*(-nu[A]/E[A]+nu[T]/E[T])*t[1]*psi(x)/t[2])/t[2]-t[1]*(diff(psi(x), x))*(-(cos(a)^2/G[T]+sin(a)^2/G[A])*t[1]*(diff(psi(x), x))/t[2]-cos(a)*sin(a)*(1/G[A]-1/G[T])*t[1]*(diff(phi(x), x))/t[2])/t[2]+(1/2)*t[1]^2*eta(x)*(-sin(a)^2*nu[A]/E[A]-cos(a)^2*nu[T]/E[T])*(diff(phi(x), x, x))/t[2]^2+(1/2)*t[1]^2*phi(x)*(-cos(a)^2*nu[A]/E[A]-sin(a)^2*nu[T]/E[T])*(diff(phi(x), x, x))/t[2]^2-t[1]*(diff(phi(x), x))*(-cos(a)*sin(a)*(1/G[A]-1/G[T])*t[1]*(diff(psi(x), x))/t[2]-(sin(a)^2/G[T]+cos(a)^2/G[A])*t[1]*(diff(phi(x), x))/t[2])/t[2]+t[1]^2*psi(x)*cos(a)*sin(a)*(-nu[A]/E[A]+nu[T]/E[T])*(diff(phi(x), x, x))/t[2]^2))*((t[1]+t[2])^3-t[1]^3)+(1/2*(t[1]^2*psi(x)*cos(a)*sin(a)*(-nu[A]/E[A]+nu[T]/E[T])*(diff(phi(x), x, x))*(-2*t[1]-2*t[2])/t[2]^2+t[1]*(diff(phi(x), x))*(t[1]+t[2])*(-cos(a)*sin(a)*(1/G[A]-1/G[T])*t[1]*(diff(psi(x), x))/t[2]-(sin(a)^2/G[T]+cos(a)^2/G[A])*t[1]*(diff(phi(x), x))/t[2])/t[2]-t[1]*(diff(phi(x), x))*(cos(a)*sin(a)*(1/G[A]-1/G[T])*t[1]*(diff(psi(x), x))*(t[1]+t[2])/t[2]+(sin(a)^2/G[T]+cos(a)^2/G[A])*t[1]*(diff(phi(x), x))*(t[1]+t[2])/t[2])/t[2]+t[1]*(diff(psi(x), x))*(t[1]+t[2])*(-(cos(a)^2/G[T]+sin(a)^2/G[A])*t[1]*(diff(psi(x), x))/t[2]-cos(a)*sin(a)*(1/G[A]-1/G[T])*t[1]*(diff(phi(x), x))/t[2])/t[2]-t[1]*(diff(psi(x), x))*((cos(a)^2/G[T]+sin(a)^2/G[A])*t[1]*(diff(psi(x), x))*(t[1]+t[2])/t[2]+cos(a)*sin(a)*(1/G[A]-1/G[T])*t[1]*(diff(phi(x), x))*(t[1]+t[2])/t[2])/t[2]+(1/2)*t[1]^2*eta(x)*(-sin(a)^2*nu[A]/E[A]-cos(a)^2*nu[T]/E[T])*(diff(phi(x), x, x))*(-2*t[1]-2*t[2])/t[2]^2+(1/2)*t[1]^2*phi(x)*(-cos(a)^2*nu[A]/E[A]-sin(a)^2*nu[T]/E[T])*(diff(phi(x), x, x))*(-2*t[1]-2*t[2])/t[2]^2+(1/4)*t[1]^2*(diff(phi(x), x, x))^2*(t[1]+t[2])^2*(-2*t[1]-2*t[2])/(t[2]^2*E[T])+(1/2)*t[1]*(diff(phi(x), x, x))*(-2*t[1]-2*t[2])*((-cos(a)^2*nu[A]/E[A]-sin(a)^2*nu[T]/E[T])*t[1]*phi(x)/t[2]+(-sin(a)^2*nu[A]/E[A]-cos(a)^2*nu[T]/E[T])*t[1]*eta(x)/t[2]+(1/2)*t[1]*(diff(phi(x), x, x))*(t[1]+t[2])^2/(E[T]*t[2])+2*cos(a)*sin(a)*(-nu[A]/E[A]+nu[T]/E[T])*t[1]*psi(x)/t[2])/t[2]))*((t[1]+t[2])^2-t[1]^2)+t[1]*phi(x)*((cos(a)^4/E[A]+cos(a)^2*sin(a)^2*(-2*nu[A]/E[A]+1/G[A])+sin(a)^4/E[T])*t[1]*phi(x)/t[2]+(sin(a)^2*cos(a)^2*(1/E[A]+1/E[T]-1/G[A])-(sin(a)^4+cos(a)^4)*nu[A]/E[A])*t[1]*eta(x)/t[2]+(1/2)*(-cos(a)^2*nu[A]/E[A]-sin(a)^2*nu[T]/E[T])*t[1]*(diff(phi(x), x, x))*(t[1]+t[2])^2/t[2]+sin(a)*cos(a)*(cos(a)^2*(2/E[A]+2*nu[A]/E[A]-1/G[A])+sin(a)^2*(-2*nu[A]/E[A]-2/E[T]+1/G[A]))*t[1]*psi(x)/t[2])+t[1]*(diff(phi(x), x))*(t[1]+t[2])*(cos(a)*sin(a)*(1/G[A]-1/G[T])*t[1]*(diff(psi(x), x))*(t[1]+t[2])/t[2]+(sin(a)^2/G[T]+cos(a)^2/G[A])*t[1]*(diff(phi(x), x))*(t[1]+t[2])/t[2])+(1/2)*t[1]*(diff(phi(x), x, x))*(t[1]+t[2])^2*((-cos(a)^2*nu[A]/E[A]-sin(a)^2*nu[T]/E[T])*t[1]*phi(x)/t[2]+(-sin(a)^2*nu[A]/E[A]-cos(a)^2*nu[T]/E[T])*t[1]*eta(x)/t[2]+(1/2)*t[1]*(diff(phi(x), x, x))*(t[1]+t[2])^2/(E[T]*t[2])+2*cos(a)*sin(a)*(-nu[A]/E[A]+nu[T]/E[T])*t[1]*psi(x)/t[2])+t[1]*eta(x)*((sin(a)^2*cos(a)^2*(1/E[A]+1/E[T]-1/G[A])-(sin(a)^4+cos(a)^4)*nu[A]/E[A])*t[1]*phi(x)/t[2]+(sin(a)^4/E[A]+cos(a)^2*sin(a)^2*(-2*nu[A]/E[A]+1/G[A])+cos(a)^4/E[T])*t[1]*eta(x)/t[2]+(1/2)*(-sin(a)^2*nu[A]/E[A]-cos(a)^2*nu[T]/E[T])*t[1]*(diff(phi(x), x, x))*(t[1]+t[2])^2/t[2]+sin(a)*cos(a)*(sin(a)^2*(2/E[A]+2*nu[A]/E[A]-1/G[A])+cos(a)^2*(-2*nu[A]/E[A]-2/E[T]+1/G[A]))*t[1]*psi(x)/t[2])+t[1]*psi(x)*(sin(a)*cos(a)*(cos(a)^2*(2/E[A]+2*nu[A]/E[A]-1/G[A])+sin(a)^2*(-2*nu[A]/E[A]-2/E[T]+1/G[A]))*t[1]*phi(x)/t[2]+sin(a)*cos(a)*(sin(a)^2*(2/E[A]+2*nu[A]/E[A]-1/G[A])+cos(a)^2*(-2*nu[A]/E[A]-2/E[T]+1/G[A]))*t[1]*eta(x)/t[2]+cos(a)*sin(a)*(-nu[A]/E[A]+nu[T]/E[T])*t[1]*(diff(phi(x), x, x))*(t[1]+t[2])^2/t[2]+(4*sin(a)^2*cos(a)^2*(1/E[A]+2*nu[A]/E[A]+1/E[T])+(sin(a)^2-cos(a)^2)^2/G[A])*t[1]*psi(x)/t[2])+t[1]*(diff(psi(x), x))*(t[1]+t[2])*((cos(a)^2/G[T]+sin(a)^2/G[A])*t[1]*(diff(psi(x), x))*(t[1]+t[2])/t[2]+cos(a)*sin(a)*(1/G[A]-1/G[T])*t[1]*(diff(phi(x), x))*(t[1]+t[2])/t[2]):
 > select(has,eq,sin(a));
 (1)
 >

import your data to a .txt file or save them in a .txt file,and read them like this :

restart:
A:=Vector(15):
FileTools[Text][Open]( "testfile.txt" );
0
for i to 15 do
od:

if testfile.txt contains 15 number of data .

good luck

## set an initial point...

restart:with(Optimization):

Minimize(x^2 + y^2 + 25*(sin(x)^2+sin(y)^2), x=-2*Pi .. 2*Pi , y= -2*Pi .. 2*Pi,initialpoint = {x =Pi}, assume = nonnegative);

f:= (x,y)->cos(x)*sin(y) -(x/(y^2+1));

Maximize((f(x,y), x = -1 .. 2, y = -1 .. 1));

Minimize((f(x,y), x = -1 .. 2, y = -1 .. 1));

as maple help page :

The Minimize and Maximize commands use various methods implemented in a built-in library provided by the Numerical Algorithms Group (NAG). The solvers are iterative in nature and require an initial point. The quality of the solution can depend greatly on the point chosen, especially for nonlinear problems. It is recommended that you provide a point using the initialpoint option. Otherwise, a point is automatically generated.

good luck!

## some problems...

1.an unbalanced parantheses in first limit !

2. make some paramteres local

3. your guess1 depends on itself ! thus it is in infinite loop and it can not be calculated ! change your guess 1 !

restart:
fp:=diff(x^2+1,x);

fp2:=diff(x^2+1,x)-1;guess0:=0.1;

guess1:=evalf(guess0-subs(x=guess0,fp)/subs(x=guess0,limit((fp-fp2)/guess0-guess1,x=guess1)));
## it returns this error :

Error, recursive assignment #

this is your corrected 1 and 2 problem, but please correct the thrid !

restart:
Secant:=proc(f,x0,tol) local guess1,count,guess0;
fp=diff(f,x);
fp2=diff(f,x)-1;
guess0=x0;
guess1:=evalf(guess0-subs(x=guess0,fp)/subs(x=guess0,limit((fp-fp2)/guess0-guess1,x=guess1))); count:=1;
while abs(guess0-guess1)>tol do
guess0:=guess1;
guess1:=evalf(guess0-subs(x=guess0,fp)/subs(x=guess0,limit((fp-fp2)/guess0-guess1),x=guess1)); count:=count+1;
end;
guess1;count;
end:

## maybe it is maybe it is not ! or another...

restart:

int(exp(-z^2*sin(z)^2), z = 0 .. infinity, numeric, epsilon = 0.1e-1); #which returns 2.835068335#

exp(-z^2*sin(z)^2);

F:=convert(%,trig);convert(F,exp);simplify(convert(%,trig));

int(convert(F,exp), z = 0 .. infinity,numeric, epsilon = 0.1e-1); # which returns 2.259350091#

i do not know why the fire can not be uploaded :| . what's up in mapleprimes ?

## your question is not as clear enough !...

when u assign sth to a symbol it gets its value and when u execute that,it will return the value not itself ! use eval instead !

 >
 >
 (1)
 >
 (2)
 >

here is one way :

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >

## do u mean this ?...

 > restart:q:=x+y;
 (1)
 > f := unapply(q, x, y);c:=10^(-1):
 (2)
 > G(x,y,xi,eta,t):=(1+2*(sum((exp(-Pi^(2)*n^(2)*c*t))*cos(n*Pi*x)*cos(n*Pi*xi),n=1..10)))*(1+2*(sum((exp(-Pi^(2)*m^(2)*c*t))*cos(m*Pi*y)*cos(m*Pi*eta),m=1..10)));
 (3)
 > w:=int(int(f(xi,eta)*G(x,y,xi,eta,t), eta=0..1), xi=0..1);W:=unapply(w,x,y,t);
 (4)
 > plot(W(.51086, .49427, t), t = 0 .. 1);
 > plottools:-getdata(%); M := %[-1]; #ExportMatrix("new2.dat", M);
 (5)
 > M(1..5,1..2);
 (6)
 > for i to 200 do X||i := M(i,1);Y||i:=M(i,2);od;
 (7)
 >