Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi, 

I try using the DeepLearning package.
I use the function Classify and, even in the simplest test case presented in the its help page (please look at it), I regularly get connection errors to the mpython server as soon as I execute classifier := Classify(...) or classifier(...) more than once.
Errors are one of these twos

Error, (in Train) unable to communicate with mpython server
or
Error (in Python:-EvalFunction) unable to communicate with mpython server

I work with Windows 7 Enterprise, on an 8 proc PC and 64 GB of memory. The worst situation happened when Maple didn't even return these errors and that I saw inflating the consumed memory in 2 minutes, forcing me to manually shut down my PC because the task manager wasn't no longer  operational.

Is it a known problem?
Could it be an installation problem?


Even if it's not the point here, I would like to say that trying to use the DeepLearning package is really challenging considering the poverty of the help pages.

Natural_frequency_No_Foundation_Mass.mw

Natural_frequency_No_Foundation_Mass.pdf

Hi guys,

I am trying to determine the first 5 eigen frequencies of a bending beam with rotational and translational spring supports. This is done by setting the determinant of the coefficient matrix equal to zero. I use RootFInder -> Analytic to find the first 5 roots between 0.001 and 0.1. After I substitute the roots back in to the equation they do not give me a zero value.

Can someone see where this goes wrong?

 

Hello Everyone,

please forgive these kind of "easy" question, but I spent the last hour trying to figure out how to give the correct boundary conditions to my dsolve-function...
What I what is to create a function that says diff(f(x),x$2)(w) = 0 where f is an arbitrary function and w is an arbitrary value. Basically, it shall create the second derivative and then evaluate it at a specific point w.
I have tried the diff-function, like this: diff(f(x),x$2)(w) = 0, but this is outputting a mess. And I cannot get the D-operator to function with a second derivative and quite frankly I do not quite understand yet how it works.

So my question would be: How many I make Maple create a second derivative and evaluate it at a specific point?

Thank you and best Regards,
Lennart

Hello

Since this is my first attempt to use plots[animate], please forgive if my question is silly.  

I want to use plots[animate] with RootLocusPlot to show the effect of variable.   Here is my attempt.

num:=10*(s+alpha);den:=s*(s^2+4*s+8);
plots[animate](RootLocusPlot,[NewSystem(subs(alpha=a,num/den))],a=1..10);

Of course, when issuing the commands, an error comes out:  

Error, (in plots/animate) symbolic value(s) in model: a
 

  • Although I could define sys using NewSystem with a symbolic value, alpha, I have no idea how to assign a value for alpha.  subs(alpha=2,..) does not seem to work.
  • If I remove the square brackets in the second argument of plots[animate], a different msg comes out.  Why do I need (or not) them? 

Many thanks.

 

Equations

 

ODES := (diff(f(eta), `$`(eta, 4)))/((1-phi1)^2.5*(1-phi2)^2.5*((1-phi2)*(1-phi1+phi1*rhos1/rhosf)+phi2*rhos2/rhosf))+S*(f(eta)*(diff(f(eta), `$`(eta, 3)))-3*(diff(f(eta), `$`(eta, 2)))-eta*(diff(f(eta), `$`(eta, 3)))-(diff(f(eta), eta))*(diff(f(eta), `$`(eta, 2)))) = 0,

(khnf/kf+(4/3)*R)*(diff(theta(eta), `$`(eta, 2)))/((1-phi2)*(1-phi1+phi1*rhos1*cp1/(rhosf*cpf))+phi2*rhos2*cp2/(rhosf*cpf))+S*Pr*(f(eta)*(diff(theta(eta), eta))-eta*(diff(theta(eta), eta))-gamma*(eta^2*(diff(theta(eta), `$`(eta, 2)))-2*eta*f(eta)*(diff(theta(eta), `$`(eta, 2)))-eta*(diff(f(eta), eta))*(diff(theta(eta), eta))+f(eta)*(diff(f(eta), eta))*(diff(theta(eta), eta))+f(eta)^2*(diff(theta(eta), `$`(eta, 2))))) = 0

Boundary Conditions

 f(0) = 0, ((D^2)(f))(0) = 0, (D(theta))(0) = 0, f(1) = 0, (D(f))(1) = 0, theta(1) = 1

 

phi1 = .1, phi2 = .1, rhos1 = 2720, rhos2 = 2810, rhosf = 997.1, khnf = 1.083061737, kf = .613, cp1 = 893, cp2 = 960, cpf = 4179, Pr = 6.2, knf = .8154646474., S=0.5,R=0.5, gamma=0.5

I am tried to solve it showing following error

Error, (in dsolve/numeric/bvp) matrix is singular

 

I have got a problem with 2D plot:

I plot a x vs y(x) but now i want to plot y(x) vs x.(x should be in vertical axis)

Be an ellipse E of center O, of foci F, F1, of major axis AA1 (OA=a, OF=c), M a point of E, m its projection on AA1, T and N the points where the tangent and the normal in M cut AA1 respectively. How to establish the formulas: NF=c/a*MF; Om*OT=a² ; ON=c²/a²*Om ? Thank you.

