## 749 Reputation

11 years, 87 days

## see maple help...

Examples

 >

Example 1: Basic usage

 >
 (1.1)
 >
 (1.2)
 >
 (1.3)
 >
 (1.4)
 >
 (1.5)

The linearization point  does not give exact zero. Compute linear model for a tighter tolerance

 >
 Warning, linpoint is not an equilibrium point
 (1.6)
 >
 (1.7)

Disable the checkpoint option for the same setting of the tolerance

 >
 (1.8)

Example 2: Use of user-defined functions

 > sys2 := {piecewise(x[1](t)<0, x[1](t), x[2](t) + x[1](t)^2) * piecewise(u(t)<0, cos(y(t)), sin(y(t))) = sin(x[1](t)^2) + 5 * y(t) + diff(x[1](t), t, t), y(t) - x[1](t)^2 + u(t)*x[1](t), diff(x[2](t), t) = f(x[1](t), u(t))}; user_function := [     f,     [float, float],     float,     proc(x, y)     local d1, d2;         d1 := cos(x)+x^2;         d2 := y*d1 + y^2;         return d1*x+d2*y- exp(d1);     end proc     ];
 (1.9)
 >
 (1.10)
 >
 (1.11)
 >
 (1.12)
 >
 (1.13)

Example of the statevariable, inputvariable, and outputvariable options

 >
 (1.14)
 >
 (1.15)

Example 3: Inverted pendulum on a moving cart

Variables

 counter-clockwise angular displacement of the pendulum from the upright position angular velocity of the pendulum, position of the cart velocity of the cart, horizontal force applied to the cart

Parameters

 half-length of pendulum mass of the pendulum mass of the cart gravitational constant (9.8 )

 >
 (1.16)

Linearization point is given by:

 >
 (1.17)
 >
 (1.18)

The state-space object given by lin_model3[1] can be used to construct a stabilizing controller using linear control theory.

 >
 (1.19)
 >

## not answer, just as an idea...

 > restart:
 > sys:={diff(Y(x, t), x\$2) = exp(-2*x*b)*(A(x, t)-Y(x, t)), diff(A(x, t), t) = exp(-2*x*b)*(Y(x, t)-A(x, t))};
 (1)
 > ans:=pdsolve(sys);
 (2)
 > PDEtools[build](op(ans));
 (3)
 > # up to here,the answer witouht inital conditons and boundaries #
 >
 >
 >
 > SYS:={isolate(op(1,sys),Y(x,t)),isolate(op(2,sys),A(x,t))};
 (4)
 > ibc:={A(x, 0) = 0, Y(0, t) = 0.1, D[1](Y)(0, t) =0};
 (5)
 >
 > Y(x,t):=(rhs(op(2,SYS)));
 (6)
 > PDE:=diff(Y(x, t), x\$2) = exp(-2*x*b)*(A(x, t)-Y(x, t));pdsolve(PDE);PDEtools[build](op(%));
 (7)
 > # this PDE actually is implification of system of PDEs, i think if u can convert your boundary like this, u can solve numerically your system, but actually i do not know how #
 >
 >
 >

