MaplePrimes Questions

Hello

I had to save previous results of a calculation to files as the number of elements is too big for my computer to handle in one go.   Here it is an idea of what I am doing to read the files and perform the calculations.

mainproc:=proc(arg1,arg2,arg3,arg4) ... end proc:

Grid:-Set(mainproc):
Grid:-Set(arg2,arg3,arg4):   #  They don't change ever.

for i from 1 to number_of_files do 
   read(...):  # it reads arg1 from a file
   Grid:-Set(arg1):
   ans:=Grid:-Seq(mainproc(arg1[i],arg2,arg3,arg4),i=1..numelems(arg1))):
   Grid:-Wait():
   save ans, ....:
   unassign('arg1'):
   unassign('ans'):
   gc():  # An attempt
end do:

The actual code works but, for every step in the loop, the memory used by Maple increases by a certain amount that seems to be mostly related to arg1 (as if arg1 is piling up from iteration to iteration). 

I read some of the earlier posts on a similar subject dated 5 to 10 years old.  I wonder if there is something new that can be done to minimize the usage of memory.   

Many thanks

Ed

PS. I am aware of tasksize, numcpus and Threads.   

I have a simple matrix, 11 rows x 3 columns, with header row.  <<

I multiply column 1 and 2 to get <<0.,0.031,0.218,0.657,1.084,1.095,0.654,0.217>>

Now, I just want to add up these elements, but 'sum' doesn't work 'Sum' doesn't work either. Is there a simpel way to do this?
 

m1 := `<|>`(`<,>`("# girls", 0, 1, 2, 3, 4, 5, 6, 7, 8), `<,>`("P(x)", 0.4e-2, 0.31e-1, .109, .219, .271, .219, .109, 0.31e-1, 0.4e-2), `<,>`("x*P(x)", 0, 0, 0, 0, 0, 0, 0, 0, 0))

Matrix(%id = 18446745635438952446)

(1)

m1[2 .. 9, 3] := `~`[`*`](m1[2 .. 9, 1], m1[2 .. 9, 2])

Vector[column](%id = 18446745635417541318)

(2)

"Sum?"

Vector[column](%id = 18446745635493441398)

(3)

"sum?"

Error, (in LinearAlgebra:-Multiply) invalid arguments

 

``


 

Download Untitled_(3).mw

I must do some formula manipulation
 

Classification of conic sections

restart; with(student):

A*x^2+B*y^2+C*x+D*y+E=0;

A*x^2+B*y^2+C*x+D*y+E = 0

(1)

f:= A*x^2+B*y^2+C*x+D*y+E;

A*x^2+B*y^2+C*x+D*y+E

(2)

completesquare(f, x);

A*(x+(1/2)*C/A)^2-(1/4)*C^2/A+B*y^2+D*y+E

(3)

f:= A*x^2+B*y^2+C*x+D*y+E;

A*x^2+B*y^2+C*x+D*y+E

(4)

ans:=Student[Precalculus][CompleteSquare]( (4), [y] );

B*(y+(1/2)*D/B)^2+A*x^2+C*x+E-(1/4)*D^2/B

(5)

ans1:=Student[Precalculus][CompleteSquare]( (4), [x] );

A*(x+(1/2)*C/A)^2-(1/4)*C^2/A+B*y^2+D*y+E

(6)

ans+ans1;

B*(y+(1/2)*D/B)^2+A*x^2+C*x+2*E-(1/4)*D^2/B+A*(x+(1/2)*C/A)^2-(1/4)*C^2/A+B*y^2+D*y

(7)

B*(y + D/(2*B))^2 + A*x^2 + C*x + 2*E - D^2/(4*B) + A*(x + C/(2*A))^2 - C^2/(4*A) + B*y^2 + D*y = 0;

B*(y+(1/2)*D/B)^2+A*x^2+C*x+2*E-(1/4)*D^2/B+A*(x+(1/2)*C/A)^2-(1/4)*C^2/A+B*y^2+D*y = 0

(8)

Now i must  get this form A( )^2 +B( )^2 = M  

 


 

Download vraag_herleiding_conic_sections_formule.mw

 

 

Does this condition happen when the character is too long?

Hello everybody,

