Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

 

How can I plot the following function?

delta := t -> piecewise(t = 0, 1, 0)
Suspect that the point  at Y=1 automatically scales when zooming in.

 

Thanks

 

 

Currently to parse initial conditions of ODE entered bu user in the form y(x0)=y0 in order to determine x0 and y0 I use patmatch on lhs and rhs separatly which is not a big deal. I wanted to see if I can use an equation inside patmatch.

I could not figure how to use patmatch on both sides of equation on one call.  Help says expression to patmatch is algebraic expression. Does this means an equation can't be used as whole? Here is an example to make it more clear

restart;
ic:=y(0) = 1;
patmatch(ic,y(x0::anything)=y0::anything,'la')

Which gives false. i.e. no match found.

Is there a trick to make the above work if possible? This is just a basic example. I might want to apply this on more complicated equation where more things are on lhs and rhs of =  but patmatch does not like `=` in the middle there. 

 

 

 

Why won't Maple solve any of these inequalities for Q?

At first I tried solving the system of equations, but then I tried solving the inequalities individually for Q, and those too could not be solved by Maple.  What am I doing wrong?
 

restart

 

assume(R1, real, R2, real, RL, real, XC1, real, XC2, real, XL1, real)

additionally(R1 > 0, R2 > 0, RL > 0, XC1 > 0, XC2 > 0, XL1 > 0)

 

 

eq3 := R1*(4*Q^2+1)-RL > 0

0 < R1*(4*Q^2+1)-RL

(1)

eq4 := 4*Q^2*R1*RL-(R1-RL)^2 >= 0

0 <= 4*Q^2*R1*RL-(R1-RL)^2

(2)

eq5 := Rs^2*(RL-R1)/Q^2+R1^2*RL > 0

0 < Rs^2*(RL-R1)/Q^2+RL*R1^2

(3)

 

``

sys1 := {eq3, eq4, eq5}

`assuming`([solve(sys1, {Q})], [R1 > RL])

`assuming`([solve(sys1, {Q})], [R1 < RL])

solve(sys1, {Q})

Warning, solutions may have been lost

 

solve(eq3, Q)

Warning, solutions may have been lost

 

solve(eq4, Q)

Warning, solutions may have been lost

 

solve(eq5, Q)

Warning, solutions may have been lost

 

``


 

Download pi-filter_anal_copy.mw

howca i determine the range of gains if g(x)=1/(x+x^2+x^3+2)

the answer is like closed loop

I need to use the fact that the expression under the radical in a larger expression is >0.

How do I programmaticaly "grab" the radical term to include it in an equation such as for example:

eq1:= b^2-4 a c>0

where lhs term would have come from a previous derivation or solution ?

Thank you...

How can I get Maple to simplify expressions into more meaningful forms?

For example, 

xc1 := -(2*Q*R1 + sqrt(4*Q^2*R1*RL - R1^2 + 2*R1*RL - RL^2))*R1/(4*Q^2*R1 + R1 - RL)

 

The numerator, under the radical, is more meaningful as sqrt(4 Q^2 R1 RL-(R1-RL)^2).

 

Similarly, the denominator can be simplified to Rs(4 Q^2+1)-RL.  

 

How do I get Maple to get me there?

After I just updated to Physics 871, my main worksheet which allready has for long time now:

Physics:-Latex:-UseColor := false;  
Physics:-Latex:-UseImaginaryUnit:=i;

Now I get 

The reason I use Physics:-Latex:-UseImaginaryUnit:=i; is to make the Latex use for complex number in Latex instead of I

What is now the correct way to use these settings with the new Physics update? if I do not use them, then compelx I  will still show as I whcih I do not want. I want lower case i

I could add interface(imaginaryunit=i); in place of Physics:-Latex:-UseImaginaryUnit:=i; and that work for the latex, making the Latex generate i. But this solution now makes the User interface no longer accept I  as complex number any more and must be typed as lower case, which is not what I want.

That is why I was using Physics:-Latex:-UseImaginaryUnit:=i; This keeps the user interface complex number as Uppercase, but let the latex generated be lower case.

I feel I am doing something wrong, but do not see it. Made sure I use Physics:-Latex on everything now.

Please see below 2 worksheets. One using the 871 version and one using 865 version.
 

