Kitonum

20469 Reputation

26 Badges

16 years, 65 days

MaplePrimes Activity


These are answers submitted by Kitonum

The function

x->2*a/Pi*arcsin(sin(2*Pi*x/b))

gives a triangular signal between -a and a with the period b .

An example:

a:=1: b:=4:

plot(2*a/Pi*arcsin(sin(2*Pi*x/b)), x=0..8, thickness=2, scaling=constrained);

 

Dr:=[[1,5],[2,6],[3,4],[4,5],[5,7],[6,8],[7,4],[8,6],[9,5],[10,7]]:

Y:=proc(i) Dr[i,2] end; ty:=proc(i) Dr[i,1] end;

P[X](omega)=(1/2)*{(Sum('Y'(j)*cos(omega*('ty'(j)-1/(2*omega*tan((Sum(sin(2*omega*'ty'(j)),j=1..N[0]))/(Sum(cos(2*omega*'ty'(j)),j=1..N[0]))))))^2,j=1..N[0]))/(Sum(cos(omega*('ty'(j)-1/(2*omega*tan((Sum(sin(2*omega*'ty'(j)),j = 1..N[0]))/(Sum(cos(2*omega*'ty'(j)),j=1..N[0]))))))^2,j= 1..N[0]))+(Sum('Y'(j)*sin(omega*('ty'(j)-1/(2*omega*tan((Sum(sin(2*omega*'ty'(j)),j=1..N[0]))/(Sum(cos(2*omega*'ty'(j)),j=1..N[0]))))))^2,j=1..N[0]))/(Sum(sin(omega*('ty'(j)-1/(2*omega*tan((Sum(sin(2*omega*'ty'(j)),j=1..N[0]))/(Sum(cos(2*omega*'ty'(j)),j =1 .. N[0]))))))^2,j=1..N[0]))};

Walk1 := proc(n)

local pick, i,j,edge,step,L,a, A, B, C, E;   

pick := rand(0..1);    (i,j) := (0,0);  L:=[[0,0]];  edge := n/2;   

for step do a:=pick();       

if a=0 then i := i + 2*pick()-1; L:=[op(L), [i,j]]; fi;       

if a=1 then j := j + 2*pick()-1; L:=[op(L),[i,j]]; fi;       

if edge < abs(i) or edge < abs(j) then  print(step); break;       

end if; end do;

print(L);

A:=plot([seq([t, i, t=-n/2..n/2],i=-n/2..n/2), seq([i, t, t=-n/2..n/2],i=-n/2..n/2)], color=black);

B:=seq(plottools[disk](L[i],0.1, color=red), i=1..nops(L));

E:=seq(plottools[curve]([seq(L[k],k=1..i)], color=blue, thickness=5), i=1..nops(L));

C:=seq(plots[display](op([A, B[i], E[i]]))$10, i=1..nops(L));

print(plots[display](seq(C[i],i=1..10*nops(L)),insequence=true,scaling=constrained,view=[-n/2-1..n/2+1, -n/2-1..n/2+1]));

end proc:

 

The procedure returns the number of steps, a list of nodes traversed, and the animation of the random walk.

An example:

Walk1(4);

It is quite simply:

L1:=seq(2*Pi*i/20,i=0..20):

L:=op(evalf([L1]));

K:=op(evalf([seq(-5*sin(L1[i]),i=1..21)]));

For example as follows:

F:=Student[VectorCalculus][Tangent](t -> <t, t^2, t^3>, t = 2):

sort(Student[VectorCalculus][DotProduct]( <F(1)[1]-F(0)[1], F(1)[2]-F(0)[2], F(1)[3]-F(0)[3]>, <x-F(0)[1], y-F(0)[2], z-F(0)[3]> ))=0;

    x + 4y + 12z - 114 = 0

You have a complicated non-linear system of 4 equations with 4 unknowns and three parameters. Maple is usually not solve these systems symbolically. This system can be solved numerically, but it must be given the values ​​of all parameters, such as:

restart;

eq1:=A2*t2*exp(zt*t2*om)*sin(t2*wd)+A3*t3*sin(t3*wd)*exp(zt*t3*om) = 0;