i am trying to use PDEchangecoords to transform a system of differential equations from Cartesian coordinates to toroidal coordinates. However, when i use a user defined coordinate transform from toroidal to Cartesian, i don't get the initial equations. Please find attached a minimal working environment.

i would highly appreciate your hints and suggestions!

Thank you

Best regards,

F

question.mw
 

NULL

NULL

NULL

restart; with(DEtools); addcoords(invToroidal, [xi, eta, phi], [sinh(xi)*cos(phi)/(cosh(xi)-cos(eta)), sinh(xi)*sin(phi)/(cosh(xi)-cos(eta)), sin(eta)/(cosh(xi)-cos(eta))]); PDEchangecoords(diff(f(x, y, z), z), [x, y, z], toroidal, [xi, eta, phi]); PDEchangecoords(%, [xi, eta, phi], invToroidal, [x, y, z]); print("i would expect here to get", diff(f(x, y, z), z))

"i would expect here to get", diff(f(x, y, z), z)

(1)

NULL


 

Download question.mw

 

Dear Community,

I would like to have an inverse interpolation with a 2D lookup table in MapleSim. The usual 2D lookup interpolation has u1 column values, and u2 row values, and a corresponding   y   table values, i.e. y = f(u1,u2). Now I would like to go the reverse way. Suppose I know y, and u2, and I would like to get u1. How can I implement this in MapleSim? An additional information is, that the 3D surface represented by the f(u1, u2) function is a smooth, slightly curved, monotonically sloping surface, so to any  y  value a unique pair of u1 and u2 values belong.

 

With my specific data, which are attached in the TestVLP.xlsx file:

 

  • u2 values are: 1st row, cells 2 .. 14
  • u1 values are  1st column, rows 2 .. 11
  • tabulated values are all the rest, i.e. from cell(2,2) .. cell(11,14)

 

Now for my case:

 

  • u2 = 42000.0
  • y   = 94.5614

 

How much is u1? I know the correct answer from elsewhere, it should be something very close to u1 ~ 85. This  y  value is in the rectangle bordered by columns 7 .. 8  and rows 5 .. 6 in the Excel file.

 

So my question is how do I correctly implement this in MapleSim? As visible from the attached TestInverse2DInterpolation.msim file I tried to do it with an Inverse Block Constraints component and a horizontally flipped 2D Lookup Table (VLP) and Constants for y and u2, but upon running MapleSim I get an error message that no solution is found, although the solution is relatively easy and straightforward. May I ask you to have a look at it, what can be the problem here, what do I do wrong? I’m using MapleSim 2019.2.

 

Your kind help is appreciated in advance

best regards

 

Andras

TestInverse2DInterpolation.msim

TestVLP.xlsx

Hello Everyone!

I have one more challenge for you.

How can I find for a Free-Pinned-Pinned-Free (3-span) beam (Picture A below) using the Krylov–Duncan Method (Literature links and references below):

- the matrix of the system?

- the transcendental equation in order to determine the natural frequencies?

- the first three mode shapes?

I tried to do it as you can see from my MAPLE (file below), but I got stuck when I use the command "determinant" and it did not find the transcendental equation.

Krylov_function_free_pinned_pinned_free_beam.mw

 

Picture_A

References:

Krylov–Duncan Method
https://link.springer.com/content/pdf/10.1007%2F978-1-4419-1047-9_14.pdf
 

Krylov–Duncan Functions - page 96

You can find that book using the https://libgen.is/
https://www.amazon.com/Formulas-Structural-Dynamics-Tables-Solutions/dp/0071367128

Hello.

I would like to solve numerically highly nonlinear and cumbersome the second order differential equation. 

Applying the numerical procedure I got an error "Error, (in dsolve) found wrong extra argument(s): range = 0 .. 4*Pi, type = numerical". The similar problem has been described earlier here however I can't realize my problem. 

Below is my code

restart;

