## 749 Reputation

11 years, 87 days

## MaplePrimes Activity

### These are answers submitted by mehdi jafari

as maple help page :

The odetest command checks explicit and implicit solutions for ODEs by making a careful simplification of the ODE with respect to the given solution. If the solution is valid, the returned result will be 0; otherwise, the algebraic remaining expression will be returned. In the case of systems of ODEs, odetest can only test explicit solutions, given either as a set or as a list of sets. (For information on non-composed sets of solutions for nonlinear systems, see dsolve,system.)

 > restart:
 > sys_ode := {diff(d11(m), m) = -(3*sin(m)^2-1)*d31(m)/a^(3/2)+(-3*cos(m)*sin(m)/a^(3/2))*d41(m), diff(d21(m), m) = (-3*cos(m)*sin(m)/a^(3/2))*d31(m)-(3*cos(m)^2-1)*d41(m)/a^(3/2), diff(d31(m), m) = -a^(3/2)*d11(m), diff(d41(m), m) = -a^(3/2)*d21(m)};
 (1)
 > dsolve(sys_ode);
 (2)
 > odetest(%, sys_ode);
 (3)
 >

GenerateMatrix(sys,w);## here is your problem # u can not generate matrix,while some of your elements of w are numbers  !#

what do u exactly want from the output of GenerateMatrix(sys,w) ? maybe we want to check this and solve with another way, please write down what do u expect from the output of that.

 > restart: with(LinearAlgebra): with(plots): with(PDEtools): interface(rtablesize=20):
 Introduction The purpose of this worksheet is to illsutrate how to solve linear elliptic PDEs.  For concreteness, we will focus on the following PDE:     where the source function  is given.  If this is known as Laplace's equation, if not it is Poisson's equation.   The function f is given. We add these boundary condition :   u(x,1)=u(x,0)=ux(0,y)=ux(1,y)=0

Stencil

In this section, we will develop the solution to the following PDE assuming a stencil for the differential operator involving five points:

 > pde := diff(u(x,y),x,x) + diff(u(x,y),y,y) - f(x,y);
 (2.1)

As usual, we make use of the GenerateStencil procedure:

 > GenerateStencil := proc(F,N,{orientation:=center,stepsize:=h,showorder:=true,showerror:=false})     local vars, f, ii, Degri, stencil, Error, unknowns, Indets, ans, Phi, r, n, phi;  Phi := convert(F, D);  vars := op(Phi); n := PDEtools[difforder](Phi); f := op(1, op(0, Phi));  if nops([vars]) <> 1 then r := op(1, op(0, op(0, Phi))) else r := 1 end if; phi := f(vars);  if orientation = center then if type(N, odd) then ii := [seq(i, i = -(N-1)*(1/2) .. (N-1)*(1/2))] else ii := [seq(i, i = -N+1 .. N-1, 2)] end if elif orientation = left then ii := [seq(i, i = -N+1 .. 0)] elif orientation = right then ii := [seq(i, i = 0 .. N-1)] end if; stencil := add(a[ii[i]]*subsop(r = op(r, phi)+ii[i]*stepsize, phi), i = 1 .. N); Error := (D[`\$`(r, n)](f))(vars)-stencil; Error := convert(series(Error, stepsize, N), polynom); unknowns := seq(a[ii[i]], i = 1 .. N); Indets := `minus`(`minus`(`minus`(indets(Error), {vars}), {unknowns}), {stepsize});  Error := collect(Error, Indets, 'distributed');     ans := solve({coeffs(Error, Indets),unknowns}, parametric = full);     if (ans=NULL) then:        print(`Failure: try increasing the number of points in the stencil`);        return NULL;     fi:     stencil := subs(ans,stencil);     Error := convert(series(`leadterm`(D[r\$n](f)(vars) - stencil),stepsize,N+20),polynom);     Degri := degree(Error,stepsize);     if (showorder) then:        print(cat(`This stencil is of order `,Degri));     fi:     if (showerror) then:        print(cat(`This leading order term in the error is `,Error));     fi:     convert(D[r\$n](f)(vars) = stencil,diff); end proc:

 > substencil[1] := GenerateStencil(diff(u(x,y),x,x),3); substencil[2] := GenerateStencil(diff(u(x,y),y,y),3);
 (2.2)