eq2:=A2*t2*exp(zt*t2*om)*cos(t2*wd)+A3*t3*cos(t3*wd)*exp(zt*t3*om) = 0;

eq3:=              A2*exp(zt*t2*om)*sin(t2*wd)+A3*sin(t3*wd)*exp(zt*t3*om) = 0;

eq4:=1-A2-A3+A2*exp(zt*t2*om)*cos(t2*wd)+A3*cos(t3*wd)*exp(zt*t3*om) = 0;

zt:=1/2: wd:=2: om:=3:

s1:=fsolve({eq1,eq2,eq3,eq4},{t2=0..infinity, t3=0..infinity, A2=0..infinity,A3=0..infinity});

Write so:

A:= Matrix(2,2,[-5,2,-3,4]):

B[1] := [1, 1];

A[op(B[1])];

plot3d(x^2+y^2, x = -1 .. 1, y = -sqrt(1-x^2) .. sqrt(1-x^2), style=surfacecontour, contours = 4);

If you wish to withdraw from the assignment of A and B and fully return to the symbolic variables A and B, we can write:

A:='A':  B:='B':

 A;  B;

    A

    B

If you want to use the A or B as symbol variables to refer to, you can write:

'A'=A; 'B'=B;

Usually, Maple does not solve completely these rather complicated non-linear equations, therewith containing a parameter (in your equation, n - parameter). The reason apparently is that Maple can not compute the integrals for any values ​​of the parameter. The problem can be solved if  to specify value of the parameter.

Example:

Eq:=((diff(R(r), r, r, r, r))*r^4+3*(diff(R(r), r))*r-3*(diff(R(r), r, r))*r^2+2*(diff(R(r), r, r, r))*r^3-3*R(r)+4*R(r)*n+2*R(r)*n^2-4*(diff(R(r), r))*r*n+2*(diff(R(r), r))*r*n^2+4*(diff(R(r), r, r))*r^2*n-2*(diff(R(r), r, r))*r^2*n^2-4*R(r)*n^3+R(r)*n^4)/r^4 = (-108-1362*n+2122*n^2+2019*n^3-3032*n^4+401*n^7+1192*n^6-1033*n^5-25*n^9+6*n^10-180*n^8-4128*r^(n+3)*n^3+2304*r^(n+3)*n-576*r^(n+5)*n-760*n^6*r+575*n^5*r-244*n^7*r-2108*n^3*r-11616*r^(n+3)*n^4-5280*r^(n+3)*n^5-456*n^2*r-6912*r^(3*n+3)*n^3+192*r^(n+3)*n^7-6*n^10*r+152*n^8*r+13*n^9*r-192*r^(n+5)*n^7+4224*r^(3*n+3)*n^2-9216*r^(3*n+3)*n^5-16512*r^(3*n+3)*n^4-1632*r^(n+5)*n^6-1536*r^(3*n+3)*n^6-7680*r^(n+5)*n^3-8832*r^(n+5)*n^4-3360*r^(n+5)*n^2-96*r^(n+3)*n^6+2304*r^(3*n+3)*n-5376*r^(n+5)*n^5+2546*n^4*r+4800*r^(n+3)*n^2)/(576*r^4+192*r^4*n^4+1248*r^4*n^3+2688*r^4*n^2+2208*r^4*n):

n:=2: dsolve(Eq, R(r));

algsubs(cos(t)/sin(t)=cot(t), cos(t)*cos(u)/sin(t) - cos(t)^2*cos(u)/sin(t)^2);

Try so:

normal(convert(sin(t)/(1+cos(t)), tan));

After with(geometry):  write assume(a,real): 

Maple does not know that you suspect this condition!

 

Code of procedure:

P := proc (Eq)

local z, u;

z:=rhs(Eq)^(1/op(2,lhs(Eq)));

u := evalc(z);

if is(0 <= Re(u)) and is(0 <= Im(u)) then abs(z)*(cos(argument(u))+I*sin(argument(u))) else abs(z)*(cos(argument(u)+2*Pi*op(2, z))+I*sin(argument(u)+2*Pi*op(2, z)));

end if;

end proc;

 

Example:

P(w^11=-5-5*I);

First 273 274 275 276 277 278 279 Last Page 275 of 283