## use evalr...

 `±`(.314, 0.401e-3)

 (1/2)*arctan(((1/5000+sin((13/30)*Pi)+sin((1/10)*Pi))*tan(1/10000+(1/3)*Pi)-tan(1/10000)*(-1/5000+sin((7/30)*Pi)+sin((13/30)*Pi)-tan(1/10000+(1/3)*Pi)*(1/5000+cos((1/10)*Pi)+cos((7/30)*Pi)))+tan(1/10000+(1/3)*Pi)*(1/5000+sin((1/10)*Pi)-sin((7/30)*Pi)-tan(1/10000+(1/3)*Pi)*(-1/5000-cos((7/30)*Pi)+cos((13/30)*Pi))-tan(1/10000)*(-1/5000-cos((1/10)*Pi)-cos((13/30)*Pi))))/((-1/5000+cos((13/30)*Pi)+cos((1/10)*Pi))*tan(-1/10000+(1/3)*Pi)+tan(1/10000)*(-1/5000-cos((7/30)*Pi)+cos((13/30)*Pi)-tan(1/10000+(1/3)*Pi)*(1/5000-sin((1/10)*Pi)+sin((7/30)*Pi)))+tan(-1/10000+(1/3)*Pi)*(-1/5000+cos((1/10)*Pi)+cos((7/30)*Pi)-tan(-1/10000+(1/3)*Pi)*(1/5000-sin((7/30)*Pi)-sin((13/30)*Pi))-tan(1/10000)*(1/5000+sin((13/30)*Pi)+sin((1/10)*Pi)))))+(1/2)*arctan(((-1/5000+sin((13/30)*Pi)+sin((1/10)*Pi))*tan(-1/10000+(1/3)*Pi)+tan(1/10000)*(-1/5000+sin((7/30)*Pi)+sin((13/30)*Pi)-tan(1/10000+(1/3)*Pi)*(1/5000+cos((1/10)*Pi)+cos((7/30)*Pi)))+tan(-1/10000+(1/3)*Pi)*(-1/5000+sin((1/10)*Pi)-sin((7/30)*Pi)-tan(-1/10000+(1/3)*Pi)*(1/5000-cos((7/30)*Pi)+cos((13/30)*Pi))+tan(1/10000)*(-1/5000-cos((1/10)*Pi)-cos((13/30)*Pi))))/((1/5000+cos((13/30)*Pi)+cos((1/10)*Pi))*tan(1/10000+(1/3)*Pi)-tan(1/10000)*(-1/5000-cos((7/30)*Pi)+cos((13/30)*Pi)-tan(1/10000+(1/3)*Pi)*(1/5000-sin((1/10)*Pi)+sin((7/30)*Pi)))+tan(1/10000+(1/3)*Pi)*(1/5000+cos((1/10)*Pi)+cos((7/30)*Pi)-tan(1/10000+(1/3)*Pi)*(-1/5000-sin((7/30)*Pi)-sin((13/30)*Pi))+tan(1/10000)*(1/5000+sin((13/30)*Pi)+sin((1/10)*Pi))))) .3141594479

 (1/2)*arctan(((-1/5000+sin((13/30)*Pi)+sin((1/10)*Pi))*tan(-1/10000+(1/3)*Pi)+tan(1/10000)*(-1/5000+sin((7/30)*Pi)+sin((13/30)*Pi)-tan(1/10000+(1/3)*Pi)*(1/5000+cos((1/10)*Pi)+cos((7/30)*Pi)))+tan(-1/10000+(1/3)*Pi)*(-1/5000+sin((1/10)*Pi)-sin((7/30)*Pi)-tan(-1/10000+(1/3)*Pi)*(1/5000-cos((7/30)*Pi)+cos((13/30)*Pi))+tan(1/10000)*(-1/5000-cos((1/10)*Pi)-cos((13/30)*Pi))))/((1/5000+cos((13/30)*Pi)+cos((1/10)*Pi))*tan(1/10000+(1/3)*Pi)-tan(1/10000)*(-1/5000-cos((7/30)*Pi)+cos((13/30)*Pi)-tan(1/10000+(1/3)*Pi)*(1/5000-sin((1/10)*Pi)+sin((7/30)*Pi)))+tan(1/10000+(1/3)*Pi)*(1/5000+cos((1/10)*Pi)+cos((7/30)*Pi)-tan(1/10000+(1/3)*Pi)*(-1/5000-sin((7/30)*Pi)-sin((13/30)*Pi))+tan(1/10000)*(1/5000+sin((13/30)*Pi)+sin((1/10)*Pi)))))-(1/2)*arctan(((1/5000+sin((13/30)*Pi)+sin((1/10)*Pi))*tan(1/10000+(1/3)*Pi)-tan(1/10000)*(-1/5000+sin((7/30)*Pi)+sin((13/30)*Pi)-tan(1/10000+(1/3)*Pi)*(1/5000+cos((1/10)*Pi)+cos((7/30)*Pi)))+tan(1/10000+(1/3)*Pi)*(1/5000+sin((1/10)*Pi)-sin((7/30)*Pi)-tan(1/10000+(1/3)*Pi)*(-1/5000-cos((7/30)*Pi)+cos((13/30)*Pi))-tan(1/10000)*(-1/5000-cos((1/10)*Pi)-cos((13/30)*Pi))))/((-1/5000+cos((13/30)*Pi)+cos((1/10)*Pi))*tan(-1/10000+(1/3)*Pi)+tan(1/10000)*(-1/5000-cos((7/30)*Pi)+cos((13/30)*Pi)-tan(1/10000+(1/3)*Pi)*(1/5000-sin((1/10)*Pi)+sin((7/30)*Pi)))+tan(-1/10000+(1/3)*Pi)*(-1/5000+cos((1/10)*Pi)+cos((7/30)*Pi)-tan(-1/10000+(1/3)*Pi)*(1/5000-sin((7/30)*Pi)-sin((13/30)*Pi))-tan(1/10000)*(1/5000+sin((13/30)*Pi)+sin((1/10)*Pi))))) -0.4006133e-3

