Maple 2016 Questions and Posts

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

I have a dataset:

NMP:=<0.530,0.555,0.572,0.592>:
ETOH:=<0.136,0.153,0.163,0.170>:

For these four data points [NMP,ETOH] I want to find the least square function in form of:

ln(ETOH/(1-ETOH-NMP))=a*ln(NMP/(1-ETOH-NMP))+b

also I need to find appropriate a,b constant values.

This function is implicite so I cannot use with(Statistics):NonlinearFit.

Can you help me how to determine a,b constants?

Hello people in Mapleprimes,

 

I have an expression which I want to modify with another equation.

They are simple, and looks easy to simplify.

nb:=(k-sigma+1)*lambda*L*(gamma*upsilon-delta__1122^k*tau)*upsilon*tau*v/(f__F*sigma*(-tau^2+upsilon^2)*k);

hh := (L*lambda*(k-sigma+1)*upsilon*tau*v)/(f__F*sigma*(-tau^2+upsilon^2)*k)=rho;

 

I want to express nb with hh as

(gamma*upsilon-delta__1122^k*tau)*rho;

With the next code, that modification can be done.

isolate(hh,f__F);subs(%,nb);simplify(%);

But, this isolates hh for f__F, which does not look intuitive.

On the other hand, the outcome of the substitution looks so simple, which you find with executing  the codes of

nb, and hh.

But, algsubs, and subs, and simplify/siderel won't work properly.

 

What I want to ask is this. Isn't there any nice way to substitute hh into nb other than isolating f__F, so that the result is expressed with rho?

 

I will be very glad if you will give me answers.

 

Best wishes.

taro

 

 

 

 

  In attached file I need to plot (R/R0 )^3  versus t for diffrent of (s) for example  s=0.01,0.005,0.003   plot.mwplot.mw

Hello people in mapleprimes,

I think that I found a bug.

Using the screen opened with command + f, I tried to find a v__1211 in the file I appended here.

But, when the cursor is trapped on an output part, which is a blue part, maple wouldn't continue to find the next

v__1211 anymore even if I clicked the Find Next on the screen.

If I move the cursol one line below with a hand, the Find Next butttons works again, but it is intricate.

Isn't there any good way to avoid this trouble other than not using double _, that is __.?

I hope you will give me some hint.

taro

v_1211.mw

P.S. I clicked the above link and opened that file with maple. Then, the notification telling that this is read-only file and

you cannot save this file after some modification, appeared. I don't know whether there is any problem. 

Does appending a maple file on a post on this mapleprimes always done in such a way? 

Hello everyone!

I want to plot few curves. I need plot legends with slected curves only. When I try to do so, I get an error saying the number of legends are less that the curves( not exact words obviously).

I am using this sample code please help me to achieve the goal.

plot([cos(x)^2, 1-(1/2)*x, x^2], x = -Pi .. Pi, legend = [typeset("Curve: ", cos(x)^2), typeset("Curve: ", 1-(1/2)*x)])

The maple file is attached here

legend.mw

 

 

 

So I'm doing homework when I get maple to plot a graph. I realize now that the graph is actually incorrect by comparing it to a graph in another program(try it yourself).  I honestly have no clue why the plotting isn't correct which is why I need your guys help.

Here is the function that I have to plot:

I am having hard time understading how a style sheet works with Maple. I am trying to use the "document mode" and would like to change the font used for math.

The first question I have is: How does one determine which style sheet is being used for the current open document?

Second: I have followed instructions on how to make a custom style sheet, as shown here: https://www.maplesoft.com/support/faqs/detail.aspx?sid=87675 and saved the style sheet on some location on my PC.

But it seems to have no effect at all. Since when I load it again using Format->Manage style sheet->User defined style set, then using the Browse... and select the file my_style.mw which I created using above instructions, I notice that fonts remain the same. I also close Maple and start again, and select my_style.mw again, but when I start typing in document mode, the font is still italic, even though in the XML I see it says  talic="false" (when I open the file in text editor):

