Unanswered Questions

This page lists MaplePrimes questions that have not yet received an answer

I have a workflow in which I edit files from a package I develop. These are usually mpl files, and I edit them in an editor (VS Code).

Then I have a worksheet called readFile.mw open in Maple that has two commands:

restart:

read("path/to/an/entry/file/that/includes/all/the/other/files")

and another worksheet actual.mw which is the actual worksheet I am working on, which starts with restart: with(MyPackage): and then contains calls to procedures from the package.

With this workflow, I make a change in the editor, execute readFile.mw and then go to my actual worksheet and restart and then use with(MyPackage), and the updates are available.

This works.

However, in actual.mw I may have a bunch of data that I don't want to wipe out with a restart. 

On the other hand, if I don't restart, a new call to with(MyPackage) does not update the import of the package (because it has already been imported. 

Is there an idiomatic or preferred way to accomplish reimporting the package without having to call restart?

PS I don't remember now the exact reason why I don't have the call to read the file in actual.mw but it had something to do with this issue of not getting the package updated correctly.

I think my question can be answered without necessrily providing any code. 

I have a procedure that takes in many arguments and performs heavy calculations (solves multiple sets of differential equations in parallel using Grid:-Map and then does matrix manipulations with results, etc).

It runs fine in a Maple worksheet. 

Until about half an hour ago, I hadn't used the Maple CLI. I would like to run my procedure from the CLI. I did exactly the steps as I do them in a worksheet.

with(MyPackage):

myProcedure(argsList);

But Maple just echoes the second command back to me. myProcedure is in myPackage. There is a much simpler procedure in that package called myProcedure2 and I can call that just fine from the CLI.

What could be happening?

 

 

queryequal(expr1, expr2)

queryequal(Int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0) = 2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2)), 2^(1/2)*EllipticF((1-1/(1+x__0))^(1/2)*2^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2)))

(1)

(This question has its origin here).
Plotting the difference of rhs - lhs seems to indicate equality over the range [0..1)

difference := rhs(op(queryequal(Int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0) = 2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2)), 2^(1/2)*EllipticF((1-1/(1+x__0))^(1/2)*2^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2))))[1])-op(queryequal(Int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0) = 2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2)), 2^(1/2)*EllipticF((1-1/(1+x__0))^(1/2)*2^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2))))[2]; plot(difference, x__0 = 0 .. 1, title = 'difference', color = RED)

 

Try simplify

`assuming`([simplify(difference)], [0 < x__0 and x__0 < 1])

(EllipticK((1/2)*(2+2*x__0)^(1/2))-EllipticF(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2))-EllipticF(1/(1+x__0)^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2)))*2^(1/2)

(2)

Try combine

`assuming`([combine(difference)], [0 < x__0 and x__0 < 1])

-2^(1/2)*EllipticF((x__0/(1+x__0))^(1/2)*2^(1/2), (1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2))+2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))

(3)

Try conversion to integral form

convert(difference, Int)

2^(1/2)*(Int(2/((-_alpha1^2+1)^(1/2)*(-2*_alpha1^2*x__0-2*_alpha1^2+4)^(1/2)), _alpha1 = 0 .. 1))-2^(1/2)*(Int(2/((-_alpha1^2+1)^(1/2)*(-2*_alpha1^2*x__0-2*_alpha1^2+4)^(1/2)), _alpha1 = 0 .. 1/(1+x__0)^(1/2)))-2^(1/2)*(Int(2/((-_alpha1^2+1)^(1/2)*(-2*_alpha1^2*x__0-2*_alpha1^2+4)^(1/2)), _alpha1 = 0 .. (1-1/(1+x__0))^(1/2)*2^(1/2)))

(4)

`assuming`([simplify(%)], [0 < x__0 and x__0 < 1])

-2*2^(1/2)*(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = 0 .. 1/(1+x__0)^(1/2))-(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2) .. 1)))

(5)

plot(-2*2^(1/2)*(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = 0 .. 1/(1+x__0)^(1/2))-(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2) .. 1))), x__0 = .999 .. 1, color = RED)

 

