MaplePrimes Questions

First, this is not a homework assignment.  I am evaluating Maple as a replacement for a paper notebook since I never seem to have one at hand when I want one.  I want to be able to do algebra but seemingly at a finer level of detail than factor, collect, simplify, and expand seem to offer.  Here is what seems like a very simple example that I cannot crack:

(x-a)2-2a(x-a)

should simplify to 

x2 - a2

No matter what try with factor, collect, simplify, sort, and expand, I cannot get it past

x2 - 2xa + a2 + 2a(x - a)

How can I get maple to expand and collect specific terms in an expression?

Hi, maybe someone knows how to fix this:

"Error, (in assuming) when calling 'assume'. Received: 'question.mw'"

I am attaching the corresponding maple file. I've never met such an error message, and unfortunately the Maplesoft help does not contain any information about such an issue : 

restart; (2^(1/2+1/2+1)*GAMMA(n+1/2+1)*GAMMA(n+1/2+1))/((2*n+1/2+1/2+1)*GAMMA(n+1/2+1/2+1)*factorial(n))

4*GAMMA(n+3/2)^2/((2*n+2)*GAMMA(n+2)*factorial(n))

(1)

JacobiP(n, 1/2, 1/2, 1)

JacobiP(n, 1/2, 1/2, 1)

(2)

evalf(JacobiP(3, 1/2, 1/2, 1))

2.187500000

(3)

f := proc (n, x) options operator, arrow; (1/4)*JacobiP(n, 1/2, 1/2, x)*4^(1/2)/(GAMMA(n+3/2)^2/((2*n+2)*GAMMA(n+2)*factorial(n)))^(1/2) end proc

proc (n, x) options operator, arrow; (1/4)*JacobiP(n, 1/2, 1/2, x)*4^(1/2)/(GAMMA(n+3/2)^2/((2*n+2)*GAMMA(n+2)*factorial(n)))^(1/2) end proc

(4)

int(f(1, x)^2*sqrt(-x^2+1), x = -1 .. 1)

1

(5)

int(f(2, x)^2*sqrt(-x^2+1), x = -1 .. 1)

1

(6)

int(f(3, x)^2*sqrt(-x^2+1), x = -1 .. 1)

1

(7)

c := proc (n) options operator, arrow; int(sqrt(1+x)*f(n, x)*sqrt(-x^2+1), x = -1 .. 0)+int(f(n, x)*sqrt(-x^2+1), x = 0 .. 1) end proc

proc (n) options operator, arrow; int(sqrt(1+x)*f(n, x)*sqrt(-x^2+1), x = -1 .. 0)+int(f(n, x)*sqrt(-x^2+1), x = 0 .. 1) end proc

(8)

c(12)

(2/450225)*(-208+679*2^(1/2))/Pi^(1/2)

(9)

S := proc (N, x) options operator, arrow; evalf(sum(c(n)*f(n, x), n = 0 .. N)) end proc

proc (N, x) options operator, arrow; evalf(sum(c(n)*f(n, x), n = 0 .. N)) end proc

(10)

S(1, 1)

Error, (in assuming) when calling 'assume'. Received: 'contradictory assumptions'

 

NULL

Download question.mw

https://www.maplesoft.com/support/help/errors/view.aspx?path=Error,%20(in%20assuming)%20when%20calling%20%27assume%27.%20Received%3A%20%27contradictory%20assumptions%27

Many thanks in advance

> ode_sys:=2*diff(x(t),t$2) + 6*x(t) - 2*y(t) = 0, diff(y(t),t$2) + 2*y(t) - 2*x(t) = 0:
> lsol:=inttrans:-laplace({ode_sys},t,s)

The displayed output has an unresolved  "=  inttrans/laplace`(0, t, s)" on the end.

> lsol

Does not. Why?

A general term for this series is+-xr, having a positive sign when r is even and a negative sign when r is odd.

​​​​Now because (-1) is positive when r is even and negative when r is odd, the general term can be written as (-1)rxr

Hence;

1-x+x2-x3+...=£or=0(-1)r(x)r

Why does fsolve(x - (-8.0)^(1/3), x) returns only the first root (1.000000000 + 1.732050807*I)  of the polynomial (which clearly has 3 roots)?

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

First 108 109 110 111 112 113 114 Last Page 110 of 2394