Kitonum

21475 Reputation

26 Badges

17 years, 48 days

MaplePrimes Activity


These are answers submitted by Kitonum

restart;
q:=Matrix(3,10,(i,j)->i^2+j+2*i); 
with(plots):
V:=i->(q[..,round(i)]):
animate(arrow,['V'(k), width=[0.4,relative=false],head_width=[1,relative=false],color=red], k = 0.5..10.45, frames=60, axes=normal, paraminfo=false);

 

solve({7*cos(2*t)=7*combine(cos(t)^2)-5, t>=0, t<2*Pi}, t, allsolutions, explicit);  # Symbolic
evalf(%);  # Numeric
                 

 

Let the function  f  be the inverse of the function temperature vs chemicals, M  is your Array. Do the following:

A:=convert(M, Matrix);
L:=convert(<f~(A[..,2]) | A[..,1]>, listlist);
plot(L);

 

eq16:=r(t)=d[vol]*V/(KUS*V^2+L*tau);
r(t)=(numer(rhs(eq16))/V)/'(expand(denom(rhs(eq16))/V))':
eq17:=%;

                     

 

 

Slightly reducing the number of digits, it is easy to check the identity of the lists:

evalb(evalf[8](listA) = evalf[8](listB));
 

restart;
f:=unapply(<r(t)*cos(t), r(t)*sin(t)>, t):
v:=diff~(f(t), t);
  # The vector of velocity


Example of use. The calculation of the vector of velocity for the curve  r(t)=t  (Archimedes' spiral) at the point  t=1 :

f:=unapply(<t*cos(t),t*sin(t)>, t):
v:=unapply(diff~(f(t),t), t):
v(t); 
# The vector of velocity
v(1);  # Velocity at the point  t=1
plots:-display(plot([convert(f(t),list)[],t=0..3], color=red, thickness=3), plots:-arrow(f(1),v(1), width=[0.01,relative=false],head_width=[0.08,relative=false],color=blue), scaling=constrained);  # Visualization

     

 


Edit.

Obviously, this is a bug. Here's a very trivial example:

f1 := x->x^2:   f2 := x->x^2:
is(f1=f2);
                                             
  false


Probably  is  command simply does not work with procedures. Obviously to check the equality of the two procedures  and  g , it suffices to verify that  f(x)=g(x)  for an arbitrary  x:

f1:=x->x^2:  f2:=t->t^2:
is(f1(a) = f2(a));
                                                 
true

Use  evalc  command for this.

Example:

evalc(exp(k*Pi*I));
                                     
 cos(k*Pi)+I*sin(k*Pi)

 

For some reason, D  operator does not work in  Physics  package, but  diff  command is working:

restart:
with(Physics[Vectors]):
Setup(mathematicalnotation = true):
r1:=t->2*t^2*_i+16*_j+(10*t-12)*_k;
r2:=t->(20-6*t)*_i+4*t^2*_j+2*t^2*_k;
v1:= unapply(diff(r1(t),t), t);
v2:= unapply(diff(r2(t),t), t);
arccos(v1(2).v2(2)/(Norm(v1(2))*Norm(v1(2)))); 
# Angle in radians
evalf(%*180/Pi);  # Angle in degrees
 

restart;
with(LinearAlgebra):
  _i:=<1,0,0>: _j:=<0,1,0>: _k:=<0,0,1>:
  # Specification of the basic vectors
r:= t->2*t^ 2*_i+16*_j+(10*t-12)*_k;  # Specification of the vector function
v:=D(r);  # Speed as a vector function
v(10);  # Speed as a vector (at the 10th sec)
Norm(%, 2);  # Speed magnitude

               

 

Edit.

For Maple  i, j, k  are just symbols. You yourself can set them as basic vectors:

i:=<1,0,0>: j:=<0,1,0>: k:=<0,0,1>:
r:=t->3*cos(5*t)*i + sin(5*t)*j +3*sin(5*t)*k:
plots:-spacecurve(r(t), t=0..2*Pi, color=red, thickness=2, labels=[x,y,z]);

                 

Edit.

 

If you want to reduce the number of significant digits in an output, use  evalf[n]  command, in which  n  is the number of desired digits. I also made a few simplifications in your code:

X := [seq(0.1e-1*i, i = 0 .. 12)]; 
Y := [0, .36, .56, .67, .73, .76, .78, .79, .79, .80, .80, .80, .80];
with(Statistics): 
f := unapply(evalf[5](Fit(a-b*exp(c*x+d), X, Y, x, initialvalues = [a = .8, b = 1, c = -50, d = -.3])), x); 
plot([f, zip(`[]`,X, Y)], 0 .. .15, color = blue, gridlines = true, style = [line, point], size = [600, 400]);

B:=proc(a, b)
local A1;
uses LinearAlgebra;
A1:=DeleteColumn(A, a);
DeleteRow(A1, b);
end proc:

# Or

B:=proc(a, b)
uses LinearAlgebra;
DeleteRow(DeleteColumn(A,a), b);
end proc:


Addition. All this can be done shorter without any procedures and without calling  LinearAlgebra  package.

Examples:

A:=<1,2,3; 4,5,6; 7,8,9>;  # Defining a matrix
A[1..2, 2..3];  # Deleted third row and first column
A[2, 2..3];  # Deleted first and third rows and first column
A[[1,3], [1,3]];  # Deleted second row and second column

                                


Edit.

See  HPM_4_new.mw

Now the system's solutions are returned for  i = 0 , but for  i=1  an error occurs in  dsolve  command. You should understand the correctness of the specification of the system for  i>=1 .

First 129 130 131 132 133 134 135 Last Page 131 of 290