MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

I tried to find the root distritubion of a polynomial? 

When p=1, q=3, the following command works.


with(plots):

eq:=u^(2*q)+1-2*K*u^(q-p);

p:=1;   q:=3;

unitcircle:=implicitplot(x^2+y^2 = 1, x = -1 .. 1, y = -1 .. 1, scaling = constrained);

animate(complexplot,[[solve(eq, u)],style = point,symbolsize=10,color="red"],frames=50,K=-1..1,background=unitcircle, scaling=constrained, trace=20 );

However, when I tried p=2, q=3, only one root was shown on the animation.  

But   "complexplot([solve(eq,u)],style=point)"      showed  6 roots anyway.

I have no idea what was wrong. 

 

 


k:=0.99: with(RealDomain):

m:=1: Digits:=2:

x:=(Pi*csc(Pi*(k-m)))/(0.693*GAMMA(k)*GAMMA(m));

x := -1.4*Pi*csc(0.1e-1*Pi)

m1:=MeijerG([[-m],[1-m]],[[0,-m,-m],[k-m]],(-m*k)/snr);

m1 := MeijerG([[-1.], [0.]], [[0., -1., -1.], [-0.1e-1]], -.99/snr)

m2:=MeijerG([[-k],[1-k]],[[0,-k,-k],[m-k]],(-m*k)/snr);

m2 := MeijerG([[-.99], [0.1e-1]], [[0., -.99, -.99], [0.1e-1]], -.99/snr)

c:=x*((((m*k)/snr)^m)*m1-(((m*k)/snr)^k)*m2);

c := -1.4*Pi*csc(0.1e-1*Pi)*(.99*MeijerG([[-1.], [0.]], [[0., -1., -1.], [-0.1e-1]], -.99/snr)/snr-.99*(1/snr)^.99*MeijerG([[-.99], [0.1e-1]], [[0., -.99, -.99], [0.1e-1]], -.99/snr))

with(plots):

Warning, the name changecoords has been redefined

plot(c,snr=0..10);

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Error, empty plot

 

 


Download capacity_kfading.mw

k:=0.99: with(RealDomain):

m:=1: Digits:=2:

x:=(Pi*csc(Pi*(k-m)))/(0.693*GAMMA(k)*GAMMA(m));

x := -1.4*Pi*csc(0.1e-1*Pi)

m1:=MeijerG([[-m],[1-m]],[[0,-m,-m],[k-m]],(-m*k)/snr);

m1 := MeijerG([[-1.], [0.]], [[0., -1., -1.], [-0.1e-1]], -.99/snr)

m2:=MeijerG([[-k],[1-k]],[[0,-k,-k],[m-k]],(-m*k)/snr);

m2 := MeijerG([[-.99], [0.1e-1]], [[0., -.99, -.99], [0.1e-1]], -.99/snr)

c:=x*((((m*k)/snr)^m)*m1-(((m*k)/snr)^k)*m2);

c := -1.4*Pi*csc(0.1e-1*Pi)*(.99*MeijerG([[-1.], [0.]], [[0., -1., -1.], [-0.1e-1]], -.99/snr)/snr-.99*(1/snr)^.99*MeijerG([[-.99], [0.1e-1]], [[0., -.99, -.99], [0.1e-1]], -.99/snr))

with(plots):

Warning, the name changecoords has been redefined

plot(c,snr=0..10);

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Error, empty plot

 

 


Download capacity_kfading.mw

k:=0.99: with(RealDomain):

m:=1: Digits:=2:

x:=(Pi*csc(Pi*(k-m)))/(0.693*GAMMA(k)*GAMMA(m));

x := -1.4*Pi*csc(0.1e-1*Pi)

m1:=MeijerG([[-m],[1-m]],[[0,-m,-m],[k-m]],(-m*k)/snr);

m1 := MeijerG([[-1.], [0.]], [[0., -1., -1.], [-0.1e-1]], -.99/snr)

m2:=MeijerG([[-k],[1-k]],[[0,-k,-k],[m-k]],(-m*k)/snr);

m2 := MeijerG([[-.99], [0.1e-1]], [[0., -.99, -.99], [0.1e-1]], -.99/snr)

c:=x*((((m*k)/snr)^m)*m1-(((m*k)/snr)^k)*m2);

