mehdi jafari

749 Reputation

13 Badges

11 years, 87 days

MaplePrimes Activity


These are answers submitted by mehdi jafari


``

Examples

 

with(DynamicSystems)

Example 1: Basic usage

sys1 := [diff(x[1](t), t) = x[2](t)^2-4, diff(x[2](t), t) = x[1](t)-1+u(t), y(t) = x[1](t)+x[2](t)]

sys1 := [diff(x[1](t), t) = x[2](t)^2-4, diff(x[2](t), t) = x[1](t)-1+u(t), y(t) = x[1](t)+x[2](t)]

(1.1)

eq_point1 := EquilibriumPoint(sys1, [u(t)], constraints = [0 < x[1](t)], initialpoint = [u(t) = 0, x[1](t) = 2, x[2](t) = 4])

eq_point1 := [x[1](t) = 1.49999999768708, x[2](t) = -2.00000001053627], [diff(x[1](t), t) = 0.421450963017378e-7, diff(x[2](t), t) = -0.462584648364128e-8], [u(t) = -.500000002312923], [y(t) = -.500000012849197]

(1.2)

lin_point1 := [op(eq_point1[1]), op(eq_point1[3])]

lin_point1 := [x[1](t) = 1.49999999768708, x[2](t) = -2.00000001053627, u(t) = -.500000002312923]

(1.3)

lin_model1a := Linearize(sys1, [u(t)], [y(t)], lin_point1)

"lin_model1a:=[[[`State Space`],[continuous],[`1 output(s); 1 input(s); 2 state(s)`],[inputvariable=[u[1](t)]],[outputvariable=[y[1](t)]],[statevariable=[x[1](t),x[2](t)]]],[[x[1]([t])=x[1]([t])-1.499999998,x[2]([t])=x[2]([t])+2.000000011]],[[u[1]([t])=u([t])+0.500000002312923]],[[y[1]([t])=y([t])+0.5000000130]]"

(1.4)

PrintSystem(lin_model1a[1])

"[[[`State Space`],[continuous],[`1 output(s); 1 input(s); 2 state(s)`],[inputvariable=[u[1](t)]],[outputvariable=[y[1](t)]],[statevariable=[x[1](t),x[2](t)]],[a=[[[0,-4.000000021],[1,0]]]],[b=[[[0],[1]]]],[c=[[[1,1]]]],[d=[[[0]]]]]"

(1.5)

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

lin_model1b := Linearize(sys1, [u(t)], [y(t)], lin_point1, 'equilibriumtolerance' = 1.*10^(-10))

Warning, linpoint is not an equilibrium point

 

"lin_model1b:=[[[`Diff. Equation`],[continuous],[`1 output(s); 1 input(s)`],[inputvariable=[u[1](t)]],[outputvariable=[y[1](t)]]],[[x[1]([t])=x[1]([t]),x[2]([t])=x[2]([t])]],[[u[1]([t])=u([t])]],[[y[1]([t])=y([t])]]"

(1.6)

PrintSystem(lin_model1b[1])

"[[[`Diff. Equation`],[continuous],[`1 output(s); 1 input(s)`],[inputvariable=[u[1](t)]],[outputvariable=[y[1](t)]],[de={[[[(x[1])(t)=-8.000000042-4.000000021 x[2](t),],[  (x[2])(t)=x[1](t)-1+u[1](t),],[  y[1](t)=x[1](t)+x[2](t)]]]]]"

(1.7)

Disable the checkpoint option for the same setting of the tolerance

lin_model1c := Linearize(sys1, [u(t)], [y(t)], lin_point1, 'equilibriumtolerance' = 1.*10^(-10), 'checkpoint' = false)