restart;

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 871 and is the same as the version installed in this computer, created 2020, November 14, 14:16 hours Pacific Time.`

Physics:-Latex:-Settings()

[invisibletimes = ` `, powersoftrigonometricfunctions = mixed, usecolor = true, useimaginaryunit = I, useinputlineprompt = true, userestrictedinputtranslation = false, usespecialfunctionrules = true, usetypesettingcurrentsettings = false]

Physics:-Latex:-UseColor := false;  
Physics:-Latex:-UseImaginaryUnit:=i;
 

Error, attempting to assign to `Physics:-Latex:-UseColor` which is protected

Error, attempting to assign to `Physics:-Latex:-UseImaginaryUnit` which is protected

Physics:-Latex(I)

I

 

 

Download latex_871.mw
 

restart;

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 871. The version installed in this computer is 865 created 2020, November 11, 8:43 hours Pacific Time, found in the directory C:\Users\me\maple\toolbox\2020\Physics Updates\lib\`

Physics:-Latex:-Settings()

usecolor = true, useimaginaryunit = I, useinvisibletimes = ` `, useinputlineprompt = true, userestrictedinputtranslation = false, usespecialfunctionrules = true, usetypesettingcurrentsettings = false

Physics:-Latex:-UseColor := false;  
Physics:-Latex:-UseImaginaryUnit:=i;
Physics:-Latex(I);
 

false

i

i

 

 

Download latex_865.mw

New error seems to have been introduced 

restart;
expr:=arccos(1/x);
Physics:-Latex(expr);

it seems to happen with the inverse trig functions when there is a fraction inside.

Do others have the same issue? I am currently using  869.  Maple 2020.1

Rolling back Physics version one at a time, I found the version this happened at. It was OK in version 865, but gives the error starting at version 866.

Hopefully this should make it easy to find the code change which caused it using source control diff.

 

As Latex improves in Maple (thanks to Physics:-Latex), I'd like to suggest not using \rm and replacing it with \mathrm.

\rm is now obsolete for long time. Reference: https://tex.stackexchange.com/questions/107186/how-to-write-norm-which-adjusts-its-size

 In addition, some Latex classes give warning or error when using it and workarounds are needed. For an example

\documentclass{scrbook}%notice the class is not article.
\usepackage{amsmath}
\begin{document}
${\rm e}^{-t}$
\end{document}

When compiled using lualatex foo4.tex gives

(base) >lualatex foo4.tex
This is LuaHBTeX, Version 1.12.0 (TeX Live 2020)
 restricted system commands enabled.
(./foo4.tex
LaTeX2e <2020-02-02> patch level 5
 L3 programming layer <2020-08-07> (/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrbook.cls
Document Class: scrbook 2020/07/22 v3.31 KOMA-Script document class (book)
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrkbase.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrbase.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrlfile.sty))) (/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/tocbasic.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrsize11pt.clo) (/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/typearea.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def) (./foo4.aux) (/usr/local/texlive/2020/texmf-dist/tex/latex/base/ts1cmr.fd)

! Class scrbook Error: undefined old font command `\rm'.

