Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I am attempting to write a series representation of a general integral of a function from a to b as follows:

int(f(x), x = a..b)= h*sum((c_k)*f(a+kh))+O(h^p),k=1..N;

where h:=(b-a)/(N+1), p(N) is greater than or equal to N + 1 and c_k are coefficients.  I then need to write procedures with Maple to evalue c_k from 1,..,N and also to evaluate P(N) for any N.  If I take the case for N = 3 and N = 6 I have to use those procedures to prove that:

int(f(x), x = a..b)=(4h/3)*(2*f_1 - f_2 +2*f_3) + O(h^5) = (7*h/1440)*(611*(f_1 + f_6) - 453*(f_2 + f_5) + 562*(f_3 + f_4)) + O(h^7) 

where f_k = f(a + kh).  I am really at a loss as to how to write this procedure, although I may have used something similar before:

P:=proc(p) add((1/k^(1/10))*(sin(1/k)-1/k), k=1..10^p) end proc;
seq( evalhf(P(p)), p = 1 .. 5 );
 

 



I am using MAPLE for quantum computation.
It appears to me that the Physics[Expand] and Physics[Symplify] functions do not operate as I expected on
Kets with multiple quantum numbers. The functions no not consider the non commutative nature of tensor
products of Kets. (neither of bras incidently). It would be very useful if thos could be adjusted in some way.

Thank you for your help

LL

restart;

with(Physics):

Setup(mathematicalnotation=true,
      noncommutativecolor=black,
      quantumoperators=q,
      noncommutativeprefix={q,psi,beta});

[mathematicalnotation = true, noncommutativecolor = black, noncommutativeprefix = {beta, psi, q}, quantumoperators = {q}]

(1)

Ket(psi):=Ket(q,-1)*Ket(q,1)*Ket(q,-1);
Ket(psi):=Ket(q,-1,1,-1);
'q[1].Ket(psi)'=q[1].Ket(psi);
'q[2].Ket(psi)'=q[2].Ket(psi);
'q[3].Ket(psi)'=q[3].Ket(psi);

Physics:-`*`(Physics:-Ket(q, -1), Physics:-Ket(q, 1), Physics:-Ket(q, -1))

 

Physics:-Ket(q, -1, 1, -1)

 

Physics:-`.`(q[1], Physics:-Ket(psi)) = -Physics:-Ket(q, -1, 1, -1)

 

Physics:-`.`(q[2], Physics:-Ket(psi)) = Physics:-Ket(q, -1, 1, -1)

 

Physics:-`.`(q[3], Physics:-Ket(psi)) = -Physics:-Ket(q, -1, 1, -1)

(2)

Ket(beta,-1,-1):=(1/2)*(sqrt(2)*(Ket(q,-1)*Ket(q,-1)));
Ket(beta,-1,-1):=(1/2)*(sqrt(2)*(Ket(q,-1,-1)));

(1/2)*2^(1/2)*Physics:-`*`(Physics:-Ket(q, -1), Physics:-Ket(q, -1))

 

(1/2)*2^(1/2)*Physics:-Ket(q, -1, -1)

(3)

Ket(Prod):='Ket(psi)'*'Ket(beta,-1,-1)';

Physics:-`*`(Physics:-Ket(psi), Physics:-Ket(beta, -1, -1))

(4)

Ket(Prod):=Ket(psi)*Ket(beta,-1,-1);
'Expand(Ket(Prod))'=Expand(Ket(Prod));
'Expand(Ket(Prod))'<>'(Ket(Prod))';

'Simplify(Ket(Prod))'=Simplify(Ket(Prod));
'Simplify(Ket(Prod))'<>'(Ket(Prod))'

(1/2)*2^(1/2)*Physics:-`*`(Physics:-Ket(q, -1, 1, -1), Physics:-Ket(q, -1, -1))

 

Physics:-Expand(Physics:-Ket(Prod)) = (1/2)*2^(1/2)*Physics:-`*`(Physics:-Ket(q, -1, -1), Physics:-Ket(q, -1, 1, -1))

 

Physics:-Expand(Physics:-Ket(Prod)) <> Physics:-Ket(Prod)

 

Physics:-Simplify(Physics:-Ket(Prod)) = (1/2)*2^(1/2)*Physics:-`*`(Physics:-Ket(q, -1, -1), Physics:-Ket(q, -1, 1, -1))

 

