Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Maple generates latex for hbar as  \mathit{hbar}  instead of just \hbar which makes it not render in PDF.  Here is an example

expr:= hbar*x;
latex(expr)

The screen display is correct. But not the latex. When compiling the above in Latex this is the output

\documentclass[12pt]{article}
\usepackage{amssymb}

\begin{document}  

%Maple generated
\[
\mathit{hbar} x
\]

%default
\[
\hbar x
\]

%need amssymb for this
\[
\hslash x
\]
\end{document}

Compiling the above gives

So to use the standard hbar,  \mathit should not be used around it. 

ps. I like \hslash more myself than \hbar , so if there is a choice, will vote for \hslash for latex.

Maple 2021, windows 10. 

 

Physics:-Version()
The "Physics Updates" version in the MapleCloud is 973 and is 

   the same as the version installed in this computer, created 

   2021, May 3, 18:54 hours Pacific Time.


 

Dear Maple community,

I was wondering whether you could help me with the following problem: Consider the non-linear system of 4 equations in 4 unknowns: {y[2,1], y[2,2], y[4,1], y[4,2]}, see MapleQ.mw. Please also note that equations y[2,1] and y[2,2] in sys2 are homogenous of degree 1 (i.e., defined only up to scale). In principle, it should be possible to choose either y[2,1] or y[2,2] as a free and unconstrained variable (a scaling factor) and express all other unknowns in terms of it. Unfortunately, I couldn't yet implement it in the current setting and was wondering whether you give me a hand. Thank you very much in advance!

``

sys1 := {y[4, 1] = 33^(2/3)*50^(1/3)/(33*(1/(y[2, 1]^(3/2)*y[4, 1]^(3/2)))^(1/3))+2^(2/3)*5^(1/3)/(2*(1/(y[2, 2]^(3/2)*y[4, 2]^(3/2)))^(1/3)), y[4, 2] = 11^(2/3)*50^(1/3)/(11*(1/(y[2, 1]^(3/2)*y[4, 1]^(3/2)))^(1/3))+4^(2/3)*5^(1/3)/(4*(1/(y[2, 2]^(3/2)*y[4, 2]^(3/2)))^(1/3))}

