MaplePrimes Questions

Hello,

I hope my question is not to general. I have a polynomial of 8th order

expression:=a8(z) * x^8 + .... + a1(z) * x + a0(z) = 0

on which I am using solve/RootOf

sol:=[solve(expression,x)]

Now when I plot it against z the solution has a jump, why?

When deriving the polynomial I could as well have used another variable instead of x above, say y. These two are related by a function...Then when I write down the 8th order polynomial in y and use RootOf/solve, then no jump occurs.

Is there a way to handle this because left of the jump the solution is not correct while right of it, it is...

Hello,

I wann to send a file  with FTP. I need an example how to do this with URL post.

 

Thanks

I have 3 given square matrices A, B, C. I would like to print

A*B = C,

where A, B, C are replaced by their values, but the multiplication is not executed.
How do I do it?

Thank you!

mapleatha

thank you for helping!! 

Hi, I'm trying to display (print / typeset) a vector of derivatives where an overdot is used instead of d/dt and the dependent variable is hidden.  For a single variable 

Suppress(x(t)):
diff(x(t),t);

Gives the desired result, but

Suppress(x(t)):
Suppress(y(t)):

<diff(x(t),t),diff(y(t),t)>;

doesn't.  I presume the vector/matrix package is doing something to the formatting?  Any help would be appreciated. Thanks.

Dears,  I have a questian about the fieldplot. 

I use the following 

with(plots):

fieldplot([x^2+y^2, 3*sin(x)-y^2], x = -1 .. 1, y = -1 .. 1, arrows = SLIM, color = x) ;

The domain is bounded from x = -1 .. 1, y = -1 .. 1.

Now, I want to use the same order to plot this function over a pentagon definde as 

with(plots):

Q11R := plottools[polygon]([[0, -1], [3/4, -1], [1, 0], [3/4, 1], [0, 1]], style = line, thickness = 3);

plots[display](Q11R, size = [.3, .5]).

I hope that I can find help.

Amr

 

I have a coupled pair of anharmonic oscillators and need to calculate the stability matrix and find the lyaupanov exponent for how the nearby trajectories diverge. In particular, I have the Hamiltonian

H = (p1^2+p2^2 + q1^4+q2^4 + 12*q1^2*q2^2 )/2

and I need to compute the matrix M given by

dM/dt = J*Hess*M

where J := Matrix(4,4,[0,0,1,0,  0,0,0,1,  -1,0,0,0,  0,-1,0,0]), and the Hessian takes the form:

Matrix(4,4, [6*q1_12(t)^2 + 12*Q2_12(t)^2, 2*12*Q1_12(t)*Q2_12(t),0,0,   2*12*Q1_12(t)*Q2_12(t), 6*Q2_12(t)^2 + 12*q1_12(t)^2,0,0,    0,0,1,0,    0,0,0,1])

The solver finds the trajectories of p1,p2,q1,q2 fine, but I don't seem to find a way to incorporate their solutions as inputs to reevaluate the Hessian at each time step. I read through https://www.maplesoft.com/support/help/Maple/view.aspx?path=DEtools%2fmatrixDE and the dsolve since I'm trying to do this numerically.

I thought I could get around this just by resolving the trajectories, but it's spitting out an error that arrays must be initialized with lists.

The actual code is here: AMO_HW4.mw

Sorry, I still need to clean it up a bit. Any help would be appreciated. I need to calculate M(t), then calculate the matrix norm and find the exponent.

 

 

 

 

Hello. I'm trying to calculate some RMS values for a school project. I've double and tripple checked that the forms and units are correctly entered, but it keeps giving me a result that is not convertable to the unit that i know it should output.
 

I've uploaded the file aswell as a picture of the project below:

Analyse.mw

Image: here
File on google drive: here

 

File is updated to include the answer from epostma 1299 , and (almost) works like charm (With exception of the possibility to convert the output unit)

Here is an image of my attempt with the piecewise functionality:

Image: here

 

 

seq(i[1], i[1] = 1 .. 2);
i[1];
                              1, 2
                               2

I thought the note saying "The index variable i is NOT private to the seq invocation" referred only to parallel code.

Several years ago, acer posted a topic on how to overcome the limitation of hardware precision plotting drivers in Maple:

https://www.mapleprimes.com/posts/100884-Precision-And-Plot-Drivers

Currently, I want to plot (1-x)^(10^9) in the range of 0..10^(-15) smoothly.