Physics:-Simplify(Physics:-Ket(Prod)) <> Physics:-Ket(Prod)

(5)

q[1]*q[2]-q[2]*q[1]<>0;
q[1]*q[3]-q[3]*q[1]<>0;
q[2]*q[3]-q[3]*q[2]<>0;

Physics:-`*`(q[1], q[2])-Physics:-`*`(q[2], q[1]) <> 0

 

Physics:-`*`(q[1], q[3])-Physics:-`*`(q[3], q[1]) <> 0

 

Physics:-`*`(q[2], q[3])-Physics:-`*`(q[3], q[2]) <> 0

(6)

 


 

Download Expand_Simplify-of-Kets.mw


 

 

 

Dear Friends
Is there a way to solve a complicated integration in less possible time?

Thanks

_________________________________________________________________________________
 

restart;
Digits := 100:
tm := time():
with(LinearAlgebra):

m := 6:
a := 0.1:
b := 10*a:
E := 1:
h := 1:
nu := 0.3:

w := (r-b)^2*(r-a)^2*add(add(W[n, i]*r^n*t^(i-n), n = 0 .. i), i = 0 .. m):
ur := -z*(diff(w, r)):
ut := -z*(diff(w, t))/r:
er := diff(ur, r)+(1/2)*(diff(w, r))^2:
et := ur/r+(diff(ut, t))/r+(diff(w, t))^2/(2*r^2):
grt := diff(ut, r)-ut/r+(diff(ur, t))/r+(diff(diff(w, t), r))/r:
u := -(1/2)*E*(2*er*et*nu+er^2+et^2)/(nu^2-1)+(1/2)*E*grt^2/(2*(1+nu)):

PI := int(int(int(u*r, z = -(1/2)*h .. (1/2)*h), t = 0 .. 2*Pi), r = a .. b)-0.5*P*(int(int(r*(diff(w, r))^2, r = a .. b), t = 0 .. 2*Pi)):

Time = time()-tm;

Does anyone know how to calculate basic reproduction number using maple coding? Or by any chance, anyone know how to solve it by hand with this complicated equations?
 

restart

interface(imaginaryunit = j)

I

(1)

lambda := k*tau*(C*Upsilon+I)/N

k*tau*(C*Upsilon+I)/N

(2)

eqn1 := (1-p)*Pi+phi*V+delta*R-(mu+lambda+`&vartheta;`)*S

(1-p)*Pi+phi*V+delta*R-(mu+k*tau*(C*Upsilon+I)/N+vartheta)*S

(3)

eqn2 := p*Pi+`&vartheta;`*S-(lambda*`&epsilon;`+mu+phi)*V

p*Pi+vartheta*S-(epsilon*k*tau*(C*Upsilon+I)/N+mu+phi)*V

(4)

eqn3 := rho*lambda*S+rho*`&epsilon;`*lambda*V+I*(1-q)*eta-(mu+beta+chi)*C

rho*k*tau*(C*Upsilon+I)*S/N+rho*epsilon*k*tau*(C*Upsilon+I)*V/N+(1-q)*eta*I-(mu+beta+chi)*C

(5)

eqn4 := (1-rho)*lambda*S+(1-rho)*`&epsilon;`*lambda*V+chi*C-I*(mu+alpha+eta)

(1-rho)*k*tau*(C*Upsilon+I)*S/N+(1-rho)*epsilon*k*tau*(C*Upsilon+I)*V/N+chi*C-(mu+alpha+eta)*I

(6)

eqn5 := beta*C+I*q*eta-(mu+delta)*R

beta*C+q*eta*I-(mu+delta)*R

(7)

``


 

Download Equation_for_basic_reproduction_number.mwEquation_for_basic_reproduction_number.mw

I am using the Physics package for quantum mechanic.

Ket product are supposed to be noncommutative and the Simplify function
appears to ignore the propety.

I must be doing someting wrong.

Thank you for your help

LL

 

Please, where are the statistical tolerance intervals in Maple, similar to those we have in MiniTab and in R ?  maybe in statistical quality control ?

