## 3d vector addition with angles ...

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?

3d_vector.mw

## isolve does not return all solutions...

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.

## How to perform numerical intergration with a gamma...

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.

## Browse Matrix: Why is the legend formated this way...

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

## why save to .m fie do not update variable in file?...

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.

 > restart;

 > 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:

 > foo();

 > foo();

 > foo();

 > foo();

 > foo();

 >

## Moving tangent portion between 2 fixed tangents on...

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]);

## Latex command fails in command line in Maple 2024...

Just found very serious problem.

Was trying my code in command line maple (cmaple.exe) only to find latex() command fails now.

Same code works with no problem in worksheet.  Here is first the worksheet version.

 > restart;

 > interface(version);

 > ode:=diff(y(x),x)=x; try     s:=latex(ode,'output'=string):     print("Latex command worked on ode"); catch:     error lastexception; end try: the_output:=Student:-ODEs:-ODESteps(ode,y(x)): try     s:=latex(the_output,'output'=string):     print("Latex command worked"); catch:     error lastexception; end try:

 >

Now I do same thing but from command line. I put the above code in A.mpl file in some folder on windows:

```ode:=diff(y(x),x)=x;
try
s:=latex(ode,'output'=string):
print("Latex command worked on ode");
catch:
error lastexception;
end try:

the_output:=Student:-ODEs:-ODESteps(ode,y(x)):
try
s:=latex(the_output,'output'=string):
print("Latex command worked");
catch:
error lastexception;
end try:

```

Then opened a command windows terminal and cd to the above folder and typed this command

`"C:\Program Files\Maple 2024\bin.X86_64_WINDOWS\cmaple.exe"  -q A.mpl`

And this is what happens. Latex works OK on generating latex for the ode, but not for the steps!It gives error

Error, latex, invalid input: %1 uses a %-2 argument, %3 (of type %4), which is missing, latex:-ModuleApply, 1, e, anything

Also I was not able to suppress the display of the odesteps on the terminal even though they do not display in worksheet, they still print in the terminal. But this is a side issue.

Why does Latex gives error in command line?

I think it is related to those funny looking characters (bullets?) signs at the start of each ODE step that show in the terminal?

But in worksheet latex has no problem converting the ODE steps to Latex. It is only in cmaple.

Is there a way to correct this? It seems to be some character encoding is causing the problem for Latex on command line vs. worksheet.

Windows 10, Maple 2024

## How does Maple solve, int(y'(x)*f(x), x) =[int(sqr...