"lin_model1c:=[[[`State Space`],[continuous],[`1 output(s); 1 input(s); 2 state(s)`],[inputvariable=[u[1](t)]],[outputvariable=[y[1](t)]],[statevariable=[x[1](t),x[2](t)]]],[[x[1]([t])=x[1]([t])-1.499999998,x[2]([t])=x[2]([t])+2.]],[[u[1]([t])=u([t])+0.499999998]],[[y[1]([t])=y([t])+0.500000002]]"

(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
    ];

 

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)

eq_point2 := EquilibriumPoint(sys2, [u(t)], functions = [user_function], initialpoint = [x[1](t) = 1, x[2](t) = 1, u(t) = 1])

eq_point2 := [x[1](t) = .853420831346895, x[2](t) = .687832129312234], [diff(x[1](t), `$`(t, 2)) = 0.243748043970982e-8, diff(x[1](t), t) = 0., diff(x[2](t), t) = -0.114152598484907e-8], [u(t) = 1.07055911392119], [y(t) = -.185310333631790]

(1.10)

lin_point2 := [op(eq_point2[1]), op(eq_point2[3])]

lin_point2 := [x[1](t) = .853420831346895, x[2](t) = .687832129312234, u(t) = 1.07055911392119]

(1.11)

lin_model2a := Linearize(sys2, [u(t)], [y(t)], lin_point2, functions = [user_function])

"lin_model2a:=[[[`State Space`],[continuous],[`1 output(s); 1 input(s); 3 state(s)`],[inputvariable=[u[1](t)]],[outputvariable=[y[1](t)]],[statevariable=[x[1](t),x[2](t),x[3](t)]]],[[x[1]([t])=x[1]([t])-0.8534208313,x[2]([t])=diff(x[1]([t])),x[3]([t])=x[2]([t])-0.6878321293]],[[u[1]([t])=u([t])-1.07055911392119]],[[y[1]([t])=y([t])+0.1853103334]]"

(1.12)

PrintSystem(lin_model2a[1])

"[[[`State Space`],[continuous],[`1 output(s); 1 input(s); 3 state(s)`],[inputvariable=[u[1](t)]],[outputvariable=[y[1](t)]],[statevariable=[x[1](t),x[2](t),x[3](t)]],[a=[[[0,1,0],[-3.88404789416651974,0,-0.184251562819176457],[-0.5192123250,0,0]]]],[b=[[[0],[3.07921630860619411],[6.405315917]]]],[c=[[[0.636282549078812876,0,0]]]],[d=[[[-0.8534208313]]]]]"

(1.13)

Example of the statevariable, inputvariable, and outputvariable options

lin_model2b := Linearize(sys2, [u(t)], [y(t)], lin_point2, functions = [user_function], statevariable = XX, inputvariable = UU, outputvariable = YY)

"lin_model2b:=[[[`State Space`],[continuous],[`1 output(s); 1 input(s); 3 state(s)`],[inputvariable=[UU[1](t)]],[outputvariable=[YY[1](t)]],[statevariable=[XX[1](t),XX[2](t),XX[3](t)]]],[[XX[1]([t])=x[1]([t])-0.8534208313,XX[2]([t])=diff(x[1]([t])),XX[3]([t])=x[2]([t])-0.6878321293]],[[UU[1]([t])=u([t])-1.07055911392119]],[[YY[1]([t])=y([t])+0.1853103334]]"

(1.14)

PrintSystem(lin_model2b[1])

"[[[`State Space`],[continuous],[`1 output(s); 1 input(s); 3 state(s)`],[inputvariable=[UU[1](t)]],[outputvariable=[YY[1](t)]],[statevariable=[XX[1](t),XX[2](t),XX[3](t)]],[a=[[[0,1,0],[-3.88404789416651974,0,-0.184251562819176457],[-0.5192123250,0,0]]]],[b=[[[0],[3.07921630860619411],[6.405315917]]]],[c=[[[0.636282549078812876,0,0]]]],[d=[[[-0.8534208313]]]]]"

(1.15)

Example 3: Inverted pendulum on a moving cart

Variables

`#mi("&theta;")`(t)