<Font name="2D Math" background="[255,255,255]" bold="false" executable="true" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="false"/>

I even tried editing the style sheet I think Maple is using, by hand (it is an XML, and modified the font to be not italic) and reloaded it, and no effect. I even added invalid entries in there, and invalid font names, just to see the effect, and nothing happens, no error or anything. It is as if Maple does not even read the style sheet I just saved.

All what I want to do it to make the math 2D input, be _not_ italic font. I spend one hr on this, and nothing seems to make any difference, Maple insist on using italic for math input when in document mode.

Why is it that the style sheet says talic="false" for 2D math, but when I start to type, it types as italic?

 

As you can see, when I type, it switch to italic, even though the style sheet I just set, it clearly saying italic=false. There is not one single italic=true in the whole XML file. Why is Maple insisting on using italic?

 

I am using Maple 2016 on windows. 

hi....how i can extract Coefficients  (i.e. {f1[2],f2[2],f2[3],f3[2],.....f3[6]}) from every algebric equations and create matrix A ,in form AX=0, (X are f1[2],f2[2],f2[3],f3[2],.....f3[6] ) then the determinant of the matrix of coefficients (A) set to zero for obtaining unknown parameter omega.?

Note that  if m=3 then 6 equations is appeare and if m=4 then 9 equations is appeare.thus i need a procedure that works for every arbitary value of ''m''.

in attached file below m=4 thus we have 9 equations, i.e. 3 for eq1[k_] and 3 for eq2[k_] and so on...

also we should use boundary conditions for some amount of fi[j] (i=1,2,3 and j=2,3,...,7)

be extacting above Coefficients for example from first equation ,

