MaplePrimes Questions

I want to write  in maple using summation notation for symbolic calculation. The output should come as 

 

W_1exp(k_1.q)+W_2exp(k_2.q)+W_3exp(k_3.q)

where k_j.q are the dot product of the vectors k_j and q. 

mp.mw

How to do this. Please help. The summation is not working for me, only suffix k is coming  

Is there a way to define tensor components without addressing each component individually? Suppose I define a tensor A[a, mu], where Latin letters are space coordinates and Greek letters are space-time coordinates. Is there an easy way to define multiple components without having to define each component separately. For example, A[a,0] = 0 and A[a,i] = LeviCevita[a,i,j].

restart;
with(Physics);
Setup(spaceindices = lowercaselatin_ah)
g_[]
Define(A[a, mu])
A[a, 1] := 0
A[a, b] := LeviCivita[a, b, c]
TensorArray(A[a, mu]) 
A[1, 2] := 0
A[2, 3] := LeviCivita[2, 3, c]
TensorArray(A[a, mu])

The general writing method does not seem to change the tensor components, but the writing method in which I address the components individually does. What exactly am I doing wrong? 

I use convert~([points1], list) command but the outcome is not I want. The code of shortscreen is attached. I wanna change the outermost curly braces of the sequence "points1" into square brackets. Thank you all guys to answer!

The below is I want.

This is not I want cause the outermost has three square brackets! I just wanna two.

GUI state after interupting with :

After switching to untitled 17 and back to test_timeout:

Sometimes it is necessary to switch back and forth twice.

Does this mean that the kernel did not receive the interupt?

eqn := B(n) = -sum(binomial(n + 1, k)*B(k), k = 0 .. n - 1)/(n + 1);
init := B(0) = 1, B(1) = -1/2;
sol := rsolve({eqn, init}, B(n));
Why doesn’t this give me any solution ? Thank you.

How to add x,y,z axis in plotsetup command? I need to enhance the quality of figure, so I use plotsetup command width=5000,height=5000. But in this case, the range of x,y,z axis vanish like this. The related code is attached.

Hi all,

I'm new to this software, I've started using it to build myself a spacemouse, and figuring out the "inverse kinematics" involved in its working. I've done a little research on how Maple works, I'm fortunate enough to have a student license, but maybe this problem is above my capacity.

