Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

In an old post, vv reported a bug in simpl/max, which has been "fixed" in Maple 2018. However, it seem that such repairs are not complete enough.
For example, suppose it is required to find the (squared) distance between the origin and a point on x3 - x + y2 = ⅓ which is closest to the origin. In other words, one needs to minimize x²+y² among the points on this curve, i.e., 

extrema(x^2 + y^2, {x^3 + y^2 - x = 1/3}, {x, y}, 's'); # in exact form

Unfortunately, an identical error message appears again: 

restart;

extrema(x^2+y^2, {x^3+y^2-x = -2/(3*sqrt(3))}, {x, y})

{4/3}

(1)

extrema(x^2+y^2, {x^3+y^2-x = 1/3}, {x, y})

Error, (in simpl/max) complex argument to max/min: 1/36*((36+12*I*3^(1/2))^(2/3)+12)^2/(36+12*I*3^(1/2))^(2/3)

 

`~`[`^`](extrema(sqrt(x^2+y^2), {x^3+y^2-x = 1/3}, {x, y}), 2)

{4/3, 4/27}

(2)

extrema(x^2+1/3-x^3+x, {x^3+y^2-x = 1/3}, {x, y})

{4/3, 4/27}

(3)

MTM[limit](extrema(x^2+y^2, {x^3+y^2-x = a}, {x, y}), 1/3)

{4/3, 4/27}

(4)

Download tryHarder.mws

How about changing the values of parameter ?

for a from -3 by 3/27 to 3 do
    try
        extrema(x^2 + y^2, {x^3 + y^2 - x = a}, {x, y}); 
    catch:
        print(a); 
    end;
od;
                               -1
                               --
                               3 

                               -2
                               --
                               9 

                               -1
                               --
                               9 

                               1
                               -
                               9

                               2
                               -
                               9

                               1
                               -
                               3

By the way, like extrema, Student[MultivariateCalculus]:-LagrangeMultipliers also executes the Lagrange Multiplier method, but strangely, 

Student[MultivariateCalculus][LagrangeMultipliers](y^2 + x^2, [x^3 + y^2 - x - 1/3], [x, y], output = plot):

does not cause any errors.

Suppose I have a matrix representing a magma such as

matrix(n,n, (i,j)->E[i].E[j])

First, if E is a set of integers then . is converged to * for some reason.

Second, is there any way to simplify the presentation of this matrix? I am using subs to simply but I have to essentially hand code every entry which sort of defeats the purpose. Is there any way to present a matrix and then have the resultant simplified as far as possible?

E.g., subs does not allow one to do something like ?.E[3] = E[2] where ? represents any value. E.g., if I have an identity it would be nice to simplify all elements quickly with one expression rather than having one for all possibilities(essentially 2n).

Also, magma's only let positive integers which seems kinda restrictive(why not create map internally to handle it?).

Also, is there any way to use special chars like -? I'm using d but I'd prefer using special chars so it is visually more congruent to what I'm doing. I realize - is also a minus but maybe there is someway around it(unicode?)?

Hello everybody! Happy new year!

Allright, well, the question states the following: "What is the maximum product of the fromula x*y*z which has the sum of 6 if you add x, y, and z together".

Now, i am seeing what they are doing, but somewhere down the line in the explaination they say "(after some calculations)". 

Isnt there a faster way to do it? And what did they do in the example to get to the result?

Thank you very much!

Greetings,

The Function    

solve(x+y+z = 6, z)

6-x-y

(1)

x*y*(6-x-y)

x*y*(6-x-y)

(2)

expand(x*y*(6-x-y))

-x^2*y-x*y^2+6*x*y

(3)

diff(-x^2*y-x*y^2+6*x*y, x)

-2*x*y-y^2+6*y

(4)

convert(-2*x*y-y^2+6*y, 'horner', y)

(-2*x+6-y)*y

(5)

solve(-2*x*y-y^2+6*y = 0, y)

0, -2*x+6

(6)

y := 0; solve(-2*y+6 = x, x)

0

 

6

(7)

restart

diff(-x^2*y-x*y^2+6*x*y, y)

-x^2-2*x*y+6*x

(8)

convert(-x^2-2*x*y+6*x, 'horner', x)

(-2*y+6-x)*x

(9)

solve(-x^2-2*x*y+6*x, x)

0, -2*y+6

(10)

x := 0; solve(-2*x+6 = y, y)

0

 

6

(11)

``

Download Mapleprimes_Question_Book_2_Paragraph_5.11_Example_35.mw

I have just installed the Google Maps package but when I run the commands I only get empty results and some errors