## with sum and index notation...

 > restart:
 > B[t+1]:=B[t]+X[t,t+1]-D[t,t+1];
 (1)
 > T[t+1]:=(m+1)/(m*sum(X[t-i,t+1-i],i=1..m-1));
 (2)
 >

## i think u just want assign s members to ...

i think u just want assign s members to constants , u can do it like this :

for i to nops(s) do
C||i:=rhs(op(i,s));od;

 > restart:
 > Eq1 := diff(psi(y), y, y, y, y)-M*(diff(psi(y), y, y))-Gr*b*y = 0;
 >
 > bcs1:=psi(0)=0,(D@@2)(psi)(0)=0,psi(h)=-F/2,D(psi)(h)=A;
 >
 > res1:=(dsolve(Eq1));
 >
 >
 (1)
 > res2:=(dsolve({Eq1,bcs1},psi(y)));
 (2)
 >
 > match(rhs(res2)=rhs(res1),y,s);
 (3)
 > s;
 (4)
 > for i to nops(s) do C||i:=rhs(op(i,s));od;
 (5)
 >

## the picture is not seen...

it is almost correct, i just made i also local ,

 > restart;
 >
 > with(plots);
 >
 > g := proc (F, A, B, X0, g::evaln) local f, a, b, E, x0,i, erreur, N, n, x1, ps, pp, pic; f := F; a := A; b := B; x0 := X0; E :=evalf(abs(f(x0)));
 >
 > erreur := 0.1e-3;
 >
 > N := 100;
 >
 > n := 0;
 >
 > for i to N do x1 := evalf(x0-f(x0)/(D(f))(x0));
 >
 > E := abs(f(x1));
 >
 > n := n+1; ps[n] := plot([[x0, 0.], [x0, f(x0)], [x1, 0.]], color = green, thickness = 2);
 >
 > x0 := x1 end do; g := evalf(x1); pp := plot(f(x), x = a .. b, color = red); pic := seq(ps[i], i = 1 .. n); display(pp, pic) end proc;
 > f := proc (x) options operator, arrow; sin(x)-cos(2*x)+.2 end proc;
 > a := 0; b := 6;
 >
 (1)
 >

## maplesoft help page...

http://www.maplesoft.com/support/faqs/detail.aspx?sid=87675

Changing the default set of fonts Maple uses in the Standard interface is a two step process.

To change the default font for a type of input or output:

1. Select Format -> Styles

2. Select the style you wish to change and click the "Modify" button.

3. Change the font type, size, colour, etc. as desired and click "OK"

The default input/output modes for Maple are:

2D Math input: "C 2D Math"

1D Math input: "C Maple Input"

2D Math output: "C 2D Output"

The above steps will apply the change for the current worksheet only. If you were to restart Maple, the old default values will be restored. You must make a user defined style set if you want this change permanently. Here is how you can save the changes made above:

1. Select Format -> Manage Style Sets -> New Style Set

2. Select "Select All". Save the file.

3. Select the "User-defined Style Set" radio button. Browse to the style set file you created in the previous step and select it. Click "OK".

This makes Maple use the style set you've defined in future sessions.

(Note that you will need to keep that style set worksheet in its current location. If you move it, the font will go back to its default)