Essentially, I want to control a 6-DOF platform by measuring six distances (with magnetic sensors, but that's not relevant, I believe), from three points forming an equiliateral triangle on the top platform, to six points on the bottom platform. So far I've been able to calculate the effect that each of the degrees of freedom has on the platform and on each of this distances that I want to measure.

But that's where the problem lies. Now I have a system of six equations with six variables and a few parameters, a system that's heavily nonlinear, involving a lot of trig functions and multiplications between them. I've tried to "brute force" a symbolic solution by simply typing in: solve(equations, variables) (note that both equations and variables were properly defined) but Maple just ran for a couple of hours without providing an answer. I don't know if this particular application reaches this software's limits, or if it's me who is doing something wrong.
I'll try to provide the maple Worksheet, I'm still not familiar with this site's formatting, sorry in advance:


restart;
L := Matrix(3, 3, [[cos(theta)*cos(psi), cos(theta)*sin(psi), -sin(theta)], [sin(phi)*sin(theta)*cos(psi) - cos(phi)*sin(psi), sin(phi)*sin(theta)*sin(psi) + cos(phi)*cos(psi), sin(phi)*cos(theta)], [cos(phi)*sin(theta)*cos(psi) + sin(psi)*sin(phi), cos(phi)*sin(theta)*sin(psi) - sin(phi)*cos(psi), cos(phi)*cos(theta)]]);
T := Matrix(3, 3, [[1, psi, -theta], [phi*theta - psi, phi*psi*theta + 1, phi], [phi*psi + theta, psi*theta - phi, 1]]);
p[ni] := Typesetting[delayDotProduct](R, Vector[column](3, [cos(theta[n]), -sin(theta[n]), 0]), true)

p__n := (T . (p[ni])) + Vector[column](3, [u, v, w])

m[m] := R*Vector[column](3, [cos(phi__m), -sin(phi__m), h/R])

`Δp` := p__n - m[m]

with(VectorCalculus)

s[n] := sqrt(`Δp` . `Δp`)

theta[1] := -Pi/12;
theta[2] := Pi/12;
theta[3] := (2*Pi)/3 - Pi/12;
theta[4] := Pi/12 + (2*Pi)/3;
theta[5] := (4*Pi)/3 - Pi/12;
theta[6] := (4*Pi)/3 + Pi/12;

phi[1] := 0;
phi[2] := (2*Pi)/3;
phi[3] := (4*Pi)/3;

s[1] := eval(s[n], {phi__m = phi[1], theta[n] = theta[1]})

s[2] := eval(s[n], {phi__m = phi[1], theta[n] = theta[2]})

s[3] := eval(s[n], {phi__m = phi[2], theta[n] = theta[3]})

s[4] := eval(s[n], {phi__m = phi[2], theta[n] = theta[4]})

s[5] := eval(s[n], {phi__m = phi[3], theta[n] = theta[5]})

s[6] := eval(s[n], {phi__m = phi[3], theta[n] = theta[6]})

 

equations := [-d[1]^2 + s[1]^2 = 0, -d[2]^2 + s[2]^2 = 0, -d[3]^2 + s[3]^2 = 0, -d[4]^2 + s[4]^2 = 0, -d[5]^2 + s[5]^2 = 0, -d[6]^2 + s[6]^2 = 0]

variables := [u, v, w, psi, theta, phi]

solve(equations, variables)

 

So far this is what I've got, thanks in advance for the help.

EDIT: In the beginning of the worksheet two rotation matrices are declared, L and T. T is a "linearized" version of L, assuming small angles, and I'm using it to simplify the expressions. Still there is no luck.

There is an integration method called orering in Maple. But see no mention on it at help page 

It shows up when using option 

method=_RETURNVERBOSE

And that is how I knew about it.

It gives division by zero when asked to integrate zero !

Any one knows what is this method? Will send bug email to Maplesoft suport just in case also.
 

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

int(0,x)

0

int(0,x,method=orering)

Error, (in IntegrationTools:-Indefinite) numeric exception: division by zero

int(1,x,method=orering)

x

 


 

Download division_by_zero_int_orering_method.mw

 

 

Dear all, how can I simplify the following command by using nested SEQ?

tagsCornersPlot := textplot3d([[seq(cornerPoints[1 .. dim, 1]), cornerPoints[1 .. dim, 1]], [seq(cornerPoints[1 .. dim, 2]), cornerPoints[1 .. dim, 2]], [seq(cornerPoints[1 .. dim, 3]), cornerPoints[1 .. dim, 3]], [seq(cornerPoints[1 .. dim, 4]), cornerPoints[1 .. dim, 3]]], align = {above, right}, font = [Courier, bold, 20])

Hello Everyone 

I created a file to sum up 5 vectors and display them in 3d space. (see below)

I would like to optimize my input so that I input the total length of the vector and the angle in the x-y plane and the angle in the x-z plane. 

At the top of the document there is an idea from a different pots how to do it with 2d vectors but I can't get it to work with 3d vectors. 

Any ideas?

Thanks in advance!

3d_vector.mw

I'm trying to replicate this video: https://www.youtube.com/watch?app=desktop&v=EUVPsxYIauo

Note that the variables a, b, c are integers.

Here is my Maple worksheet:

restart;
eq1 := a*b + c = 2020;
                     eq1 := a b + c = 2020

eq2 := b*c + a = 2021;
                     eq2 := b c + a = 2021

sol1 := isolve({eq1, eq2});
              sol1 := {a = 2021, b = 0, c = 2020}

However, there is another solution {a = 673, b = 2, c = 674}. Why does isolve not find the second solution? I tried 'allvalues', but it did not work.

Hello all,

I need to perform this numerical integration through maple. Having been a complete beginner I just wanted to ask if at all this is feasible using maple? I have done similar stuff using mathematica, but would like to try and calculate the same using maple, especially with the gamma function in the above equation.

W_{-} := M*sqrt(Pi)/(2*A*a)*(x*erf(a*x) + (1/(a*sqrt(Pi)))*exp(-a^2*x^2)) + (M/(A*a*sqrt(Pi)))*evalf(Int(exp(-epsilon^2/(4*a^2) - tau*epsilon^3)*(cos(epsilon*x) - 1)/epsilon^2, epsilon = 0..infinity)) + (2*m/Pi)*evalf(Int(exp(-tau*epsilon^3)*(cos(epsilon*x) - 1)/epsilon^2, epsilon = 0..infinity)) + (M/(A*a*sqrt(Pi)))*evalf(Int((1/(2*a^2) + 3*tau*epsilon)*exp(-epsilon^2/(4*a^2) - tau*epsilon^3), epsilon = 0..infinity)) - (2*m/Pi)*tau^(1/3)*GAMMA(2/3) -m*x;

W_{+} := M*sqrt(Pi)/(2*A*a)*(x*erf(a*x) + (1/(a*sqrt(Pi)))*exp(-a^2*x^2)) + (M/(A*a*sqrt(Pi)))*evalf(Int(exp(-epsilon^2/(4*a^2) - tau*epsilon^3)*(cos(epsilon*x) - 1)/epsilon^2, epsilon = 0..infinity)) + (2*m/Pi)*evalf(Int(exp(-tau*epsilon^3)*(cos(epsilon*x) - 1)/epsilon^2, epsilon = 0..infinity)) + (M/(A*a*sqrt(Pi)))*evalf(Int((1/(2*a^2) + 3*tau*epsilon)*exp(-epsilon^2/(4*a^2) - tau*epsilon^3), epsilon = 0..infinity)) - (2*m/Pi)*tau^(1/3)*GAMMA(2/3) + m*x;

M := 6.3*10^{17};

t := 7200;

a := 10^3 ;

m := 1;

D := 10^{-5};

Omega := 1.7*10^{23}

tau := 10^{-14}

A := tau/(D*Omega*t);

Any suggestions as how to proceed would be very helpful. Thanks.

EDIT: I would like plot the functions W_{+} and W_{-} as a function of x-axis, with both representing either side of x=0.

EDIT: for some reason I cannot reply to the comments but I have modified the question based on the comments below.

For the legend in the image below I would have expected a black image and not a white

 

 

I wanted to keep a running total over a number of independent batch mode Maple scripts.

So I figured I use .m file.   

Each run will read the old variable from .m file, update it, and write it again.

All what it need to do is just check if the .m file exist or not to account for the very first run.

But to my surprise, I found the variable content do not update after doing SAVE A,"TMP.m"

It seems Maple sees A variable already in TMP.m and does not save the new value of A again?. Just guessing. I was expecting that after I do  read "TMP.m" that the variable in the file will overwrite same variable value in the local proc. 

After one time update, each time I read the variable, its value is same.

First time using save myself, so may be I am doing something wrong but do not see it. I was expecting to see   10,20,30,40,50,..... running total, but I see 10,20,20,20,20,...../

What Am I doing wrong? do I need to make the variable global for this to work?

Here is worksheet. Maple 2024 on windows 10.


 

24344

restart;

24344

currentdir("G:/public_html/my_notes/solving_ODE/new_version/tests/");
try  #remove TMP.m first time
    FileTools:-Remove("TMP.m");
catch:
    NULL;
end try;

#this function is called many times.
foo:=proc()
 local A:=0,B;
 A:=A+10;
 if FileTools:-Exists("TMP.m") then
     print("TMP.m exists, will read its content");
     B:=A; #save copy
     read "TMP.m";
     print("Read old value of A from file",A);
     A:= A + B; #update running total
     print("Now A is ",A," will now save this new value");     
     save A,"TMP.m";
  else
     print("TMP.m do not exist, first time saving to it");
     save A,"TMP.m";
  fi;
  print("A=",A);
end proc:
 

"C:\Program Files\Maple 2024"

foo();

"TMP.m do not exist, first time saving to it"

"A=", 10

foo();

"TMP.m exists, will read its content"

"Read old value of A from file", 10

"Now A is ", 20, " will now save this new value"

"A=", 20

foo();

"TMP.m exists, will read its content"

"Read old value of A from file", 10

"Now A is ", 20, " will now save this new value"

"A=", 20

foo();

"TMP.m exists, will read its content"

"Read old value of A from file", 10

"Now A is ", 20, " will now save this new value"

"A=", 20

foo();

"TMP.m exists, will read its content"

"Read old value of A from file", 10

"Now A is ", 20, " will now save this new value"

"A=", 20

 


 

Download T.mw

How to show that the angle QF2P remains constant when M moves on the ellipse ? Perhaps with Explore ?
restart;
with(plots);
with(geometry);
_EnvHorizontalName := 'x';
_EnvVerticalName := 'y';
x0 := 100;
y0 := 40;
a := 7;
b := 5;
c := sqrt(a^2 - b^2);
ellipse(el, x^2/a^2 + y^2/b^2 - 1);
point(F1, -c, 0);
point(F2, c, 0);
eq := simplify((a^2 - x0^2)*(y - y0)^2 + (b^2 - y0^2)*(x - x0)^2 + 2*x0*y0*(x - x0)*(y - y0)) = 0;
sol := solve({eq}, {y});
line(tang1, op(sol[1]));
line(tang2, op(sol[2]));
sol2 := op(solve({op(sol[1]), x^2/a^2 + y^2/b^2 - 1 = 0}, {x, y}));
xM2 := rhs(sol2[1]);
yM2 := rhs(sol2[2]);
point(A, xM2, yM2);
sol3 := op(solve({op(sol[2]), x^2/a^2 + y^2/b^2 - 1 = 0}, {x, y}));
xM3 := rhs(sol3[1]);
yM3 := rhs(sol3[2]);
point(B, xM3, yM3);
line(Pol, [A, B]);
simplify(Equation(Pol));
isolate(%, y);
xM := 4;
sol := solve({subs(x = xM, x^2/a^2 + y^2/b^2 - 1 = 0)}, {y});
yM := rhs(op(sol[1]));
point(M, xM, yM);
line(Tang, x*xM/a^2 + y*yM/b^2 - 1 = 0);
intersection(P, tang1, Tang);
intersection(Q, tang2, Tang);
line(PF2, [P, F2]);
line(QF2, [Q, F2]);
alpha := FindAngle(PF2, QF2);
arctan(alpha);
evalf(%);
display(textplot([[-c, 0, "F1"], [c, 0, "F2"], [coordinates(B)[], "B"], [coordinates(A)[], "A "], [coordinates(M)[], "M "], [coordinates(P)[], "P "], [coordinates(Q)[], "Q "]], align = {"above", 'right'}), draw([el(color = red), A(color = black, symbol = solidcircle, symbolsize = 16), PF2(color = brown), QF2(color = brown), B(color = black, symbol = solidcircle, symbolsize = 16), M(color = black, symbol = solidcircle, symbolsize = 16), P(color = black, symbol = solidcircle, symbolsize = 16), tang1(color = green), tang2(color = green), Tang(color = green), F1(color = blue, symbol = solidcircle, symbolsize = 16), Q(color = blue, symbol = solidcircle, symbolsize = 16), F2(color = red, symbol = solidcircle, symbolsize = 16)]), axes = none, view = [-7 .. 15, -7 .. 12]);

First 94 95 96 97 98 99 100 Last Page 96 of 2427