Notice that we have assumed the same stepsize  in the  and  directions.  Putting these into PDE gives:

 > stencil[1] := subs(substencil[1],substencil[2],pde);
 (2.3)
 >

aving now obtained a discrete form of the PDE  we now turn our attention to how to exploit it and obtain a numeric solution.  We first need to discretize the domain  over which we seek a solution.  We will assume  lattice points in the  and  directions, respectively.  The coordinates of the lattice point will be explicitly given by  and ,

 > Z := i -> (1/(N+1))*i; x[0] = Z(0),x[N+1] = Z(N+1),y[0] = Z(0),y[N+1] = Z(N+1);
 (2.4)
 >

Each node is labelled by our approximation to the true solution of the PDE .  Boundary conditions will be used to fix  at each of the purple boundary nodes, so the goal of the code will be to solve for  at each of the white interior nodes.  We also define , which allows us to re-write the stencil as:

 > Subs := seq(seq(u(x+ii*h,y+jj*h)=u[i+ii,j+jj],ii=-1..1),jj=-1..1),f(x,y)=f[i,j]: stencil[1] := subs(Subs,stencil[1]); Stencil[1] := unapply(stencil[1],h,i,j,u,f);
 (2.5)
 >
 >
 > ## checking your second procedure #
 >
 > N:=1;_f := (x,y) -> 0;
 (2.6)
 > Z := unapply( (1/(N+1))*i,i); x[0] := Z(0);x[N+1] := Z(N+1);y[0] := Z(0);y[N+1] := Z(N+1);  h := evalf(Z(1)-Z(0));
 (2.7)
 >
 > for i from 1 to N do:     # Neumann boundary condition      u[N+2,i] :=  u[N,i] ;          u[-1,i] := u[1,i]; od; for i from -1 to N+2 do:      # Dirichlet boundary condition      u[i,0] := 0;      u[i,N+1] := 0; od;
 (2.8)
 > f := Array(0..N+1,0..N+1,[seq([seq(evalf(_f(Z(i),Z(j))),i=0..N+1)],j=0..N+1)],datatype=float);
 (2.9)
 > f(1..9);
 (2.10)
 > sys := [seq(seq(Stencil[1](h,i,j,u,f),i=0..N+1),j=1..N)];
 (2.11)
 > w := [seq(seq(u[i,j],i=-1..N+2),j=0..N+1)];
 (2.12)
 > GenerateMatrix(sys,w);## here is your problem # u can not generate matrix,while some of your elements of w are zero !#
 >

Procedure

Using the previous suty in section stencil we can write the procedure to solve the Laplace equation in [0,1]*[0,1] with the boundary condition Neumann conditions on the vertical boundary and Dirichlet boundary condition on the horizontal baoundary. In our study we will use the same stepsize h in x and y direction.

 > PoissonSolve:=proc(N,_f) local Z,i,h,y,x,sys,w,f,ff,sol,j,u,Data; # define basic grid parameters _f:=ff; Z := unapply( (1/(N+1))*i,i); x[0] := Z(0);x[N+1] := Z(N+1);y[0] := Z(0);y[N+1] := Z(N+1);  h := evalf(Z(1)-Z(0)); # Fix the boundary data and the source matrix for i from 1 to N do:     # Neumann boundary condition      u[N+2,i] :=  u[N,i] ;          u[-1,i] := u[1,i]; od: for i from -1 to N+2 do:      # Dirichlet boundary condition      u[i,0] := 0;      u[i,N+1] := 0; od:    ff := Array(0..N+1,0..N+1,[seq([seq(evalf(ff(Z(i),Z(j))),i=0..N+1)],j=0..N+1)]); # Write down the system of equations to solve and solve them      sys := [seq(seq(Stencil[1](h,i,j,u,ff),i=0..N+1),j=1..N)];   w := [seq(seq(u[i,j],i=-1..N+2),j=0..N+1)];   sol := LinearSolve(GenerateMatrix(sys,w));    # parse the solution vector sol back into "matrix" form    for i from 0 to N+1 do:      for j from 0 to N+1 do:         u[i,j] := sol[j*(N+1)+i]:      od:    od: # generate a 3D plot of the solution using the surfdata command    Data := [seq([seq([Z(i),Z(j),u[i,j]],i=0..N+1)],j=0..N+1)]: surfdata(Data,axes=boxed,labels=[`x`,`y`,`u(x,y)`],shading=zhue,style=patchcontour); end proc:

Here is an example of the output when the source function is set to zero ; i.e., when  reduces down to Laplace's equation:

 > _f := (x,y) -> 0; PoissonSolve(5,_f);
 >
 >

## your code is so vague !...

you always ask a question as complicated as it possible ! and you expect every body to get phd on your code !

you should check your code without procedure and by giving value to inputs of your procedure,so that you can find your problem, i just changed some bracket and some problems in your first procedure and your answers changed and i do not know whether yours are correct or mine !
thus please check these complicated codes yourself line by line , beacuse you yourself should know which answer is correct and which in not ! and please just ask about programming questions ! good luck !

 > restart: with(LinearAlgebra): with(plots): with(PDEtools): interface(rtablesize=20):
 Introduction The purpose of this worksheet is to illsutrate how to solve linear elliptic PDEs.  For concreteness, we will focus on the following PDE:     where the source function  is given.  If this is known as Laplace's equation, if not it is Poisson's equation.   The function f is given. We add these boundary condition :   u(x,1)=u(x,0)=ux(0,y)=ux(1,y)=0

Stencil

In this section, we will develop the solution to the following PDE assuming a stencil for the differential operator involving five points:

 > pde := diff(u(x,y),x,x) + diff(u(x,y),y,y) - f(x,y);
 (2.1)

As usual, we make use of the GenerateStencil procedure:

 > GenerateStencil := proc(F,N,{orientation:=center,stepsize:=h,showorder:=true,showerror:=false})     local vars, f, ii, Degri, stencil, Error, unknowns, Indets, ans, Phi, r, n, phi;  Phi := convert(F, D);  vars := op(Phi); n := PDEtools[difforder](Phi); f := op(1, op(0, Phi));  if nops([vars]) <> 1 then r := op(1, op(0, op(0, Phi))) else r := 1 end if; phi := f(vars);  if orientation = center then if type(N, odd) then ii := [seq(i, i = -(N-1)*(1/2) .. (N-1)*(1/2))] else ii := [seq(i, i = -N+1 .. N-1, 2)] end if elif orientation = left then ii := [seq(i, i = -N+1 .. 0)] elif orientation = right then ii := [seq(i, i = 0 .. N-1)] end if; stencil := add(a[ii[i]]*subsop(r = op(r, phi)+ii[i]*stepsize, phi), i = 1 .. N); Error := (D[`\$`(r, n)](f))(vars)-stencil; Error := convert(series(Error, stepsize, N), polynom); unknowns := seq(a[ii[i]], i = 1 .. N); Indets := `minus`(`minus`(`minus`(indets(Error), {vars}), {unknowns}), {stepsize});  Error := collect(Error, Indets, 'distributed');     ans := solve({coeffs(Error, Indets),unknowns}, parametric = full);     if (ans=NULL) then:        print(`Failure: try increasing the number of points in the stencil`);        return NULL;     fi:     stencil := subs(ans,stencil);     Error := convert(series(`leadterm`(D[r\$n](f)(vars) - stencil),stepsize,N+20),polynom);     Degri := degree(Error,stepsize);     if (showorder) then:        print(cat(`This stencil is of order `,Degri));     fi:     if (showerror) then:        print(cat(`This leading order term in the error is `,Error));     fi:     convert(D[r\$n](f)(vars) = stencil,diff); end proc:

 > substencil[1] := GenerateStencil(diff(u(x,y),x,x),3); substencil[2] := GenerateStencil(diff(u(x,y),y,y),3);
 (2.2)