See the scrbook class documentation for explanation.
Type  H <return>  for immediate help.
 ...MAClassName  Error: undefined old font command `\string \rm '.

See the \KOMAClassName  class documentation for explanation.
Type  H <return>  for immediate help\@err@
                                                                                                                                                                                                        
l.7 ${\rm
        e}^{-t}$
?

And Maple generates lots of these. For example

Physics:-Latex(exp(-t))
 
          {\rm e}^{-t}

mathrm works and give same output. Here is an example, where now I change the class to article to make it compile 

\documentclass{article}
\usepackage{amsmath}
\begin{document}

${\rm e}^{-t}$

$\mathrm{e}^{-t}$

$e^{-t}$

\end{document}

gives

The first is \rm, the second is mathrm and the last is the default with no modification.

Do others see any problem if this change could be made to Maple's Latex?

I am using Maple 2020.1 and Physics  867


One forum had a topic related to such a platform. You can download a video of the movement of this platform from the picture at this link. The manufacturer calls the three-degrees platform, that is, having three degrees of freedom. Three cranks rotate, and the platform is connected to them by connecting rods through ball joints. The movable beam (rocker arm) has torsion springs.  I counted 4 degrees of freedom, because when all three cranks are locked, the platform remains mobile, which is camouflaged by the springs of the rocker arm. Actually, the topic on the forum arose due to problems with the work of this platform. Neither the designers nor those who operate the platform take into account this additional fourth, so-called parasitic degree of freedom. Obviously, if we will to move the rocker with the locked  cranks , the platform will move.
Based on this parasitic movement and a similar platform design, a very simple device is proposed that has one degree of freedom and is, in fact, a spatial linkage mechanism. We remove 3 cranks, keep the connecting rods, convert the rocker arm into a crank and get such movements that will not be worse (will not yield) to the movements of the platform with 6 degrees of freedom. And by changing the length of the crank, the plane of its rotation, etc., we can create simple structures with the required design trajectories of movement and one degree of freedom.
Two examples (two pictures for each example). The crank rotates in the vertical plane (side view and top view)
PLAT_1.mw


and the crank rotates in the horizontal plane (side view and top view).

The program consists of three parts. 1 choice of starting position, 2 calculation of the trajectory, 3 design of the picture.  Similar to the programm  in this topic.

 

 

Any idea why

if 2+89^(1/2)>0 then
   print("yes");
else
   print("no");
fi;

gives

Since 

evalf(2+89^(1/2))

is 11.4339.

 

I tried in Mathematica, and it works there

If[2 + 89^(1/2) > 0, Print["Yes"], Print["No"]]

What is the correct way to do this in Maple? i.e. to check that a numerical value is >0 ?

This is done in code, where the value I am doing this check on are known to be numeric, but I do not know what form they will be, I just know they will contain no floating point numbers. Only exact numbers.

The problem is the 89^(1/2). Maple knows it is >0 

is(89^(1/2)>0)

        true

but 

if (89)^(1/2)>0 then
   print("yes");
else
   print("no");
fi;

May be because 89 is prime. Should I replace my if with is for this check? 

interface(version)
Standard Worksheet Interface, Maple 2020.1, Windows 10, July 30 

   2020 Build ID 1482634


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

   the same as the version installed in this computer, created 

   2020, November 12, 9:14 hours Pacific Time.


 

 

Hi, 

I often need to draw several curves on the same figure and the question of which colors to choose to distinguish them is crucial. 
In particular when these curves depend on a parameter I would like to color them by using a "regular" change of color.
The trick I use is this one
 

# here I want to plot N=10 different curves

N := 10:

# step 1: generate a list of colours using colorscheme
# (I was hoping for 10 levels of colors but I got 19)

plot(x, x=0..1, colorscheme=["Gold", "Blue"], numpoints=N):
MyColors := op([1,2, 2], %);
M := numelems(MyColors[..,1]);

# step 2: do the plots of interest, for instance

plots:-display(
  seq(
    plot(m*x^2, x=0..1, color=ColorTools:-Color([entries(MyColors[round(m/N*M)], nolist)])), 
    m=1..N
  )
);

My question is: How can we make that MyColors be a matrix whose the number of rows equal N (this to avoid the round(m/N*M) operation)?
(I will accept any other strategy)

Thanks in advance

I am wondering if there are examples of agent-based models in economics domain that have been implemented in Maple.

Any infomration/source is more than welcome!

 

Thanks in advance

I actually want to numerically solve Karhunen-Loeve Decomposition, which is reduced to homogenous Fredholm integral equation second kind when the kernel is the function of correlation of variables, by using any procedures (Galerkin is better if it is availabe). FYI, with "intsolve" I just got f(x)=0. 

When this question was asked here earlier, I neglected to suggest or to emphasize two further items.  Now, on revising Mathematics for Chemistry with [Maple], I recognise that I should have included these two objectives for inclusion in Maple 2021.

- an extended and improved spreadsheet with symbolic capability; I suspect that Maple was the only software for symbolic computation to include such a facility, which sadly has become deprecated, for no obvious reason.

- a much extended capability to solve integral equations; publications dating from 1976 -- i.e. before Maple! -- have shown what is possible; Maple's capabilities for differential equations might still be superior, although the competition is becoming close, so further efforts in the development of both differential and integral equations are timely and appropriate.  Related to differential equations is naturally the extension of capabilities of special functions, both to extend present functions and to produce new functions, such as those of Lame.

First 352 353 354 355 356 357 358 Last Page 354 of 2097