Hi all,

There is issue with modp1(('Embed')(...)) function.

Please look at the file:

bug_embed.mw

As you can see in lines 1, 3, 5 Embed function in combining with Constant cutting several digits from argument.

Thank you.

Hi, I bought the linuix 64 installation, and prior to doing so I read that I would have two installations, and so I have proceeded to replace my windows OS on my computer of highest processing power, after a successful install on my laptop, however when I attempted to activate my second installation it returned the message that I have already used all of my activations. If worse comes to worse, I need to uninstall maple2020 on this laptop, . and use my one activationon the other machine. What do I do?

Does Maple have any faciltiy to find any solution to two equations in  3 variables subject to constraint that each equation is not zero?

Here is an example. I like to find any values of t1,t2,t3 such that alpha and beta are not zero. Any choice of such t's will do. But not all can be zero ofcourse. All the t's are linear.

restart;
eq1:= alpha = -2*t1 - 4*t2 - 2*t3;
eq2:= beta = t1 + 2*t2 + t3;

By inspection we see that choice t2=0,t3=0,t1=1 works since

subs([t2=0,t3=0,t1=1],[eq1,eq2])

There are many other choices (infinite). I just need to find one combination of t_i in the integers.

I could write a loop and keep trying different values of t1,t2,t3 until I find such choise ofcourse. But I was wondering if there is better way to do this in Maple. Solve does not work on this ofcourse.

solve([eq1,eq2,eq3],[t1,t2,t3]) assuming alpha<>0,beta<>0

And setting up Ax=b does not work

restart;
A:=Matrix([[-2,-4,-2],[1,2,1]]);
b:=Vector([alpha,beta]);
LinearAlgebra:-LinearSolve(A,b)

Error, (in LinearAlgebra:-LinearSolve) inconsistent system
 

However, one thing I could do, is pick random alpha,beta values, and then solve for t_i, as in

restart;
A:=Matrix([[-2,-4,-2],[1,2,1]]);
b:=Vector([-2,1]);
LinearAlgebra:-LinearSolve(A,b)

And now I am able to find a solution I want. The problem with this method, is that if I pick wrong values of alpha,beta, I can also get no solution. For example, if I guessed alpha=1,beta=1 I get

restart;
A:=Matrix([[-2,-4,-2],[1,2,1]]);
b:=Vector([1,1]);
LinearAlgebra:-LinearSolve(A,b)

Error, (in LinearAlgebra:-LinearSolve) inconsistent system
 

So one option I could try, is pick random values of alpha,beta, and call LinearSolve until I get a choice which works?  i.e. one which does not give inconsistent system.

Thanks for any better suggestions.

Maple is not adding a function g(y) to the indefinite integral 
Maybe i do miss here something ?
 

int(2*x*y, x)

x^2*y

(1)

textbook  f(x, y) = int(f[x](x, y), x) and int(f[x](x, y), x) = int(2*x*y, x) and int(2*x*y, x) = x^2*y+g(y)f(x, y) = int(f[x](x, y), x)

f(x, y) = int(f[x](x, y), x)

(2)

int(2*x*y, x) = x^2*y+g(y)

x^2*y = x^2*y+g(y)

(3)

looks like the y is constant  in f(x,y)
Maple is not putting a constant with the integral int(f, x)  , the same for int(2*x*y, x)
Think then only the integrand 2x is integrated and y is a constant, but the notation of g(y) is not C  

 

Integral  x^2*y+g(y)and then  partieel differentation gives  2x.y  

Its about finding a potential function for a vectorfield F

 

 

NULL


 

Download integraal_bij_part_diff_van_vectorvels.mw

Why can't I do double negatives and why is it so difficult to do simple mathematics with negatives?

 

(a - b)

 

want to simply rewrite this by substitution for a simple quick calculation, repalce a and b with their values, e.g.,

 

-3 - -5

 

Maple complains!

4*-10

 

maple complains!

 

This makes it impossible to not have to rewrite simple expressions just to get maple to work.

 

Surely there is a untary negative sign that I can use that will please maple?

 

 

I am trying to reproduce this fractal graphic by Daniel Geisler, using maple 18:

http://tetration.org/Tetration/index.html

I suspect the images were produced by fractint - with a floating point hardware accelerator, but I am not sure. In any case, they were produced by a numerical program, not a symbolic one and probably with 16-18 digits of accuracy.

The Maple code I use makes for a valiant effort, but is nowhere close in accuracy to the two images above. Here's the Maple 18 code:

tetrationFractal18.mw

Several questions here:

1) Geisler's image colors according to period (right graph). Period 1 is red. 2 is yellow (although not all yellow regions are period 2) 3 is green, 4 is cyan, 5 is blue, etc.

I have some period checking code in my doc, which stores the last 20 iterates of the maxIter iterations of the orbit in orb[n]  then extracts a period p, based on some backwards comparisons.

I am only interested in graphing max period up to N=20, hence the orb[1..N] array, stores only the last N elements of the iterates. This is relatively fast, but extracting the period (below) from the orb array, puts an additional strain on the overall calculations, probably of the order of O((N+p)*n) for each n in the iteration, where p is the period returned. That's why I avoid storing in orb unless the global bound "bail" has not been exceeded.

