Kitonum

21835 Reputation

26 Badges

17 years, 221 days

MaplePrimes Activity


These are answers submitted by Kitonum

It can be done as in the Help.

Example:

df := DataFrame( < 1, 2, 3, 4; 5, 6, 7, 8; 9, 10, 11, 12 >, 'rows' = [ 'a', 'b', 'c' ], 'columns' = [ 'A', 'B', 'C', 'D' ] );

df['a'..'b', 'B'..'D'];  # Removed third row and first column

                                

eq2 := -4*A[2]*cos(2*x)-16*A[4]*cos(4*x)-36*A[6]*cos(6*x)-64*A[8]*cos(8*x)+a*A[0]+cos(8*x)*a*A[8]+cos(6*x)*a*A[6]+cos(4*x)*a*A[4]+2*cos(2*x)*q*A[0]+cos(2*x)*a*A[2]+q*A[8]*cos(6*x)+q*A[8]*cos(10*x)+q*A[6]*cos(4*x)+q*A[6]*cos(8*x)+q*A[4]*cos(2*x)+q*A[4]*cos(6*x)+q*A[2]*cos(4*x)+q*A[2]:

select(t->not has(t, cos), eq2);

                                                                      a*A[0]+q*A[2]

Try

simplify(A1^2+B1^2-CC1^2, size);

If I understand correctly, you want to both animations built simultaneously, rather than sequentially. To do this, remove the option  insequence = true . Also the parameters  b  and  J  should be specified in advance.

Example:

b:=1: J:=2:

tau[1] := h-1+(4/3)*(1/sqrt(3)-h+1)*sqrt(3)*(sqrt(3)*((1/4)*J^2-z^2)/(J^2*b));

tau[2] := (4/3)*sqrt(3)*((1/4)*h^2-z^2)/(h^2*b);

plot2 := plots[animate](plot, [tau[1], z = -(1/2)*J .. (1/2)*J, color = red, legend = shear*stress], h = 1 .. 1+1/sqrt(3)):

plot3 := plots[animate](plot, [tau[2], z = -(1/2)*h .. (1/2)*h, color = blue, legend = shear*stress], h = 0 .. 1):

plots[display]([plot2, plot3]);

 

 

 

Should be

factor(x^2-2*a*x+a^2);

                                                     (a - x)^2

 

Addition: In standard interface in 2d math you can do a space between  a  and  x . Maple regards a space between two symbols as a multiplication sign.  ax  in your code is just a new symbol, not  a*x . A space between a number (numeric type) and a symbol you do not necessarily have to do. For example in 2d math,  2a  is the same as 2 a  or  2*a 

V_matrix:=<seq(V[i], i=1..100)>;

You can solve the equation numerically for specific values of parameters and an initial condition.

Example:

eq:=diff(y(x),x) - (Q - x*p0*(exp(alpha-beta*y(x)))/(1+exp(alpha-beta*y(x))))^2=0:
sol:=dsolve({eq, y(0)=0}, numeric, parameters=[Q,p0,alpha,beta] );
sol(parameters=[1,2,3,4]);
plots[odeplot](sol, [x,y(x)], x=0..5);

                                      

 

 Addition. `Series` solution (above) fits only near x=0. Compare: 

restart;
eq:=diff(y(x),x) - (Q - x*p0*(exp(alpha-beta*y(x)))/(1+exp(alpha-beta*y(x))))^2=0:
P:=[Q,p0,alpha,beta]:
sol1:=dsolve({eq,y(0)=0}, numeric, parameters=P):
sol1(parameters=[1,2,3,4]):
dsolve([eq, y(0) = 0], y(x), type = 'series'):
sol2:=convert(%, polynom):
sol2:=eval(rhs(sol2),P=~[1,2,3,4]);

plots[display](plots[odeplot](sol1,[x,y(x)], x=0..5, color=red, legend=`Numerical solution`), plot(sol2, x=0..5, color=blue, legend=`Solution by series`), view=[0..5,-1..1.2]);

        

 

 

 

In  #2  should be

convert~(L, string);

                               ["Norman.Mailer", "Richard.Brautigan"]

Even simplier example:

g:= a -> int(x+a, x=a..2*a):

g(1);   # OK

eval(g(x), x=1);  # The error ( a premature calculation)

eval(g(z), z=1);  # OK

eval('g(x)', x=1);  # OK (a workaround)

V:=Int(x*sqrt(2*x^4+3), x);

value(V);  # The result (a direct calculation)

IntegrationTools[Change](V, u = sqrt(2)*x^2);  # Calculation by a change

value(%);

combine(expand(eval(%, u = sqrt(2)*x^2)));   # The result

                         

 

Int  is an inert form of an integral.

Here is a simple example of the equation with the explicit solution, in which the same error:

dsolve({diff(y(x),x)*(x-1)^2+1=0, y(0)=0});

sol:=dsolve({diff(y(x),x)*(x-1)^2+1=0, y(0)=0}, numeric);

sol(2);

 

 It is obvious that the curve going from point (0,0) can not be continuously extended further right of  x = 1

 

plottools:-getdata  command seems appeared in Maple 15. For older versions instead of  plottools:-getdata(A)[3];  you can write

op([1, 1], A);

First, we find 3 specific points on the surface, then - the equation of the plane through these points, and then we prove that each point of the surface lies on this plane:

restart;

r:=[(u-v)^2, u^2-3*v^2, (1/2)*v*(u-2*v)]:

P1, P2, P3:=seq(eval(r,p), p=[[u=0,v=0],[u=1,v=0],[u=0,v=1]]);

LinearAlgebra[Determinant](Matrix([[x,y,z], P2, P3]))=0;

expand(eval(%,[x,y,z]=~r));

                              

 

 

 

Your system is inconsistent for any  rho<>0 . First we eliminate  rho  from equations 2 and 3 and then solve the system of two equations:

restart;

sys:=[8*g(t)^3*diff(g(t),t$2)+4*(g(t)*diff(g(t),t))^2+1=0,rho=-1/g(t)-2*(diff(g(t),t)+t*diff(g(t),t$2))-t/(2*g(t)^3),rho=(-t/g(t))*(diff(g(t),t))^2+t/(4*g(t)^3)];

R:=eliminate(sys[2..3], rho);

Sol:=dsolve([sys[1],op(R[2])]);

eval(sys,Sol[1,1]);

eval(sys,Sol[1,2]);

 

 For  rho=0  solutions are  Sol .

 

In the procedure  linalg  package was used but it is not called. Add the line  uses linalg; after local-line of your procedure:

Cocycle:=proc(L,n)

local i,j,k,h,v,u,w,C,eqns,e,f,g;  

uses linalg;

... 

First 181 182 183 184 185 186 187 Last Page 183 of 292