evalf(eval(-2*2^(1/2)*(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = 0 .. 1/(1+x__0)^(1/2))-(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2) .. 1))), x__0 = 1), 40); evalf(eval(-2*2^(1/2)*(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = 0 .. 1/(1+x__0)^(1/2))-(Int(1/((-_alpha1^2+1)^(1/2)*(4+(-2*x__0-2)*_alpha1^2)^(1/2)), _alpha1 = x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2) .. 1))), x__0 = .9999999999), 40)

-0.8716953127866940896552122384831392143938e-30

(6)

There seems to be a finite difference at x__0 = 1

``

Try an addition theorem from DLMF

Since all elliptic expression have the same modulus k, the following addition theorem could be applied under the condition that the corresponding case is fulfilled https://dlmf.nist.gov/19.11#E7

Check if the following case applies (i.e. is ψ=π/2?)

 

NULL

NULL

queryequal(Int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0) = 2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2)), 2^(1/2)*EllipticF((1-1/(1+x__0))^(1/2)*2^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2)))

queryequal(Int(1/((x__0-x)^(1/2)*(-x^2+1)^(1/2)), x = 0 .. x__0) = 2^(1/2)*EllipticK((1/2)*(2+2*x__0)^(1/2))-2^(1/2)*EllipticF(1/(1+x__0)^(1/2), (1/2)*(2+2*x__0)^(1/2)), 2^(1/2)*EllipticF((1-1/(1+x__0))^(1/2)*2^(1/2), (1/2)*(1+x__0)^(1/2)*2^(1/2)))

(7)

theta = 1/sqrt(1+x__0), `&varphi;` = sqrt(1-1/(1+x__0))*sqrt(2)

theta = 1/(x__0+1)^(1/2), varphi = (1-1/(x__0+1))^(1/2)*2^(1/2)

(8)

k = (1/2)*sqrt(1+x__0)*sqrt(2)

k = (1/2)*(x__0+1)^(1/2)*2^(1/2)

(9)

tan((1/2)*psi) = (sin(theta)*Delta(`&varphi;`)+sin(`&varphi;`)*Delta(theta))/(cos(theta)+cos(`&varphi;`))

tan((1/2)*psi) = (sin(theta)*Delta(varphi)+sin(varphi)*Delta(theta))/(cos(theta)+cos(varphi))

(10)

Delta(theta) = sqrt(1-k^2*sin(theta)^2)

Delta(theta) = (1-k^2*sin(theta)^2)^(1/2)

(11)

subs(theta = `&varphi;`, Delta(theta) = (1-k^2*sin(theta)^2)^(1/2))

Delta(varphi) = (1-k^2*sin(varphi)^2)^(1/2)

(12)

subs(Delta(theta) = (1-k^2*sin(theta)^2)^(1/2), Delta(varphi) = (1-k^2*sin(varphi)^2)^(1/2), k = (1/2)*(1+x__0)^(1/2)*2^(1/2), theta = 1/(1+x__0)^(1/2), varphi = (1-1/(1+x__0))^(1/2)*2^(1/2), tan((1/2)*psi) = (sin(theta)*Delta(varphi)+sin(varphi)*Delta(theta))/(cos(theta)+cos(varphi)))

tan((1/2)*psi) = (sin(1/(x__0+1)^(1/2))*(1-(1/2)*(x__0+1)*sin((1-1/(x__0+1))^(1/2)*2^(1/2))^2)^(1/2)+sin((1-1/(x__0+1))^(1/2)*2^(1/2))*(1-(1/2)*(x__0+1)*sin(1/(x__0+1)^(1/2))^2)^(1/2))/(cos(1/(x__0+1)^(1/2))+cos((1-1/(x__0+1))^(1/2)*2^(1/2)))

(13)

