MaplePrimes Questions

Using Maple 2017.3, I ask for the roots of x3-x2-8x+8 and I get the following result:

roots(x^3-x^2-8*x+8);
                            [[1, 1]]

However, I know that (2*sqrt(2)) and -(2 * sqrt(2)) are also roots. Is this a bug or something I do not understand about the "roots" command?

 

Here's a slightly reduced form of a little module from some code that I posted recently:

KandR:= module()
local
   a, b, c, e, #parameters

   #procedure that lets user set parameter values:
   ModuleApply:= proc({
       a::algebraic:= KandR:-a, b::algebraic:= KandR:-b, 
       c::algebraic:= KandR:-c, e::algebraic:= KandR:-e
   })
   local k;
      for k to _noptions do thismodule[lhs(_options[k])]:= rhs(_options[k]) od;
      return
   end proc
;
end module:

The purpose of the module is simply to be a container for the four parameters and to provide a simple ModuleApply interface by which they can be set, reset, and/or unset. 

I very often use a procedure parameter of a ModuleApply to set a local variable of same name in the module. Because of the name conflict, thismodule needs to be used in these situations. I see this as the primary use of thismodule. In the module above, the purpose of the line 

for k to _noptions do thismodule[lhs(_options[k])]:= rhs(_options[k]) od;

is to avoid the need to explictly use the parameters yet a third time. First off, I am amazed that this works! I've had many disappointments with thismodule (which is essentially undocumented---its miniscule help page is nearly worthless). I am using Maple 2018, release 1. Another Maple 2018 user (not sure which release) reports that the above line gives an error (when executed) that thismodule's index must be a name.

Question 1: What's up with that?

[Edit: It's been determined that the problem was due to an unfortunate global assignment in that user's initialization file rather than different behavior of thismodule. So, I consider Question 1 to be completely answered, and it should be ignored.]

Question 2: The for loop is not entirely satisfying to me. Is there a better way?

[Status: Answered, see below.]

Question 3: Ideally, I'd like to explicity use the four parameters once, not two or three times. Is there a way? If I need to use a container for the parameters (such as a Record), to achieve that, I'd be happy to do that, and I wouldn't mind needing to invoke that container's name any number of times.

[Status: Answered, see below.]

Note that op and exports can be applied to thismodule to extract the module's operands. I have found this occasionally useful.

Question 4: What are some other good uses for thismodule? The one and only example given on its help page seems ridiculous to me.

The docs say that you can assign initial values to a record as shown in this screenshot:

I would expect the last two lines of output to be 1, 2. The slighly more complicated example in the docs does not work as expected either. This is the worksheet: queery.mw

I can assign to a record subsequently, but that makes for very prolix code,

Thanks for any help.

How do we use the command convert(expression, number format) in the conversion of number input in a textarea?radianToDegree.mw
 

``

``

 

``

``

``

``

 

 

 

I want conversion from string to float and evaluate radian to degree and show it in textareaDegree.

I am unable to do the operation. 6 radian = 6x180/2 (pi) degrees must be shown degree textbox.

Please help.

Thanks.

Ramki

``

``


 

Download radianToDegree.mw

 

Hello,

I am trying to get Maple to recognize and reverse the product rule in more than one dimension. In one dimension, this works:

Int((Diff(f(x), x))*g(x)+(Diff(g(x), x))*f(x), x) = int((diff(f(x), x))*g(x)+f(x)*(diff(g(x), x)), x);

Int((Diff(f(x), x))*g(x)+(Diff(g(x), x))*f(x), x) = int((diff(f(x), x))*g(x)+f(x)*(diff(g(x), x)), x).

But in two dimensions, it no longer evaluates:

Int((Diff(f(x, y), x))*g(x, y)+(Diff(g(x, y), x))*f(x, y), x) = int((diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x)), x)

Int((Diff(f(x, y), x))*g(x, y)+(Diff(g(x, y), x))*f(x, y), x) = int((diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x)), x)

As far as I can tell, mathematically these should be identical (except for the antiderivatives being defined up to a constant in the first case and a function of y in the second). Is there a way to get Maple to reverse the product rule to integrate in more than one dimension? Or am I missing something mathematically that makes this incorrect?

Thanks for your help,

Johnathan


 

M := `<,>`(`<|>`(1, 2, 3), `<|>`(4, 5, 6), `<|>`(7, 8, 9))

Matrix(%id = 18446745804653824710)

(1)

b := `<|>`(10, 11, 12)

Vector[row](%id = 18446745804653819654)

(2)

M+b

Error, (in rtable/Sum) invalid input: dimensions do not match: Matrix(1 .. 3, 1 .. 3) cannot be added to Vector[row](1 .. 3)

 

``

Of course the above addition will throw an error because M and b have different dimensions. But if broadcasting was allowed, then the row vector b is added to each row in the matrix M. For example, in Python:

 

 

Is there a similar feature in Maple?


 

Download question.mw

I am working on solving a set of equations for a number of parameters, and everything looks great except that I am getting a "1." in front of the solution for a couple of variables. What does this mean? In the example below, in the solution for both d__1 and d__2, there is a "1." (3 of them in fact).

 

s1Mean := -1/(2*(-rho^2+1))*(-2*d__1/c__1)-2*rho*d__2/((2*(-rho^2+1))*c__1^.5*c__2^.5) = -2*(-(-X*beta+y)*kappa/(2*sigma)+xi__2*Z__2*gamma__1/(2*tau__2)-xi__1*Z__1/(2*tau__1))

