MaplePrimes Questions

I am re-posting. I am not sure why my question was deleted. Please advise on how to amend my post so that it's not considered spam.

I simply wonder how parameters can "disappear" in a solution. In particular, in my example below the parameter gamma correctly appears in 3 out of 4 solution. However, the solution in which 'gamma' does not appear is also the solution I am most interested in, given its manageable size. Why gamma is "lost" for this solution? 281223_gamma_disappear.mw

How do i check if an equation or function does not contain an '=' sign, to convert it?

if eq:= a+b=c

If it has an  '=' I can use eq1:=lhs(eq)-rhs(eq).

If eq=d+e+f there is no lhs/rhs and checking produces an error.

eq := a*x^2 + b*x = v;
                               2          
                      eq := a x  + b x = v

eq1 := lhs(eq) - rhs(eq);
                            2          
                         a x  + b x - v

eq2 := a*x^2 + b*x - v;
                               2          
                     eq1 := a x  + b x - v

lhs(eq1);
Error, invalid input: lhs received a*x^2+b*x-v, which is not valid for its 1st argument, expr
NULL;
has(eq,'=');
Error, invalid uneval
        Typesetting:-mambiguous(hasApplyFunction(eqcomma

          Typesetting:-mambiguous((equals), 

          Typesetting:-merror("invalid uneval"))))


has(eq2, rhs(eq2));
Error, invalid input: rhs received eq2, which is not valid for its 1st argument, expr
NULL;

 

Dear power users, I am still struggling with relative simple tasks and do hope that some of you can help me in the right direction. Solving an ODE is straightforward in Maple. But how do you solve an ODE with multiple inputs, as shown in the attached worksheet. I would appreciate any help with respect to my question. I would also like to wish all of you a good ending of 2023 and a brilliant start in 2024.

MapleprimesODE_Question.mw

Hi, will happy to find out how can I get the proper answer for the expression following:

abs(exp(I*k*x))?

I expected to get 1

Bu actually I've got

e^R(Ikx)

Futhermore, Maple also doesn't calculate any absolute values of complex expressions, only adds the brackets.

in this plot...i want to do like only 5 points in y coordinates and x coordinates...how to change? there are many

For example, I would like to draw the following figure in Maple.

 