A1 := 8*Pi^3*R^2*n(x)^4*m+(2*Pi*sin((1/2)*x)*m*omega0*p+Pi*sin((1/2)*x)*m*omega0+3*Pi^2*(diff(n(x), x, x)))*n(x)^3+(-2*sin((1/2)*x)^2*m^2*omega0^2*p^2+2*cos((1/2)*x)^2*m^2*omega0^2*p^2-2*sin((1/2)*x)^2*m^2*omega0^2*p+2*cos((1/2)*x)^2*m^2*omega0^2*p)*n(x)^2+(-4*(diff(n(x), x, x))*sin((1/2)*x)^2*m^2*omega0^2*p^2-8*sin((1/2)*x)*(diff(n(x), x))*cos((1/2)*x)*m^2*omega0^2*p^2-4*(diff(n(x), x, x))*sin((1/2)*x)^2*m^2*omega0^2*p-8*sin((1/2)*x)*(diff(n(x), x))*cos((1/2)*x)*m^2*omega0^2*p)*n(x)+8*sin((1/2)*x)^2*(diff(n(x), x))^2*m^2*omega0^2*p^2+8*sin((1/2)*x)^2*(diff(n(x), x))^2*m^2*omega0^2*p;

R := 1; m := 1; p := 10; omega0 := 1000;

A2 := A1;

with(plots):
A3 := dsolve({A2, n(0) = n(4*Pi), (D(n))(0) = (D(n))(4*Pi)}, type = numerical, range = 0 .. 4*Pi):

odeplot(A3);


I appreciate for any help and suggestion.

 

Help required to plot the real part only in  multiple plots. i have written some codes  please help me to rectify the errors.Thanks in advance

 

restart:
with(plots):
n:=0.75:Eh:=100:mn:=1:t0:=0.2:
a1:=(mn/t0)^((n-1)/(n))*(tb)^(1/n):a3:=Eh/tb:a4:=(Eh)^2:
U1:=(a1/Eh)*(-1+(a3*r/Eh))^(1/n)*(n*a4/(1+n))*(1/a3-(r/Eh))-a1*(-1+(1/tb))^(1/n)*(n/(n+1)*(tb-1)):
plot([Re(seq(eval(U1,tb=j),j in[0.8,0.9,1.0]))],r=0..1,legend = [tb =0.8, tb=0.9,tb =1.0],  labels = ["z ", "U"], labeldirections = ["horizontal", "vertical"],  linestyle = [solid,dash,dot],color = [black, red,green]);

I want to shade the area where the two polar curves overlap. The first curve is r=2 and the other curve is r=2(1-cos(theta)). How do I do this?

I want to find the surface area of this parametric curve revolving around the x-axis. I was able to plot the 2D rendering but I want to show the plot so that I can see the surface area. I suspect that would be the 3D rendering.

x=cos(t), y=2+sin(t), 0<=t<=2pi, x-axis

I see this error once in a while

Error, (in SolveTools:-CancelInverses) assertion failed, simplify should not leak _Z variables out from RootOfs 

When I run a long script. Unfortunately, I have not been able to make a small example to reproduce it. So it is random. I've seen it about 5-6 times in the last 2-3 weeks, over 100 runs during this time.

Just wanted to see if anyone saw this before. The strange thing it is random. I can re-run the same script, or restart it from the point where it failed,  with no changes anywhere, and this error do not show up again for days, and suddenly it shows up again.

Must be related how to Maple internal cache memory happened to be arranged at that time. I noticed that a number of things in Maple seem to happen at random times, such as a random hang of the server at different times and places. I could never understand why this happens in Maple.

If there is only one thing Maplesoft could do for the next version, it will be to improve the robustness of its software.

Update March 7, 2024.

FYI, examples giving this error using Maple 2024 using different functions


 

interface(version);

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

restart;

kernelopts('assertlevel'=2):

ode:=(exp(x)*sin(y(x))-3*x^2)+(exp(x)*cos(y(x))+y(x)^(-2/3)/3)*diff(y(x),x)=0;
DEtools:-odeadvisor(ode,y(x))

exp(x)*sin(y(x))-3*x^2+(exp(x)*cos(y(x))+(1/3)/y(x)^(2/3))*(diff(y(x), x)) = 0

Error, (in SolveTools:-CancelInverses) assertion failed, simplify should not leak _Z variables out from RootOfs

ode:=diff(y(x),x)*y(x)/(1+1/2*sqrt(1+diff(y(x),x)^2))=-x;
dsolve([ode,y(0)=3],y(x))

(diff(y(x), x))*y(x)/(1+(1/2)*(1+(diff(y(x), x))^2)^(1/2)) = -x