Format -> Manage Style Sets

and select “Default Maple Style Set”.

good luck!

## oh, you are so respective and cute...

one of many way is this :

 > restart:n:=5;# number of arguments#
 (1)
 > f:=Sum((a[i])*x^i,i=0..n);
 (2)
 >
 > # giving values to coefficients#
 > a[1]:=1.3:a[2]:=5.73:a[3]:=7:a[4]:=9:a[5]:=11:
 > value(eval(f));
 (3)
 > #or u can do like this
 > restart:
 > f:=a*x^2+b*x+c:
 > params:={a=1,b=2,c=3}:
 > eval(f,params);
 (4)
 >

for editing your post, in the down of your question,there is more,click on more and edit it . hope bests for you,since you decerve it . good luck

## use a program which adds virtual printer...

u can use a program which adds virtual printer so that u can print any thing u want to pdf files. for example adobe acrobat pro.
also u can use these pdfs.

M15QRC_win.pdf

maple-ref.pdf

maple_18.pdf

## use hint...

use hint for sepration of varibales, you should also write Pi with capital P .

 > restart:
 > PDE:=diff(u(x,t),t)=diff(u(x,t),x\$2);
 (1)
 > BCs:={u(0,t)=0, u(Pi/4,t)=0 , u(x,0)=x*(Pi/4-x)};
 (2)
 >
 > ans:=pdsolve(PDE, HINT = h(x)*g(t));
 (3)
 > PDEtools:-build(ans);
 (4)
 >
 > pds:=pdsolve(PDE,BCs,numeric):
 > 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});
 >
 > PDEtools:-Laplace(PDE,u(x,t));
 >

actually i do not know why Laplace does not solve this.

## two procedures...

 > restart:
 > Max:=proc() local m,i; m:=-infinity; for i in (args) do if i>m then m:=i end if;od;m; end proc:
 > triangle:=proc(a,b,c) local A,S; A:=evalf({(args)} minus {Max(args)}); S:=sqrt(op(1,A)^2+op(2,A)^2); if Max(args)
 > triangle(3,5,10);triangle(3,5,4);
 (1)
 >
 >
 >
 >

## the problem solved...

 > restart: with(Optimization): with(LinearAlgebra): L:=1:  r:=2:  tau:= 1: interface(rtablesize= 2*r+1): Z:= Matrix(      2*r+1, 2*r+1,      [tau,       seq(evalf((L/(2*(iz-1)*Pi))*sin(2*(iz-1)*Pi*tau/L)), iz= 2..r+1),       seq(evalf((L/(2*(iz-1-r)*Pi))*(1-cos(2*(iz-1-r)*Pi*tau/L))), iz= r+2..2*r+1)       ],      scan= columns,      datatype= float[8] );                          Dtau00:= < 1 >: Dtau01:= Vector[row](r): Dtau02:= Vector[row](r): Dtau10:= Vector(r): Dtau20:= Vector(r): Dtau1:= DiagonalMatrix([seq(evalf(cos(2*i*Pi*tau/L)), i= 1..r)]): Dtau2:= DiagonalMatrix([seq(evalf(sin(2*i*Pi*tau/L)), i= 1..r)]): Dtau3:= -Dtau2: Dtau4:= copy(Dtau1): Dtau:= < < Dtau00 | Dtau01 | Dtau02 >,          < Dtau10 | Dtau1  | Dtau2  >,          < Dtau20 | Dtau3  | Dtau4  > >;   P00:= < L/2 >: P01:= Vector[row](r): P02:= Vector[row](r, j-> evalf(-L/j/Pi), datatype= float[8]): P10:= Vector(r): P20:= Vector(r, i-> evalf(L/2/i/Pi)): P1:= Matrix(r,r): P2:= DiagonalMatrix(P20): P3:= DiagonalMatrix(-P20): P4:= Matrix(r,r): P:= < < P00 | P01 | P02 >,       < P10 | P1  | P2  >,       < P20 | P3  | P4  > >; interface(rtablesize=2*r+1):    # optionally J:=Vector([L, L/2 \$ 2*r]):      # Matrix([[...]]) would also work here E:=DiagonalMatrix(J); X:=  Vector[row](2*r+1,symbol=a); U:=Vector[row](2*r+1,symbol=b); X0:= Vector[row](2*r+1,[1]); G:=Vector[row](2*r+1,[1]); C:=simplify(X-X0-G.Z-X.Dtau.P+X.Dtau.Z-U.P);
 (1)
 > J:=X.E.Transpose(X)+U.E.Transpose(U);
 (2)
 >
 (3)
 > Minimize(J,{seq(C[i]=0,i=1..nops(C))});
 (4)
 > #XP:=-.015+X[1]+add(X[l+1]*f1(l)+X[r+l+1]*f2(l), l= 1..r): #plot([XP,T1], t= 0..1);#,legend= "Solution Of x(t) with r=50"):
 >
 >
 >
 >
 >