plot((1-x)^(10^9), x=0..10^(-15)) does not work. Is there an updated option to this in Maple since 2011? 

 

How do I simplify the integral,  where a(u) and b(u) are T-periodic and s,t belongs to the interval [0,T]

I have been using CodeTools::Usage with Maple 17 to compare timings of a couple of matrix inversion routines against each other and against the Maple library routines LinearAlgebra::MatrixInverse and LinearAlgebra::Determinant.

The small section of code that I use to collect the cpu times for each method is:

----------------------------------------

udata := Usage(invTest(x,y,z,delta,mu), output=['cputime', 'bytesused'],
              iterations=nRepeats, quiet);
dat[1]:=udata[1]; dat[2]:=udata[2];

----------------------------------------
nRepeats has been set to 25.

In order to get the timings as accurate as possible, I only open a couple of terminal windows on my laptop so as to run the tests with as low a loaded machine as I can get. (I'm running Ubuntu 14.04 on an 8 core Intel (R) Core i7-3840QM, 2.8GHz CPU with 16Gb of memory.)

A test run consists of a sequence of test matrices each of which is run for an increasing sequence of matrix orders. I either time an implementation on its own or I time both an implementation and the Maple library routines. In the later case for each test matrix and order of matrix, I use Usage to first time the Maple routines and then the times for one of the implementations:

----------------------------------------

if compMaple then
udata := Usage(MatrixInverse(A), output=['cputime', 'bytesused'],
              iterations=nRepeats, quiet);
mdat[1]:=udata[1]; mdat[2]:=udata[2];

udata := Usage(Determinant(A), output=[cputime, bytesused],
              iterations=nRepeats, quiet);
mdat[1]:=mdat[1]+udata[1];
mdat[2]:=mdat[2]+udata[2];
else
  mdat[1..2] := 0:
end if:

udata := Usage(invTest(x,y,z,delta,mu), output=['cputime', 'bytesused'],
              iterations=nRepeats, quiet);
dat[1]:=udata[1]; dat[2]:=udata[2];

----------------------------------------

I have noticed the following:

a) If I time both Maple and an implementation, and the same implementation on its own I can get timings that vary up to a factor of 2 or more,

b) Changes in timings for the same test run and as close to the same environment as I can get (i.e., just the two user terminal windows open) can generate timing differences of up to 50%.

c) Sometimes `chaotic' timings are generated, for example,

    n = 150, t = 3 (secs)
    n = 200, t = 24 (secs)
    n = 250, t = 18 (secs)

which cannot be reflecting the times required to perform the calculations. This type of behaviour always seems to occur when the reported memory bytecount is increasing from ~0.25* 10^9 to over 10^9.

Is there anything I can be doing here to get more consistent timings?

I want to use the timings from these tests in a journal article so it would be good to have the same test run under very similar conditions to return timings within a few percent difference of one another. I certainly get this sort of tolerances (<10%) if I use the Fortran cpu_time intrinsic to time Fortran code.

Any advice would be gratefully received.

Hi, 

As an example, I have these 3 equations below and I need to balance them similar to balancing a chemical equation.

Equation 1: E1=A+B+C+D
Equation 2: E2=A-B+C-D
Equation 3: E3=C

So, I am wondering if there are any functions or algorithms that allow me to input such that they will give me a result of 

xE1 ± yE2 ± zE3 = wA

where w,x,y &z are integers and x,y & z can be zero. 

Thanks.

Ho do I print this?

A - lambdaI = some matrix

On the left of the equation I have the letter "A" a minus sign, the Greek letter "lambda" and the letter "I" right next to it.
The rest. from "=" on, is math.

Thank you!

mapleatha

I'm trying to create the set of monomials in n variables (given as a list var), up to a given degree d. Her eis my code. Any comments to make it better?

mondeg:=proc(var::list,d)
local n, mon, moni, i, j, m1, m;

   n:=nops(var);
   mon:={1};
   moni:={1};
   for i to d do
        for m1 in moni do
             #print(m1);
             moni:=moni minus {m1};
             #print(moni);
             for j to n do
                #print(var[j]);
                 m:=m1*var[j];
                 moni:=moni union {m};
                #print("moni=",moni);
             od;
        od;
        mon:=mon union moni;
        #print(mon);
   od;

mon;
end:

First 915 916 917 918 919 920 921 Last Page 917 of 2429