`assuming`([simplify(subs(psi = (1/2)*Pi, tan((1/2)*psi) = (sin(1/(1+x__0)^(1/2))*(1-(1/2)*(1+x__0)*sin((1-1/(1+x__0))^(1/2)*2^(1/2))^2)^(1/2)+sin((1-1/(1+x__0))^(1/2)*2^(1/2))*(1-(1/2)*(1+x__0)*sin(1/(1+x__0)^(1/2))^2)^(1/2))/(cos(1/(1+x__0)^(1/2))+cos((1-1/(1+x__0))^(1/2)*2^(1/2)))))], [0 < x__0 and x__0 < 1])

1 = (sin(1/(x__0+1)^(1/2))*((2+2*x__0)*cos(x__0^(1/2)*2^(1/2)/(x__0+1)^(1/2))^2+2-2*x__0)^(1/2)+sin(x__0^(1/2)*2^(1/2)/(x__0+1)^(1/2))*((2+2*x__0)*cos(1/(x__0+1)^(1/2))^2+2-2*x__0)^(1/2))/(2*cos(1/(x__0+1)^(1/2))+2*cos(x__0^(1/2)*2^(1/2)/(x__0+1)^(1/2)))

(14)

plot([lhs(1 = (sin(1/(1+x__0)^(1/2))*((2+2*x__0)*cos(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2))^2+2-2*x__0)^(1/2)+sin(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2))*((2+2*x__0)*cos(1/(1+x__0)^(1/2))^2+2-2*x__0)^(1/2))/(2*cos(1/(1+x__0)^(1/2))+2*cos(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2)))), rhs(1 = (sin(1/(1+x__0)^(1/2))*((2+2*x__0)*cos(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2))^2+2-2*x__0)^(1/2)+sin(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2))*((2+2*x__0)*cos(1/(1+x__0)^(1/2))^2+2-2*x__0)^(1/2))/(2*cos(1/(1+x__0)^(1/2))+2*cos(x__0^(1/2)*2^(1/2)/(1+x__0)^(1/2))))], x__0 = 0 .. 1, legend = [lhs, rhs])

 

lhs and rhs are not equal -> Case psi = (1/2)*Pi does not apply (provided that the formulas have been applied correctly).
Perhaps this is why Maple does not simply the difference to zero.  NULL


Anything else that could be tried in Maple (maybe with other formulas)?

Download Equality_of_Elliptic_expressions.mw

Hi,

I have been bothered lately by the number format for axis labels in Maple. My problem existed before, but it apparently didn't bother me before. I have spent many hours trying to find an answer in the program help, in MaplePrimes, and in general online searches. I am not having any luck at all (good luck, that is).

