Kitonum

21475 Reputation

26 Badges

17 years, 52 days

MaplePrimes Activity


These are answers submitted by Kitonum

A cylinder can be regarded as the result of parallel translation of a circle:

plots[animate](plot3d,[[r*cos(phi), r*sin(phi), L], phi = 0 .. 2*Pi, r = 0 .. 3, filled = true, axes = normal, style = surface, view = [-4.7 .. 4.7, -4.7 .. 4.7, -2.7 .. 13.7], lightmodel = light4, numpoints=10000], L=0..12, frames=50);

 

 

plot3d([r*cos(phi), r*sin(phi), 12], phi = 0 .. 2*Pi, r = 0 .. 3, filled = true, axes = normal, style = surface, view = [-4.7 .. 4.7, -4.7 .. 4.7, -2.7 .. 13.7], lightmodel = light4);

 

 

 

 

Your integral can be easy calculated  numerically, if you set values  ​​n  and  h .

Example:

restart;

eta:=1000: B:=2.5: n:=1: h:=10:

evalf(Int(B*eta^(-B)*t^(B-1)*exp(-(t/eta)^B)*(t-n*h), t = n .. (n+1)*h));

                                          0.0002427195843

The global minimum is obvious without any calculation  f(0,0)=0. Initial point for finding the global maximum is easy to find from the graph:

plot3d(x^2 + y^2 + 25*(sin(x)^2+sin(y)^2), x=-2*Pi .. 2*Pi , y= -2*Pi .. 2*Pi, numpoints=3000);

Optimization[Maximize](x^2 + y^2 + 25*(sin(x)^2+sin(y)^2), initialpoint = {x =5, y=5});

                     [96.2898370467124068, [x = 4.91441834836532454, y = 4.91441834836532454]]

 

 Addition. The problem can be solved without any plots with  DirectSearch package:

DirectSearch[GlobalOptima](x^2 + y^2 + 25*(sin(x)^2+sin(y)^2), {x>=-2*Pi, x<=2*Pi , y>=-2*Pi,y<=2*Pi},maximize);

                           [96.2898370467124, [x = 4.9144183478452, y = -4.9144183485987], 347]

 

This package is available for free download link  http://www.maplesoft.com/applications/view.aspx?SID=101333

 

f:=piecewise(x>0 and x<1,x^2+1, x>1 and x<2,x-x^2, x>2 and x<3,x+1-x^2);

plot(f, x=0..3, discont);

 

 

Your functions  b[n,m]  is easy to construct by a double loop. Procedure  HybrFunc  solves this problem. Functions  b[n,m]  can be called by their names (b - global variable) or as array elements. You have not written what values variable  tj  takes , so I just specify it how procedure argument.

restart;

HybrFunc:=proc(N, M, tj)

local T, n, m;

global b;

for n to N do

for m from 0 to M-1 do

T[m]:=t->t^m;

b[n,m]:=unapply(piecewise(t>=(n-1)*tj/N and t<n*tj/N, T[m](N*t-(n-1)*tj), 0), t);

od; od;

Array(1..N, 0..M-1, (n,m)->b[n,m](t));

end proc:

 

Example:

HybrFunc(3, 4, 10)[3,1];

b[3,2](t);

 

 

restart;

sort(x+y+z, [x, y, z], ascending);

                     z+y+x

restart: 

Mf(x):=piecewise(x<=L/2,1/2*x*F,x>1/2*L,1/2*x*F-F*(x-1/2*L)): 

eq[1]:=Mf(xi)*F*L=Mf(x): 

Mf(xi):=simplify(convert(solve(eq[1],Mf(xi)), piecewise,x)); 

Mf(xi):=subs(x=xi*L,Mf(xi)); 

Mf(xi):=simplify(Mf(xi)) assuming F>0, L>0;

 

plot(x^2, x=-1..2, tickmarks=[0,0]);

 

 

f := int((A*sin(omega*t+phi)-B*sin(omega*t))^2, t):

g := int((A*sin(omega*t)*cos(phi)+A*cos(omega*t)*sin(phi)-B*sin(omega*t))^2, t):

delta=simplify(expand(f)-expand(g));  # Difference between f and g 

 

We see that the difference between  f  and   does not depend on  t, so there is no contradiction.

