MaplePrimes Questions

Problem 5.

Definition. The q-binomial coefficient ---denoted by qbinomial(n,k,q) --is defined by the formula
      qbinomial(n,k,q)    =       
"Product(q^i - 1, i = n - k + 1 .. n)/Product(q^i - 1, i = 1 .. 

   k)"

qbinomial(n,k,q) is a polynomial of degree k*(n-k) in the variable q. These polynomials are also called Gaussian polynomials or Gaussian  coefficients. They occur in various places in mathematics. For example qbinomial(n,k,q) is the number of k-dimensional subspaces of an n-dimensional vector space over a field with q elements.  An example:  qbinomial(6,3,q)  is the polynomial 

"q^9 + q^8 + 2*q^7 + 3*q^6 + 3*q^5 + 3*q^4 + 3*q^3 + 2*q^2 + q 

   + 1"

(a) Write a procedure to find qbinomial(n,k,q) and check to see that it agrees with the above for n=6  and k=3.  Note that to get nice output you will need to simplify, expand and sort the expression.

(b) Check whether or not the sequence of coefficients of the Gaussian polynomial qbinomial(n,k,q) is unimodal for  0 =< n < =10 and 0=< k < =n.  Do not print out all these in your final work. Just write a program to do the checking.  Have it print out the number of pairs (n,k) for which qbinomial(n,k,q) 's coefficients are not unimodal. This is a number from 0 to 66.

[Hint: You may use the following to convert the coefficients of a polynomial f in the variable q to a list:
>L:=[seq(coeff(f,q,i),i=0..degree(f,q))]; ]

Definition: A list or sequence of numbers 
                             "a[1]"


                             "a[2]"

, ..., 
                             "a[n]"

 is unimodal if there is an index i such that 
                         
                             "a[1]"

 <= 
                             "a[2]"

 <= . . . <= 
                             "a[i]"

 >= 
                           "a[i + 1]"

 >= 
                           "a[i + 2]"

 >= . . . >= 
                             "a[n]"


That is, the sequence is non-decreasing up to some point after which it is non-increasing. Note that i can be 1 or n.  A constant sequence is considered to be unimodal.

Examples of unimodal lists:

         [1, 1, 1, 1, 1],  
         [1,2,3,4,5,4,3,2,1], 
         [1, 2, 2, 3, 4, 5, 5, 5],   
         [5, 5, 4, 4, 3, 3, 1],   
         [1, 2, 2, 3, 3, 3, 4, 4, 2, 2, 1, 1, 1]

Examples of lists that are not unimodal:

          [1, 0, 1, 0], 
          [1, 1, 2, 2, 3, 4, 5, 2, 2, 6, 4, 2, 2, 1, 0]

(a) Write a procedure unimodal to check whether or not a list of numbers is unimodal. The input should be a list and the output should be true or false. 

One way to do this is to first write procedures called  increasing and decreasing which will check whether or not a sequence is non-decreasing (
                             "a[1]"

 <= 
                             "a[2]"

 <=...) or non-increasing (
                             "a[1]"

>= 
                             "a[2]"

>=...). Then for a list L use these procedures to check the two parts L[1..i] and L[i..n], n=nops(L) for each i. If you find an i such that the first list is "increasing" and the second is "decreasing" then you can return true. 

I have up to here.

I need help with this part.

For n from 10 to 15  check whether or not the sequence of binomial coefficients  

[binomial(n,0), binomial(n,1), binomial(n,2), . . ., binomial(n,n)]

is unimodal. 

Hello there, 

Would you allow me to ask this one question?

Is it possible to apply diffop2de() to three different functions in a single expression? For example, the attached worksheet shows an expression, 'eq_e5_9', where three time domain function derivatives are defined, D*Delta__delta(t), D*Delta__psi__d(t) and D*Delta__psi__q(t). However, once 'diffop2de(eq_e5_9, f(t))' is applied, none of them gets propely unrolled (e.g, D*Delta__delta(t)becomes d/dt*Delta__delta(t))