c := -1.4*Pi*csc(0.1e-1*Pi)*(.99*MeijerG([[-1.], [0.]], [[0., -1., -1.], [-0.1e-1]], -.99/snr)/snr-.99*(1/snr)^.99*MeijerG([[-.99], [0.1e-1]], [[0., -.99, -.99], [0.1e-1]], -.99/snr))

with(plots):

Warning, the name changecoords has been redefined

plot(c,snr=0..10);

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Error, empty plot

 

 


Download capacity_kfading.mw

k:=0.99: with(RealDomain):

m:=1: Digits:=2:

x:=(Pi*csc(Pi*(k-m)))/(0.693*GAMMA(k)*GAMMA(m));

x := -1.4*Pi*csc(0.1e-1*Pi)

m1:=MeijerG([[-m],[1-m]],[[0,-m,-m],[k-m]],(-m*k)/snr);

m1 := MeijerG([[-1.], [0.]], [[0., -1., -1.], [-0.1e-1]], -.99/snr)

m2:=MeijerG([[-k],[1-k]],[[0,-k,-k],[m-k]],(-m*k)/snr);

m2 := MeijerG([[-.99], [0.1e-1]], [[0., -.99, -.99], [0.1e-1]], -.99/snr)

c:=x*((((m*k)/snr)^m)*m1-(((m*k)/snr)^k)*m2);

c := -1.4*Pi*csc(0.1e-1*Pi)*(.99*MeijerG([[-1.], [0.]], [[0., -1., -1.], [-0.1e-1]], -.99/snr)/snr-.99*(1/snr)^.99*MeijerG([[-.99], [0.1e-1]], [[0., -.99, -.99], [0.1e-1]], -.99/snr))

with(plots):

Warning, the name changecoords has been redefined

plot(c,snr=0..10);

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Error, empty plot

 

 


Download capacity_kfading.mw

require help to overcome this warning. Thanks.

How do I solve Smith Chart...

September 01 2014 jared 5

How do I mark a value on circles

I want to plot Smith Chart and calculate the value Correspond to circles.

Any one can give me some suggestions or better idea to plot Smith Chart.

There are my code:Doc1.doc

 

 

Hi Maple friends.

x(x+y)^4 = y(3*x-y)^2

When I differentiate implicitly by hand, I get:

-5*x^4-4*x^3*y+3*y^2/x^4-6*x*y+3*y^2 (my lecturer also got this solution)

Maple gives the result as: 

(-2*x(x+y)^3*(D(x))(x+y)+3*y(3*x-y)*(D(y))(3*x-y))/(2*x(x+y)^3*(D(x))(x+y)+y(3*x-y)*(D(y))(3*x-y))

Maybe I am doing something wrong in Maple? From the context menu, I choose implicit differentiation, and then select y as the dependent variable. How can I get Maple to give the same solution?

Thanks in advance.

I have some lengthy formulas in the maple. I don't want to waste time on rewritting them in a word document.
Is there a way to import those equations in a clean and tidy form to a word document or the mathtype program or something else! :)

I wanted to answer a question and show an animation contained in an animated gif file. The file is small gif file and is on my local drive on my PC.

I am not able to find a way to include it here as I can easily do on stackexchange so it plays on the screen when someone sees the post.

Does this forum support such a feature? I tried the image->include, and in the URL I typed  C:\foo.gif, but nothing showed up on the post. So it did not work that way.

I've been instructed to create an animation showing the changing plots of a single square waveform using 5,10,20,40,80,160,320, and 640 terms in my Fourier series. This is my code right now: 

 

with (plots):
L := [seq(2^i, i = 0 .. 6)];


[1, 2, 4, 8, 16, 32, 64]


animate( plot, [2/((2*n-1)*Pi))*sin((2*n-1)*Pi*x], n=L);
Error, `)` unexpected

 

It doesn't work. Can anyone explain what I'm doing wrong, or how to solve my question?

dualaxisplot(listplot(sols[2], color = red), listplot(sols[1], color = blue), style = line, gridlines = false);

How can I define general matrices in Maple and do symbolic manipulation - for example specifying a matirx M to be of dimension n x m where n and m are integers ?

The permanent of a square matrix is defined similarly to the determinant, as a sum of products of sets of matrix entries that lie in distinct rows and columns. However, where the determinant weights each of these products with a ±1 sign based on the parity of the set, the permanent weights them all with a + 1 sign.While the determinant can be computed in polynomial time by Gaussian elimination, the permanent cannot. Valiant has showed that computing permanents is #P-hard, and even #P-complete for matrices in which all entries are 0 or 1 [L.G. Valiant, The Complexity of Computing the Permanent, Theoretical Computer Science 8 (1979) 189–201]. The development of both exact and approximate algorithms for computing the permanent of a matrix is an active area of research. (see Wikipedia: computing the permanent, more details on permanent)

