Maple 2019 Questions and Posts

These are Posts and Questions associated with the product, Maple 2019

first I define some constants (note I may change the constants later based on the context of the application)

p_l := 10^(-15);     
epsilon := 1.09*10^(-10);
p_B := 1.09*10^(-8);

n_A := 10^7;         
k_A := 0;
n_B := 10^8; 
k_B := 0;

then I define a function l(x,y):

l := (x, y) -> x^k_A*(1 - x)^(n_A - k_A)*y^k_B*(1 - y)^(n_B - k_B)

Now I use both with(GlobalOptimization) and with(Optimization) to maximize l(x,y) give some constraints and I get:

GlobalSolve(l(x_1, y_1), x_1 = p_l .. epsilon, y_1 = p_B .. 1, maximize, initialpoint = [x_1 = 0, y_1 = 0]);
  [-0., [x_1 = 1.09000000000000 10^(-10)   , y_1 = 0.633548870211381]]


Maximize(l(x_1, y_1), x_1 = p_l .. epsilon, y_1 = p_B .. 1, initialpoint = [x_1 = 0, y_1 = 0]);
 [0.33621648834727435318,  [x_1 = 1.00000000000000 10^(-15)   , y_1 = 1.0900000000000000000 10^(-8)  ] ]

 

Clearly the second answer is right and the first is wrong... I am not sure why the ``global optimazation'' is doing worse than the normal and free ``optimazation''.. Am I using the GlobalSolve in a wrong way??

Hello people in mapleprimes,
I have a question.

I use maple2019 with mac os 10.14.6.

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14.6
BuildVersion:	18G95

With maple2019, errors appears.

> kernelopts(version);
        Maple 2019.1, APPLE UNIVERSAL OSX, Jun 6 2019, Build ID 1403154

> assume(a>-1,b>0);
> additionally(a<=1);
> about(a);
Originally a, renamed a~:
  is assumed to be: FAIL

> assume(tau<1,tau>0,s<1,s>0):
> a_e1:=tau*s*(1+tau)<tau*s+tau+s-1:
> b_e2:=expand(lhs(a_e1)-rhs(a_e1))<0:
>  b_e3:=collect(b_e2,s,factor):
> solve(b_e2,s) assuming tau<1;
Error, (in assuming) when calling 'property/ConvertProperty'. Received: 'FAIL
is an invalid property'

On the other hand, with maple2018, they do not.

> kernelopts(version);
       Maple 2018.2, APPLE UNIVERSAL OSX, Nov 16 2018, Build ID 1362973

> assume(a>-1,b>0);
> additionally(a<=1);
> about(a);
Originally a, renamed a~:
  is assumed to be: RealRange(Open(-1),1)

> assume(tau<1,tau>0,s<1,s>0):
> a_e1:=tau*s*(1+tau)<tau*s+tau+s-1:
> b_e2:=expand(lhs(a_e1)-rhs(a_e1))<0:
> b_e3:=collect(b_e2,s,factor):
> solve(b_e2,s) assuming tau<1;
                                    1
                               [{-------- < s~}]
                                 1 + tau~

Are errors due to some bugs in maple2019 when being used with mac os 10.14.6?

Take care.

taro

Is there or will there be a german version or is there a language pack available somewhere?

r=a+b sin(x), this is the function I want to plot the graph in polar co-ordinates but how to manage those arbitrary constants "a and b" ?

Hi everyone, I need someone’s expertise with the Maple Soft Application, I am currently into my 4th day of my Maple Soft experience and also returning to School after many years. Can someone help me with the following codes to solve step by step Differential Equation 1 below;

Please help me with following codes below

  1. Boundary Condition 1
  2. Boundary Condition 2
  3. General Solution
  4. The integration Part of the Equation
  5. Solving the Differential Equation  

Equation 1.

Determine the equilibrium temperature for a one dimensional rod with a constant thermal properties with the following source and boundary conditions.

  1. Q = 0, U(0) = 10, u(L) = 20
  2. Q/K0 = x, u(0) = 0, u(L) = 10

 

I understand how to obtain the solution to the equation above,

(a) Equilibrium satisfies

                                                U’’(x) = 0,

Whose general solution is u = c1 + c2x.

The boundary condition u(0) = 0 implies c1 = 0 and u(L) = T implies c2 = T/L so that u = T x/L.

(f) In equilibrium, u satisfies

U’’(x) = −Q/K0 = −x^2,

Whose general solution (by integrating twice) is

u = −x ^4 /12 + c1 + c2x.

The boundary condition u(0) = T yields c1 = T, while u’(L) = 0 yields c2 = L^3/3.

Thus u = −x ^4 /12 + L^3x/3 + T.

I am trying to get jacobian computed for lorenz equations, not showing matrix, using Maple 2019 newest version. any guidance?

 

 

 

 

Hi everybody!

 

Quick question for you guys. I have access to Maple 2019 on my main computer and Maple 2018 on a remote Desktop (but I don't want to use because it's super slow and bad (normal rdp stuff)). The problem I have is for the same document, same line, same instruction, Maple 2019 on my computer is failling to do it correctly (unable to do the matrix correctly) and in the Remote Maple 2018 it's doing it just fine. I really don't understand. If someone can give me a little help it would be highly apreciated!

 