ex := taylor(exp(x), x = 0, 5);

eval(ex, x=1);

subs(x=1, convert(ex, polynom));

A:=Matrix(3,2, symbol=a):

B:=Matrix(2,3, symbol=b):

C:=Matrix([[8, 2, -2], [2, 5, 4], [-2, 4, 5]]):

simplify(B.A, {seq(seq((A.B)[i,j]=C[i,j], j=1..3), i=1..3)});

 

 

mahmood180, I tried to upload your file, but the 404 error appeared.

Look at my solution:

restart;

SpecialMatrix := proc (A::list)

local r, a, b, A1, A2, a1, a2; 

r := (1/2)*nops(A)-1/2;

assign(seq(a[i-1] = A[i], i = 1 .. r+1), seq(b[i] = A[r+1+i], i = 1 .. r));

A1[1, 1] := Matrix(1, {(1, 1) = 2*a[0]});

A1[1, 2] := Matrix([[seq(a[i], i = 1 .. r)]]);

A1[1, 3] := Matrix([[seq(b[i], i = 1 .. r)]]); A1[2, 1] := A1[1, 2]^%T;

A1[2, 2] := Matrix(r, {seq(seq((i, j) = a[j-i], j = i+1 .. r), i = 1 .. r-1), seq((i, i) = 2*a[0], i = 1 .. r)}, shape = symmetric);

A1[2, 3] := Matrix(r, {seq(seq((i, j) = b[j-i], j = i+1 .. r), i = 1 .. r-1), seq((i, i) = 0, i = 1 .. r)}, shape = antisymmetric);

A1[3, 1] := A1[1, 3]^%T; A1[3, 2] := -A1[2, 3]; A1[3, 3] := A1[2, 2];

a1 := `<,>`(seq(`<|>`(A1[i, 1], A1[i, 2], A1[i, 3]), i = 1 .. 3)); 

A2[1, 1] := Matrix(1);

A2[1, 2] := A1[1, 2];

A2[1, 3] := A1[1, 3];

A2[2, 1] := Matrix(r, 1);

A2[2, 2] := Matrix(r,{seq(seq((i, j) = a[i+j], j = 1 .. r-i), i = 1 .. r-1)});

A2[2, 3] := Matrix(r,{seq(seq((i, j) = b[i+j], j = 1 .. r-i), i = 1 .. r-1)});

A2[3, 1] := A2[2, 1]; A2[3, 2] := A2[2, 3]; A2[3, 3] := -A2[2, 2];

a2 := `<,>`(seq(`<|>`(A2[i, 1], A2[i, 2], A2[i, 3]), i = 1 .. 3)); 

(1/2)*a1+(1/2)*a2; 

end proc:

 

Example for r=4:

SpecialMatrix([seq(a[i], i = 0 .. 4), seq(a[i]^`&lowast;`, i = 1 .. 4)]);

SymmetricSum:=proc(S::{list,set}, P::list)

local L;

uses combinat;

if nops(S)<>nops(P) then error "Should be nops(S)=nops(P)" fi;

L:=permute(P);

add(mul(S[i]^l[i], i=1..nops(S)), l=L);

end proc;

 

CyclicSum:=proc(S::list, P::list)

local n, L0, L;

if nops(S)<>nops(P) then error "Should be nops(S)=nops(P)" fi;

n:=nops(P);

L0:=[op(P),op(P)]; L:=[seq([seq(L0[i+j], j=0..n-1)],i=1..n)];

add(mul(S[i]^l[i], i=1..nops(S)), l=L);

end proc:

 

Examples:

SymmetricSum([x,y,z], [2,3,5]);

CyclicSum([x,y,z,u], [2,3,4,5]);

 

 

Formal parameters:  L - the list of your functions  psi ,  m - a symbol or a number,  M - a positive integer.

 

MMatrix := proc (L::list, m, M::posint)

Matrix(M, [seq([seq(L[i]((1/2)*(2*j-1)/m), j = 1 .. M)], i = 1 .. M)]);

end proc:

 

Example:

MMatrix([seq(psi[1, i], i = 0 .. 4)], 10, 5);

 

Of course instead of arbitrary functions psi, you can write as the entries of the list L your specific functions.

 

First 242 243 244 245 246 247 248 Last Page 244 of 290