Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Here, I have a 3D map T=(T1,T2,T3) with

T1(x1,x2,x3)=x1*exp(6-2*x1-x2-0.3*x3),

T2(x1,x2,x3)=x2*exp(5-2*x1-2*x2-*x3),

T3(x1,x2,x3)=x3*exp(8-0.2*x1-x2-x3),

How can I use  IterativeMaps:-Attractor obtain the attractor for T.

After 3 hrs trying I give up.  I am a Maple newbie.

I need to read a plain text file, where each line contains 12 fields in it.

The fields are comma separated.  But some of the fields are quoted strings. Here is an example of one line below. I can read the line OK, as a string, using readline(), but I do not know how to split it correctly into 12 fields inside Maple once read, so I can access each field easily and make any changes I want.

The problem is that, once I read the line using readline(), it comes in as string. But it has string embeded in it allready, since the line in the file, allready has quoted string as fields.

Here is one line in file foo.txt

1,2,3,4,0.1,5,"int(x^2,x)","\frac{x^3}{3}",6,7,"(2*x + 1)^(3/2)/3","A"

Each line has the same number of fields. 12.  Now I do this:

current_line:=readline("foo.txt");

And now current_line is

"1,2,3,4,0.1,5,"int(x^2,x)","\frac{x^3}{3}",6,7,"(2*x + 1)^(3/2)/3","A""

And here I am stuck. I tried StringTools[Split], I tried sscanf, tried readata, and nothing worked. For example, if I do

sscanf(current_line,"%d,%d,%d,%d,%f,%d,%s,%s,%d,%d,%s,%s");

The result is