Error, (in SolveTools:-CancelInverses) assertion failed, simplify should not leak _Z variables out from RootOfs

 


 

Download leak_Z_maple_2024.mw

 

I have reported this to Mapesoft.

 

Any chance to get a dataplot with units in one or both axis?

Or is this another thing where units are cause of trouble?

plotunits1.mw

Hi Everyone!

I would like your help again.

Considering a Free-Pinned-Pinned-Free beam (page 88 in the pdf file). In case of a matrix 12x12 how could I find the coefficients (a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4) using MAPLE in order to plot the mode shapes of the Figure 3.22 (a) (page 70 in the pdf file)? in case of a matrix 16x16 and  20x20, the procedure is the same?

I tried to plot the mode shapes but I failed because I believe they should be similar to Figure 3.22 (a) (page 70 in the pdf file)

 

sys_GE := {-a1 + a3 = 0, -a2 + a4 = 0, 0.9341161484*a1 + 0.3569692163*a2 + 1.519943120*a3 + 1.819402948*a4 = 0, 0.6669014188*b1 - 0.7451459573*b2 + 5.530777989*b3 + 5.620454178*b4 = 0, 0.9938777922*c1 - 0.1104849953*c2 + 62.17096851*c3 + 62.17901032*c4 = 0, -0.9341161484*a1 - 0.3569692163*a2 + 1.519943120*a3 + 1.819402948*a4 + 0.9341161484*b1 + 0.3569692163*b2 - 1.519943120*b3 - 1.819402948*b4 = 0, -0.3569692163*a1 + 0.9341161484*a2 + 1.819402948*a3 + 1.519943120*a4 + 0.3569692163*b1 - 0.9341161484*b2 - 1.819402948*b3 - 1.519943120*b4 = 0, 0.3569692163*a1 - 0.9341161484*a2 + 1.819402948*a3 + 1.519943120*a4 - 0.3569692163*b1 + 0.9341161484*b2 - 1.819402948*b3 - 1.519943120*b4 = 0, -0.7451459573*b1 - 0.6669014188*b2 + 5.620454178*b3 + 5.530777989*b4 + 0.7451459573*c1 + 0.6669014188*c2 - 5.620454178*c3 - 5.530777989*c4 = 0, -0.6669014188*b1 + 0.7451459573*b2 + 5.530777989*b3 + 5.620454178*b4 + 0.6669014188*c1 - 0.7451459573*c2 - 5.530777989*c3 - 5.620454178*c4 = 0, 0.7451459573*b1 + 0.6669014188*b2 + 5.620454178*b3 + 5.530777989*b4 - 0.7451459573*c1 - 0.6669014188*c2 - 5.620454178*c3 - 5.530777989*c4 = 0}

 

solve(sys_GE, {a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4});
        {a1 = 0.1014436637 c4, a2 = -0.1143870369 c4, 

          a3 = 0.1014436637 c4, a4 = -0.1143870369 c4, 

          b1 = 0.07095134140 c4, b2 = -0.1260395712 c4, 

          b3 = 0.1510591164 c4, b4 = -0.1737777468 c4, 

          c1 = 0.2102272829 c4, c2 = -0.2816561313 c4, 

          c3 = -1.003990622 c4, c4 = c4}

26_06_2020_Transcedental_equation_matrix_12x12_artigo_2.mw

Hello everyone, can anyone help me to solve this problem? noted I want to solve a couple of odes and need to find involved integration constant i.e c1 to c4. 
 

restart

diff(q(y), y, y)-A*q(y) = B*(P*y+c1)

diff(diff(q(y), y), y)-A*q(y) = B*(P*y+c1)

(1)

NULL

bc := q(-sigma) = 0, q(sigma) = 0

q(-sigma) = 0, q(sigma) = 0

(2)

(1+N)*(diff(u(y), y, y))+N*(diff(q(y), y)) = P

(1+N)*(diff(diff(u(y), y), y))+N*(diff(q(y), y)) = P

(3)

bc := u(-sigma) = 1, u(sigma) = -k

u(-sigma) = 1, u(sigma) = -k

(4)

``


 

Download help_couple_ode.mw

First 409 410 411 412 413 414 415 Last Page 411 of 2308