''**:= (1/128)*f1[2]*omega^2-(1/4)*f2[2]-(1/2)*f2[3]+(1/4)*f2[4]+(1/4)*f3[2]-(1/2)*f3[3]+(1/4)*f3[4]+140*f1[2]-80*f1[3]+20*f1[4]'''

must compute

coeff(**, f1[2]); coeff(**, f2[2]) and so on...

 

 

 

 

 

fdm-maple.mw

 

 ############################Define some parameters

 

 
restart; Digits := 15; A1 := 10; A2 := 10; A3 := 10; A4 := 1; A5 := 1; A6 := 1; A7 := 1; A8 := 1; A9 := 1; A10 := 1; A11 := 1; B1 := 10; B2 := 10; B3 := 10; B4 := 1; B5 := 1; B6 := 1; B7 := 1; B8 := 1; B9 := 1; B10 := 1; B11 := 1; C1 := 10; C2 := 10; C3 := 10; C4 := 1; C5 := 1; C6 := 1; C7 := 1; C8 := 1; C9 := 1; C10 := 1; C11 := 1; C12 := 1; C13 := 1; C14 := 1; C15 := 1; C16 := 1; A12 := 1; B12 := 1; C18 := 1; C17 := 1; C19 := 1; n := 1; U := proc (x, theta) options operator, arrow; f1(x)*cos(n*theta) end proc; V := proc (x, theta) options operator, arrow; f2(x)*sin(n*theta) end proc; W := proc (x, theta) options operator, arrow; f3(x)*cos(n*theta) end proc; n := 1; m := 4; len := 1; h := len/m; nn := m+1
 ############################Define some equation

eq1[k_] := -2*f1[k]*(-A11*n^4+A10*n^2+A12*omega^2)*h^4+(A6*(f2[k-1]-f2[k+1])*n^3+A9*(f3[k-1]-f3[k+1])*n^2-A5*(f2[k-1]-f2[k+1])*n-A8*(f3[k-1]-f3[k+1]))*h^3+(4*(f1[k]-(1/2)*f1[k-1]-(1/2)*f1[k+1]))*(A3*n^2-A2)*h^2+(-A4*(f2[k-2]-2*f2[k-1]+2*f2[k+1]-f2[k+2])*n-A7*(f3[k-2]-2*f3[k-1]+2*f3[k+1]-f3[k+2]))*h+12*A1*(f1[k]+(1/6)*f1[k-2]-(2/3)*f1[k-1]-(2/3)*f1[k+1]+(1/6)*f1[k+2]):
  ``

 

 

 

 

                                     ######################################  APPLY BOUNDARY CONDITIONS

f1[nn+1] := f1[m]:
 

for k from 2 to m do eq1[k_]; eq2[k_]; eq3[k_] end do

-(1/64)*f2[4]+(1/128)*f2[3]+(1/64)*(f3[4]-(1/2)*f3[3])*(omega^2-1)-(1/64)*f1[2]+(1/32)*f1[3]+(1/64)*f1[4]-280*f3[4]-120*f3[2]+300*f3[3]+20*f3[7]

(1)

``



Download fdm-maple.mw

 

Hello people in Mapleprimes,

I want to factor

g^((2*(-sigma+k+1))/(-1+sigma))-tau^2

as

(g^((-sigma+k+1)/(-1+sigma)) -tau)*(g^((-sigma+k+1)/(-1+sigma))+tau);

 

I know that the following code works:

subs(g^((2*(-sigma+k+1))/(-1+sigma))=(g^((-sigma+k+1)/(-1+sigma)))^2,g^((2*(-sigma+k+1))/(-1+sigma))-tau^2);

factor(%);

 

Isn't there another better way than this?

I will be very glad if you teach me about this.

Thanks in advance.

taro

Hi,

In the following example I introduce some commutation rules that are standard in Quantum Mechanics. A major feature of the Maple Physics Package, is that it is possible to define tensors as Quantum Operators. This is of great interest because powerful tensor simplification rules can then be used in Quantum Mechanics. For an example, see the commutation rules of the components of the angular momentum operator in ?Physics,Examples. Here, I focus on a possible issue: when destroying all quantum operators, the pre-defined commutation rules still apply, which should not be the case. As shown in the post, this is link to the fact that these operators are also tensors.
 

NULL

 

Physics:-Version()[2]

`2016, August 16, 18:56 hours`

(1)

NULL

NULL

restart; with(Physics); interface(imaginaryunit = I)

First, set a 3D Euclidian space

Setup(mathematicalnotation = true, dimension = 3, signature = `+`, spacetimeindices = lowercaselatin, quiet)

[dimension = 3, mathematicalnotation = true, signature = `+ + +`, spacetimeindices = lowercaselatin]

(2)

Define two rank 1 tensors

Define(x[k], p[k])

`Defined objects with tensor properties`

 

{Physics:-Dgamma[a], Physics:-Psigma[a], Physics:-d_[a], Physics:-g_[a, b], p[k], x[k], Physics:-KroneckerDelta[a, b], Physics:-LeviCivita[a, b, c]}

(3)

Now, further define these tensors as quantum operators and gives the usual commutation rule between position and momentum operators (Quantum Mechanics).

Setup(hermitianoperators = {p, x}, algebrarules = {%Commutator(p[k], p[n]) = 0, %Commutator(x[k], p[l]) = I*`&hbar;`*KroneckerDelta[k, l], %Commutator(x[k], x[l]) = 0}, realobjects = {`&hbar;`})

[algebrarules = {%Commutator(p[k], p[n]) = 0, %Commutator(x[k], p[l]) = I*`&hbar;`*Physics:-KroneckerDelta[k, l], %Commutator(x[k], x[l]) = 0}, hermitianoperators = {p, x}, realobjects = {`&hbar;`}]

(4)

As expected:

(%Commutator = Commutator)(p[a], x[b])

%Commutator(p[a], x[b]) = -I*`&hbar;`*Physics:-KroneckerDelta[a, b]

(5)

Now, reset all the Hermitian operators, so that all quantum operators are destroyed. This is useful if, for instance, one needs to compare some the result with the commutative case.

Setup(redo, hermitianoperators = {})

[hermitianoperators = none]

(6)

As expected, there are no quantum operators anymore...

Setup(quantumoperators)

[quantumoperators = {}]

(7)

...so that the following expressions should commute (result should be true)

Library:-Commute(p[a], x[b])

false

(8)

Result should be 0NULL

Commutator(p[a], x[b])

-I*`&hbar;`*Physics:-KroneckerDelta[a, b]

(9)

p[a], x[b]

p[a], x[b]

(10)

NULL

NULL

``

NULLNULL

Below is just a copy & paste of the above section. The only difference, is that "Define(x[k], p[k])" has been commented, so that x[k]and p[k] are not a tensor. In that case, everything behaves as expected (but of course, the interesting feature of tensors is not available).

````

NULL

restart; with(Physics); interface(imaginaryunit = I)

First, set a 3D Euclidian space

Physics:-Setup(mathematicalnotation = true, dimension = 3, signature = `+`, spacetimeindices = lowercaselatin, quiet)

[dimension = 3, mathematicalnotation = true, signature = `+ + +`, spacetimeindices = lowercaselatin]

(11)

#Define two rank 1 tensors

Now, further define these tensors as quantum operators and gives the usual commutation rule between position and momentum operators (Quantum Mechanics)

Physics:-Setup(hermitianoperators = {p, x}, algebrarules = {%Commutator(p[k], p[n]) = 0, %Commutator(x[k], p[l]) = Physics:-`*`(Physics:-`*`(I, `&hbar;`), Physics:-KroneckerDelta[k, l]), %Commutator(x[k], x[l]) = 0}, realobjects = {`&hbar;`})

[algebrarules = {%Commutator(p[k], p[n]) = 0, %Commutator(x[k], p[l]) = I*`&hbar;`*Physics:-KroneckerDelta[k, l], %Commutator(x[k], x[l]) = 0}, hermitianoperators = {p, x}, realobjects = {`&hbar;`}]

(12)

As expected:

(%Commutator = Physics:-Commutator)(p[a], x[b])

%Commutator(p[a], x[b]) = -I*`&hbar;`*Physics:-KroneckerDelta[a, b]

(13)

Now, reset all the Hermitian operators, so that all quantum operators are destroyed.

Physics:-Setup(redo, hermitianoperators = {})

[hermitianoperators = none]

(14)

As expected, there are no quantum operators anymore...

Physics:-Setup(quantumoperators)

[quantumoperators = {}]

(15)

...so that the following expressions should commute (result should be true)

Physics:-Library:-Commute(p[a], x[b])

true

(16)

Result should be 0``

Physics:-Commutator(p[a], x[b])

0

(17)

p[a], x[b]

p[a], x[b]

(18)

NULL

``

NULL``

NULL


Download Quantum_operator_as_Tensors_August_23_2016.mw

hi .may every one help me for pdsolve this differential equations?

all initial boundary condition are zero

thanks...

pdeSol_(1).mw

 

#
# Define some parameters
#
  sigma := 10; N := 0; beta := 1; alpha := 1; PDE1 := diff(w(X, theta, t), X, X, X, X)+2*alpha^2*(diff(w(X, theta, t), theta, theta, X, X))+alpha^4*(diff(w(X, theta, t), theta, theta, theta, theta))-N*(diff(w(X, theta, t), X, X))+diff(w(X, theta, t), t, t)-beta*w(X, theta, t)-sigma = 0

10

 

0

 

1

 

1

 

diff(diff(diff(diff(w(X, theta, t), X), X), X), X)+2*(diff(diff(diff(diff(w(X, theta, t), X), X), theta), theta))+diff(diff(diff(diff(w(X, theta, t), theta), theta), theta), theta)-10+diff(diff(w(X, theta, t), t), t)-w(X, theta, t) = 0

(1)

#
# Define the PDES
#
  PDEs:= { diff(w(X, theta, t), X, X, X, X)+2*alpha^2*(diff(w(X, theta, t), theta, theta, X, X))+alpha^4*(diff(w(X, theta, t), theta, theta, theta, theta))-N*(diff(w(X, theta, t), X, X))+diff(w(X, theta, t), t, t)-beta*w(X, theta, t)-sigma = 0
   };

{diff(diff(diff(diff(w(X, theta, t), X), X), X), X)+2*(diff(diff(diff(diff(w(X, theta, t), X), X), theta), theta))+diff(diff(diff(diff(w(X, theta, t), theta), theta), theta), theta)-10+diff(diff(w(X, theta, t), t), t)-w(X, theta, t) = 0}

(2)

#
# Set of boundary conditions at x=1.
#
   bcs1:= { D[1](w)(1,theta, t) = 0,
              w(1,theta, t) = 0
         };

{w(1, theta, t) = 0, (D[1](w))(1, theta, t) = 0}

(3)

#
# Set of boundary conditions at x=0
#
  bcs2:= {    w(0,theta, t)=0,
           D[1](w)(0,theta, t)=0
         };

{w(0, theta, t) = 0, (D[1](w))(0, theta, t) = 0}

(4)

#
# Set of boundary conditions at t=0
#
  bcs3:= { w(x,theta,0)=0,
          
           D[2](w)(x,theta,0)=0 };
           

{w(x, theta, 0) = 0, (D[2](w))(x, theta, 0) = 0}

(5)

 


  pdsolve( PDEs, `union`(bcs1, bcs2, bcs3), numeric);

Error, (in pdsolve/numeric/process_PDEs) can only numerically solve PDE with two independent variables, got {X, t, theta}

 

 

 

Download pdeSol_(1).mw

Hello everybody, I'm an engineer student and I'm having quite some troubles with Maple. See my teacher told us to program a homework using Maple, problem is I've never used Maple in my life and it's not that hard, but I'm having some trouble with my homework.

 

My homework is about a 4-bar mechanism (grashof's condition) which will define the type of movement my mechanism will have depending on the data I input:

we define 4 variables expressed lenght measurments:

L= (largest link in the mechanism) 
S= (smallest link in the mechanism)

P and Q= other 2 links in the 4 bar mechanism

also 

L0: the link of the mechanism which is FIXED (frame)

L1: the link of the mechanism which is moves (driver)

L2: coupler link

L3: follower link

4 bar mechanism

here 1 will be the fram, 2 the driver, 3 the coupler and 4 the follower

grashofs condition consist on the following:

1. IF L + S < P + Q

and S is the frame, then the program should print that the mechanism presents a rotatory-rotatory movement

or L+S < P+Q and the FRAME is the opposite link of the shortest link, then the program should print that the mechanism presents oscilatory-oscilatory movement

or L+S<P+Q and S is the driver and the frame is adyacent to the driver, then the program should print that the mechanism presents two rotatory movement.

2. IF   L + S > P + Q

the program should print that the mechanism doesn't follow grashof condition and the movement is roker-rocker (doesnt matter what link is the driver and what link is the frame)

3. IF L+S=P+Q

the program should print that the mechanism doesn't follow grashof condition and the mechanism will have deadpoints.

I'm sorry, im a mechanical engineer student and I have very few experience programming (I only learned python like 2 years ago) and I'm having trouble with maple's language (which i know is very simple)

If someone could help me or guide me I would really appreciate it

Thanks alot 

PD. excuse my english

 

In a Maple Primes reply by Joel Riel on Sept. 14, 2011 he included the following command referring to warnings issued from a dsolve, numeric command having events containing a halt action:

_Env_in_maplet := true:  # incantation to suppress integrator warnings

Where can if find explanatory help for his command and any others of a similar nature?

I am trying to solve an equation using surd and I get a strange result.

solve(surd(x^4,8)=-2)
    4, -4, 4 I, -4 I

These solutions are clearly wrong.

The equation (x^4)^(1/8) = -2 has no solution.

This problem is equivalent to asking the computer to solve sqrt(x) = -2

which has no solution in R or C.

 

However if I type

solve((x^4)^(1/8) = -2) , then I get no answer, which is what I expected.

Why does surd behave in this unexpected way.

 

Also another thing I am wondering, why doesn't Maple simplify (x^4)^(1/8) to x^(1/2).

I tried the simplify command it didn't work.

 

First 48 49 50 51 52 53 54 Last Page 50 of 60