s2Mean := -1/(2*(-rho^2+1))*(-2*d__2/c__2)-2*rho*d__1/((2*(-rho^2+1))*c__1^.5*c__2^.5) = -2*(-(-X*beta+y)*gamma__2/(2*sigma)-xi__2*Z__2/(2*tau__2))

 

meanSol := solve({s1Mean, s2Mean}, {d__1, d__2})

with maple 2015

how can type log[2](3) into

Can you help me?

Thank you very much.

log.mw

 

 Any one can help me to solve the differential equations using maple to get the velocities u ,v and pressure p for the problem mentioned below

I tried the example in BodePlot help.

restart;
with(DynamicSystems):
sys := TransferFunction( 1/(s-10) ):
BodePlot(sys);


That works OK. But, if I invoke Syrup, the example no longer works.

restart;
with(Syrup);
with(DynamicSystems):
ckt := [V, Rsrc(50), C1(15e-9), L1(15e-6), C2(22e-9), L2(15e-6), C3(22e-9), L3(15e-6), C4(15e-9), 1, Rload(50)];

TF := subs(other, V=1, v[Rload]);
sys := TransferFunction(TF);

BodePlot(sys);
I get a message "not a valid plot structure".  OK, try the example, again.

sys := TransferFunction( 1/(s-10) ):
BodePlot(sys);
I also get the "not a valid plot structure" message.

What am I doing wrong?

I have asked this before but am still confused. I have a half-dozen procedures I want to save. Don't want them in a module/package. I am using windows 10.

I just can't get the syntax correct on this.

Obviously after saving restart and load to test.

libname;
       "C:\Program Files\Maple 2018\lib", 

         "C:\Users\Ronan\maple\toolbox\CodeBuilder\lib", 

         "C:\Users\Ronan\maple\toolbox\OEIS\lib", 

         "C:\Users\Ronan\maple\toolbox\personal\lib", 

         "C:\Users\Ronan\maple\toolbox\UTF8\lib"
libdir := "C:/Users/Ronan/maple/toolbox/personal/lib";
     libdir := "C:/Users/Ronan/maple/toolbox/personal/lib"
NULL;

LibraryTools:-Save(Pedal, cat(kernelopts(homedir), "/maple/toolbox/personal/lib/Pedal.mpl"));
Error, (in LibraryTools:-Save) could not open `C:\Users\Ronan/maple/toolbox/personal/lib/Pedal.mpl\Pedal.m` for writing

 

Please tell me where I go wrong

And I have not even tried lamda in nanometers

Since theata is small I repalce sin(theta) by theta because, with units, sin did not compute

Anyone know a good reference (book/website) explaing Maple units?

Many thanks


TelescopeUnits.mw

Hi

I hope everyone is fine.

Here is a nice question :

I have an inequality ( please see maple code) if I assume a special condition (on |f(u,s)| used in the code )

how can I get an upper bound of the function |x(t)| and is the upper bound converges to zero when t goes to infinity.

Maybe this is can be done using maple because by hand up to know I can't find an upper bound which converges to zero as t goes to infinity.

Maybe, there is  a good, nice and appropriate answer using maple.

Below, please find the upper_bound.mw code.

Many thinks

 

Upper_bound.mw


 

``

restart; assume*(0 < gamma); assume*(0 < M)

(0 < gamma)*assume

 

(0 < M)*assume

(1)

abs(x(t)) <= exp(-gamma*t)*abs(x(0))+int(abs(x(s))*(int(exp(-gamma*(t-u))*abs(f(u, s)), u = s .. t)), s = 0 .. t);

abs(x(t)) <= exp(-gamma*t)*abs(x(0))+int(abs(x(s))*(int(exp(-gamma*(t-u))*abs(f(u, s)), u = s .. t)), s = 0 .. t)

(2)

assume*(int(abs(f(u, s)), u = 0 .. infinity) < M)

(int(abs(f(u, s)), u = 0 .. infinity) < M)*assume

(3)

``

 

(I*Can*get*an*upper*bound*of*abs(x(t))*when*I)*assume; int(abs(f(u, s)), u = 0 .. infinity) < M


 

Download Upper_bound.mw

I am curious how one can fine the whattype of operation in expression when two variables are actually doing difference or division operation

like

whattype(a-b);
whattype(a/b);

is there any better method to find out actually for all five operations exactly.

1. a-b;  should tell the operation is difference(substraction(`-`))
2. a+b; should tell the operation is addition(`+`)
3. a*b;  should tell the operation is multiplication(`*`)
4. a/b;  should tell the operation is division(`/`)
5. a^b;  should tell the operation is power(`^`)

I understood that maple is reading a-b as a+(-b) and same a/b as a*(1/b). but, for programing it is very much comfortable to know exactly the operation. Especially when solving partial differentiation it is easy if I know exactly.

would be very grateful if I can get this thing solved. Any suggestions and coments are welcomed and thanks in advance
 

Hi,

      I need to compute something involved with the pseudo differential operators.

https://en.wikipedia.org/wiki/Pseudo-differential_operator

Specifically, I need to calculate the inverse of a pseudo differential operator, the multiplication of two pseudo differential operators, and the n-th root of a pseudo differential operator. 

I don't know whether Maple could handle these. 

Thanks.

First 759 760 761 762 763 764 765 Last Page 761 of 2426