Besides, this is my third time attempting to post a question. The first one got disappeared with no sign, the second one came out with a site error message. 

In Kwon Park 

 

Download Q20220425.mw

Dear all

I have a nonlinear system of algebraic equations, I would like to solve it  without using fsolve and Newton's method. 
Maybe one can use, fixed point method or Broyden's method

Fixed_Broyden_method.mw

Can we solve the system of 4 equations, using the proposed methods

thank you 

Hi everyone, I have some questions about the printf func in maple.

As an image I attach below, I want to print this to the console so that I can presentation it for my teacher, because I'm using this palletes many times, only showing the result will make me and my teacher hard to check the right result. I trying using the sum palletes as a tring ("%s") and also the result as ("%f") too, but it wont work. Please help me with this, thanks a lot

Solve produces different output in the attachment depending on how it is used. Why is that and how can simplification to arctan(y/z) be avoided? Arctan(y/z) only gives correct angles for positive y and z.  I prefer arctan(y,z) output that I can subsequently simplify to the y and z ranges of interest (if possible). Imagine “wrong” simplification of complex algebraic output (e.g., from inverse kinematics).

Arctan.mw

I am using the method of alias(seq(c[k] = _C||k, k = 1..10)); for better latex of constants generated from solving an ode as recommended. See this for example. 

This works well 99.99% of the time. But now I noticed this in Maple 2022. Is this a display issue? When the constant is inside an inert Int it does not display the same as the other constant outside. Also the Latex is not the same. Even though lprint shows they are both correct.