at first,i should request to upload the worksheet insetead of copying commands with this format, just copy and paste it in your worksheet to see it is not directly executable. when you load LinearAlgebra packgar,there is no need everytime to load part of package , if you need to load part of the package, just to it like this :

with(LinearAlgebra,DiagonalMatrix):

your matrix bounds are not correct so you can not multiply them correctly ! please change your matrix bounds,

 > restart:with(Optimization):with(LinearAlgebra,DiagonalMatrix):
 > L := 1: r := 2: tau := 1:
 > interface(rtablesize = 2*r+1):
 > Z:= Matrix(2*r+1, 2*r+1,[tau,seq(evalf((L/(2*(iz-1)*Pi))*sin(2*(iz-1)*Pi*tau/L)), iz= 2..r+1),seq(evalf((L/(2*(iz-1-r)*Pi))*(1-cos(2*(iz-1-r)*Pi*tau/L))), iz= r+2..2*r+1)],scan= columns,datatype = float[8]);
 (1)
 > Dtau00 := `<,>`(1); Dtau01 := Vector[row](r); Dtau02 := Vector[row](r); Dtau10 := Vector(r); Dtau20 := Vector(r);
 >
 (2)
 > Dtau1:= DiagonalMatrix([seq(evalf(cos(2*i*Pi*tau/L)), i= 1..r)]): Dtau2:= DiagonalMatrix([seq(evalf(sin(2*i*Pi*tau/L)), i= 1..r)]):  Dtau3:= -Dtau2: Dtau4:= copy(Dtau1): Dtau:= < < Dtau00 | Dtau01 | Dtau02 >>, < Dtau10 | Dtau1 | Dtau2 >, < Dtau20 | Dtau3 | Dtau4 > ;
 (3)
 > P00:= < L/2 >: P01:= Vector[row](r): P02:= Vector[row](r, j-> evalf(-L/j/Pi), datatype= float[8]):P10:= Vector(r): P20:= Vector(r, i-> evalf(L/2/i/Pi)): P1:= Matrix(r,r): P2:= DiagonalMatrix(P20): P3:= DiagonalMatrix(-P20): P4:= Matrix(r,r): P:= < < P00 | P01 | P02 >> ,< P10 | P1 | P2 >, < P20 | P3 | P4 > ;
 (4)
 > interface(rtablesize = 2*r+1); J := Vector([L, `\$`((1/2)*L, 2*r)]); E := DiagonalMatrix(J); X := Vector[row](2*r+1, symbol = a); U := Vector[row](2*r+1, symbol = b); X0 := Vector[row](2*r+1, [1]); G := Vector[row](2*r+1, [1]); C := simplify(X-X0-G.Z-X.Dtau.P+X.Dtau.Z-U.P);
 (5)
 > J := X.E.Transpose(X)+U.E.Transpose(U);
 > Minimize(J, {C = 0});
 >

## actually the only way is to go back from...

you can remove differentiation independent parameter by using declare and prime, like this :

with(PDEtools,declare):
declare(A(t), prime = t);

but actually it is not what you want, what you want is this :

 > restart:
 >
 >
 > d:=diff(A(t), t);
 >
 (1)
 > A(t)=((Int(d,t)));
 (2)
 >

maybe it is so obvious ,but this is the only direct way to relate a function to its differentiation !!! and u can not do it in any other way i think ! good luck !