Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Is it possible to have a variable in a filename ?

as an example if I save a file by


save M, "Result(Variable).txt";

So If Variable is e.g. set to

Variable:=10;
then the filename saved should be
Result(10).txt

It is not that this a terribly difficult to work out, but I feel I am probably missing something. I need to check if a 3D point lies on a 3D line. What is a good approach here. I started of with the idea all alpha's are equal. but there are exceptions. See P3 and P4

restart

NULL

l := `<,>`(3+2*alpha, 1+6*alpha, 4-5*alpha)

Vector[column](%id = 36893489809910741940)

(1)

NULL

P := [9, 19, -11]

[9, 19, -11]

(2)

seq(solve({l[i] = P[i]}, alpha), i = 1 .. 3)

{alpha = 3}, {alpha = 3}, {alpha = 3}

(3)

l1 := `<,>`(3+2*alpha, 1+0*alpha, 4-5*alpha)

Vector[column](%id = 36893489809910721460)

(4)

P1 := [9, 1, -11]

[9, 1, -11]

(5)

seq(solve({l1[i] = P1[i]}, alpha), i = 1 .. 3)

{alpha = 3}, {alpha = alpha}, {alpha = 3}

(6)

l2 := `<,>`(3+2*alpha, 1+0*alpha, 4-0*alpha)

Vector[column](%id = 36893489809910705556)

(7)

P2 := [9, 1, 4]

[9, 1, 4]

(8)

seq(solve({l2[i] = P2[i]}, alpha), i = 1 .. 3)

{alpha = 3}, {alpha = alpha}, {alpha = alpha}

(9)

l3 := `<,>`(3+2*alpha, 0+0*alpha, 4-0*alpha)

Vector[column](%id = 36893489809963852012)

(10)

P3 := [9, 0, 4]

[9, 0, 4]

(11)

seq(solve({l3[i] = P3[i]}, alpha), i = 1 .. 3)

{alpha = 3}, {alpha = alpha}

(12)

P4 := [9, 0, -2]

[9, 0, -2]

(13)

seq(solve({l3[i] = P4[i]}, alpha), i = 1 .. 3)

{alpha = 3}, {alpha = alpha}

(14)

 

Download 2024-12-21_Q_3D_point_lies_on_3D_line.mw

I don't know what that line above the question is. Thanks in Advance.

NULLComplex Numbers

 

Key Skills 11-48

NULLc11 := 2-3*i+(6+8*i)"(=)"8+5*i

c12 := 4+5*i-8+2*i"(=)"-4+7*i

c13 := -3+2*i-4+4*i"(=)"-7+6*i

c14 := 3-4*i+(3+4*i) = 6NULL

c15 := 2-5*i-8-6*i"(=)"-6-11*i

c16 := -8+4*i-2+2*i"(=)"-10+6*i

c17 := 3*(2-6*i)"(=)"6-18*i

c18 := -4*(2+8*i)"(=)"-8-32*i

NULLc19 := 2*i(2-3*i) = 2*i(2-3*i)NULL

c20 := 3*i*(-3+4*i) = 3*i*(-3+4*i)

c21 := (3-4*i)*(2+i) = (3-4*i)*(2+i)NULL

c22 := (5+3*i)*(2-i) = (5+3*i)*(2-i)

``

``

Download 1.3-Complex_Numbers_bad.mw

I'm trying to get my problems in standard form  a + bi . Questions 19 - 22 are wrong.

How can I display the symbol (blue solid circle) and the line (blue line) together in the legend box (( from   to ))?

plot(sin(x), x = -3 .. 3, colour = [blue], style = pointline, symbol = [solidcircle], numpoints = 20, legend = ["sin(x)"])

 

 
 

``

Download Plot1.mw

As a Maple beginner, I am now interested in symbolic calculations in Maple. As before, I set a problem from a subject area that interests me in order to learn from professional answers.

Determine all regular square (n;n) matrices (determinant not equal to zero) that are commutable with every regular (n;n) matrix with respect to matrix multiplication.

(I know the solution from long ago.)

Example code

printlevel :=1     

for indx1 from 1 by 1 to  3  do  

f[indx1] :=indx1;  

 end do;

This prints
f1:=1
f2:=2
f3:=3

How do I use the "save" command to save exactly the loop's results above to a file so that I can read the file later and execute it in another  maple worksheet.

The maple manual https://www.maplesoft.com/support/help/Maple/view.aspx? 

for "save"   contains no examples, and definately not how to save results of a loop using the save command. e.g. how do you append  with a file using the "save" command ?

Note: I dont need any help with reading the results, from the saved file, my question is only about writing the results with "save" command. The "save" command gives me the best results for reading files back into a speadsheet, and text file save routines just gives me ascii garbage and not the exact results in executable maple format as "save" does, saving exacltly what you see on screen. Therefore text save routines are useless to me.

I have a file TEST.m. How can I make it so that every time I start Maple, all the subprograms in the TEST.m file will run first? Then I just need to type the function with(TEST): sumpro(2,3,4) to get the result 9. I copied the TEST.m file into Maple's lib directory, but it doesn't run after starting Maple.

I just need to type sumvip(2, 3, 4) to get the result, but Maple doesn't understand it.

Please help.

TEST := module () local sumpro; export sumvip; option package;  sumpro := proc (a, b, c) local sumex; sumex := a+b+c; printf("sum of %A , %A and %A is %A", a, b, c, sumex) end proc; sumvip := proc () sumpro(args) end proc end module:

save TEST, "TEST.m"

with(TEST)

[sumvip]

(1)

