Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi, 

I installed syrup within Maple 2022 according to the procedure described in syrup's README file. The installation seems to run normally. After that I restarted Maple. When I now enter

with(Syrup);

it shows

[Draw, Library, Print, Solve, ToModelica, ToSpice, Version]

instead of 

[deindex, makecheckttable, printdeck, reindex, syrup]

as described in the application center: https://www.maplesoft.com/applications/Preview.aspx?id=4680

Also the example which is decribed there doesn't work:

syrup(divider, dc, 'curr');

delivers no result.

I'm working on Windows 10 64 bit.

Could it be that syrup is not yet prepared for Maple 2022, as it seems not to be updated for a long time? Or is the description in the application center not up to date?

Many thanks for your help!

Best regards,

Michael

 

Hi,all

I am new in Maple,when I execute the "InversePlot" command ,all functions were correct except for exp(x), error occurs as follows, can anyone tell me what mistake I took?

Tks in advance!

restart;
with(Student[Calculus1]);

InversePlot(exp(x), -1 .. 1);
Error, (in Student:-Calculus1:-InversePlot) module does not export `IsTrigProc`

 

Tks for all you guys. 

I have uninstall Maple and deleted the installed directory ,clear the register,reinstall Maple 2022, now all works well.

I think the problem is I installed Maple 2022 in the old directory of 2021for keeping my configuration,this caused much unexpected problem

I want to create a variable that is made up of a letter and an arrow on top. How to do that?

Also, how can I create a variable that is bold? I tried to type it as bold and then assign. But when I hit return it returns a normal symbol.

How to distinguish between a scalar variable and a vector variable in Maple?

Hi,

I want to solve a differential equation and plot the particle densities versus the distance.

How can I do this in Maple?

DE.mw

Sincerely

Suppose I want to calculate gcd(g(x),f(x))=a(x)f(x)+b(x)g(x) for two polynomial, i.e finding the RHS representation of the gcd, then how to implement this in maple?

I know of the command GCD(f(x),g(x)) but how to find the RHS representation?

Thanks!

Many formulas use a capital D to define parameters. A popular example is the second moment of area "I" of a tube. In Maple we get

Both I and D are protected symbols in Maple and are therefore printed in roman. With the "local" command, I and D can be used as unprotected symbols. However, only the unprotected "I" is printed in italic (like other symbols or names do). D is still printed in roman, which spoils Maple's excellent printout (a bit).

I hope this inconsistency can be improved one day. For the time being, I am looking for better alternatives than my workaround with a fat white space in the attachment. Are there better workarounds?

Italic_I_and_D.mw

primes_integrale_exp.mwThe integral in x of 

exp(-sqrt(x^2 + c))

was done by Maple 11 but return unevaluated in Maple 2021,

see attached worksheet 

I am trying to solve the equation in the attached Maple file, but Maple cannot return a result.

 

restart

Digits := 30

30

(1)

with(plots)

[animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot]

(2)

with(Statistics)

NULL

say the f(x) is a Beta with parameters alpha and beta

 

alpha := 10

10

(3)

beta := 100000

100000

(4)

"f(x):=PDF(BetaDistribution(alpha,beta),x)"

proc (x) options operator, arrow, function_assign; Statistics:-PDF(BetaDistribution(alpha, beta), x) end proc

(5)

f(x)

piecewise(x < 0, 0, x < 1, x^9*(1-x)^99999/Beta(10, 100000), 0)

(6)

NULL

semilogplot(PDF(BetaDistribution(alpha, beta), x), x = 0 .. 1)

 

 

fsolve(int(f(x), x = 0 .. y) = .1, y = 0 .. 1)

Download test_fsolve_integ.mw

On a shared cluster with 32 CPU cores, how do I limit Maple (called from the Linux command line) to use only 8 cores? (Certain built-in operations in Maple are parallelized by default.)

I try to sove the equation x^2-10*y^2=9 with tne procedure : 
genpellsolve := proc(D::posint, N::integer)
local t, u, L1, L2, sols, x, y;
if type(sqrt(D), integer) then error "D must be a nonsquare integer"; end
if; t, u := pellsolve(D); if 0 < N then L1 := 0;
L2 := floor(sqrt(1/2*N*(t - 1)/D)); elif N < 0 then L1 := ceil(sqrt(-N/D));
L2 := floor(sqrt(-1/2*N*(t + 1)/D)); else return {[0, 0]}; end if;
sols := {}; for y from L1 to L2 do x := sqrt(N + D*y^2);
if type(x, integer) then sols := sols union {[x, y]};
if (x^2 + D*y^2) mod N <> 0 or (2*x*y) mod N <> 0 then sols := sols union {[-x, y]};
end if;
end if;
end do;  return sols;
end proc:
This procedudure fails; I don't see why. Thank you for your help.