Example 1 :  Package « tolerance » in R (https://cran.r-project.org/web/packages/tolerance/tolerance.pdf) : 

 

« Description :  Statistical tolerance limits provide the limits between which we can expect to find a specified proportion of a sampled population with a given level of confidence. This package provides functions for estimating tolerance limits (intervals) for various univariate distributions (binomial, Cauchy, discrete Pareto, exponential, two-parameter exponential, extreme value, hypergeometric, Laplace, logistic, negative binomial, negative hypergeometric, normal, Pareto, Poisson-Lindley, Poisson, uniform, and Zipf-Mandelbrot), Bayesian normal tolerance limits, multivariate normal tolerance regions, nonparametric tolerance intervals, tolerance bands for regression settings (linear regression, nonlinear regression, nonparametric regression, and multivariate regression), and analysis of variance tolerance intervals. Visualizations are also available for most of these settings. »

 

Example 2 : 

https://support.minitab.com/en-us/minitab/18/help-and-how-to/quality-and-process-improvement/quality-tools/how-to/tolerance-intervals-normal-distribution/methods-and-formulas/methods-and-formulas/

https://support.minitab.com/fr-fr/minitab/18/help-and-how-to/quality-and-process-improvement/quality-tools/how-to/tolerance-intervals-nonnormal-distribution/methods-and-formulas/tolerance-intervals/   

Hi, i want to investigate  chaos for the problem , cantilever beam under random narro band excitation, but the code has errors .the code is this:

      restart:with(plots):      h:=1: Omega:=(0..376):alpha1:=617.2:alpha2:=1.02*10^(8): c:=.002:k:=18.4:  step:=0.1:imax:=376:  for i from 0 to imax do;  Omega[i]:=i*step:   f:=evalf(solve({((-a*Omega[i]^(2)+alpha1*a+3/(4)*alpha2*a^(3)+1/(4)*k*Omega[i]^(2)*a^(3)-(3)/(4)*k*Omega[i]^(2)*a^(3))^(2)+(c*Omega[i]*a^())^(2))=h^(2),a>0}));  ff[i]:=((rhs(f[1]))^(2))/(2):  end do:   l1:=[[Omega[n],ff[n]] $n=0..imax]:  p1:=plot(l1, x=0..3,y=0..1,  style=point,symbol=solidcircle,symbolsize=4,color=red):    jmax:=914: f1:=array(377..914):f2:=array(377..914):f3:=array(377..914):Omega1:=array(377..914):  for j from 377to jmax do;  Omega1[j]:=j*step:   fff:=evalf(solve({((-a*Omega1[j]^(2)+alpha1*a+3/(4)*alpha2*a^(3)+1/(4)*k*Omega1[j]^(2)*a^(3)-(3)/(4)*k*Omega1[j]^(2)*a^(3))^(2)+(c*Omega1[j]*a^())^(2))=h^(2),a>0}));  f1[j]:=((rhs(fff[1,1]))^(2))/(2):f2[j]:=((rhs(fff[2,1]))^(2))/(2):f3[j]:=((rhs(fff[3,1]))^(2))/(2):  end do:   ll1:=[[Omega1[n],f1[n]] $n=377..jmax]:  pp1:=plot(ll1, x=0..10,y=0..1,  style=point,symbol=solidcircle,symbolsize=4,color=red):    ll2:=[[Omega1[n],f2[n]] $n=377..jmax]:  pp2:=plot(ll2, x=0..10,y=0..1,  style=point,symbol=solidcircle,symbolsize=4,color=red):    ll3:=[[Omega1[n],f3[n]] $n=377..jmax]:  pp3:=plot(ll3, x=0..15,y=0..1,  style=point,symbol=solidcircle,symbolsize=4,color=red):       plot({  seq(seq(p1), seq(seq(pp1),seq(seq(pp2),seq(seq(pp3))  },style=point,title=`Pitchfork Diagram`);  Thanks for your help

Below is a link to my worksheet that evaluates 6 expressions that are presumably equivalent.  However, there seems to be a region for 7<n<100 where the results diverge.  All other values of n yield identical results.  I am at a TOTAL loss as to what is happening.  I hope that someone here might shed some light on this quirk.

divergent_behavior.mw

We conjecture that the polynomial h(n) = n^2 + n + 41 is prime for an infinite number of values n.
We furthur conjecture that p(n) = n^2 + 1 is prime an infinite number of times.

I have shown that the set (x,y) with h(y) mod x is congruent to 0 can be written down.  It is p(x,y).  p(x,y) is the set of all divisors of h(n).  See

https://sites.google.com/site/primeproducingpolynomial/

landau.mw

Regards,

Matt

Am I applying improper syntax for the is command?  Out of the 5 attempts to equate X with the time derivative of S11 only the combine command yields the expected result.  If only combine works then why do the others not work?
 

Ck1 := sin(Pi*k)/(Pi*k); 1; Ck2 := (1-cos(Pi*k))/(Pi*k); 1; S11 := a[0]+int(sum(2*Ck2*Pi*k*cos(2*Pi*k*x/T)/T, k = 1 .. m), x = 0 .. t); -1; Q1 := 2*sin(alpha)*(diff(S11, t)); -1; Q3 := sum(2*Ck2*Pi*k*(sin(alpha+2*Pi*k*t/T)+sin(alpha-2*Pi*k*t/T))/T, k = 1 .. m); -1; is(Q1 = Q3)

true

(1)

sum1 := sum(2*Ck2*Pi*k*cos(2*Pi*k*x/T)/T, k = 1 .. m):

true

(2)

subs(x = t, simplify(expand(combine(2*sin(alpha)*sum1)))) = simplify(expand(combine(Q3)))"(->)"true

NULL

m := 2*n;

-4*sin(Pi*t/T)*sin(Pi*t*n/T)*cos(Pi*t*n/T)*(2*cos(Pi*t*n/T)^2-1)/(T*cos(Pi*t/T)*(-1+cos(Pi*t/T)^2))

(3)

is(`assuming`([X = diff(S11, t)], [n::integer])), is(`assuming`([expand(X = diff(S11, t))], [n::integer])), is(`assuming`([combine(X = diff(S11, t))], [n::integer])), is(`assuming`([eval(X = diff(S11, t))], [n::integer])), is(`assuming`([value(X = diff(S11, t))], [n::integer])), simplify(`assuming`([combine(X-(diff(S11, t)))], [n::integer]))

false, false, true, false, false, 0

(4)

X

-4*sin(Pi*t/T)*sin(Pi*t*n/T)*cos(Pi*t*n/T)*(2*cos(Pi*t*n/T)^2-1)/(T*cos(Pi*t/T)*(-1+cos(Pi*t/T)^2))

(5)

`assuming`([combine(X-(diff(S11, t)))], [n::integer])

0

(6)

`assuming`([X-combine(diff(S11, t))], [n::integer])

-4*sin(Pi*t/T)*sin(Pi*t*n/T)*cos(Pi*t*n/T)*(2*cos(Pi*t*n/T)^2-1)/(T*cos(Pi*t/T)*(-1+cos(Pi*t/T)^2))-(2*cos((-Pi*t+4*Pi*t*n)/T)-2*cos((Pi*t+4*Pi*t*n)/T))/(T*cos(Pi*t/T)-T*cos(3*Pi*t/T))

(7)

"(=)"

0

(8)

``


 

Download syntax_for_is.mw

 

Hello Guys,

Can maple derive Einstein field equations from Einstein-Hilbert action ?

 

Thx

The attached worksheet performs two functions:

(1) It lets me print 4 × 6 Index Cards for the short entries in each table.

(2) It allows for easy storage and retrieval of syntax (code).

The worksheet has many tables, each separated by a Page Break.

Questions:

(a) Is there a way to sort all the different tables so they will be arranged in alphebetical order?

(b) When I select one table to print and open the Print Dialog, the "Selection" option is grayed out. (see graphic below).  (1) Is there a way to enable the selection option?  (2) Is there a way to determine what page I am on so I can use the "Pages from...to" option?  If I need to number the pages, will the page numbers reset to parallel a new alphabetic sort order.

Many thanks in advance.  See WC29_4_BY_6_NOTE_CARDS_UNSORTED.mw attached. And see image of Print Dialog below.

Les

Hello,

How can i solve this integro-PDE(partial diffrential equation)??

regards...

eq := (1+6*(l/h)^2/(1+nu))*(diff(u(xi, tau), xi, xi, xi, xi)+int(-B*lambda*exp(-lambda(tau-s))*(diff(u(xi, s), xi, xi, xi, xi)), s = 0 .. tau))+diff(u(xi, tau), tau, tau) = alpha*(int((diff(u(xi, tau), xi))^2, xi = 0 .. 1)+int(-B*lambda*exp(-lambda(tau-s))*(int((diff(u(xi, tau), xi))^2, xi = 0 .. 1)), s = 0 .. tau))*(diff(u(xi, tau), xi, xi))+V^2*(sum(j*u(xi, tau)^(j-1), j = 1 .. 8))

jing-Fu.mw

The program below is a high school problem, related to the area a horse can graze, given it is tethered to a rectangular barn.  The level of difficulty is related to the length of rope.  

   I wanted to display some graphics of the field, barn and tethered horse - this latter being the most difficult.  I experimented with a .png picture of a plain silouhette of a horse, imported this into Photoshop, then saved it as a .pdf file, importing this into Maple,  I managed to import this into the worksheet, but I wanted a scaled down version of the horse in the program plots[display] section.  I was unsuccessful in this.  Undeterred, I decided to try and draw a version of a horse using the plots/plottools packages.  The resulting "horse" looks more like a cat, warthog,  mouse or chameleon! 

   I understand later versions of Maple are able to import graphic images.   I'd appreciate some feedback as to how easy this is, and the quality of the resulting images in Maple output.

Thanks,

    David  .  .    

 

restart:

# # # # # # # # # # # # # # # # # # # # # # # # # # # #

# Horse tethered to barn - what area of grass?

# # # # # # # # # # # # # # # # # # # # # # # # # # # #

with(plots):

with(plottools):

macro(palegreen=COLOR(RGB, .5607, .9372, .5607)):

col1:=`black`:

print(`A horse is tethered to the corner of a barn, 10 m wide and 20 m long.  Find the area`);

print(`the horse can graze, if the length of rope is:`);

print(` i.)   5 m   ii.)  25 m  amd iii.)  50 m`);

#Length of rope

L:=10:

#Dims of barn

len:=20:wid:=10:

#Position of bottom left corner of barn

x_barn:=50:y_barn:=50:

len:=20:wid:=10:

 

#dimensions of field

flen:=120:fwid:=110:

 

rect_barn:=rectangle([x_barn,wid+y_barn], [len+x_barn,y_barn], color=brown):

rect_field:=rectangle([0,fwid], [flen,0], color=palegreen):

 

#Position of horse

x0:=37:y0:=32:

a := 4: b := 2.5:

belli := ellipse([x0,y0], a, b, filled=true, color=col1):

legf:=line([x0-1,y0-2], [x0-2,y0-6], color=col1, linestyle=1, thickness=1):

legf2:=line([x0-2,y0-2], [x0-3,y0-6], color=col1, linestyle=1, thickness=2):

rleg:=line([x0+1,y0-2], [x0+2,y0-6], color=col1, linestyle=1, thickness=2):

 

rleg2:=line([x0+2,y0-2], [x0+3,y0-6], color=col1, linestyle=1, thickness=2):

head := polygon([[x0-6,y0+3],[x0-5,y0+4], [x0-2,y0+5], [x0-3,y0+2]], color=brown, linestyle=3, thickness=2):

tail:=line([x0+6,y0-4], [x0+4,y0+1], color=col1, linestyle=1,thickness=2):

 

a := arc([x0+13,y0+3], 15, Pi/2..Pi+.1, color=blue):

plots[display](a,tail,head,belli,legf,legf2,rleg,rleg2,rect_barn,rect_field, scaling=constrained, axes=none);

In the link below I attempt to solve 2 trig series which are essentially equivalent as indicated by the numerical output of eq (5).  The series  represented by S13 & S14 has arguments of the trig functions that realizes that only the odd terms for k yield non-zero results.  The case represented S11 & S12 by makes no such presumption; nonetheless, all cases agree within reason numerically.  Now to find min/max values taking the derivative is needed which is simply done by removing the integral as indicated by Q1 through Q6.

Now resolving the roots works OK for Q6 because beta = 2*pi *t/T conveniently collapsed the numerator into factorable expressions.  Resolving the roots for Q3 did not work so well because what I think is that the expression in red has multiple roots so it only spits out t as the solution?  I expressed the angle alpha in terms of beta & probably need to resolve kappa to somehow get the expression in red to collapse into a factored expression, but I am not sure how to execute this.  When I solve for kappa I get ZERO.

Does anyone have suggestions?  Remember I demonstrated that both series are practically idendical numerically; hence, there derivatives should be as well as long as both series are well behaved functions.  So the solutions must be the same as well.

trig_series_solns.mw

First 106 107 108 109 110 111 112 Last Page 108 of 2097