The best known general exact algorithm is due to H. J. Ryser (1963) [Ryser, Herbert John (1963), Combinatorial Mathematics, The Carus mathematical monographs, The Mathematical Association of America. Ryser formula ]. Ryser's formula can be evaluated using O(2^{n}*n^2) arithmetic operations, whereas O(n!*n) arithmetic operations if we compute the permanent using the definition.

There have been codes of Ryser's algorithm for computing the permanent written in C language and Matlab. I cannot find a Ryser's procedure in Maple. So I try to write a Maple procedure to compute the permanent using Ryser's algorithm. The code is as follows:

permanentRyser := proc (M::Matrix) 
      local S, T, B, m, n, s, i, j, rowsum, sum, prod, perm;
      m, n := op(1, M);
      if m <> n then
               error "expecting a square Matrix, got dimensions %1, %2", m, n
      end if;
      rowsum := 0;
      sum := 0;
      prod := 1; 
      S := combinat:-subsets([seq(1 .. m)]);
      Snextvalue();
      while not Sfinished do
             T := Snextvalue();
             s := numelems(T);
             B := LinearAlgebra:-SubMatrix(M, [1 .. m], T);
             for i to m do
                  for j to s do
                          rowsum := rowsum+B[i][j];
                 end do;
                 prod := prod*rowsum; 
                 rowsum := 0;
             end do; 
            prod := (-1)^s*prod;
            sum := sum+prod;
            prod := 1 ;
      end do;
      perm := expand((-1)^m*sum) ;
end proc:
The last second statement "perm := expand((-1)^m*sum) ;" I mean to compute the permanent of  a matrix containing a variable, e.g. the characteristic matrix. If the matrix is numeric, then "expand" should be deleted.

Now I have two questions:

1. Suppose that A is random matrix of order 20, the time(permanentRyser(A)) is about 716 seconds and time(LinearAlgebra:-Permanent(A)) is about 66 seconds. We can see that LinearAlgebra:-Permanent(A) is much faster than permanentRyser(A).  I don't know whether the code I written is accurate and efficient. Thanks to anyone who gives a more efficient procedure of computing the permanent using Ryser's formular.

2. The source code of the function permanent is as follows.