[1, 2, 3, 4, .1, 5, ""int(x^2,x)","\frac{x^3}{3}",6,7,"(2*x"]

The fields are

[integer,integer,integer,integer,float,integer,string,string,integer,integer,string,string]

The problem is the embeded string. I am sure there is a Maple function to do this easily, I just can't find it.

What is the correct way to read these lines, and split them into a Matlab list (of lists) so I can access them easily inside Maple?

Using Maple 2016.2

 

 

I tryed this, because i thought i might be abel to shade this new piecewise function later on, but i dont know how to tell maple that there is 2 y-axes values in the interval from (2;3):

so it failed. 

pleace help regards Niklas.

 

The commands below are from a response by Carl Love to a question posed on February 27, 2016.

Variable t is not mentioned in the plot of f. Does t assume one or more particular values in the construction of the plot?

When t is given a specific value before executing the plot command, the resulting plot appears to be independent of t's value.

What is the logic behind the plot's construction?

f:= cos(2*t/m) + cos(2*(t+5)/m):
plot('maximize'(f), m= 1..10);

Hi

I have a nonlinear PDEs, solved using finite difference in the square

I get the following nonlinear system of equation. Is there any idea how correct the code and display the solution.

I will appreciate any help in this question.

 

restart;
n:=100;
h:=1/(n+1);

# Boundary condition

for j from 0 by 1  to n+1 do
u[0, j] = 0;
u[n+1, j] = 0;
u[j, 0] = 0;
u[j, n+1] = 0 ;
end do;
## Loop for interior point in the square
for i from 1 by 1 to  n do
for j from 1 by 1 to  n do
(u[i+1, j]-u[i, j])*(u[i+1, j]-2*u[i, j]+u[i-1, j])+h*(u[i, j+1]-2*u[i, j]+u[i, j-1]) = 0;
end do;
end do;
 

How can I solve this system of equations with unknown u[i,j], where i,j=1,..,n

 

Many thanks for any help


Generate 8 random 3 by 3 matrices using the RandomMatrix command from the  LinearAlgebra package. As each matrix is generated use Eigenvalues to compute its eigenvalues. Then take the product of the eigenvalues, and check that for each matrix, this product is equal to the determinant of the matrix.  
 

Hi!

I have a question here. Is there any way to simplify a complicated number expressed in terms of RootOf() forms?

I got numbers like

c:=(3/128)*RootOf(3*_Z^4-20*_Z^3+50*_Z^2-20*_Z+3)^3-(5/32)*RootOf(3*_Z^4-20*_Z^3+50*_Z^2-20*_Z+3)^2+(1/64)*sqrt(4+6*sqrt(6))+(25/64)*RootOf(3*_Z^4-20*_Z^3+50*_Z^2-20*_Z+3)-(3/128)*RootOf(3+3*_Z^2+(-3*RootOf(3*_Z^4-20*_Z^3+50*_Z^2-20*_Z+3)^3+20*RootOf(3*_Z^4-20*_Z^3+50*_Z^2-20*_Z+3)^2-47*RootOf(3*_Z^4-20*_Z^3+50*_Z^2-20*_Z+3))*_Z)-5/64

I am quite sure this number is 0: 
evalf(c, 100) gives:
0.+1.*10^(-101)*I

However, I tried simplify(c) and convert( c, 'radical' ) and some other choices of simplify() function. None of them can output 0. Is there any maple functions that can help me to simplify this kind of expressions?

Thanks!

William

Hi, I wondered if anyone knows a way to separate out addition (or subtraction) terms in an equation.

For example given eqn1:

eqn1:= (1/2)*p+1+(-4*p^2-p-1)/(3*p^3+7*p^2+2*p+2)

I would like to get the first rational term before the first plus (or minus) sign. In this case it would be (p/2).

This is a trivial example shown above but the real value in this is that I want to customize my own factorizations using the pratial fraction function of Maple. In this case I would not know eqn1 before hand but it would be the solution to some previous factorization and I need just the first term (before the first plus sign).

If anyone knows any tips or tricks that will set me on the right path to doing this it is most appreciated.

Hey, I'm sitting with an extremely annoying problem. Basically, I want a "Mathematical Expression" component to include a definition of a variable, so I want it to say, for example, "h := 3", now, I can easily type this into the component field myself, and it all works great, but I want to manipulate the field with a button component. Every time I attempt it, it seems as if the ":=" symbol is protected, however I can write it myself without trouble.

Good day, I need to 2D plot from points which I get by solving numerically 17-degree equations. Firstly I take an only first solution of the equation as below, and I have a Matrix with 3 column which represents X, Y, and VALUE respectively. On the left side should be the first column ( X ), and right axis Y (2. column). As seen from Matrix X and Y getting the value between 0 and 10. Is there any option that I can plot my data in 2D?  Thanks in advance.


points := seq(seq(seq(Fun[n, i, j], n = 0 .. step), i = 0 .. step), j = 1);
Mat := Matrix((step+1)^2, 3, [points]);
         .                             X                  Y                 VALUE
           
with(plots);
pointplot3d(Mat, style = point, color = black);
 
 

Hi

 

I have a system of equations (4) which I would like to plot in regards to a fifth variable. Is there a good way to do this. Some of the solutions would end up as negative values, which is not an option I am interested in having.

 

C__A is my variable, and the other variables I would like to solve are tau,C__B,C__C,C__D. Im specifically interested in tau with regards to C__A. I hope this makes sense :)

regards

 

C__A := .75;
                              0.75


a := tau = (C__A0-C__A)/(-r__A);
                                  0.75                      
    tau = - ------------------------------------------------
                                              2             
            -0.00900 C__B + 0.03500000000 C__C  - 0.075 C__C
b := tau = (C__B0-C__B)/(-r__B);
                               2 - C__B              
          tau = - -----------------------------------
                                                    2
                  -0.00900 C__B + 0.03500000000 C__C 
c := tau = (C__C0-C__C)/(-r__C);
                                C__C                  
         tau = ---------------------------------------
                                        2             
               0.01800 C__B - 0.070 C__C  - 0.075 C__C
d := tau = (C__D0-C__D)/(-r__D);
                           13.33333333 C__D
                     tau = ----------------
                                 C__C      
sol := fsolve([a, b, c, d], {C__B = 1, C__C = .2, C__D = .2, tau = 50});

{C__B = 1.673672109, C__C = 0.2289836744, C__D = 0.4236721086, 

  tau = 24.66971264}

I'm trying to solve the equation    

diff(y(x), x) = -A*y(x)/x+x^alpha*(C+(y(x)^alpha/x^alpha-C)^(-gamma))/y(x)^alpha 

i.e

and I'm getting the following answer

y(x) = RootOf(-ln(x)-Intat(_a^alpha/(_a^(1+alpha)*A-C-(_a^alpha-C)^(-gamma)+_a^(1+alpha)), _a = _Z)+_C1)*x

i.e

Please tell me what exactly is '_a' and '_Z'. I'm finding it hard to understand this language.

 

I'm doing a Maximum/Minimum problem ( Calculus 3).

I need to plot f(x,y) =   x2  + y 2 -2y + 1

over R={x,y): x 2 + y 2         (less than or equal sign) 4}

When I use Maple solve on functions that involves exp, ln to decide the maxima, minima points by solving derivative equals zero, it only returns the first point, not the second point.

Which by definition it shall return two points, one at 2.030837315, the other around 6.7.

See the Maple code and exported PDF attached.

Maple_Solve_MinMaxma.mw

Maple_Solve_MinMaxma.pdf


 

restart;

Digits:=10;
to 10 do
evalf(add(sin(k), k = 1 .. 10000)) od;

10

 

1.633891035

 

1.633891035

 

1.633891035

 

1.633891046

 

1.633891046

 

1.633891046

 

1.633891012

 

1.633891012

 

1.633891012

 

1.633891049

(1)

restart;   # execute several times to obtain randomness

interface(version);

`Standard Worksheet Interface, Maple 2016.2, Windows 7, January 13 2017 Build ID 1194701`

(2)

Digits:=18;

18

(3)

to 10 do  
evalf(add(sin(k), k = 1 .. 10000)) od;

1.63389102179246197

 

1.63389102179246223

 

1.63389102179246223

 

1.63389102179246233

 

1.63389102179246233

 

1.63389102179246242

 

1.63389102179246242

 

1.63389102179246371

 

1.63389102179246371

 

1.63389102179246410

(4)

 

First 973 974 975 976 977 978 979 Last Page 975 of 2215