Notice that we have assumed the same stepsize  in the  and  directions.  Putting these into PDE gives:

 > stencil[1] := subs(substencil[1],substencil[2],pde);
 (2.3)

aving now obtained a discrete form of the PDE  we now turn our attention to how to exploit it and obtain a numeric solution.  We first need to discretize the domain  over which we seek a solution.  We will assume  lattice points in the  and  directions, respectively.  The coordinates of the lattice point will be explicitly given by  and ,

 > Z := i -> (1/(N+1))*i; x[0] = Z(0),x[N+1] = Z(N+1),y[0] = Z(0),y[N+1] = Z(N+1);
 (2.4)
 >

Each node is labelled by our approximation to the true solution of the PDE .  Boundary conditions will be used to fix  at each of the purple boundary nodes, so the goal of the code will be to solve for  at each of the white interior nodes.  We also define , which allows us to re-write the stencil as:

 > Subs := seq(seq(u(x+ii*h,y+jj*h)=u[i+ii,j+jj],ii=-1..1),jj=-1..1),f(x,y)=f[i,j]: stencil[1] := subs(Subs,stencil[1]); Stencil[1] := unapply(stencil[1],h,i,j,u,f);
 (2.5)
 >

Procedure

Using the previous suty in section stencil we can write the procedure to solve the Laplace equation in [0,1]*[0,1] with the boundary condition Neumann conditions on the vertical boundary and Dirichlet boundary condition on the horizontal baoundary. In our study we will use the same stepsize h in x and y direction.

 > PoissonSolve:=proc(N,_f) local Z,i,h,y,x,sys,w,f,sol,j,u,Data; # define basic grid parameters Z := i -> (1/(N+1))*i; x[0] = Z(0),x[N+1] = Z(N+1),y[0] = Z(0),y[N+1] = Z(N+1);  h := evalf(Z(1)-Z(0)); # Fix the boundary data and the source matrix for i from 1 to N do:     # Neumann boundary condition      u[N+2,i] :=  u[N,i] ;          u[-1,i] := u[1,i]; od: for i from -1 to N+2 do:      # Dirichlet boundary condition      u[i,0] := 0;      u[i,N+1] := 0; od:    f := Array(0..N+1,0..N+1,[seq([seq(evalf(_f(Z(i),Z(j))),i=0..N+1)],j=0..N+1)],datatype=float); # Write down the system of equations to solve and solve them      sys := [seq(seq(Stencil[1](h,i,j,u,f),i=0..N+1),j=1..N)];   w := [seq(seq(u[i,j],i=-1..N+2),j=0..N+1)];   sol := LinearSolve(GenerateMatrix(sys,w));    # parse the solution vector sol back into "matrix" form    for i from 0 to N+1 do:      for j from 0 to N+1 do:         u[i,j] := sol[j*(N+1)+i]:      od:    od: # generate a 3D plot of the solution using the surfdata command    Data := [seq([seq([Z(i),Z(j),u[i,j]],i=0..N+1)],j=0..N+1)]: surfdata(Data,axes=boxed,labels=[`x`,`y`,`u(x,y)`],shading=zhue,style=patchcontour); end proc:

Here is an example of the output when the source function is set to zero ; i.e., when  reduces down to Laplace's equation:

 > f := (x,y) -> 0; PoissonSolve(10,f);
 >
 >

## 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 ?

 3 4 5 6 7 8 9 Page 5 of 9
﻿