I upgraded to Maple 2022 and some of my old sheets from Maple 2021 don't work anymore. When I plot a histogram with a legend I get an error saying: Error, invalid input: Statistics:-Histogram expects value for keyword parameter legend to be of type list, but received data set 1.

OK so maybe Histogram changed in 2022 although I didn't think it did. I ran it in Maple 2021 and I received no such error message. I chose to comply with the error message and the plot is output without an error message, however the legend labels carry extra characters I don't want to be there.  My attempt at a solution was to first use square brackets to make the object a list, then use the typeset command to typeset the label.  Strangely, the typeset command was not recognized.

What am I doing wrong? All I want is to plot a histogram with a legend labelled by a string which I have done many times in the past. I have attached below, a maplesheet which explicitly shows the problematic behaviour.

Thanks,
N

restart

NULL

with(Statistics)

with(LinearAlgebra)``

with(plots)``

NULL

NULL

Define Random Variable

X := RandomVariable(Normal(1, 2))

_R

(1)

Sample that variable and plot a histogram.

s := Sample(X, 1000)

NULL

Maple 2022 as opposed to Maple 2021 does not consider this a valid way to define the legend. It want's it defined in a list as requested in the pink error message.

Histogram(s, legend = "data set 1")

Error, invalid input: Statistics:-Histogram expects value for keyword parameter legend to be of type list, but received data set 1

 

NULL

NULL

Maple 2022 as opposed to Maple 2021 does not consider this a valid way to define the legend. It works fine in Maple 2021. Maple 2022, want's it defined in a list. This works but, the square brackets and quotation marks appear when I don't want them to. The legend shouldn't have these extra quotations and brackets, just the desired name.

Histogram(s, legend = ["data set 1"], size = [300, 300])

 

I tried the typeset command. It doesn't seem to be recognized anymore.

 

Histogram(s, legend = [typeset("data set 1")], size = [300, 300])

 

What am I doing wrong? All I want is to plot a histogram with a legend labelled by a string.   

Download legend_as_list.mw

I want to solve a system of 3 simple real linear odinary differential equations.

The solution using dsolve has some extra imaginary terms with very small (10^-10) coefficients.   How to I get just the real part of the solution.

Here is an example code:

v1 := 1;
v2 := 0.5;
k := 0.12;
p1 := 0.328;
p2 := 0.74;
l1 := 0.31;
l2 := 1.16;
sysode := diff(Cp(t), t) = -(p1 + p2 + k)*Cp(t) + l1*C1(t) + l2*C2(t), diff(C1(t), t) = (p1*Cp(t) - l1*C1(t))/v1, diff(C2(t), t) = (p2*Cp(t) - l2*C2(t))/v2;
ics := Cp(0) = 0.347, C1(0) = 0., C2(0) = 0.;
sol := convert(dsolve([sysode, ics]), float);

Hello everybody!! Can you please help me figure it out. I wrote the code, but for some reason I have an infinite loop going on, it counts normally to the cycle, as the cycle reaches, then everything is infinite

restart;
with(plots):
f:=unapply(2*x-4*cos(x)-0.6,x); #the equation itself
f1:=unapply(diff(f(x),x),x); #its derivative
a:=-0.5; b:=1.5; eps:=0.001: #interval and accuracy
 
 
phi:=unapply((4*cos(x)-0.6)/2,x); #solving the equation with respect to x
x[0]:=1; #I take any point from the interval
x[1]:=evalf(phi(x[0]));
L:=evalf(abs(phi(b)-phi(a))/abs(b-a)); 
L1:=evalf(abs(phi(x[1])-phi(x[0]))/abs(x[1]-x[0])); 
psi:=unapply(abs(diff(phi(x),x)),x);
plot([psi(x),1],x=a..b,color=[red,green]);
 
n:=1:
while abs(evalf(x[n]-x[n-1])) > eps do
n:=n+1:
x[n]:=evalf(phi(x[n-1]));
od;
fsolve(f(x)=0,x=a..b);

 

First 198 199 200 201 202 203 204 Last Page 200 of 2097