Kitonum

21465 Reputation

26 Badges

17 years, 48 days

MaplePrimes Activity


These are answers submitted by Kitonum

You write your system, first in vector form (as it is defined), and then convert to normal form and solve using  dsolve  command:

restart;
Sys:=diff(<x1(t),x2(t)>,t)=~<-4,-2;6,3>.<x1(t),x2(t)>+<2/(exp(t)+1),-3/(exp(t)+1)>;
dsolve(convert(Sys,set) union {x1(0)=0,x2(0)=ln(2)});

You missed the multiplication sign:

evalf(((12*sqrt(13))/13 - 3/4)/(1 + ((12*sqrt(13))/13)*(3/4)));

                                                 0 .7374399056

Use  plots:-textplot  command for this. For example, add the new line  Anim4  to your code (for the example1):

Anim4 := animate(textplot, [[op(convert(Position(t)+(1.3/4)*Vitesse(t), list)), "V"], align = [right, below], font = [times, bold, 18]], t = t0 .. t1, frames = 100):

 

When creating complex animations, it is convenient to first write a procedure that creates one frame and then use  plots:-animate  command. Here's the original example:

restart;

P:=proc(t)
local f, g, alpha, beta, Position, Vitesse, Accélération, P1, P2, V1, V2 ;
uses plots, plottools;
f := t->sin(3*t)*cos(t);
g := t->cos(3*t)*sin(t);
alpha := (1/4)*Pi;
beta := 3*Pi*(1/4);
Position := <f(t), g(t)>;
Vitesse := <(D(f))(t), (D(g))(t)>;
Accélération := <(D@@2)(f)(t), (D@@2)(g)(t)>;
P1:=plot([f(s), g(s), s=alpha .. t], color=green, thickness=2);
P2:=plot([[f(t), g(t)]], style=point, symbol=solidcircle, color=blue, symbolsize=20);
V1:=arrow(Position,0.1*Vitesse, width=0.015, color=blue); # Vector of vitesse
V2:=arrow(Position,0.1*Accélération, width=0.015, color=red); # Vector of accélération
display(P1,P2,V1,V2);
end proc:

plots:-animate(P,[t], t=Pi/4..3*Pi/4, frames=90, size=[500,500]);

                             

 

When simplifying complex expressions, it is often useful to replace some subexpression with a name and use subs  or  algsubs  commands, and instead of  simplify  use the  factor  command with the required options:

The set of points  z=x+I*y  on the complex plane satisfying this equation  Eq  is empty . See below

restart;
z:=x+I*y:
Eq:=evalc(abs(2*z-I)=Im(z+1-I)); # The equation Eq is equivalent to the system S
S:={Eq^2, y>=1};
solve(Eq);
is(-3*y^2+2*y<0) assuming y>=1;

                         

 

5 points define a polynomial of degree <=4 :

CurveFitting:-PolynomialInterpolation([[1,2],[2,3],[3,4],[4,6],[5,10]], x);
plot(%, x=0..5, tickmarks=[6,11], gridlines, scaling=constrained, size=[300,500]);

                  

Addition. If you still want to get a polynomial of degree 5, then you need to specify one more point. I have defined it with a parameter  a . We see that as a parameter we can take any  a<>17 :

CurveFitting:-PolynomialInterpolation([[1,2],[2,3],[3,4],[4,6],[5,10],[6,a]], x);

  

In the solution above, nowhere are the forces 70 lb and 60 lb taken into account. 
In this problem, the unknown quantities are: the reaction of the support  OA (say F), the weight of the pot (say P) , and the 1st coordinate  x  of point  A. To find them, we compose a system of 3 equations with 3 unknowns. After finding  x , the coordinates of all points will be known and it will be easy to find all the angles. The sum of all forces applied to point  A  should equal 0.

restart;
local O;
O:=<0,0,0>: A:=<x,6,2>: B:=<-3,0,4>: C:=<5/2,0,5*sqrt(3)/2>:
AC:=C-A; AB:=B-A; AO:=O-A;
assume(x>0): 
vOA:=A/sqrt(A.A)*F; # Force vector in the direction of OA 
vAB:=AB/sqrt(AB.AB)*70; # Force vector in the direction of AB   
vAC:=AC/sqrt(AC.AC)*60; # Force vector in the direction of AC  
vP:=<0,0,-P>; # Force vector vertically down 
Sys:={seq((vOA+vAB+vAC+vP)[i]=0, i=1..3)};
Sol:=fsolve(Sys, {F,P,x});
x:=eval(x,Sol);
`Angle BAC`=evalf(arccos(AB.AC/sqrt(AB.AB)/sqrt(AC.AC))*180/Pi)*degrees; 
`Angle OAC`=evalf(arccos(AO.AC/sqrt(AO.AO)/sqrt(AC.AC))*180/Pi)*degrees;

                       

 