proc (A::(`~Matrix`(square)), ` $`)
     option `Copyright (c) 1999 Waterloo Maple Inc. All rights reserved.`;
     local m, n, t1;
     m, n := op(1, A);
     if m <> n then
              error "expecting a square Matrix, got dimensions %1, %2", m, n
     end if;
     if n = 1 then t1 := A[1, 1] ;
     else
            tools/ClearRememberTable(Permanent/pminor`);
            t1 := [`$`(1 .. n)];
            t1 := Permanent/pminor(A, t1, t1, n)
      end if
end proc

I cannot understand the source code. Does the source code compute the permanent by Laplacian expansion? If the LinearAlgebra:-Permanent() compute the permanent by Laplacian expansion, then it should take more time than by using Ryser's algorithm.

Thanks all.

1-Suppose that after applying the command "factor(f)" the "f "takes the form:

f=(BesselJ(0,r))*(A very lengthy term)

Is there a way to force maple to show f like below:

f=(A very lengthy term)*(BesselJ(0,r))


2-Suppose f is written as follows:

f=a*b*x+a*b*y

Can you suggest a way (without using "op" command) to write f as:

f=a*(b*x+b*y)

Hi:

i will solve the three equations below with numerical method,how?

eq1 := -2.517407096*10^12*q[1](t)^2-5.292771429*10^12*q[1](t)-1.888055322*10^12*q[2](t) = 0
eq2 := 2.246321962*10^12*q[1](t)^2+1.684741471*10^12*q[2](t)+8.110113889*10^12*q[1](t)-7.480938859*10^10*q[3](t) = 0
eq3 := int((-3.826000000*10^11*q[2](t)*cos(Pi*x)*Pi^2-3.826000000*10^11*q[1](t)^2*cos(Pi*x)*Pi^3*sin(Pi*x)+3.414000000*10^11*q[1](t)^2*sin(Pi*x)^2*Pi^4-3.414000000*10^11*q[1](t)^2*cos(Pi*x)^2*Pi^4+7*(int(exp(10*tau), tau = -infinity .. t))+q(x, t))*sin(Pi*x), x = 0 .. 1) = 0

Hello everybody,

I'm trying to solve for a challenging problem : a moving inclined plane with a block

I want to solve for the acceleration components for the block and the plane and the normal force acting on the block.

Let O=(0,0) be an external origin.

Let h be the upper left height of the inclined plane.

Let x1 be the x-position of the center of gravity of the inclined plane.

Let x2 be the x-postion of the center of gravity of the block.

Let y be the y-position of the center of gravity of the block.

Let m1 be the mass of the plane. Let m2 be the mass of the block.

Let  mu[1] be the coeffiction of kinetic friction between the bottom of the inclined plane and the level surface.

Let mu[2]  be the coeffiction of kinetic friction between the block and the upper surface of the inclined plane.

Let theta be the angle of the plane with the horizontal.

Let Fp a force applied to the inclined plane.

 

With those defined variables, I make two separable free body diagrams for the block and for the inclined plane, indicating all of the external forces acting on each. It then comes those two vectorial equations :

Block : m2a2=Wweight of block+Fplan acting on block+Ffriction from plan to block+Nnormal from plan to block

Plane : m1a1=Wweight of plane+Fpushing force+Fblock acting on plane+Ffriction from level to plan+Nnormal from level to plane+Ffriction from block to plane+Nnormal from block to plane

I am quite not sure whether I should include the Ffriction from block to plane and the Nnormal from block to plane into the plane's acceleration calculation. Am I right ?

I notice that from the geometry of the figure, I can write down the relation : tan(theta)=(h-y)/(x2-x1)

This implies the relation : -a2y=tan(theta)(a2x-a1x) (equation 1)

Writing down the equations for the x- and y- components of the accelerations of the block and of the plane , this yields :

( equation 2) : m2a2x=m1 sqrt(a1x2+a1y2) cos(theta) -    mu[2]  N1 sin(theta) +Ncos(theta

 

(equation 3) : m2a2y= m2g+m1 sqrt(a1x2+a1y2) sin(theta) +  mu[2]  N1 cos(theta) +Nsin(theta

(equation 4) : m1a1x=Fp - m2 sqrt(a2x2+a2y2)  sin(theta) +  mu[2]  N1 cos(theta) - Ncos(theta

(equation 5) : m1a1y=-m1g  - m2 sqrt(a2x2+a2y2)  cos(theta) - mu[1] N1 + N1 -  mu[2]  N1 sin(theta) -  mu[2]  N1 cos(theta)

Since N1=m1g,  equation 5 becomes : m1a1y= - m2 sqrt(a2x2+a2y2)  cos(theta)   -  mu[2]  N1 sin(theta) -  mu[2]  N1 cos(theta)

I am confused at this stage because a1y=0, that is to say, the plane remains at the ground level surface.

Where am I wrong ? Does this comes from my previous question ?

 

I want to solve this problem with Maple and plot the solutions. Thank you for any answer !

 

Hello,

I could obtain the simulation of my multibody with kinematic closed chain (CKC).

However, it seems that from a specific time (around 12s) in my model I believe that I have some numerical instabilities. Indeed, I could compare my simulation results with another mulbody software. I obtain the same simulation until 12s and after in MapleSim, it appears many perturbations as you can see on the figures belows.

So, I think that I tune the numerical solver. This numerical solver must solve DAEs equations since my model contains 4 kinematic closed loops.

If i read correctly the help menu, there are the following methods to solve the DAEs :

- use specific DAE numerical solver (3 differents solvers are used : ck45 method, RKF45 method and Rosenbrock method

- use reformulation equations techniques (Baumgarte, Projection) which can be associated (I believe) with a classic solver like (RK4).

For the moment, I have obtained my results with the rosenbrock solver with error absolute : 1.0*10^(-4) and eror relative :error absolute : 1.0*10^(-4) 

Do you have some ideas or advices so as to find a better method to solve my multibody systems with kinematic closed loops ? This method should  prevent the creation of numerical instabilities.

Thanks a lot for your help

 

Hi Everyone

Is there a built-in way to fit a regression using generalized least squares in Maple ?

 

5 6 7 8 9 10 11 Last Page 7 of 1051