MaplePrimes Questions

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

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. 

The uploaded worksheet contains a copy of figure of a pencil from a geometry book, followed by a failed attempt to code Maple to produce the same figure.

The book containing the figure gives no indication of how to code for the figure. Can the figure be produced in Maple?

Respondents will have to establish their own path to DirectSearch.

Pencil.mw

I have Maple solve a system of equations.  I then want to assign the result to the different variables for use later in the worksheet.  How do I do this?
 

 

{C1 = .6666666670*Ceq, C2 = 2.000000002*Ceq, L1 = 0.1377592863e-15/Ceq, R1 = 0.8802817643e-8/Ceq}

(24)

c1 := sol3[1]

C1 = .6666666670*Ceq

(25)

l1 := sol3[2]

C2 = 2.000000002*Ceq

(26)

r1 := sol3[3]

L1 = 0.1377592863e-15/Ceq

(27)

Solutions, C2=10pf

Ceqsol := 20*e-12

20*e-12

(28)

C1sol := subs(Ceq = Ceqsol, c1)

C1 = 13.33333334*e-8.000000004

(29)
 

 

 


First, all I want to do is assign the solution value for C1 to C1.  Not being able to do this, I try to assign C1 to "different" variable c1, but the assignment is C1~=.66667* Ceq, instead of just the value of C1.  Later, I then try to substitute the value of Ceq, to get the solution for c1, and instead of just getting the value, I get  that C1= 13.33x10^-8 is assigned to C1sol, again instead of just the value, 13.33x10^-8.  How do I just assign the values to these variables instead of the expressions?

 

Thank you.

Download new_filter_solution.mw

i have ode system of two dependent variables y and x  and one independent varibale time. how can i find explicit expression between y and x? 

 

restart

sys:=diff(x(t),t)=x(t)*y(t)+t,diff(y(t),t)=x(t)-t;

diff(x(t), t) = x(t)*y(t)+t, diff(y(t), t) = x(t)-t

(1)

dsolve([sys,x(0)=0,y(0)=1],[x(t),y(t)],series)

{x(t) = series((1/2)*t^2+(1/6)*t^3+(1/24)*t^4-(1/24)*t^5+O(t^6),t,6), y(t) = series(1-(1/2)*t^2+(1/6)*t^3+(1/24)*t^4+(1/120)*t^5+O(t^6),t,6)}

(2)

 

 

 


 

Download explicit.mw

I am a newbie in Maple! I tried both ThermophysicalData and its CoolProp package to find saturation pressure of vapor for given air-water mixture temperature.

I want to calculate water vapor density in air or simply Absolute humidity (kg/m3)

But i can not see any meaningful function or combination of functions/properties in CoolProp to give such output.

P_w in CoolProp, HApropSI takes this as input only that is not usefule either way inpoutput

The rationale is to work from RH and then calculate P_w as output: P_w=RH x P_g where P_g is vapor saturation pressure at the given ambient condition.

From there all world is yours!

You can use ideal gas rules to do everything. But i cant use CoolProp to calculate the ABsolute humidty for given RH and ambient condition.

 

Note that clearly i can calculate all these from hand calculation as well as approximation formuale of Clausius-Clapeyron equation. But i wanted to do in Maple with its packages.

 

Any help is appreciated!?

Regards

Sina

 

 

First 358 359 360 361 362 363 364 Last Page 360 of 2308