counter-clockwise angular displacement of the pendulum from the upright position

`#mi("&phi;")`(t)

angular velocity of the pendulum, `#mi("&phi;")`(t) = diff(`#mi("&theta;")`(t), t)

x(t)

position of the cart

y(t)

velocity of the cart, y(t) = diff(x(t), t)

u(t)

horizontal force applied to the cart

 

Parameters

L

half-length of pendulum

m

mass of the pendulum

M

mass of the cart

g

gravitational constant (9.8 m/s^2)

 

sys3 := [diff(x(t), t) = y(t), diff(theta(t), t) = phi(t), diff(y(t), t) = -(-3*cos(theta(t))*sin(theta(t))*g-2*u(t)+2*m*L*sin(theta(t))*phi(t)^2)/(-3*cos(theta(t))*m+2*M+2*m), diff(phi(t), t) = -(3*(-sin(theta(t))*g*M-sin(theta(t))*g*m-m*u(t)+m^2*L*sin(theta(t))*phi(t)^2))/((-3*cos(theta(t))*m+2*M+2*m)*m*L)]

sys3 := [diff(x(t), t) = y(t), diff(theta(t), t) = phi(t), diff(y(t), t) = -(-3*cos(theta(t))*sin(theta(t))*g-2*u(t)+2*m*L*sin(theta(t))*phi(t)^2)/(-3*cos(theta(t))*m+2*M+2*m), diff(phi(t), t) = -3*(-sin(theta(t))*g*M-sin(theta(t))*g*m-m*u(t)+m^2*L*sin(theta(t))*phi(t)^2)/((-3*cos(theta(t))*m+2*M+2*m)*m*L)]

(1.16)

Linearization point is given by:

lin_point3 := [phi(t) = 0, x(t) = 0, y(t) = 0, theta(t) = 0, u(t) = 0]

lin_point3 := [phi(t) = 0, x(t) = 0, y(t) = 0, theta(t) = 0, u(t) = 0]

(1.17)

lin_model3 := Linearize(sys3, [u(t)], [phi(t), x(t), y(t), theta(t)], lin_point3)

"lin_model3:=[[[`State Space`],[continuous],[`4 output(s); 1 input(s); 4 state(s)`],[inputvariable=[u[1](t)]],[outputvariable=[y[1](t),y[2](t),y[3](t),y[4](t)]],[statevariable=[x[1](t),x[2](t),x[3](t),x[4](t)]]],[[x[1]([t])=phi([t]),x[2]([t])=theta([t]),x[3]([t])=x([t]),x[4]([t])=y([t])]],[[u[1]([t])=u([t])]],[[y[1]([t])=phi([t]),y[2]([t])=theta([t]),y[3]([t])=x([t]),y[4]([t])=y([t])]]"

(1.18)

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

PrintSystem(lin_model3[1])

"[[[`State Space`],[continuous],[`4 output(s); 1 input(s); 4 state(s)`],[inputvariable=[u[1](t)]],[outputvariable=[y[1](t),y[2](t),y[3](t),y[4](t)]],[statevariable=[x[1](t),x[2](t),x[3](t),x[4](t)]],[a=[[[0,-(3. (-g M-g m))/((-m+2. M) m L),0,0],[1,0,0,0],[0,0,0,1],[0,(3. g)/(-m+2. M),0,0]]]],[b=[[[3./((-m+2. M) L)],[0],[0],[2./(-m+2. M)]]]],[c=[[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]]],[d=[[[0],[0],[0],[0]]]]]"

(1.19)

 

``


Download linearize.mw


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))};