'odeadvisor' suggests isolating y(x) from the equation as a first step, y=G(x,y'(x)), then apply the method of 'patterns'. For the first step, y(x) = (9/4)*[(y'(x))^2]/{[int(f(x),x)]^5} is what I found but, could take it no further. Nevertheless, Maple finds an intrinsic solution of the form, (3/4)*y(x)^(4/3) +(2/3)*int(sqrt(y(x)*f(x))^(-5/3) + _C1 =0, from which an explicit solution can be obtained. If anyone can supply the steps leading to the Maple solution - that would be great.

## Third party Package wkptest & ONEOptimal...

Dear all
If you have the following two maple package, kindly share it with me.
wkptest: For the symbolic computation of Painleve test for nonlinear PDEs.
ONEOptimal:-  Maple Package for obtaining Optimal System

Debendra

## How to fix 'Illegal use of a formal parameter' err...

Hello. I am trying to create a procedure that calculates the properties of a triangle (such as the sides, angles, area, and centroid) and then plots it. However, when I try to run my code, I keep getting the error:

`Runtime error: Error, (in triangle) illegal use of a formal parameter`

Here is the code I am using:

triangle := proc({a::numeric := 0, b::numeric := 0, c::numeric := 0, AngleA::numeric := 0, AngleB::numeric := 0, AngleC::numeric := 0})
local A, B, C, T, Tr, DegreeA, DegreeB, DegreeC, TA, TB, TC, Area, Centroid, AreaLabel, deg, rad;
uses geometry, plots;

# Function to convert degrees to radians
rad := proc(deg) evalf(deg * Pi / 180) end proc;

# Function to convert radians to degrees

# Temporary variables for calculations
local a_calc, b_calc, c_calc, AngleA_calc, AngleB_calc, AngleC_calc;

a_calc := a;
b_calc := b;
c_calc := c;
AngleA_calc := AngleA;
AngleB_calc := AngleB;
AngleC_calc := AngleC;

# Calculate missing sides or angles
if a_calc = 0 then
if AngleA_calc <> 0 and AngleB_calc <> 0 then
elif AngleA_calc <> 0 and AngleC_calc <> 0 then
end if;
elif b_calc = 0 then
if AngleB_calc <> 0 and AngleA_calc <> 0 then
elif AngleB_calc <> 0 and AngleC_calc <> 0 then
end if;
elif c_calc = 0 then
if AngleC_calc <> 0 and AngleA_calc <> 0 then
elif AngleC_calc <> 0 and AngleB_calc <> 0 then
end if;
end if;

if AngleA_calc = 0 then
AngleA_calc := deg(arccos((b_calc^2 + c_calc^2 - a_calc^2) / (2 * b_calc * c_calc)));
end if;
if AngleB_calc = 0 then
AngleB_calc := deg(arccos((a_calc^2 + c_calc^2 - b_calc^2) / (2 * a_calc * c_calc)));
end if;
if AngleC_calc = 0 then
AngleC_calc := 180 - AngleA_calc - AngleB_calc;
end if;

# Convert angles to radians for calculation

# Define points A, B, and C
geometry:-point(A, 0, 0);
geometry:-point(B, c_calc, 0);
geometry:-point(C, b_calc * cos(AngleA), b_calc * sin(AngleA));

# Calculate the area using Heron's formula
s := (a_calc + b_calc + c_calc) / 2;
Area := sqrt(s * (s - a_calc) * (s - b_calc) * (s - c_calc));
Area := evalf(Area, 4);

# Calculate the centroid of the triangle
Centroid := [(0 + c_calc + b_calc * cos(AngleA)) / 3, (0 + 0 + b_calc * sin(AngleA)) / 3];

# Text plot for side labels
T := plots:-textplot([[1/2 * c_calc, 0, cat("c = ", c_calc), align = below],
[1/2 * c_calc + 1/2 * b_calc * cos(AngleA) + 1/30 * a_calc, 1/2 * b_calc * sin(AngleA), cat("a = ", a_calc), align = right],
[1/2 * b_calc * cos(AngleA) - 1/30 * a_calc, 1/2 * b_calc * sin(AngleA), cat("b = ", b_calc), align = left]]);

# Text plot for angle labels with valid alignment options
TA := plots:-textplot([0, 0, cat(evalf(deg(AngleA)), "°"), align = right]);
TB := plots:-textplot([c_calc, 0, cat(evalf(deg(AngleB)), "°"), align = left]);
TC := plots:-textplot([b_calc * cos(AngleA), b_calc * sin(AngleA), cat(evalf(deg(AngleC)), "°"), align = above]);

# Text plot for the area of the triangle
AreaLabel := plots:-textplot([Centroid[1], Centroid[2], cat("Area= ", Area), align = above]);

# Display the triangle with labels
plots:-display([geometry:-draw([geometry:-triangle(Tr, [A, B, C])],
font = [times, roman, 18], labels = [x, y], axes = none, printtext = true), T, TA, TB, TC, AreaLabel]);
end proc:

What am I doing wrong, and how can I fix this error? Thanks!

## How to get the solution with higher order polynomi...

Hi all guys! I am doing the error analysis but now I meet one question: how to get the explict solution of eq11? If it is complex, I just wanna the real part. Welcome all guys discussion!

## How to resolve unwanted spacing issue in maple 24 ...

Hi -- I have used this valuable platform many times to ask technical questions, but I am facing a particularly annoying problem in Maple 24 that did not exist in Maple 23. When I work on a Maple sheet and press Shift + Enter to move the cursor to a new line, an unwanted space appears. The issue is that when I use this combination twice on existing Maple sheets to create whitespace, the variable name often gets split up. Additionally, when I try to move back to the previous line to add something, I simply cannot. This issue did not exist in Maple 23 or any version since Maple 15. I have checked Tools > Options under both Display and Interface, but I have not found a solution. Is there a way to eliminate this annoying space?

## Can A3 print size be installed for Maple...

I would like to print my help pages to pdf. Is there a way to install A3 paper size. That would help in maintaining the layout as seen on the screen.

Maybe there is an alternative approach.

## Question:How do i obtain lie symmetries for this t...

I have a PDE of the form

u_{tt}+2*a(t)*u_x^2+2*b(t)*u(t,x,y)*u_{xx}+u_{yy}=0

How can I find Lie symmetries of this equation using PDEtools?