MaplePrimes Questions

Mac OS 11 Big Sur ist not listed as a compatible system with Maple 2020. Are there known issues? Could someone who already upgraded give feedback?

 

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?

Hi,

i have plotted a histogram and then fitted a uniform distribution curve. I need to compare how well the distribution fits the histogram. We are allowed to use the statistics package but i am nit sure how to do that. Not my image but just showing what I get approximately. I just need to quantify how well the red line fits the histogram. 

 

Many thanks 

Thanks 

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

Hi

I have constructed a model of an UR5e in maplesim with the hop to be able to test my controller writen in python on it. 

I hope to be able from the model to

  • Enter a tourqvalue for the joints.
  • Extract joint angles, joint velocitys as well as the forces and tourqes that affects the end effector.
  • (If posible) visualize the sumulated robot arm so I can se that the motion reflects that of the real robot arm.

the simulated robot arm 

The question is how to best do this in a semi realtime way?

I have been looking into generating a FMU but if there are other ways to do this, then I am open to ides. 

The contorller is based on a haptic algoritm for connecting two robot arms and I will only get one robot arm due to prise and space constraints.

This means that I will reseave realtime information from the real robot arm into my python controller that then i supose to take inforamtion from the simulated arm and with information from both arms calculate the tourqe values for both arms joints. 

 

Thanks in advance for all youre help

Eric Ragnarsson

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

First 477 478 479 480 481 482 483 Last Page 479 of 2427