I want to change the format of the axis numbering. Maple seems to default to 2 decimal places in my graph, and I really need more. Oddly, when I export the graph to PDF, I get another decimal place (even though I didn't explicitly ask for one). 

How do I change the axis-label format? Any idea what I might get when I export the graph?

Thanks for your help,

Jno.

 

Hi MaplePrimes, 

I am interested in obtaining some gravitational field equations from an action using the FunDiff command. I have been able to write what I think is a pretty short and quick worksheet(with an arbitrary metric) and I am easily able to obtain the Einstein Field Equations. However, when I introduce some new more complicated terms into the action and apply the Simplify command maple does not appear to be able to evaluate and I end up halting the computation. When I specify a metric Maple, for example Schwarzschild, Maple will easily be able to Simplify my expression but it will use metric components during the process. Where what I am interested in is just the Tensor expression with respective indices. 

I was wondering if anyone had any thoughts on how I could resolve this. 

I have attached the worksheet that I am working with. I look forward to your thoughts/comments.

Thank you.  

ActionFieldEquations.mw

Help, have no idea what to do.

Obtain a finite topological space from a dynamical system specified as a system of ODEs, by writing Maple code for following steps (use Maple packages DynamicSytems and GraphTheory, preferablly):

  1. Visualize the phase space of the system by plotting solution curves for different initial conditions.

  2. Consider a finite region of the phase space.

  3. Define a finite grid of points in the region.

  4. Define a topology on the grid points based on their connectivity.

  5. Give some useful information regarding the dynamical system in terms of topological properties.

Article https://mapleprimes.com/posts/208409-Downloading-Historical-Stock-Quotes has worked well for the last few years.

Somewhere in the last 6 months Yahoo has changed the method. Crumbstore no longer exists within the page source.

Does anyone have a method that currently works.

Problem is also verified at: https://www.solveforum.com/forums/threads/solved-yahoo-finance-cookie-and-crumb-not-working.2316600/ ,however they do not have a solution.

Dear all,

consider two lists of complex values :

list1 := [l1,l2,l3,l4,l5]

list2 := [s1,s2,s3,s4,s5].

There is a set of second order differential equation

d^2u(k)/dt^2+I*A*du/dt-B*u=0

where A is sum of elements of list1 and list2 and B is multiplication of their element. Therefore,

d^2u[1](k)/dt^2+I*(l1+s1)*du[1]/dt-(l1*s1)*u[1]=0

d^2u[2](k)/dt^2+I*(l2+s2)*du[2]/dt-(l2*s2)*u[2]=0

d^2u[3](k)/dt^2+I*(l3+s3)*du[3]/dt-(l3*s3)*u[3]=0

d^2u[4](k)/dt^2+I*(l4+s4)*du[4]/dt-(l4*s4)*u[4]=0

d^2u[5](k)/dt^2+I*(l5+s5)*du[5]/dt-(l5*s5)*u[5]=0

How can I create a set of differential equations and initial conditions based on nops(list1), then solve this system of differential equations numerically in Maple.

since u[i] are function of k, next step is to transforme them to real space by inverse fourier transform.

finally save the results and plot them.

Note that for simplisity I wrote a linear equation but it is not. so, because of nonlinear terms it is not possible to use superposition of the solution. I have to take them as coupled system of equations.

====

for example

list1 := [ [0., -5.496799068*10^(-15)-0.*I], [.1, 5.201897725*10^(-16)-1.188994754*I], [.2, 6.924043163*10^(-17)-4.747763855*I], [.3, 2.297497722*10^(-17)-10.66272177*I], [.4, 1.159126178*10^(-17)-18.96299588*I] ] 

list2 :=[ [0., -8.634351786*10^(-7)-67.81404036*I], [.1, -0.7387644021e-5-67.76491234*I], [.2, -0.1433025271e-4-67.59922295*I], [.3, -0.2231598645e-4-67.25152449*I], [.4, -0.3280855430e-4-66.56357035*I] ]

where first element is k and the second value is l_i and s_i

the differential equation is

ode_u[i]:= diff(u[i](t),t$2)+I*(list1[i][2]+list2[i][2])*diff(u[i](t),t)-list1[1][2]*list2[2][2]*u[i](t)=0;

eta is in fourier space where k values are in list1[i][1].

We laso know that f(-k)= - f*(k) where f=list[i][2]

and u[i] as function of k, initially has a Gaussian shape at t=0 in fourier space..

Thanks in advance for your help

Anyone out there converted the  nyqlog at MATLAB/nyqlog.m at master · nielsSkov/MATLAB · GitHub  to Maple or Maple Flow? For Nyquist plots...

Bonjour, petite question simple que je me pose la MapleSim permet de tout réaliser ?

I want to import a numeric 2800*1 matrix from matlab to maple by following command, but faced error as bellow:

X := ImportMatrix("E:/.../Omega.mat", source = MATLAB);
 ImportMatrix:-ModuleApply called with arguments: E:/.../Omega.mat, datatype = auto, delimiter = (), format = (), mode = (), output = all, ragged = true, skiplines = 0, source = MATLAB, sourceid = all, transpose = false
 #(ImportMatrix:-ModuleApply,36): error
Error, (in ImportMatrix) Array index out of range
 locals defined as: file = E:/.../Omega.mat, src = Matlab, ext = ext, res = res, x = x, isv7 = isv7, del = false

Where is the problem?

How to import?

Hello guys
I'm having trouble solving a PDE using pdsolve-numerical. Here's a notebook attached.

I'm grateful if anyone can help.

Regards,

Oliveira

                   PDE1.mw

I would appreciate any help to solve the following Partial Differential Equation, which is a mix of partial and regular derivatives as coefficients.

How to solve it with/without initial conditions?

Let us begin with few simulations: 
 

restart;

CodeTools:-Usage(plots['pointplot3d'](Matrix((proc (_) options operator, arrow; [_[() .. (), 1]-_[() .. (), 3], _[() .. (), 2]-_[() .. (), 4], _[() .. (), 5]] end proc)(convert(ssystem("wolframscript -code \"RandomPoint[Simplex[IdentityMatrix[5]], 2*^4]\"")[-1], FromMma)), scan = [rectangular, columns], datatype = float[4]), scaling = constrained))

memory used=0.57TiB, alloc change=91.51MiB, cpu time=18.77m, real time=15.86m, gc time=4.91m

 

CodeTools:-Usage(plots['pointplot3d'](Matrix((proc (_) options operator, arrow; [_[() .. (), 1]-_[() .. (), 3], _[() .. (), 2]-_[() .. (), 4], _[() .. (), 5]] end proc)(convert(ssystem("wolframscript -code \"RandomPoint[Sphere[5], 2*^4, ConstantArray[List[0, 1], 5]]\"")[-1], FromMma)), scan = columns, datatype = float[4]), scaling = constrained))

memory used=0.56TiB, alloc change=-12.08MiB, cpu time=18.70m, real time=15.11m, gc time=5.69m

 

NULL


 

Download iDistributionVector.mws

Well, I'd like to prove (through the use of Maple): 

transform((x1, x2, x3, x4, x5) -> [x1 - x3, x2 - x4, x5])(inequal(And((x || (1 .. 5)) >=~ 0, norm([x || (1 .. 5)], 1) = 1))) # not Maple syntax

is equivalent to a filled pyramid

ImplicitRegion((X, Y, Z), 0 <= Z <= 1 - abs(X) - abs(Y)) # not SymPy syntax

transform((x1, x2, x3, x4, x5) -> [x1 - x3, x2 - x4, x5])(inequal(And((x || (1 .. 5)) >=~ 0, norm([x || (1 .. 5)], 2) = 1))) # not Maple syntax

is equivalent to a hemi-ball

ImplicitRegion((X, Y, Z), 0 <= Z <= sqrt(1 - X**2 - Y**2)) # not SymPy syntax

, and 

transform((x1, x2, x3, x4, x5) -> [x1 - x3, x2 - x4, x5])(inequal(And((x || (1 .. 5)) >=~ 0, norm([x || (1 .. 5)], 'infinity') = 1))) # not Maple syntax

is equivalent to a solid cuboid

ImplicitRegion((X, Y, Z), -1 <= X <= 1 & -1 <= Y <= 1 & 0 <= Z <= 1) # not SymPy syntax

. (Here, for the convenience of the descriptions, I utilize some non-standard notation from .) 
Note that ”two regions are equal" is a two-way property, which means the following proof 

is(Z >= 0) and is(Z <= 1 - abs(X) - abs(Y)) assuming (X, Y, Z) =~ (x1 - x3, x2 - x4, x5), x || (1 .. 5) >=~ 0, add(x || (1 .. 5)) = 1;
                              true
(*Accordingly, the latter region is a subset of the former one.*) 

is incomplete (because it's hard to determine whether the is routine always performs equivalent transformations in internal evaluation). 

So, can I execute such eliminations in Maple?

As the code:

poly := x^4 + 8*x + 12:
galois(poly, x)

"4T4", {"A(4)"}, "+", 12, {"(1 2 4)", "(2 3 4)"}

 Then I know it's Galois group has to be (isomorphic to) A4. And I can draw its Subgroup Lattice:

DrawSubgroupLattice(GaloisGroup(poly, x), 'indices')

But according to Galois's theory, each subgroup represents an intermediate field. As far as I know, ⑤⑥⑦⑧ are Q(r1),Q(r2),Q(r3) and Q(r4), respectively, where ri is the root of equation x^4+8x+12. But I have no idea what fields ②③④⑨ means. How do you calculate out those intermediate fields with maple?

First 8 9 10 11 12 13 14 Last Page 10 of 318