The period finding algorithm works. It rerurns p correctly, and that's the value the graphic proc returns for plot3d. The problem is that the range of values is small (p\in[1..N]) and therefore the palette in plot3d is poor. I.e., it doesn't differentiate very much between colors of different period regions. How can I spread out the color pallete with plot3d with such results? ideally, I'd like to assign colors roughly from red to violet, with period 1 red, 2 orange, 3 green, 4 blue, 5 purple, etc.

I tried returning log(p) and this spreads the zhue some, but not enough (see attached document). Further, I'd like to assign black to points which escape the calculations, such as when the bail bound is exceeded in my iteration loop. By default, these show up as "purple", which is the same as the color for period 1 with the latest implementation. How can I except these escape points from the palette, i.e. what does the fractal proc have to return to color these black? Note that for these points, orb[n] defaults to 0, so the palette colors this close to p=1 region (these are the black "hairs"/threads of the Cantor Bouquets in Geisler's second image. That's the first question.

 

Second question is, why are there "white" regions interlaced under this scheme? is the calculation failing at these points because of low resolution? (epsilon~0.01 in this doc). (If points fail "bound"=1e10 then the orbit is orb[1..N]=0, so p=1 and zhue=1?) White seems to decrease as I increase epsilon and maxIter, but i can't test further, because the calculation limit is already prohibitive for this version of Maple. The graph with a plot3d grid [400,400] and maxIter=100 and epsilon=0.01, takes around 25 minutes. Testing anything finer than than, is time uneasonable.

Would increasing Digits help with any of the above?

Does anyone have any ideas on how to improve the code performance for this graph in maple 18, as per the above problems?.

Many thanks.

second has rsolve solution

compare original sequence

accsum(ListTools[Reverse]([seq(patterngroup[k], k=(mm)..(mm+lengthofsequence))])),

with rsolve solution , it start from third number wrong, some number are wrong but correct at next number, 

but i just want to guess next number is 1 or 2

[seq(subs(k=kk, sol), kk=0..(lengthofsequence+1))],

with(SumTools):
with(gfun):
accsum := proc(xx)
local result,mm:
result := []:
for mm from 1 to nops(xx) do
temp := Summation(xx[k], k = 1 .. mm):
result := [op(result), temp]:
od:
return result:
end proc:


patterngroup := [2, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1]: # left is latest, 2,1,1..
lengthofsequence := 5:
for mm from 1 to 12 do
if guessgf(accsum(Reverse([seq(patterngroup[k], k=(mm)..(mm+lengthofsequence))])), x) = FAIL then
print(patterngroup[mm]):
else
sol := rsolve(listtorec(accsum(ListTools[Reverse]([seq(patterngroup[k], k=(mm)..(mm+lengthofsequence))])), u(n))[1], u(k)):
acxxc := accsum(ListTools[Reverse]([seq(patterngroup[k], k=(mm)..(mm+lengthofsequence))])):
olist := [seq(patterngroup[k], k=(mm)..(mm+5))]:
#start from 0
print(patterngroup[mm], olist, accsum(ListTools[Reverse]([seq(patterngroup[k], k=(mm)..(mm+lengthofsequence))])), [seq(subs(k=kk, sol), kk=0..(lengthofsequence+1))], sol, subs(k=(lengthofsequence+1), sol), subs(k=(lengthofsequence+1), sol)-acxxc[nops(acxxc)]):
end if:
od:
 

Below is python code found in the internet kind help to convert to maple but only thing instead on the input to be string I want it to be a set of integers or array of integers

Kind help

# Python program to print all permutations with repetition

# of characters

  

def toString(List):

    return ''.join(List)

  

# The main function that recursively prints all repeated

# permutations of the given string. It uses data[] to store

# all permutations one by one

def allLexicographicRecur (string, data, last, index):

    length = len(string)

  

    # One by one fix all characters at the given index and

    # recur for the subsequent indexes

    for i in xrange(length):

  

        # Fix the ith character at index and if this is not

        # the last index then recursively call for higher

        # indexes

        data[index] = string[i]

  

        # If this is the last index then print the string

        # stored in data[]

        if index==last:

            print toString(data)

        else:

            allLexicographicRecur(string, data, last, index+1)

  

# This function sorts input string, allocate memory for data

# (needed for allLexicographicRecur()) and calls

# allLexicographicRecur() for printing all permutations

def allLexicographic(string):

    length = len(string)

  

    # Create a temp array that will be used by

    # allLexicographicRecur()

    data = [""] * (length+1)

  

    # Sort the input string so that we get all output strings in

    # lexicographically sorted order

    string = sorted(string)

  

    # Now print all permutaions

    allLexicographicRecur(string, data, length-1, 0)

  

# Driver program to test the above functions

string = "ABC"

print "All permutations with repetition of " + string + " are:"

allLexicographic(string)

First 372 373 374 375 376 377 378 Last Page 374 of 2097