Any thoughts of what can be wrong. Have latest Montery OSX 

/Anders

I have a system of first order ODEs to solve using ODEplot. Now, need to plot one of the dependent variables by varying the initial condition. How do I go about this?

Dear Forum,

I get data from a mass-spectrometer and want to do some analysis on it . 

What I get looks like this : ( only a few lines, the files are very large )

t[s]; scanId; m/z; I[A]; pTot[mbar]
2.00;0;0; 0.000000e+000; 0.000000e+000
4.00;0;0; 0.000000e+000; 0.000000e+000
441.00;0;0; 0.000000e+000;1,29E+00
443.00;0;0; 0.000000e+000;1,29E+00
453.00;0;0; 0.000000e+000;1,26E+00
455.00;0;0; 0.000000e+000;1,24E+00
463.00;1; 0.390625;8,14E-05;1,23E+00
464.00;1; 0.40625;1,23E-04;1,43E+00
464.00;1; 0.421875;1,73E-04;1,43E+00
464.00;1; 0.4375;2,27E-04;1,43E+00
464.00;1; 0.453125;2,77E-04;1,43E+00

When I add some blanks, it looks like this :  

t[s];        scanId;   m/z;              I[A];               pTot[mbar]

464.00;  1;           0.421875;     1,73E-04;     1,43E+00

The columns are separated by semicolon

t[s]  and m/z are separated with a dot,  I[A]  and p come as exponentials with a comma.

When I try to import this  with

 BKK := Import("H:\\Maple\\Spielwiese\\BGSample.csv")

I get a DataFrame with two columns -correct-  because there are two commas. 

Is there a way to import such data without preprocessing into maple ?

I include the data file, had to change the suffix to .txt - the original is .csv

Thank you and kind regards, 

Klaus

BKK := Import("H:\\Maple\\Spielwiese\\BGSample.csv")

module DataFrame () description "two-dimensional rich data container"; local columns, rows, data, binder; option object(BaseDataObject); end module

(1)

BKK[10, 1] = 27.NULL

NULL

Download howdoiimportthis.mw

I often want to export an expression from Maple to LaTeX. Often, the output will contain commands that my LaTeX compiler doesn't recongnize. This hinders my LaTeX document production efficiency greatly. I use MiKTeX and Texmaker to generate documents in LaTeX language. Naively I assumed that Maple sticks to core LaTeX packages when generating an output. I still don't know if that is the case. The main issue is that, I don't know which LaTeX packages some of the Maple outputs use, and so, I don't know which packages to load in my LaTeX document.

As a concrete example, I show how I convert an expression to LaTeX language and how that particular output contains commands: \iup and \idn which are not recongnized by my LaTeX compiler since I don't know which package these commands come from. I google search for commands \iup and \idn came up empty. How do I figure out what package these commands come from

Latex_export_problems_1.mw

Hello,

I have been trying to figure this out for a long time and can't find anyone else having the same problem.

I use the built-in unit system for assigned values (short-cut is Ctrl+Shift+u) a lot when doing electronics calculations and electromagnetism, so I often use resistances and therefore need to use Ohm. This is very often an option in the "Choose Unit" drop-down menu on the right, but when too many units are brought into the same calculation the option dissappear. Usually I the go to the "Enter Unit" menu as to write the unit out myself I cannot figure out a way for it to accept greek letters. Does anyone know what to do?

I am a little not clear why Maple's odeadvisor gives [_2nd_order, _reducible, _mu_xy] as an ode type for a second order ode which is already exact as is.

When the ode is exact, then no integrating factor mu is needed (or rather mu=1). But Maple says the ode is "reducible" using an integrating factor mu(x,y)

restart;
ode:=x*diff(diff(y(x),x),x)+(y(x)-1)*diff(y(x),x)=0;
DEtools:-intfactor(ode);
DEtools:-odeadvisor(ode)

 

THis ode is Kamke's 6.78, it is alslo mentioned in this paper in table 1 at page 18

I am just little confused, about the terminology. I thought reducible means the ode reguire an integrating factor of the form mu(x,y) or my(x,y') or mu(y,y') when it is not exact in order to make it to an exact ode so it can be now solved.

Why would odeavisor then says an ode which is already exact is also reducible using mu(x,y)?

 How to rectify the Error, (in MTM:-findsym) invalid input: a string/name list is expected for sort method `lexorder`   .Could you please help me to plot the curve.

TC1.mw

Are Maple settings responsible for this error:

My worksheet carries out some preliminary checks and if these fail I want to prevent or cancel any further executuon of the worksheet.  Something like (pseodo-code)