sys2 := {y[2, 1] = 33/(100*sqrt(y[2, 1])*y[4, 1]^(3/2)*(33/(50*y[2, 1]^(3/2)*y[4, 1]^(3/2))+2/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+11/(40*sqrt(y[2, 1])*y[4, 1]^(3/2)*(11/(20*y[2, 1]^(3/2)*y[4, 1]^(3/2))+1/(2*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+3*y[2, 2]/(20*y[2, 1]^(3/2)*y[4, 1]^(3/2)*(11/(50*y[2, 1]^(3/2)*y[4, 1]^(3/2))+4/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+3*y[2, 2]/(10*y[2, 1]^(3/2)*y[4, 1]^(3/2)*(11/(25*y[2, 1]^(3/2)*y[4, 1]^(3/2))+3/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2)))), y[2, 2] = 11*y[2, 1]/(75*y[2, 2]^(3/2)*y[4, 2]^(3/2)*(33/(50*y[2, 1]^(3/2)*y[4, 1]^(3/2))+2/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+11*y[2, 1]/(60*y[2, 2]^(3/2)*y[4, 2]^(3/2)*(11/(20*y[2, 1]^(3/2)*y[4, 1]^(3/2))+1/(2*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+2/(5*sqrt(y[2, 2])*y[4, 2]^(3/2)*(11/(50*y[2, 1]^(3/2)*y[4, 1]^(3/2))+4/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+3/(10*sqrt(y[2, 2])*y[4, 2]^(3/2)*(11/(25*y[2, 1]^(3/2)*y[4, 1]^(3/2))+3/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2))))}

 

Download MapleQ.mw

I was taking notes from a video and fromatting them in a table so I could pring them.

I an using the commands in the context panel to keep things neat.

I can't get this to work for the last row of the table. when I select the equation, the right context panel changes to information about the table and the commands for manipulating the equations are not available. This occurs on the tenth row or later. 

I have since tried interface(rtablesize = [12,12]) but that didnt help.

If I run the document I can get the 10th row to solve by displaying the output first and then using the commands from the context panel

         
             

2*a[0]*a[9]*c[2] + 2*a[1]*a[8]*c[2] + 2*a[2]*a[7]*c[2] + 2*a[3]*a[6]*c[2] + 2*a[4]*a[5]*c[2] + a[9]*c[1];
 
                              8            
                     1430 c[2]             
                     ---------- + a[9] c[1]
                           16              
                       c[1]                

                             "(->)"

solve( 1430*c[2]^8/c[1]^16 + a[9]*c[1]=0, a[9] );
                                     8
                            1430 c[2] 
                          - ----------
                                  17  
                              c[1]    

                             "(->)"

a[9] := -1430*c[2]^8/c[1]^17: 'a[9]';
                              a[9]


           

Edited:- to improve readability and add more information.

restart

 

NULL

NULL``

                                                           

 

a[0] := 0

2*a[0]*a[1]*c[2]+a[1]*c[1]+1 = 0"(->)"-1/c[1]"(->)"a[1]NULL

2*a[0]*a[2]*c[2]+a[1]^2*c[2]+a[2]*c[1] = 0"(->)"-c[2]/c[1]^3"(->)"a[2]NULL

2*a[0]*a[3]*c[2]+2*a[1]*a[2]*c[2]+a[3]*c[1] = 0"(->)"-2*c[2]^2/c[1]^5"(->)"a[3]

2*a[0]*a[4]*c[2]+2*a[1]*a[3]*c[2]+a[2]^2*c[2]+a[4]*c[1] = 0"(->)"-5*c[2]^3/c[1]^7"(->)"a[4]

2*a[0]*a[5]*c[2]+2*a[1]*a[4]*c[2]+2*a[2]*a[3]*c[2]+a[5]*c[1] = 0"(->)"-14*c[2]^4/c[1]^9"(->)"a[5]NULL

2*a[0]*a[6]*c[2]+2*a[1]*a[5]*c[2]+2*a[2]*a[4]*c[2]+a[3]^2*c[2]+a[6]*c[1]"(->)"-42*c[2]^5/c[1]^11"(->)"a[6]

2*a[0]*a[7]*c[2]+2*a[1]*a[6]*c[2]+2*a[2]*a[5]*c[2]+2*a[3]*a[4]*c[2]+a[7]*c[1]"(->)"-132*c[2]^6/c[1]^13"(->)"a[7]

2*a[0]*a[8]*c[2]+2*a[1]*a[7]*c[2]+2*a[2]*a[6]*c[2]+2*a[3]*a[5]*c[2]+a[4]^2*c[2]+a[8]*c[1]"(->)"-429*c[2]^7/c[1]^15"(->)"a[8]

2*a[0]*a[9]*c[2]+2*a[1]*a[8]*c[2]+2*a[2]*a[7]*c[2]+2*a[3]*a[6]*c[2]+2*a[4]*a[5]*c[2]+a[9]*c[1]

 

 

NULL


 

Download Table_solve_issue.mw

Hi,

I am trying to randomly generate, say, 20 ordered pairs of 'noisy' data that have a correlation coefficient in the range 0.8 - 0.9. I've looked at certain command in the Statistics package, but I'm not finding anything that appears useful. Can this be done in Maple?

How can I use symbols from the Emoji and Symbols collection on a Mac in a document or worksheet in Maple? I want to create documents but I find symbols not included in Maple that I require. I have found that some symbols will stay in the document if I insert them when in TEXT mode, but that does not work when entering a fraction for example and needing a symbol. When reloading a previously saved document, I find that the symbol has not saved.

 

A related question: how can I expand on the default symbols in the toolboxes?

 

Thanks.

 

Dear maple users,

In this code, how to find out the f'(x,t) and f''(x,t) values.
How to export the computed values in the excel file.JVB.mw

restart:

with(PDEtools):

with(plots):

fcns := {f(x,t)};

{f(x, t)}

(1)

ra:=2:b1:=1.41:na:=0.7:we:=0.5:eta[1]:=4*0.1:d:=0.5/1:xi:=0.1:m:=na:ea:=0.5:pr:=21: gr:=0.1:

R:=0.9323556933;

.9323556933

(2)

PDE1 :=ra*(diff(f(x,t),t))=+b1*(1+ea*cos(t))+(1/(R^2))*((diff(f(x,t),x,x))+(1/x)*diff(f(x,t),x));

2*(diff(f(x, t), t)) = 1.41+.705*cos(t)+1.150367877*(diff(diff(f(x, t), x), x))+1.150367877*(diff(f(x, t), x))/x

(3)

IBC := {D[1](f)(0,t)=0,f(1,t)=0,f(x,0)=0};

{f(1, t) = 0, f(x, 0) = 0, (D[1](f))(0, t) = 0}

(4)

sol :=  pdsolve({PDE1}, IBC, numeric,spacestep = 0.025, timestep=0.0001) ;

module () local INFO; export plot, plot3d, animate, value, settings; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; end module

(5)

sol:-plot[display](f(x, t), t = 1.2, linestyle = "solid", title = "Velocity Profile", labels = ["r", "f"]);

 

``


 

Download JVB.mw

 

Hello,

For debbugging big programs, i have been told that one good solution is to use the mint application.

I'm trying to do so that is to say to use the mint application with windows. But, i encounter some difficulties.

The program on which i would like to apply the mint is composed of several parts like in the package Shapes and the different parts of the module are called thanks to the $include syntax.

To test mint, i have launched a command window with the command cmd in windows.

After, i apply cd PathRepertoryContainingMint

On i am located in this repertory, i test the following syntax :
mint -I PathRepertoryContainingTheDifferentFiles PathRepertoryContainingTheMainProgram\program.mpl

In my case these two paths are the same.

I test also the following syntax:

mint -o PathRepertoryContainingTheOuput\mintoutput.mpl PathRepertoryContainingTheMainProgram\program.mpl

It may run but i don't know where i can recover the output of mint

I have been told also to set the Windows PATH variable to include the Maple bin directory (thank you @Joe Riel for this tip). I think that it should be a good idea but I never do this type of manipulation.

On the net, I find that the process to do so is the following : setx path "%path%;c:\directoryPath"

Questions: 

1) If you have some experience in using mint with windows, may you give some tips (precise the right syntax) to use it ? 

2) In case the option -o is not used, where the output of mint is coming ?

I thank you in advance for your help.

I only use latex() to convert Maple solution to Latex. I do not export whole document to Latex.

When I ask Maple to convert this solution of a PDE to latex, it generated strange Latex which is different, from the Latex it generates for same solution, when doing File->Export As->Latex.

The Latex it generated in the export case, is the one I want. The latex it generates from the latex() command, I am not able to use and is completely different. It has things like \mathit{Typesetting} and other different latex.  

Why is that? And how to make it generates the same Latex for this expression as in the export case?

First I show screen shot, then the worksheet to reproduce it

 

But Now when I save this worksheet (with only the expression I want) 

Using File->Export As->Latex, and then look at the latex for the "sol" in the latex file generated, this is what it shows (I am only showing the latex part of the above, not the whole file)

\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{sol} \coloneqq u \left(r ,t \right)=\mathcal{L}^{-1}
\left(\frac{\mathrm{BesselJ}\left(0,10 \sqrt{-s}\, r \right) s}
{\mathrm{BesselJ}\left(0,20 \sqrt{-s}\right) \left(s^{2}+1\right)},s ,t \right)
-\mathcal{L}^{-1}\left(\frac{\mathrm{BesselJ}\left(0,10 \sqrt{-s}\, r \right)}
{\mathrm{BesselJ}\left(0,20 \sqrt{-s}\right) s},s ,t \right)
-\cos \left(t \right)+1\]}
\end{maplelatex}

The above latex I can compile standalone, and it does not have the problematic constructs found when using latex(sol)

One can see it is very different from the top one given earlier.

Why are the two latex different? Is there an extra setting one needs to adjust?  How make latex(sol) generate the same latex for the expression as found in the file generated by export as latex?

may_2.mw

update 1

Did some debugging. The problem happens when using `:-executeprintroutines`.  Tracing the latex() command in the debugger. At lines 42, it has the call

texlist := [latex:-Print(e,_rest,':-executeprintroutines',':- handleimaginaryunit',':-performonlyoncetasks',opt)];

Where above is the expression to convert to Latex. When I removed ':-executeprintroutines' the problems in latex went away. Here is an example

restart;
sol:=u(r,t) = invlaplace(BesselJ(0,10*(-s)^(1/2)*r)/BesselJ(0,20*(-s)^(1/2))*s/(s^2+1),s, t) - invlaplace(BesselJ(0,10*(-s)^(1/2)*r)/BesselJ(0,20*(-s)^(1/2))/s,s, t)- cos(t) + 1;
latex:-Print(sol)

Gives

"u ! left(r , t\right)", ` = `, `\\mathit{invlaplace} 
\\! \\left(\\frac{\\mathit{BesselJ}\\! \\left(0, 10 \\sqrt{-s}\\, r \\right) s}
{\\mathit{BesselJ}\\! \\left(0, 20 \\sqrt{-s}\\right) \\left(s^{2}+1\\right)}, s , t\\right)
-\\mathit{invlaplace} \\! \\left(\\frac{\\mathit{BesselJ}\\! 
\\left(0, 10 \\sqrt{-s}\\, r \\right)}{\\mathit{BesselJ}\\! \\left(0, 20 \\sqrt{-s}\\right) s}, s , t\\right)
-\\cos \\! \\left(t \\right)+1`

Now notice what happens when adding ':-executeprintroutines'

restart;
sol:=u(r,t) = invlaplace(BesselJ(0,10*(-s)^(1/2)*r)/BesselJ(0,20*(-s)^(1/2))*s/(s^2+1),s, t) - invlaplace(BesselJ(0,10*(-s)^(1/2)*r)/BesselJ(0,20*(-s)^(1/2))/s,s, t)- cos(t) + 1;
latex:-Print(sol,':-executeprintroutines')

it gives the problematic latex

"u ! left(r , t\right)", ` = `, `\\mathit{Typesetting}\\mcoloneq \\mathit{msup}\\! 
\\left(\\mathit{Typesetting}\\mcoloneq \\mathit{mi}\\! 
\\left(\\text{\`\`$\\mathcal\\{L\\}$"}\\right), \\mathit{Typesetting}\\mcoloneq 
\\mathit{mrow}\\! \\left(\\mathit{Typesetting}\\mcoloneq \\mathit{mo}\\! 
\\left(\\text{\`\`$-$"}\\right), \\mathit{Typesetting}\\mcoloneq \\mathit{mn}\\! 
\\left(\`\`1"\\right)\\right), \\mathit{Typesetting}\\mcoloneq \\mathit{msemantics}=\\text{\`\`atomic"}\\right)\\! \\left(\\frac{J_{0}\\! \\left(10 
\\sqrt{-s}\\, r \\right) s}{J_{0}\\! \\left(20 \\sqrt{-s}\\right) \\left(s^{2}+1\\right)}, s , t\\right)-
\\mathit{Typesetting}\\mcoloneq \\mathit{msup}\\! \\left(\\mathit{Typesetting}\\mcoloneq 
\\mathit{mi}\\! \\left(\\text{\`\`$\\mathcal\\{L\\}$"}\\right), \\mathit{Typesetting}\\mcoloneq 
\\mathit{mrow}\\! \\left(\\mathit{Typesetting}\\mcoloneq \\mathit{mo}\\! \\left(\\text{\`\`$-$"}\\right), 
\\mathit{Typesetting}\\mcoloneq \\mathit{mn}\\! \\left(\`\`1"\\right)\\right), 
\\mathit{Typesetting}\\mcoloneq \\mathit{msemantics}=
\\text{\`\`atomic"}\\right)\\! \\left(\\frac{J_{0}\\! \\left(10 \\sqrt{-s}\\, r \\right)}
{J_{0}\\! \\left(20 \\sqrt{-s}\\right) s}, s , t\\right)-\\cos \\! \\left(t \\right)+1`

I do not know what :-executeprintroutines does and how one can tell latex() not to call it at the user level. I asked about :-executeprintroutines before here

  https://www.mapleprimes.com/questions/231230-Why-Latex-Removes-Constant-From-Expression

And I could not find any documenation on it.  

I tried to define my own executeprintroutines proc() which does nothing. But it did not help

restart;
sol:=u(r,t) = invlaplace(BesselJ(0,10*(-s)^(1/2)*r)/BesselJ(0,20*(-s)^(1/2))*s/(s^2+1),s, t) - invlaplace(BesselJ(0,10*(-s)^(1/2)*r)/BesselJ(0,20*(-s)^(1/2))/s,s, t)- cos(t) + 1;
executeprintroutines:=proc()
   NULL;
end proc;
latex(sol)

The Latex was not fixed. It is same. 

May be the above will help find the issue.

 

Using a Cyrillic font in the Combo Box component gives an runtime error when saving workbook file (*.maple file extension).

cyr_wb_save_error.zip

Select the second item in Combo Box component and press save button.

 

I want to create a graph from y1 to yn+1.

Something like:

f(x)=piecewise(

x<a[1],y(x)[1],

for i from 2 to n+1,

a[i-1] <=  x  <=  a[i], y(x)[i];

od:);

plot(f(x),x=0..l);

But then something that works.

Can anyone help me with an example?

 

 

I have read a few papers on accuracy and numerical methods to solve problems.  My personal interest is in very stiff DAE equations of state (eos) for gaseous expansions/flow problems in very high differential starting conditions for the convergence to occur in the initial time steps.

A long time goal has been to convert the FORTRAN real*16 floating point DAE solver (initially ran on CRAY) into Maple proc() using arbitrary precision that actually solves at the hardware float ieee precision.

Any reference material on stiff solvers and maple implementation would be great.

Bill

Dear all
I solve a nonlinear equation using Newton's method

Using 

https://planetcalc.com/7748/
and maple code I get two different results from sixth iteration  ... What's the problem... I can not understand which one is correct.

Newton.mw

Thank you for your help 

Dear all

I have two equations

the first one: f1(x)=r*x; 

and the second one: f29x)=exp(x);

where r in a real number.

Using maple i try to determine the number of solutions of f1(x)=f2(x) for different value of r.
Using maple, 
for r <0 its obvious we have only one solution, but for r =0; No solution 
My problem for r>0, using maple I trided to plot different curve but I can not conclude, the number of  roots for each value of r

Number_solution.mw

thank you for your help 

 

Fortran 2000 introduced a simple system for interoperability with C. That was expanded in 2020 to provide C macros to support Fortran concepts that do not exist in C, such as optional arguments and assumed-shape arrays. This is all described in Chapter 18 of the Fortran 2020 standard at http://j3-fortran.org/doc/year/21/21-007.pdf.

 

I want to call Maple from Fortran. The StartMaple function has a result of type MKernelVector. I can't find any description of it in the Advanced Maple Programming Guide other than that it's a handle. In order to create a Fortran variable to hold the result of StartMaple, to pass to the other functions, I need to know more. Is it an int or a long or a longlong or a pointer, or what?

 

I guessed longlong would work, but it apparently doesn't. The result value of StartMaple is nonzero and apparently at least 64 bits. Invoking EvalMapleStatement using that result value causes a segmentationf fault (I'm running Debian Buster 10 Linux).

 

That's as far as I've gotten.

 

Any ideas how to proceed?

 

Hi,

I am having trouble with a Lie algebra cohomology computation. Suppose I have a poset on {1,2,3,4} where 1 < 3, 1 < 4, 2 < 3, and 2 < 4. I can express this as a matrix:

* 0 * *
0 * * *
0 0 * 0
0 0 0 *

where *'s mean "any entry in my ground field," say R or C, and 0s are 0s. Basically, if there is a relation between row i and column j, there is a *. This is why there is a * in row-1 and column 3, as 1<3, but a 0 in row-1 and column 2. I can make the collection of all of these matrices into a Lie algebra using the commutator, as it is closed, and can further suppose it is of trace 0 - that is, it is Type A.

My question is this: I know this algebra has non-trivial cohology, and deforms. However, I want to make Maple do this for me, so I can try it on bigger algebras - however it always tells me that the cohomology is dead zero. What am I doing wrong? My approach is this:

Let P equal the following collection of matrices - these form my basis:

 [Matrix(4, 4, [[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]), Matrix(4, 4, [[0, 0, 1, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]), Matrix(4, 4, [[0, 0, 0, 1], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]), Matrix(4, 4, [[0, 0, 0, 0], [0, 1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 0]]), Matrix(4, 4, [[0, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 0], [0, 0, 0, 0]]), Matrix(4, 4, [[0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 0], [0, 0, 0, 0]]), Matrix(4, 4, [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, -1]])]

Now I can run the basic commands to get started:

L := LieAlgebraData(P, Ex1);
DGsetup(L);


I can now go straight to cohomology. If my algebra is named L, then I want to build my cochain complex C^*(L, L):

c := RelativeChains([e1,e2,e3,e4,e5,e6,e7]);

However, the answer is always that there are no non-trivial cochains: the answer is [[], []]. This will make it very difficult to have non-trivial cohomology.

I know this isn't true (see https://arxiv.org/pdf/1407.0428.pdf). I also tried the approach in the Maple documentation, where I work in the adjoint representation. This gave me non-trivial cochains, but the cohomolgy was 0.

Does anyone know what I'm doing wrong?

Thanks!

First 404 405 406 407 408 409 410 Last Page 406 of 2216