{diff(A(x, t), t) = exp(-2*x*b)*(Y(x, t)-A(x, t)), diff(diff(Y(x, t), x), x) = exp(-2*x*b)*(A(x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*_c[2]^4*b^2-(1/9)*_c[2]^5)*(exp(x*b))^2+I*_c[2]^(7/2)*b-(1/9)*_c[2]^4+(22/9)*_c[2]^3*b^2+(32/9)*b^4*_c[2]^2)*_C1*(exp(2*x*b))^2*hypergeom([(1/2)*(I*_c[2]^(1/2)+6*b)/b, (1/2)*(I*_c[2]^(1/2)+6*b)/b], [(I*_c[2]^(1/2)+3*b)/b], -_c[2]*exp(2*x*b))-(16/9)*_C2*(-(1/4)*(_c[2]*(exp(x*b))^2+1)*(b^2+_c[2])*exp(-2*x*b)+I*_c[2]^(5/2)*(exp(x*b))^2*b+I*_c[2]^(3/2)*(exp(x*b))^2*b^3-(b^2+_c[2])*_c[2]*(-1/4+(b^2-(1/4)*_c[2])*(exp(x*b))^2))*hypergeom([-(1/2)*(I*_c[2]^(1/2)-2*b)/b, -(1/2)*(I*_c[2]^(1/2)-2*b)/b], [(b-I*_c[2]^(1/2))/b], -_c[2]*exp(2*x*b))+(16/9)*(exp(I*_c[2]^(1/2)*x))^2*_C1*((1/4)*(_c[2]*(exp(x*b))^2+1)*(b^2+_c[2])*exp(-2*x*b)+I*_c[2]^(5/2)*(exp(x*b))^2*b+I*_c[2]^(3/2)*(exp(x*b))^2*b^3+(b^2+_c[2])*_c[2]*(-1/4+(b^2-(1/4)*_c[2])*(exp(x*b))^2))*hypergeom([(1/2)*(2*b+I*_c[2]^(1/2))/b, (1/2)*(2*b+I*_c[2]^(1/2))/b], [(b+I*_c[2]^(1/2))/b], -_c[2]*exp(2*x*b)))/(exp(I*_c[2]^(1/2)*x)*(b+I*_c[2]^(1/2))*(I*_c[2]^(1/2)-b)*exp(-2*x*b)), Y(x, t) = _C3*exp(_c[2]*t)*_C1*hypergeom([(1/2)*(2*b+I*_c[2]^(1/2))/b, (1/2)*(2*b+I*_c[2]^(1/2))/b], [(b+I*_c[2]^(1/2))/b], -_c[2]*exp(2*x*b))*_c[2]*exp(I*_c[2]^(1/2)*x)*(exp(x*b))^2+_C3*exp(_c[2]*t)*_C2*hypergeom([-(1/2)*(I*_c[2]^(1/2)-2*b)/b, -(1/2)*(I*_c[2]^(1/2)-2*b)/b], [-(I*_c[2]^(1/2)-b)/b], -_c[2]*exp(2*x*b))*_c[2]*(exp(x*b))^2/exp(I*_c[2]^(1/2)*x)+_C3*exp(_c[2]*t)*_C1*hypergeom([(1/2)*(2*b+I*_c[2]^(1/2))/b, (1/2)*(2*b+I*_c[2]^(1/2))/b], [(b+I*_c[2]^(1/2))/b], -_c[2]*exp(2*x*b))*exp(I*_c[2]^(1/2)*x)+_C3*exp(_c[2]*t)*_C2*hypergeom([-(1/2)*(I*_c[2]^(1/2)-2*b)/b, -(1/2)*(I*_c[2]^(1/2)-2*b)/b], [-(I*_c[2]^(1/2)-b)/b], -_c[2]*exp(2*x*b))/exp(I*_c[2]^(1/2)*x)}

(2)

PDEtools[build](op(ans));