Maple 2018 (what it's supposed to do):

 

Maple 2019 (what it is not suppose to do):

restart;

with(DifferentialGeometry);
with(Tensor);

DGsetup([x, t], M1);

g := evalDG((dt &t dt) - t^2*(dx &t dx))
Geodesics()

 

I created a two dimensional cross-section of a spacetime described by this metric above. 

I would like to plot the geodesics in polar coordinates using the time t as the radius (normalized to our current time equal to unity).

That is, I would like to plot the geodesics starting at x=0, t=1 (x=0 maps to the top of the polar plot). X is the polar angle.

This plot is likely to map to this figure. Never mind the details of wiggles, or titles, etc.  I am new to maple and could use an initial push.

Glyph2.maple

The above link is a maple workbook containing the package Glyph2 together with the install script and two worksheets illustrating the difficulty I am having with the code in the procedure assignaltbasis (near the end of the code in Glyph2.mpl).

The problematic code is shown standalone is basisdemo worksheet, but reproduced below for reference. Interestingly, even though the table should be evaluated in a seq command, outside the module it works without eval. Inside the module evaluation does not make any difference.

indxs := [1, 2, 3, 4];
altbasis := [seq(seq(e[i[]], i = combinat:-choose(indxs, 2*k)), k = 1 .. 2)];
gen := table([seq(op(gen[i]) = bivec[i], i = 1 .. nops(gen))]);
exprs := [seq(exteriorp(seq(gen[op(2*i - 1 .. 2*i, b)], i = 1 .. nops(b)/2)), b = altbasis)];

The worksheet Basischangedemo shows how the exported procedure “assignaltbasis” is used in the module and the error that results if a bivector basis is used. From experimentation I have found that the error results because “assignaltbasis” passes the table name to the procedure “exteriorp” instead of the bivectors that should have resulted from evaluation of the table. Including the eval command within the seq procedure does not make any difference to the result. I am unclear whether this is a problem with evaluation of the table or a problem that results from namespace conflict.

I have a further namespace problem with the local variables, AltRoot, AltToStd, and StdToAlt which store the results from assignaltbasis.  If I declare these variables as exports, I get an error message “attempt to assign to a protected variable”. Therefore I added an exported procedure “ShowAltBasis” to display the results.  As you can see, this procedure produces the fully-qualified names of each blade making the result difficult to read. I would prefer to get rid of the “Glyph2:-” qualification.

The waters are muddied even further because the other worksheet, “basisdemo”, contains the core code extracted from assignaltbasis showing that the code using the table actually works (outside the module). From this I conclude that a namespace conflict exists within the module, preventing the table from fully evaluating.

My understanding is that within the module local and exported names are more or less equivalent, so I am puzzled why local and exported names in assignaltbasis are so problematic.

I would appreciate any advice about these issues. Clearly my understanding of maple’s namespaces is incomplete.

We often use the vector notation "< >" as in <x, y, z>.  However, when I use it with a function, it does not evaluate the same way as a simple list "[ , ]". 
 

"restart;  g(r):=k*r;"

proc (r) options operator, arrow, function_assign; k*r end proc

(1)

g1 := g([x, y]); g2 := g(`<,>`(x, y))

g1 := k*[x, y]

 

Vector[column](%id = 18446745825756564886)

(2)

k := 1; g1; g2

k := 1

 

[x, y]

 

Vector[column](%id = 18446745825756564886)

(3)

 

The value of k is not applied in g2.  Can someone point me in the direction as to the difference between the two types of entities as interpreted by Maple?  

Download HowToDefineTensorRankZero.mw

Using the latest Physics package, I try define a tensor of rank zero, but an error accurs:

> Define(Theta = varepsilon[mu, ~mu](X));
Error, (in Physics:-Define) expected left-hand-side of tensor definition as a tensor with non-numerical indices, received: Theta

The same error occurs when I try:
> Define(Theta[] = varepsilon[mu, ~mu](X));
Error, (in Physics:-Define) expected left-hand-side of tensor definition as a tensor with non-numerical indices, received: Theta[]

So my question is: how can I define a tensor of rank zero? 
Hope someone can help me out. 

Regards, Wouter

Fyi, this solution to 1D wave pde is wrong. The solution does not even satisfy the PDE itself. Compared it to a numerical solution and they are not the same solution. Do not have time now to write the hand solution. But it is clear the solution is not valid.

I do not know now how to roll back to earlier version of the Physcis packages to see if this used to work OK before. Since when typing Physics:-Version(420) It gives error

Error, (in Physics:-Version) unable to determine the Physics Updates version, could you please report the problem to support@maplesoft.com

And Physics:-Version(425) seems to hang. I am not sure if these commands are supposed to automatically download the physics package from the cloud and install it on my PC or what.

Any way, could someone please verify the solution they get is the same as shown below? May be someone with earlier physics package could try to see if they get different solution?

restart

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 429 and is the same as the version installed in this computer, created 2019, September 23, 0:14 hours, found in the directory C:\Users\me\maple\toolbox\2019\Physics Updates\lib\`

pde:=diff(u(x,t),t$2)=4*diff(u(x,t),x$2);
ic:=u(x,0)=0,D[2](u)(x,0)=sin(x)^2;
bc:=u(-Pi,t)=0,u(Pi,t)=0;
sol:=pdsolve([pde,ic,bc],u(x,t))

diff(diff(u(x, t), t), t) = 4*(diff(diff(u(x, t), x), x))

u(x, 0) = 0, (D[2](u))(x, 0) = sin(x)^2

u(-Pi, t) = 0, u(Pi, t) = 0

u(x, t) = t*sin(x)^2

pdetest(sol,pde)

-8*t*(2*cos(x)^2-1)

simplify(diff(rhs(sol),t$2)-4*diff(rhs(sol),x$2))

-16*t*cos(x)^2+8*t

 


 

Download sept_23_2019.mw

I'm trying to debug a problem with define_external, and I would love some help!

I have a Maple module that contains this line of Maple code:

EigValsVecsC := define_external('EigValsVecsC', LIB = cat(dll_home,"\\operators.dll"), 'm'::ARRAY(datatype=float[8]), 'n'::integer[4], 'eig_vals'::ARRAY(datatype=float[8]), 'eig_vecs'::ARRAY(datatype=float[8]), 'THREAD_SAFE');

Running the Maple code to create the module produces this error message:

"Error, (in ModuleLoad) external linking: error loading external library C:\Users\zander\maple\toolbox\EigLib\misc\operators.dll: The specified procedure could not be found."

I've discovered that there's a single line of C++ code (in the C++ function EigValsVecsC) that I can comment out to make the problem go away.  Here's the line of C++ code:

MKL_INT info = LAPACKE_dsyev(LAPACK_ROW_MAJOR, 'V', 'U', eig_vecs.rows(), eig_vecs.raw(), eig_vecs.rows(), eig_vals.raw());

To clarify:

  • C++ compilation succeeds for operators.dll (which contains the function EigValsVecsC), with this one line either commented or uncommented.
  • The C++ function EigValsVecsC works correctly when not called from Maple (i.e., called from Visual Studio or the command line), with this one line either commented or uncommented.  (Of course, it doesn't work fully correctly with this one line commented, since this one line is the whole point of the function.  But it runs successfully and does the correct massaging of inputs.)
  • When this one line of C++ code is commented, the Maple module builds successfully, and I can call EigValsVecsC in Maple and get results back showing that, in the C++ code, the inputs to the commented line are being set up properly.

The relevant include statement in the C++ code is:

#include "mkl_lapacke.h"

I don't have to comment out the include statement (though the compiler may well be ignoring it if it's never used, when the call to LAPACKE_dsyev is commented out).

I have no good theories about what the problem may be.  I've been trolling the Web for any helpful information, and I've come up with nothing.

Can anyone help?  Thanks!

 

with(inttrans)

eq1 := 2*(diff(y__1(t), t)) = -2*y__1(t)-3*y__2(t)+2*u__1

eq2 := diff(y__2(t), t) = 4*y__1(t)-6*y__2(t)+2*u__1+4*u__2

help("laplace")

We have two coupled differential equations relating two outputs (y__1, y__2 ) with two inputs u__1, u__2

The objective of the exercise is to obtain the four transfer functions relating the outputs to the inputs, in other words, we must find:

To save time, we will from now on write Y__1 instead of Y__1(s) , etc.

In order to find tese relations, we must solve Y__1 and Y__2 as a function of U__1 and U__2

Since our model is defined in the time-domain, the first step is to perform Laplace Transform:

Note tha y__1(0) and y__2(0)are zero because y__1 and y__2 are deviation variables, as indicated in the problem description of this exercise.

Now we have a set of two equations with two unknowns, which can be solved algebraically
(this is the advantage of the Laplace Transform). For example, from equation (3) we can
isolate Y__2:

We can substitute the expression (5) in equation (4) to obtain Y__1, as follows:

We can multiply both sides by -3 and expand the products to get:

Now we must group the factors multiplying Y__1, U__1 and U__2

Note that this relation is analogous to:

Y__1 = G__11*U__1+G__12*U__2

Since the effects of `U__1 ` and U__2 are additive, if we want to obtain the relation between one output and only one input ( for example Y__1 and "`U__1`)" we can set the other input to zero, i.e. U__2 = 0.

We still have to obtan the relation between Y__2 and the inputs. We can use equation (5) and (6):

Finally we can find the relations:

 



 

Download Transfer_function.mw

 

Hello

I have this problem:

in which I have to find the four transfer functions relating the outputs(yand y2) to the inputs (u1,u2).

The u and y are deviation variables. 

The objective is to find the four transfer functions:

So I have done it by hand but I was wondering if there are any maple commands, that could be used to solve such a question?

 

I found the transfer functions to be:

First 33 34 35 36 37 38 39 Last Page 35 of 47