sumvip(2, 3, 4)

sum of 2 , 3 and 4 is 9

 

NULL

Download TEST.mw

2024-12-20_Q_simplification_Question.mw
Solve the general cubic. Apply values and simplify. 

Could someone show how Maple simplifies to the value of X=3? I tried doing it manually and I could not figure it out. 

Also is there a Help assistant to see the setps?

restart

 

 

X^3+a*X=b

X^3+X*a = b

(1)

 

 

sol:=solve(X^3+a*X=b,[X])

[[X = (1/6)*(108*b+12*(12*a^3+81*b^2)^(1/2))^(1/3)-2*a/(108*b+12*(12*a^3+81*b^2)^(1/2))^(1/3)], [X = -(1/12)*(108*b+12*(12*a^3+81*b^2)^(1/2))^(1/3)+a/(108*b+12*(12*a^3+81*b^2)^(1/2))^(1/3)+((1/2)*I)*3^(1/2)*((1/6)*(108*b+12*(12*a^3+81*b^2)^(1/2))^(1/3)+2*a/(108*b+12*(12*a^3+81*b^2)^(1/2))^(1/3))], [X = -(1/12)*(108*b+12*(12*a^3+81*b^2)^(1/2))^(1/3)+a/(108*b+12*(12*a^3+81*b^2)^(1/2))^(1/3)-((1/2)*I)*3^(1/2)*((1/6)*(108*b+12*(12*a^3+81*b^2)^(1/2))^(1/3)+2*a/(108*b+12*(12*a^3+81*b^2)^(1/2))^(1/3))]]

(2)

vals:=[a=6,b=45]

[a = 6, b = 45]

(3)

Nans:=(map(eval,sol,vals))

[[X = (1/6)*(4860+12*166617^(1/2))^(1/3)-12/(4860+12*166617^(1/2))^(1/3)], [X = -(1/12)*(4860+12*166617^(1/2))^(1/3)+6/(4860+12*166617^(1/2))^(1/3)+((1/2)*I)*3^(1/2)*((1/6)*(4860+12*166617^(1/2))^(1/3)+12/(4860+12*166617^(1/2))^(1/3))], [X = -(1/12)*(4860+12*166617^(1/2))^(1/3)+6/(4860+12*166617^(1/2))^(1/3)-((1/2)*I)*3^(1/2)*((1/6)*(4860+12*166617^(1/2))^(1/3)+12/(4860+12*166617^(1/2))^(1/3))]]

(4)

simplify(Nans)

[[X = 3], [X = (1/4)*(I*3^(1/2)*(180+44*17^(1/2))^(2/3)+(8*I)*3^(1/2)-(180+44*17^(1/2))^(2/3)+8)/(180+44*17^(1/2))^(1/3)], [X = -3/2-((1/2)*I)*51^(1/2)]]

(5)
 

 

Download 2024-12-20_Q_simplification_Question.mw

In the decimal system, we are looking for all natural numbers with at most six digits that only swap the order of the digits when multiplied by 2, 3, ..., 6.

In a plane, equilateral triangles D(i) with side lengths a(i)= 2*i−1, i = 1; 2; 3; ... are arranged along a straight line g in such a way that the "right" corner point of triangle D(k) coincides with the "left" corner point of triangle D(k+1) and that the third corner points all lie in the same half-plane generated by g. Determine the curve/function on which the third corner points lie!

I am very happy to announce the first public release of a project which I have been working on for the last couple of years.

NODEMaple consists of a set of Maple workbooks and a library for structural design based on the Eurocode.

Currently the main development of the workbooks is focused on "Eurocode 5: Design of timber structures" with the Norwegian Annex.

This software has been made public in the hope of that it might be useful for other structural designers, professionals as well as students. Everyone interested is very Welcome to contribute to this project. The code is published under the GPLv3 license.

For more information see https://github.com/Anthrazit68/NODEMaple.

Good afternoon.

I have a differential equation of non-integer degree and would like to know if it is possible to express a solution in terms of elementary or special-functions for certain values of the exponent, n>0.

For this equation, Maple provides an analytical solution for the exponent values n=0 and n=1, otherwise, there is no solution returned. I am particularly interested in the cases where n=1/2, 3/2, 2, 5/2, and 3

I am hoping that someone can help me resolve this - if a closed-form solution is not possible, then a numerical solution would also be welcome.

I have provided the details in the attached worksheet.

Thanks for reading!

MaplePrimes_Dec_19.mw

Given the center x1 of a circle in R^2 with radius d12, and a point p2 on the circle, so that d12=||p2-x1||, denote the points on the line segment from x1 to p2 as x1(t) = x1+t*v12, with t=0..d12, and v12 =( p2-x1)/d12.  I want to animate the points x1(t) moving along the line segment from x1 to p2 and the corresponding circles of decreasing radius, with center x(t) and radius d12-t, so that p2 remains on the circle.

I can animate the points along the line segment from x1 to p2 using ‘style=point, symbol=solidcircle’.

I would like to use plottools-circle, to plot the circles. I have also tried the following type commands for the circles of decreasing radius.

Plot([x1(1)+t*v12(1)+(d12-t)*cos(theta)*v12(1)+ (d12-t)*sin(theta)*u12(1), x1(2)+ +t*v12(2)+(d12-t)*d12*cos(theta)*v12(2)+(d12-t)*sin(theta)*u12(2), theta=0..2*PI]

where u12 is a unit vector orthogonal to v12.

I have not been able to combine the two plots into an animation. Thank you

First 46 47 48 49 50 51 52 Last Page 48 of 2216