A(x, t) = -(9/4)*_C3*exp(_c[2]*t)*((8/3)*(((2/3)*I)*b*((exp(x*b))^2*b^2+1)*_c[2]^(5/2)+((2/3)*I)*_c[2]^(3/2)*b^3+(I*_c[2]^(7/2)*b-2*b^4*_c[2]^2-(3/2)*_c[2]^3*b^2+(1/6)*_c[2]^4)*(exp(x*b))^2-(2/3)*(b^2-(1/4)*_c[2])*(b^2+_c[2])*_c[2])*_C2*exp(2*x*b)*hypergeom([(1/2)*(-I*_c[2]^(1/2)+4*b)/b, (1/2)*(-I*_c[2]^(1/2)+4*b)/b], [(2*b-I*_c[2]^(1/2))/b], -_c[2]*exp(2*x*b))-_C2*((I*_c[2]^(9/2)*b-(32/9)*b^4*_c[2]^3-(22/9)*_c[2]^4*b^2+(1/9)*_c[2]^5)*(exp(x*b))^2+I*_c[2]^(7/2)*b-(32/9)*b^4*_c[2]^2-(22/9)*_c[2]^3*b^2+(1/9)*_c[2]^4)*(exp(2*x*b))^2*hypergeom([(1/2)*(-I*_c[2]^(1/2)+6*b)/b, (1/2)*(-I*_c[2]^(1/2)+6*b)/b], [(-I*_c[2]^(1/2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2]^(3/2)*(exp(x*b))^2*b^3+(b^2+_c[2])*_c[2]*(-1/4+(b^2-(1/4)*_c[2])*(exp(x*b))^2))*hypergeom([(1/2)*(2*b+I*_c[2]^(1/2))/b, (1/2)*(2*b+I*_c[2]^(1/2))/b], [(b+I*_c[2]^(1/2))/b], -_c[2]*exp(2*x*b)))/(exp(I*_c[2]^(1/2)*x)*(b+I*_c[2]^(1/2))*(I*_c[2]^(1/2)-b)*exp(-2*x*b))

(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))};

{A(x, t) = (diff(diff(Y(x, t), x), x))/exp(-2*x*b)+Y(x, t), Y(x, t) = (diff(A(x, t), t))/exp(-2*x*b)+A(x, t)}

(4)

ibc:={A(x, 0) = 0, Y(0, t) = 0.1, D[1](Y)(0, t) =0};

{A(x, 0) = 0, Y(0, t) = .1, (D[1](Y))(0, t) = 0}

(5)

 

Y(x,t):=(rhs(op(2,SYS)));

(diff(A(x, t), t))/exp(-1.0*x)+A(x, t)

(6)

PDE:=diff(Y(x, t), x$2) = exp(-2*x*b)*(A(x, t)-Y(x, t));pdsolve(PDE);PDEtools[build](op(%));

(diff(diff(diff(A(x, t), t), x), x))/exp(-1.0*x)+2.0*(diff(diff(A(x, t), t), x))/exp(-1.0*x)+1.00*(diff(A(x, t), t))/exp(-1.0*x)+diff(diff(A(x, t), x), x) = -(diff(A(x, t), t))

 

PDESolStruc(A(x, t) = _F1(x)*_F2(t), [{diff(_F2(t), t) = _c[2]*_F2(t), diff(diff(_F1(x), x), x) = (-2.0*(diff(_F1(x), x))*exp(1.0*x)-1.00*_F1(x)*exp(1.0*x)-1.*_F1(x))*_c[2]/(1+exp(1.0*x)*_c[2])}])

 

A(x, t) = _F1(x)*_F2(t)

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

 

 

 


Download pdsolve.mw

 

