Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I wonder if this a bug or Am I overlooking something?

I set infolevel[dsolve]:=5; and first time calling dsolve(ode), it works as expected. It prints on the screen the trace and steps it did.  But when I repeat the command dsolve, now it only prints one line and the rest of info that were printed before no longer show.

Should not the same information be printed each time? This is what happens on another example I tried. It seems infolevel does not work the same depending on the ode being solved?  Here is a worksheet attached to show the above.

Is there a workaround to make it display same information each time?

Maple 2023.2 on windows 10.

 

restart;

21424

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, October 25 2023 Build ID 1753458`

ode:=[2*diff(x(t),t)+diff(y(t),t)=x(t)+y(t)+t,diff(x(t),t)+diff(y(t),t)=2*x(t)+3*y(t)+exp(t)];
infolevel[dsolve]:=5;
dsolve(ode);

[2*(diff(x(t), t))+diff(y(t), t) = x(t)+y(t)+t, diff(x(t), t)+diff(y(t), t) = 2*x(t)+3*y(t)+exp(t)]

5

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

-> Calling odsolve with the ODE diff(diff(y(x) x) x) = 4*(diff(y(x) x))-y(x)-3*x+1 y(x) singsol = none

Methods for second order ODEs:

--- Trying classification methods ---

trying a quadrature

trying high order exact linear fully integrable

trying differential order: 2; linear nonhomogeneous with symmetry [0,1]

trying a double symmetry of the form [xi=0, eta=F(x)]

-> Try solving first the homogeneous part of the ODE

   checking if the LODE has constant coefficients

   <- constant coefficients successful

   -> Determining now a particular solution to the non-homogeneous ODE

      trying a rational particular solution

      <- rational particular solution successful

<- solving first the homogeneous part of the ODE successful

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

dsolve(ode);

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

infolevel[dsolve]:=5;

5

dsolve(ode);

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

dsolve(ode);

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

ode:=diff(y(x),x$2)+y(x)=sin(x);
dsolve(ode);

diff(diff(y(x), x), x)+y(x) = sin(x)

Methods for second order ODEs:

--- Trying classification methods ---

trying a quadrature

trying high order exact linear fully integrable

trying differential order: 2; linear nonhomogeneous with symmetry [0,1]

trying a double symmetry of the form [xi=0, eta=F(x)]

-> Try solving first the homogeneous part of the ODE

   checking if the LODE has constant coefficients

   <- constant coefficients successful

   -> Determining now a particular solution to the non-homogeneous ODE

      building a particular solution using variation of parameters

<- solving first the homogeneous part of the ODE successful

y(x) = sin(x)*c__2+cos(x)*c__1+(1/2)*sin(x)-(1/2)*cos(x)*x

dsolve(ode);

Methods for second order ODEs:

--- Trying classification methods ---

trying a quadrature

trying high order exact linear fully integrable

trying differential order: 2; linear nonhomogeneous with symmetry [0,1]

trying a double symmetry of the form [xi=0, eta=F(x)]

-> Try solving first the homogeneous part of the ODE

   checking if the LODE has constant coefficients

   <- constant coefficients successful

   -> Determining now a particular solution to the non-homogeneous ODE

      building a particular solution using variation of parameters

<- solving first the homogeneous part of the ODE successful

y(x) = sin(x)*c__2+cos(x)*c__1+(1/2)*sin(x)-(1/2)*cos(x)*x

 


On a side note. the first line of the display is hard to read. Any one know what it is supposed to mean by the space between the 1 and y(x) at the end there?

Download infolevel_stops_working.mw

Another example where infolevel changes on second call to dsolve: The first call gives more information which is lost in the second call. There does not seem to be a way to fix this at user level.

restart;

23828

ode:=diff(y(x),x)+(a*x+y(x))*y(x)^2=0:
infolevel[dsolve]:=5:
dsolve(ode)

Methods for first order ODEs:

--- Trying classification methods ---

trying a quadrature

trying 1st order linear

trying Bernoulli

trying separable

trying inverse linear

trying homogeneous types:

trying Chini

differential order: 1; looking for linear symmetries

trying exact

trying Abel

The relative invariant s3 is: -1/27*a*(2*a^2*x^3-9)

The first absolute invariant s5^3/s3^5 is: 729*a^4*x^6*(2*a^2*x^3-15)^3/(2*a^2*x^3-9)^5

The second absolute invariant s3*s7/s5^2 is: 5/3/a^2*(2*a^2*x^3-9)/x^3*(2*a^4*x^6-21*a^2*x^3+18)/(2*a^2*x^3-15)^2

...checking Abel class AIL (45)

...checking Abel class AIL (310)

...checking Abel class AIR (36)

inverse of the transformation solving the problem is: {t = 1/2*(-2*a^2)^(1/3)*x, u(t) = -(-2*a^2)^(1/3)/a*y(x)}

<- Abel successful

y(x) = 2*a/(a^2*x^2+2*RootOf((-2*a^2)^(1/3)*AiryBi(_Z)*c__1*x+(-2*a^2)^(1/3)*x*AiryAi(_Z)+2*AiryBi(1, _Z)*c__1+2*AiryAi(1, _Z))*(-2*a^2)^(1/3))

dsolve(ode)

Methods for first order ODEs:

--- Trying classification methods ---

trying a quadrature

trying 1st order linear

trying Bernoulli

trying separable

trying inverse linear

trying homogeneous types:

trying Chini

differential order: 1; looking for linear symmetries

trying exact

trying Abel

<- Abel successful

y(x) = 2*a/(a^2*x^2+2*RootOf((-2*a^2)^(1/3)*AiryBi(_Z)*c__1*x+(-2*a^2)^(1/3)*x*AiryAi(_Z)+2*AiryBi(1, _Z)*c__1+2*AiryAi(1, _Z))*(-2*a^2)^(1/3))

 

Download another_example_info_level_changes.mw

I'd like to plot vectors with one beginning at the head of the other. The application is a reflection at a surface. VectorPositionPlot doesn't seem to do it.

The same kind of plot would be used to illustrate vector addition.

I have done a complete clean reinstall of windows 10 and all programs on my pc.

In worksheet mode new files do not have the "default" red/brown text coluor ond the font is different. 

Might not be a problem but thought that was the default?

What have I changed or have Maple defaults changed?

restart

``

2+2

4

(1)

NULL

eq := x^3+x-7

x^3+x-7

(2)

NULL

Download 23-11-23_Q_inputs_to_worksheet_not_brown_red_colour.mw

Sorry if this is already known, but I haven't found the proper function call.

I just want to "print" this expression without evaluating the boolean calls

restart;
P(X <= 5) = P(-5 <= -X) = P(E(X) - 5 <= E(X) - X);

As it stands, this will evaluate to "false" which I obviously don't want.

I just want to use it as a displayer.

Hello
I have a problem in writing the Maple code of the image below, I don't know why the 3.5 answers are not available?

which one is better?

123.mw

0123.mw

This is strange problem. I have matrix M. when doing latex(M), it works. But when doing latex(simplify(evalf[16](M))) it gives internal Maple error 

Error, (in unknown) invalid input: ^ expects 2 arguments, but received 1

any workaround or ideas why it happens?

Maple 2023.2 on windows 10.

restart;

2848

interface(version)

`Standard Worksheet Interface, Maple 2023.2, Windows 10, October 25 2023 Build ID 1753458`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1590. The version installed in this computer is 1585 created 2023, October 29, 6:31 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2023\Physics Updates\lib\`

expr:=Matrix(3, 3, [[(-a^2-b^2-c^2)^(1/2),b*c/a,-b*c/a],[0,-(a^2+b^2)/(-a^2-b^2-c^2)^(1/2),c*a/b-c^2/(-a^2-b^2-c^2)^(1/2)],[0,0,0]]);
latex(expr);

Matrix(3, 3, {(1, 1) = sqrt(-a^2-b^2-c^2), (1, 2) = b*c/a, (1, 3) = -b*c/a, (2, 1) = 0, (2, 2) = -(a^2+b^2)/sqrt(-a^2-b^2-c^2), (2, 3) = c*a/b-c^2/sqrt(-a^2-b^2-c^2), (3, 1) = 0, (3, 2) = 0, (3, 3) = 0})

\left[\begin{array}{ccc}
\sqrt{-a^{2}-b^{2}-c^{2}} & \frac{b c}{a} & -\frac{b c}{a}
\\
 0 & -\frac{a^{2}+b^{2}}{\sqrt{-a^{2}-b^{2}-c^{2}}} & \frac{c a}{b}-\frac{c^{2}}{\sqrt{-a^{2}-b^{2}-c^{2}}}
\\
 0 & 0 & 0
\end{array}\right]

expr:=simplify(evalf[16](expr));
latex(expr);

Matrix(3, 3, {(1, 1) = 1.*sqrt(-a^2-b^2-c^2), (1, 2) = b*c/a, (1, 3) = -1.*b*c/a, (2, 1) = 0., (2, 2) = (-1.*a^2-1.*b^2)/sqrt(-a^2-b^2-c^2), (2, 3) = c*a/b-1.*c^2/sqrt(-1.000000000*a^2-1.000000000*b^2-1.000000000*c^2), (3, 1) = 0., (3, 2) = 0., (3, 3) = 0.})

Error, (in unknown) invalid input: ^ expects 2 arguments, but received 1

 

(will send to Maplesoft)

Download latex_problem_after_using_evalf_nov_23_2023.mw

Anteriorly, I had done a question that you answered in the forum and it basically it was about the simplification of a equation. I'm posting the print of the screen and the code because the question of today is similarly, but not completely, because there are something that make more complicate the code that I devolved.

restart;
Hi := -Delta*S1^2 - J*S1*S2;
R1 := S1*exp(-beta*Hi);
R1 := add(R1, S1 = [--1, 0, 1]);
R2 := exp(-beta*Hi);
R2 := add(R2, S1 = [-1, 0, 1]);
S := R1/R2;
S := convert(S, trig, {J*S2});
S := simplify(S);
S := convert(S, exp, {Delta});

In this case I had to put in evidence the therm exp(Delta beta), where I simplified the expression. Now, we have more 2 variables (+2 and -2) to substitute in the equation. The code is:

restart;
Hi := -Delta*S1^2 - J*S1*S2;
R1 := S1*exp(-beta*Hi);
R1 := add(R1, S1 = [-2, -1, 0, 1, 2]);
R2 := exp(-beta*Hi);
R2 := add(R2, S1 = [-2, -1, 0, 1, -2]);
S := R1/R2;
S := convert(S, trig, {J*S2});
S := simplify(S);
S := convert(S, exp, {Delta});

In the last line we had the final equation

What should I change in the code for that my exponential function continue in evidence? This is, for my expression  be

(4*sinh(2*J*S2*beta) + 2*sinh(J*S2*beta)*exp(-3*Delta*beta))/(2*cosh(2*J*S2*beta) + 2*cosh(J*S2*beta)*exp(-3*Delta*beta) + exp(-4*Delta*beta))

Hi everybody and Acer 

I have problems with this file I have, where it says “there where problems during the loading process” … Can anyone help med with my file?

Chemistry-Cheatsheet-Ramz_edition_Week_7-12_1_1.mw

i want to find fitted parameter value for G1,G2,G3,tau1,tau2,tau3 and plot stress-strain curve that fit to true_stress_strain curve(experimental data)
and i tried many times and still get error..can anyone please help me.here is my maple file...
 prony.mw 

Good day to all of you. 

I am working with a differential equation, got a first approximation setting all the constants equal to 1. But at the time to use the real values there appears the error numeric exception: division by zero.

I'll thanks any advice.

best regards

division_by_zero.mw

In the system below, I need to solve the solution algebraically (it is known in advance that from "V3" that a0=1,just open the V3 command).

V := exp(lambda*S) = S^4*a4 + S^3*a3 + S^2*a2 + S*a1 + a0;
V1 := subs(S = 2, V);
V2 := subs(S = 1, V);
V3 := subs(S = 0, V);
V4 := subs(S = -1, V);
V5 := subs(S = -2, V);
fsolve(subs(a0 = 1, {V1, V2, V4, V5}), {a1, a2, a3, a4});

I already know the answers, but I need maple to provide me with the command in the form

a1:=(1/6)*[8*sinh(lambda)-sinh(2*lambda)] and

a2:=(1/12)*[16*cosh(lambda)-cosh(2*lambda)-15],

a3:= ... etc.

What is the best way to do this?

Something to be aware of.  I realized you can't use rand in an equation with other rand's since the calculation affects the other call to it. 

Here is an example:

A simulation of 3 six sided die rolls added together for 50 trials. 

with(Statistics):
a:=[]:
for i from 1 to 50 do
  b:=rand(1..6)()+rand(1..6)()+rand(1..6)():
  a:=[op(a),b]:
end do:
Histogram(a,frequencyscale=absolute,discrete=true)

You'll notice the rand calls have affected the other calls to rand, and has eliminated some possible results.  

[added by moderator, from a Reply by the OP]

The idea was to generate values from 1 to 20 (I just chose 20 as an example) using 6 sided dice, and one that which produces as uniform a distrubution as possible. I appreciate the explanations.  I chose 4 as the smallest number of rolls needed. In the physical world as n approaches large numbers rolling that many becomes increasingly more difficult and time consuming.

So just wondering what the best solution would be for a uniform distribution in a range from 1 to n using only six sided dice?

For plotting with a plot function that has not been upgraded to units I want to remove units from the following

5.818576570*10^(-7)*exp(`&ndash;`((1.827959741*10^(-6))*(x^2+y^2)/Unit('`&mu;m`')^2))/Unit('`&mu;m`')^2

0.5818576570e-6*exp(-0.1827959741e-5*(x^2+y^2)/Units:-Unit(`&mu;m`)^2)/Units:-Unit(`&mu;m`)^2

(1)

convert(0.5818576570e-6*exp(-0.1827959741e-5*(x^2+y^2)/Units:-Unit(`&mu;m`)^2)/Units:-Unit(`&mu;m`)^2, unit_free)

0.5818576570e-6*exp((-0.1827959741e-5*x^2-0.1827959741e-5*y^2)*Units:-Unit(1/`&mu;m`^2))

(2)

map(convert, 0.5818576570e-6*exp(-0.1827959741e-5*(x^2+y^2)/Units:-Unit(`&mu;m`)^2)/Units:-Unit(`&mu;m`)^2, unit_free)

0.5818576570e-6*exp((-0.1827959741e-5*x^2-0.1827959741e-5*y^2)*Units:-Unit(1/`&mu;m`^2))

(3)

NULL


Anything else I could try with convert or something better than this

subs(Unit(1/'`&mu;m`'^2) = 1, %)

I cannot conclude form the help page ?convert,unitfree if it should have worked on the expression.

Is the expression (1) non-scalar?

The term unit-free describes a scalar quantity with no (multiplicative) unit attached to it. Conversion to unit-free does not apply directly to any non-scalar Maple object or data structure, which may still have units embedded within it.

Download convert_unit_free_of_exp.mw

Download Exercises_all_lectures_1.mw

Exercises_all_lectures_1.mw

Hello,

I have a Maple document that contains a lot of notes that I have an exam for tomorrow. I opened the document today and it suggests I save a copy of a corrupt document and also it gives me the message "There were problems during the loading process.
Your worksheet may be incomplete." when it finally does load.

Any suggestions for how I could fix this would be greatly greatly appreciated.

Thank you

I have this equation:

and I need to do some manipulation to obtain this:

I manage to get it but my manipulation is too long for my liking. Can someone show me a shorter version. I have linked the Maple document.

Manipulating_polynomial.mw

Thank you in advance for your help.

Mario

First 31 32 33 34 35 36 37 Last Page 33 of 2097