llContinue = DoThePreliminaryChecks()
If Not llContinue
    Cancel/Return/?
EndIf

I couldn't find anything in the docs or with Google.  Any suggestions?  Thanks.

Mathematica's Dimensions returns a list of the allowed levels, which has been implemented in Maple as . But 

MmaTranslator:-Mma:-Dimensions(<<1 | 2>, <1 | 0>>);

returns [6], and 

MmaTranslator:-Mma:-Dimensions([[1, 2], [1, 0]]);

returns [2, 2, 4]. What happened here?

It should be [2, 2].

restart;

MmaTranslator:-Mma:-Dimensions(linalg[matrix]([[1, 2], [1, 0]]));

[0]

(1)

MmaTranslator:-Mma:-Dimensions(< 1 , 2 ; 1 , 0 >);

[6]

(2)

MmaTranslator:-Mma:-Dimensions(convert(`{{1, 2}, {1, 0}}`, FromMma));

[2, 2, 4]

(3)

MmaTranslator:-FromMma(`Dimensions[{{1, 2}, {1, 0}}]`, evaluate);

[2, 2]

(4)

NULL

Download Mma[Dimensions].mws

I have a vector (matrix) that looks like this. I want to save it to txt text. But the Export function doesn't seem to do that.

M:=Vector[column](10, [{{a, b}, {b, c}}, {{d, e}, {e, f}},
{{d, f}, {e, f}}, {{a, h}, {h, i}}, {{a, i}, {h, i}},
{{d, e}, {d, f}}, {{a, h}, {a, i}},{{c, d}}, {{a, b}, {a, c}}, {{a, c}, {b, c}}]);
Export(M,"E:\\M.txt");

Error, (in Export) invalid input: Export expects its 1st argument, input, to be of type string when target=file, but received Vector(10, [{{a, b}, {b, c}},{{d, e}, {e, f}},{{d, f}, {e, f}},{{a, h}, {h, i}},{{a, i}, {h, i}},{{d, e}, {d, f}},{{a, h}, {a, i}},{{c, d}},{{a, b}, {a, c}},{{a, c}, {b, c}}])
 

I found that I can save it in xsl format.

with(ExcelTools): Export(M, "E:\\M.xls");

How to save M in txt format below?

Hi Everyone,

I intend to find the invariants of a 2nd-order Tensor using the representation of the rotational group as an Infinitesimal generator. However, maple does not seem to find the correct invariants $\tr \mathbf{a}$, $\tr \mathbf{a}^2$, $\tr \mathbf{a}^3$. Maple only returns an empty set. I can't seem to figure out why that is the case.

Here is my code

NULL

restart

with(PDETools)

assume(r >= 0)

interface(showassumed = 0)

X_z2 := (-a__21-a__12)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__11))+(a__11-a__22)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__12))-a__23*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__13))+(a__11-a__22)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__21))+(a__12+a__21)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__22))+a__13*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__23))-a__32*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__31))+a__31*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__32)) = 0

(-a__21-a__12)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__11))+(a__11-a__22)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__12))-a__23*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__13))+(a__11-a__22)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__21))+(a__12+a__21)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__22))+a__13*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__23))-a__32*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__31))+a__31*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__32)) = 0

(1)

X_y2 := (-a__31-a__13)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__11))-a__32*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__12))+(a__11-a__33)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__13))-a__23*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__21))+a__21*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__23))+(a__11-a__33)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__31))+a__12*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__32))+(a__13+a__31)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__33)) = 0

(-a__31-a__13)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__11))-a__32*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__12))+(a__11-a__33)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__13))-a__23*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__21))+a__21*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__23))+(a__11-a__33)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__31))+a__12*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__32))+(a__13+a__31)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__33)) = 0

(2)

X_x2 := -a__13*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__12))+a__12*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__13))-a__31*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__21))+(-a__32-a__23)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__22))+(a__22-a__33)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__23))+a__21*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__31))+(a__22-a__33)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__32))+(a__23+a__32)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__33)) = 0

-a__13*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__12))+a__12*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__13))-a__31*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__21))+(-a__32-a__23)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__22))+(a__22-a__33)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__23))+a__21*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__31))+(a__22-a__33)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__32))+(a__23+a__32)*(diff(f_1(x, y, z, a__11, a__12, a__13, a__21, a__22, a__23, a__31, a__32, a__33), a__33)) = 0

(3)

sys := [X_z2, X_y2, X_x2]

sol := pdsolve(sys)

(4)

NULL

Download SO(3)_spherical_2.mw

Any input would be appreciated!

First 123 124 125 126 127 128 129 Last Page 125 of 2097