restart; with(Tolerances); ALL := [`$`(1 .. 3)]; solution_k := simplify(solve(map(proc (i) options operator, arrow; 1/k[i] = (cos(Phi)*(x[i]-Tx)+sin(Phi)*(y[i]-Ty))/(-sin(Phi)*(x[i]-Tx)+cos(Phi)*(y[i]-Ty)) end proc, ALL), [Tx, Ty, Phi]), size); assign(solution_k); k := map(proc (i) options operator, arrow; tan(phi[i]) end proc, ALL); deg2rad := Tolerances:-`*`(Pi, Tolerances:-`^`(180, Tolerances:-`-`(1))); phi0[1] := Tolerances:-`*`(Pi, Tolerances:-`^`(3, Tolerances:-`-`(1))); phi0[2] := Pi; phi0[3] := Tolerances:-`-`(Tolerances:-`*`(Pi, Tolerances:-`^`(3, Tolerances:-`-`(1)))); alpha := Tolerances:-`*`(Pi, Tolerances:-`^`(10, Tolerances:-`-`(1))); L := 1; phi := phi0; x := map(proc (i) options operator, arrow; cos(phi0[i]+alpha)*L end proc, ALL); y := map(proc (i) options operator, arrow; sin(phi0[i]+alpha)*L end proc, ALL); angleError := Tolerances:-`&+-`(0, Tolerances:-`^`(10, -4)); locError := Tolerances:-`&+-`(0, Tolerances:-`^`(10, -4)); phi := map(proc (i) options operator, arrow; phi[i]+angleError end proc, ALL); x := map(proc (i) options operator, arrow; x[i]+locError end proc, ALL); y := map(proc (i) options operator, arrow; y[i]+locError end proc, ALL); evalr(Phi)

`&plusmn;`(.314, 0.401e-3)

 

NominalValue(%);

(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

 

ToleranceValue(`%%%`);

(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

 

``


Download evalr.mw


restart:

B[t+1]:=B[t]+X[t,t+1]-D[t,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));

(m+1)/(m*(sum(X[t-i, t+1-i], i = 1 .. m-1)))

(2)

 


Download sum.mw

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));

 

 

diff(diff(diff(diff(psi(y), y), y), y), y)-M*(diff(diff(psi(y), y), y))-Gr*b*y = 0

 

psi(0) = 0, ((D@@2)(psi))(0) = 0, psi(h) = -(1/2)*F, (D(psi))(h) = A

 

psi(y) = -((1/6)*Gr*b*y^3-exp(M^(1/2)*y)*_C2-exp(-M^(1/2)*y)*_C1)/M+_C3*y+_C4

(1)

res2:=(dsolve({Eq1,bcs1},psi(y)));

psi(y) = -((1/6)*Gr*b*y^3-(1/6)*exp(M^(1/2)*y)*(2*Gr*b*h^3+6*A*M*h+3*F*M)/(exp(M^(1/2)*h)*M^(1/2)*h+exp(-M^(1/2)*h)*M^(1/2)*h-exp(M^(1/2)*h)+exp(-M^(1/2)*h))+(1/6)*exp(-M^(1/2)*y)*(2*Gr*b*h^3+6*A*M*h+3*F*M)/(exp(M^(1/2)*h)*M^(1/2)*h+exp(-M^(1/2)*h)*M^(1/2)*h-exp(M^(1/2)*h)+exp(-M^(1/2)*h)))/M-(1/6)*(-Gr*exp(M^(1/2)*h)*M^(1/2)*b*h^3-Gr*exp(-M^(1/2)*h)*M^(1/2)*b*h^3+3*Gr*exp(M^(1/2)*h)*b*h^2-3*Gr*exp(-M^(1/2)*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)+exp(-M^(1/2)*h))

 

-(1/6)*(-Gr*exp(M^(1/2)*h)*M^(1/2)*b*h^3-Gr*exp(-M^(1/2)*h)*M^(1/2)*b*h^3+3*Gr*exp(M^(1/2)*h)*b*h^2-3*Gr*exp(-M^(1/2)*h)*b*h^2+3*F*M^(3/2)*exp(M^(1/2)*h)+3*F*M^(3/2)*exp(-M^(1/2)*h)+6*A*M*exp(M^(1/2)*h)-6*A*M*exp(-M^(1/2)*h))/(M*(exp(M^(1/2)*h)*M^(1/2)*h+exp(-M^(1/2)*h)*M^(1/2)*h-exp(M^(1/2)*h)+exp(-M^(1/2)*h)))

 