(The above figure is taken from MatLab's documentation.) 
Here are these four graphics objects: 

use plottools, ColorTools in
	l0, l1 := line~([<1 | 0>, <1 | 1>], [<6 | 5>, <6 | 6>], 'color' =~ Color~(["#0072BD", "#D95319"]))[];
	r0, r1 := rectangle~([[2, 0], [4, 0]], [[3, 6], [5, 6]], 'color' =~ Color~([[.6, .7, .9], [.95, .7, .6]]))[]
end:

However, either 

`plots/display`([r1, l1, l0, r0], 'axes' = "boxed", 'size' = ["default", "golden"], 'style' = "patchnogrid")

or 

`plots/display`([r0, l0, l1, r1], 'axes' = "boxed", 'size' = ["default", "golden"], 'style' = "patchnogrid")

outputs the same graphical image where the lines are always rendered on top of each rectangles instead of the other way around.

plots:-display([plottools:-rectangle([2, 0], [3, 6], 'color' = ColorTools:-Color([.6, .7, .9])), plottools:-line([1, 0], [6, 5], 'color' = ColorTools:-Color( 

So how to superimpose the right rectangle over the two lines? To put it differently, how to handle the graphics hierarchy? I have read some similar questions like Order in plots:-display - MaplePrimes, yet I cannot find any workarounds. 

Note that in my opinion, the result should comprise two unbroken line segments rather than four subordinate line segments! 

I would like to take advantage from the powerful command "SSTransformation" of the DynamicSystems package to reuse the corresponding output.

For example, if we use the following shape:

         > SSTransformation( Amat, Bmat, Cmat, Dmat, form = ModalCanon, output=['A','B','C','D','T'] );

How to do to assign names to the outputs A,B,C,D and T to subsequently reuse them?

is it possible to find why Maple fails to solve these two equations in two unknowns? Has this always been the case? I do not have older versions of Maple to check. The trace shows that it found solution but then itg says no solution was found. This is very strange.

17020

interface(version)

`Standard Worksheet Interface, Maple 2023.2, Windows 10, November 24 2023 Build ID 1762575`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1622. The version installed in this computer is 1618 created 2023, November 29, 17:28 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2023\Physics Updates\lib\`

restart;

17020

sol:=1/4*exp(-t) * (c2*(-1+exp(4*t)) + c1*(3+exp(4*t))):
expand(simplify(sol));

-(1/4)*c2/exp(t)+(1/4)*(exp(t))^3*c2+(3/4)*c1/exp(t)+(1/4)*(exp(t))^3*c1

eq1:=-3=eval(sol,t=4):
expand(simplify(eq1));

-3 = (1/4)*c1*exp(12)+(1/4)*c2*exp(12)+(3/4)*exp(-4)*c1-(1/4)*exp(-4)*c2

eq1:=-17=eval(diff(sol,t),t=4);
expand(simplify(eq1));

-17 = -(1/4)*exp(-4)*(c2*(-1+exp(16))+c1*(3+exp(16)))+(1/4)*exp(-4)*(4*c2*exp(16)+4*c1*exp(16))

-17 = (1/4)*exp(-4)*c2+(3/4)*c2*exp(12)-(3/4)*exp(-4)*c1+(3/4)*c1*exp(12)

infolevel[solve]:=5;
solve([eq1,eq2],[c1,c2])

5

Main: Entering solver with 2 equations in 2 variables

Main: attempting to solve as a linear system

Linear: solving 2 linear equations

Algebraic: # equations is: 2

Main: Linear solver successful. Exiting solver returning 1 solution

solve: Warning: no solutions found

[]

Download unable_to_solve_2_equations_dec_26_2023.mw

For reference this is the solution given by Mathematica

 

Hello,

Please could someone explain the background and motivation for using evalhf, and its scope and limitations.

I am not a computer scientist and only have a rudimentary knowledge regarding computer hardware, so the idea of the "hardware float" is abstract and not at all clear to me.

I have tried to go through the page https://www.maplesoft.com/support/help/maple/view.aspx?path=evalhf, but things like "double precision" do not mean anything to me.

Any comments or discussion, or direction to articles aimed at the novice, about what the evalhf instruction does would be much appreciated.

Thank you!

Season's Greetings!

Mikey

A case where simplify(...) and simplify~(...) both return the wrong result.
Should we consider this a simplify bug?

restart:


A simple case

J := Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity)
     *
     Int(r[2]^2*varphi[2](r[2]), r[2] = -infinity .. infinity)

(Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[2]^2*varphi[2](r[2]), r[2] = -infinity .. infinity))

(1)

# OK

op(1, J) = simplify(op(1, J))

Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity) = Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity)

(2)

# OK

op(2, J) = simplify(op(2, J))

Int(r[2]^2*varphi[2](r[2]), r[2] = -infinity .. infinity) = Int(r[2]^2*varphi[2](r[2]), r[2] = -infinity .. infinity)

(3)

# But...
#
# Not OK

simplify(J)

(Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[1]^2*varphi[2](r[1]), r[1] = -infinity .. infinity))

(4)

# Not OK

simplify~(J)

(Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[1]^2*varphi[2](r[1]), r[1] = -infinity .. infinity))

(5)

# OK

map(simplify, J)

(Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[2]^2*varphi[2](r[2]), r[2] = -infinity .. infinity))

(6)


A slightly more complex case

J := (Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[2]^2*varphi[2](r[2]), r[2] = -infinity .. infinity))-(Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[2]*varphi[2](r[2]), r[2] = -infinity .. infinity))^2;

(Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[2]^2*varphi[2](r[2]), r[2] = -infinity .. infinity))-(Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[2]*varphi[2](r[2]), r[2] = -infinity .. infinity))^2

(7)

is(J=simplify(J))

false

(8)

is(J=simplify~(J))

false

(9)

is(J=map(simplify, J));
map(simplify, J);

false

 

(Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[1]^2*varphi[2](r[1]), r[1] = -infinity .. infinity))-(Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[1]*varphi[2](r[1]), r[1] = -infinity .. infinity))^2

(10)

add(map(u -> map(simplify, u), [op(J)]));

is(J=%);

(Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[2]^2*varphi[2](r[2]), r[2] = -infinity .. infinity))-(Int(r[1]^2*varphi[1](r[1]), r[1] = -infinity .. infinity))*(Int(r[2]*varphi[2](r[2]), r[2] = -infinity .. infinity))^2

 

true

(11)

 

Download Simplify_is_wrong.mw

Good Morning Sir. How to get the series of g(x).I couldn't get  it.

AGM.mw

Please help to plot this equation 

fwf-v.mw

Hello,

I am a beginner using Maple 18. In the procedure I am analyzing, the result is 0.*I. This result means that the procedure cannot be completed until the end, displaying the graph. I am attaching Maple worksheet. Please help me solve this problem.

Capillarity.mw

Maple does not give solution to this first order ode with IC, if asked to do it implicit. It only solves it explicit. 

ode := diff(y(x), x) - 2*(2*y(x) - x)/(x + y(x)) = 0;
ic:=y(0)=2;
dsolve([ode,ic],'implicit'); #maple gives no solution when implicit!

Then I asked Maple for an implicit solution but with no IC. Then solved for the constant of integration myself, and plugged this back in the solution. But odetest now says the initial conditions do not verify. 

Here are the steps I did to solve for the constant of integration. I do not see any error I made. Does any one see where my error is and why odetest does not verify the solution for IC?

This first order ode has unique solution. Here is my worksheet.
 

35220

restart;

35220

ode := diff(y(x), x) - 2*(2*y(x) - x)/(x + y(x)) = 0;
ic:=y(0)=2;
dsolve([ode,ic],'implicit'); #maple gives no solution when implicit!

diff(y(x), x)-2*(2*y(x)-x)/(x+y(x)) = 0

y(0) = 2

#lets now try finding the constant of integration ourself
sol:=dsolve(ode,'implicit')

2*ln(-(-y(x)+x)/x)-3*ln(-(-y(x)+2*x)/x)-ln(x)-c__1 = 0

#setup equation and plugin the IC. Raise both sides to exp. RHS becomes 1
eq:=exp(lhs(sol))=1;

exp(2*ln(-(-y(x)+x)/x)-3*ln(-(-y(x)+2*x)/x)-ln(x)-c__1) = 1

simplify(eq,exp);

(y(x)-x)^2*exp(-c__1)/(y(x)-2*x)^3 = 1

#plugin in y=2 at x=0
eval(%,[y(x)=2,x=0]);

(1/2)*exp(-c__1) = 1

#solve for constant of integration
solve(%,c__1)

-ln(2)

#subtitute back in the solution
sol:=eval(sol,c__1=%);

2*ln(-(-y(x)+x)/x)-3*ln(-(-y(x)+2*x)/x)-ln(x)+ln(2) = 0

#verify. Why it failed check on IC?? Notice it is not [0,0].
odetest(sol,[ode,ic])

[0, 2]

 


 

Download why_fails_to_verify.mw

 

First 22 23 24 25 26 27 28 Last Page 24 of 2308