Edit.

i:=1: k:=3:
G[i,k]=abs(u[i] - u[k])-(u[i]-u[k])^2;

                                        

You can generate your table as a matrix:

Matrix(5, (i,j)->`if`(i>=j,'y[i,j]'=y[i,j], ``));

 

 

restart;                    
T := (p*a^(-Phi(xi))+q+r*a^Phi(xi))/ln(a):                    
u[0] := C[0]+C[1]*a^Phi(xi)+C[2]*a^(2*Phi(xi)):                          
u[1] := diff(u[0], xi):               
d[1] := C[1]*a^Phi(xi)*T*ln(a)+2*C[2]*a^(2*Phi(xi))*T*ln(a):         
u[2] := diff(d[1], xi):     
d[2] := C[1]*a^Phi(xi)*T*ln(a)*(p*a^(-Phi(xi))+q+r*a^Phi(xi))+C[1]*a^Phi(xi)*(-p*a^(-Phi(xi))*T*ln(a)+r*a^Phi(xi)*T*ln(a))+4*C[2]*a^(2*Phi(xi))*T*ln(a)*(p*a^(-Phi(xi))+q+r*a^Phi(xi))+2*C[2]*a^(2*Phi(xi))*(-p*a^(-Phi(xi))*T*ln(a)+r*a^Phi(xi)*T*ln(a)):                                     
expand((2*k*k)*w*beta*d[2]-(2*alpha*k*k)*d[1]-2*w*u[0]+k*u[0]*u[0]):     
subsindets(%,identical(a^Phi(xi)), t->z);
collect(%, z);
subs(z=a^Phi(xi), %);

Use  unapply  instead of a function in arrow notation:

restart;
K := x^3*y^4 + 6*x^2*y^3 + 3*x*y^4 + x^2*y^2 + 2*x*y^3;
f := unapply(K, x,y); 
f(t, x);


You can see for yourself that when using arrow notation  f:=(x,y)->K , the right-hand side  K  must be explicitly specified in terms of  x  and  y .

restart;
V:= Vector([3 * x[1] ^ 4 * x[2] ^ 2 + 7 * x[1] ^ 3 * x[2] ^ 3 + 6 * x[1] ^ 2 * x[2] ^ 4 + 7 * xi[1] * xi[2] ^ 5 + 65 * xi[1] ^ 3 + 76 * xi[1] ^ 2 * xi[ 2] + 56 * xi[1] ^ 2 * xi[3], 13 * x[1] ^ 6 - 7 * x[1] ^ 5 * x[2] + 30 * x[1] ^ 4 * x[2] ^ 2 + 75 * x[1] ^ 3 * x[2] ^ 3 + 130 * x[1] ^ 2 * x[2] ^ 4 + 54 * xi[1] * xi[2] ^ 5 + 43 * xi[2] ^ 6 + xi[2] ^ 2 * xi[3] + 76 * xi[2] ^ 2 * xi[4] + 43 * xi[2] * xi[3] ^ 2 ]);
 
map(v->select(t->degree(t)=3, v), V);
       

 


To get the list of coefficients use the  coeffs  command.

You can use the  Student:-LinearAlgebra:-RotationMatrix  command to parameterize a circle in 3D. In the example below  M  is rotation matrix around the axis defined by the vector  <2,3,-4>  by the angle  t ,  A  is the center of the circle,  B  is the point on this circle: 

restart;
M:=Student:-LinearAlgebra:-RotationMatrix(t, <2,3,-4>);
A:=<1,2,3>: 
B:=<2,4,5>:
Eq:=A + M.(B-A); # The parametric equations of the circle
plots:-spacecurve(Eq, t=0..2*Pi, color=red, axes=normal, scaling=constrained, view=[-2..5.5,-2..5.5,-2..5.5]);

 
Note that the vectors  <2, 3, -4>  and  B - A  are perpendicular.

restart;
y := t -> 0.7*sin(300*t);
filenm := "https://www.gw-openscience.org/GW150914data/P150914/fig2-unfiltered-template-reconstruction-H.txt";
K := ImportMatrix(filenm, source = Matlab, skiplines = 1);
R:=[seq([K[i,1],abs(K[i,3]-y(K[i,1]))], i=1..3441)]:
plot([K[() .. (), [1, 3]], y(t)], t = 0.35 .. 0.4, color=[red,blue]);
plot(R, color=green, view=[0.35..0.4,0..1]);


I understood the plot of residuals as the plot of the modulus of the difference of two plots (blue and red).

Edit. If you just take the differences (no modulus), you get a graph like Carl's.

R:=[seq([K[i,1],y(K[i,1])-K[i,3]], i=1..3441)]:
plot(R, color=green, view=[0.35..0.4,-1.5..1.5]);

 

First 33 34 35 36 37 38 39 Last Page 35 of 290