0

(5)

 



Download maple_(3).mw

 

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;

 

[animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot]

 

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); plots:-display(pp, pic) end proc

 

proc (x) options operator, arrow; sin(x)-cos(2*x)+.2 end proc

 

0

 

6

(1)

 


Download correct.mw

please read this article or i copy some of it here :
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)

To return to the defaults, go back to:

Format -> Manage Style Sets

and select “Default Maple Style Set”.

good luck!

one of many way is this :


restart:n:=5;# number of arguments#

5

(1)

f:=Sum((a[i])*x^i,i=0..n);

Sum(a[i]*x^i, i = 0 .. 5)

(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));

a[0]+1.3*x+5.73*x^2+7*x^3+9*x^4+11*x^5

(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);

x^2+2*x+3

(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

Download value.mw

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 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);

diff(u(x, t), t) = diff(diff(u(x, t), x), x)

(1)

BCs:={u(0,t)=0, u(Pi/4,t)=0 , u(x,0)=x*(Pi/4-x)};

{u(0, t) = 0, u(x, 0) = x*((1/4)*Pi-x), u((1/4)*Pi, t) = 0}

(2)

 

ans:=pdsolve(PDE, HINT = h(x)*g(t));

PDESolStruc(u(x, t) = h(x)*g(t), [{diff(diff(h(x), x), x) = _c[1]*h(x), diff(g(t), t) = _c[1]*g(t)}])

(3)

PDEtools:-build(ans);

u(x, t) = exp(_c[1]^(1/2)*x)*_C1*exp(_c[1]*t)*_C2+_C1*exp(_c[1]*t)*_C3/exp(_c[1]^(1/2)*x)

(4)

NULL

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):``NULLp5 := pds:-plot(t = 2):plots[display]({p1, p2, p3, p4, p5});

 

 

PDEtools:-Laplace(PDE,u(x,t));

``

NULL

``


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

Download pde_(2).mw

 

 

 

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)<S then;
print("the triangle is acute");
elif Max(args)=S then;
print("the triangle is right");
else;
print("the triangle is obtuse");
end if;
end proc:

triangle(3,5,10);triangle(3,5,4);

 

 

(1)

 

 

 

 

 

 two_procedures.mw


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);

Matrix(%id = 18446744073932440990)

Matrix(%id = 18446744073932442670)

Matrix(%id = 18446744073936503742)

Matrix(%id = 18446744073936503982)

Vector[row](%id = 18446744073936504342)

Vector[row](%id = 18446744073936504462)

Vector[row](%id = 18446744073936504582)

Vector[row](%id = 18446744073936504702)

Vector[row](%id = 18446744073936506878)

(1)

J:=X.E.Transpose(X)+U.E.Transpose(U);

a[1]^2+(1/2)*a[2]^2+(1/2)*a[3]^2+(1/2)*a[4]^2+(1/2)*a[5]^2+b[1]^2+(1/2)*b[2]^2+(1/2)*b[3]^2+(1/2)*b[4]^2+(1/2)*b[5]^2

(2)

indets(J); indets(C)

{a[1], a[2], a[3], a[4], a[5], b[1], b[2], b[3], b[4], b[5]}

{a[1], a[2], a[3], a[4], a[5], b[1], b[2], b[3], b[4], b[5]}

(3)

Minimize(J,{seq(C[i]=0,i=1..nops(C))});






[1.52587355672056, [a[1] = HFloat(1.1444051675404217), a[2] = HFloat(0.07357433784470904), a[3] = HFloat(0.019083716254587775), a[4] = HFloat(-0.23114059939913092), a[5] = HFloat(-0.11990652561630644), b[1] = HFloat(-0.3814683891801405), b[2] = HFloat(0.0), b[3] = HFloat(-8.695843524419988e-16), b[4] = HFloat(-0.23114059939913095), b[5] = HFloat(-0.1199065256163064)]]