This is the worksheet itself


 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2022.0, Windows 10, March 8 2022 Build ID 1599809`

alias(seq(c[k] = _C||k, k = 1..10));
ode:=x*diff(y(x),x$2)-cos(x)*diff(y(x),x)+sin(x)*y(x)=2;
sol:=dsolve(ode);
lprint(sol)

c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8], c[9], c[10]

x*(diff(diff(y(x), x), x))-cos(x)*(diff(y(x), x))+sin(x)*y(x) = 2

y(x) = (c[2]+Int((c[1]+2*x)/(exp(Ci(x))*x^2), x))*exp(Ci(x))*x

y(x) = (c[2]+Int((c[1]+2*x)/exp(Ci(x))/x^2,x))*exp(Ci(x))*x

latex(sol)

y \! \left(x \right) =
\left(c_{2}+\textcolor{gray}{\int}\frac{\mathit{c[1]} +2 x}{{\mathrm e}^{\mathrm{Ci}\left(x \right)} x^{2}}\textcolor{gray}{d}x \right) {\mathrm e}^{\mathrm{Ci}\left(x \right)} x

restart;

ode:=x*diff(y(x),x$2)-cos(x)*diff(y(x),x)+sin(x)*y(x)=2;
sol:=dsolve(ode);
lprint(sol)

x*(diff(diff(y(x), x), x))-cos(x)*(diff(y(x), x))+sin(x)*y(x) = 2

y(x) = (_C2+Int((_C1+2*x)/(exp(Ci(x))*x^2), x))*exp(Ci(x))*x

y(x) = (_C2+Int((_C1+2*x)/exp(Ci(x))/x^2,x))*exp(Ci(x))*x

 


 

Download april_25_2022.mw

 

 

Hi,

I'm experimenting with some plot functions in Maple and cannot make the animate function to work, even for the help example (attached). It works fine when I insert it here but not in my worksheet.

with(plots)

NULL

plots[animate](plot, [A*sin(x), x = 0 .. 10], A = 0 .. 2)

 

NULL

Download animate_prob.mw

Any ideas?

Hi,

I like to know if it is possible to use a for loops in MapleFlow. I've tried a couple of times but it didn't work. For example,

n:=6
a:=Matrix(n,n)

for l from 1 to n do

   for c from 1 to n do

     a[l,c]:=2^(l+c)

   end do

end do

a=

 

doesn't produce any result for a

Best regards,

Hello;

Hope you are fine. Can i apply numerical scheme on maple for the following problem. This in integro-differential equation i think. Waiting for kind response.

Thanks

 


could you please help me ,the maple code for this given series.

restart

U[0](x) := x;

x

(1)

"U[k+1](x):=solve((k+1)*U[k+1](x)+(x*(-1)^((k-1)/(2)))/(k!)-x^(2)*((e)^(x))/(10){6/(k!)-sum((2^(k[1]))/(k[1!])(5*delta[k[]-k[1]](x)+(2^(k-k[1])*(-1)^((k-k[1])/(2)))/((k-k[1])!)+(2^(k-k[1]+1)*(-1)^((k-k[1]-1)/(2)))/((k-k[1])!)),k[1]=0..k)}-(cos^(2)(x)+sin^()(x))*((&PartialD;)^2)/((&PartialD;)^( )x^2) [U[k](x)]-(e)^(x)[sum(1/(k[1]!){1/(k-k[1])(sum(sum(1/(k[3]!)*U[k[2]-k[3]](x)*U[k-k[1]-k[2]-1](x)},k[1]=0..k),k[2]=0..k-k[1]-1),k[3]=0..k[2])),U[k+1](x)];  od;"

Error, unable to match delimiters

"U[k+1](x):=solve((k+1)*U[k+1](x)+(x*(-1)^((k-1)/2))/(k!)-x^2*((e)^x)/10{6/(k!)-sum((2^(k[1]))/(k[1!])(5*delta[k-k[1]](x)+(2^(k-k[1])*(-1)^((k-k[1])/2))/((k-k[1])!)+(2^(k-k[1]+1)*(-1)^((k-k[1]-1)/2))/((k-k[1])!)),k[1]=0..k)}-(cos^2(x)+sin(x))*((&PartialD;)^2)/(&PartialD;x^2) [U[k](x)]-(e)^x[sum(1/(k[1]!){1/(k-k[1])(sum(sum(1/(k[3]!)*U[k[2]-k[3]](x)*U[k-k[1]-k[2]-1](x)},k[1]=0..k),k[2]=0..k-k[1]-1),k[3]=0..k[2])),U[k+1](x)];  od;"

 

``


 

Download Chapter_6-Example-6.5.4.mw

How to make the matrix construction by points animated?
I sketched this code - it doesn't work(((
 

a := Matrix([stoimostyM, izmeniya]);
plots[animate](plot, [a[n, m]], n = 1 .. 2970, m = 1 .. 2, numpoints = 50, frames = 100);
Error, bad index into Matrix

Hi! Do you know maybe how to solve equation with Laplace operator in Maple like BZ equation?

restart;
a := 0.75;
rho := u(t) + v(t) + w(t);
ode := diff(u(t), t) = 10*Delta(u(t)) + u*(-a*v - rho + 1);
ode1 := diff(v(t), t) = 10*Delta(v(t)) + v*(-a*w - rho + 1);
ode2 := diff(w(t), t) = 10*Delta(w(t)) + w*(-a*u - rho + 1);

 

Edit: Sorry I guess it should be function of three variables so u,v,w depends on (x,y,z) not strictle from time

I am wondering how to animate something like this from BZ equation:

Given a list L=[x,y,z], what is the best way to generate the following sequential expression?
L1=[[x],[y],[z],[x,x],[x,y],[[x,z],[y,y],[y,z],[z,z],[x,x,x],[x,x,y],[x,x,z],[x,y,y],[x,y,z],[y,y,y],[y,y,z],[y,z,z],[z,z,z]].

With Lin mind (a list of list of at most three variables), how can one generate a list of lists of any number of variable from L.

I am currently out of options, a response will be highly appreciated.

Thanks

 

I have Maple 2021 and Mapleflow 2021 installed. The Maple 2021 is working fine. However, MapleFlow gives the error as follows. ERROR: Flow does not evaluate to a module. My system OS is Windows 10 updates till April 2022

 

 

First 84 85 86 87 88 89 90 Last Page 86 of 2195
´╗┐