(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"):

 

 

 

 

 


Download solved.mws

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]);

Z := Matrix(5, 5, {(1, 1) = 1., (1, 2) = 0., (1, 3) = 0., (1, 4) = 0., (1, 5) = 0., (2, 1) = 0., (2, 2) = 0., (2, 3) = 0., (2, 4) = 0., (2, 5) = 0., (3, 1) = 0., (3, 2) = 0., (3, 3) = 0., (3, 4) = 0., (3, 5) = 0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = 0., (4, 5) = 0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = 0., (5, 5) = 0.})

(1)

Dtau00 := `<,>`(1); Dtau01 := Vector[row](r); Dtau02 := Vector[row](r); Dtau10 := Vector(r); Dtau20 := Vector(r);

 

Dtau00 := Vector(1, {(1) = 1})

 

Dtau01 := Vector[row](2, {(1) = 0, (2) = 0})

 

Dtau02 := Vector[row](2, {(1) = 0, (2) = 0})

 

Dtau10 := Vector(2, {(1) = 0, (2) = 0})

 

Dtau20 := Vector(2, {(1) = 0, (2) = 0})

(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 > ;

Dtau := Matrix(1, 5, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0}), Matrix(2, 5, {(1, 1) = 0, (1, 2) = 1., (1, 3) = 0, (1, 4) = 0., (1, 5) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1., (2, 4) = 0, (2, 5) = 0.}), Matrix(2, 5, {(1, 1) = 0, (1, 2) = -0., (1, 3) = -0., (1, 4) = 1., (1, 5) = 0, (2, 1) = 0, (2, 2) = -0., (2, 3) = -0., (2, 4) = 0, (2, 5) = 1.})

(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 > ;

P := Matrix(1, 5, {(1, 1) = 1/2, (1, 2) = 0, (1, 3) = 0, (1, 4) = -.318309886100000, (1, 5) = -.159154943000000}), Matrix(2, 5, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = .1591549430, (1, 5) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0.7957747152e-1}), Matrix(2, 5, {(1, 1) = .1591549430, (1, 2) = -.159154943000000, (1, 3) = 0., (1, 4) = 0, (1, 5) = 0, (2, 1) = 0.7957747152e-1, (2, 2) = 0., (2, 3) = -0.795774715200000e-1, (2, 4) = 0, (2, 5) = 0})

(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 := Vector(5, {(1) = 1, (2) = 1/2, (3) = 1/2, (4) = 1/2, (5) = 1/2})

 

E := Matrix(5, 5, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 1/2, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1/2, (3, 4) = 0, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1/2, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 1/2})

 

X := Vector[row](5, {(1) = a[1], (2) = a[2], (3) = a[3], (4) = a[4], (5) = a[5]})

 

U := Vector[row](5, {(1) = b[1], (2) = b[2], (3) = b[3], (4) = b[4], (5) = b[5]})

 

X0 := Vector[row](5, {(1) = 1, (2) = 0, (3) = 0, (4) = 0, (5) = 0})

 

G := Vector[row](5, {(1) = 1, (2) = 0, (3) = 0, (4) = 0, (5) = 0})

(5)

J := X.E.Transpose(X)+U.E.Transpose(U);

Minimize(J, {C = 0});

 


Download problem.mw

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);

 

diff(A(t), t)

(1)

A(t)=((Int(d,t)));

A(t) = Int(diff(A(t), t), 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 !

Download diff.mw

Hi sir,please refer to these links, hope it helps you . good luck Sir.

http://www.mapleprimes.com/questions/150659-How-To-Plot-With-The-Results-Of-Desolve-Command

http://www.mapleprimes.com/questions/201243-Solution-Of-System-Of-Nonlinear-ODEs#answer204818

good luck!

5 6 7 8 9 Page 7 of 9