## 45 Reputation

8 years, 252 days

## Extract the indices themselves...

Maple

Is there a way in Maple to extract the indices themselves?

Example:

node [2,3,5]: = 7

I want is to be able to obtain the number 2, 3 and 5 separetly.

Thanks.

## Diferential equation...

Maple

Hi,

I try solve this differential equation:

de := diff(y(t), t)+2 = (y(t)^2+1)*(diff(x(t), t))
dsolve(ode);

Maple not solve.

Any help?

Regards

## Integral not solve...

Maple

Hello, I try this integral, but Maple not solutions, the answer is the same integral.

int(N*exp((2*(-(1/2)*x^2-2*a^2*ln(x)*x/(-2*x^2+2)))/sigma^2)/(-2*x^2+2), x = -1 .. 1)

N,a, sigma are constants.

Regards

## Heatmap Matrix all values +1 or -1, try...

```Hello, I want to repeat in matrix for two colors a matrix, if the element i, j
takes the value +1 is blue and if it is -1 green, it happens that sometimes
the matrix can take all the values ​​as +1 or -1, I used heatmap, but apparently
it gives problems if all the elements of the matrix take +1 or -1.```

restart;
sizeMatriz := 4; iter := 1000; with(Statistics); with(LinearAlgebra); randomize(); with(plots);
sizeMatriz := 4
iter := 1000
f := rand(1 .. 2);
f := proc()  ...  end;
g := rand(1 .. 10);
g := proc()  ...  end;
k := 1;
k := 1
RM := Matrix(sizeMatriz, sizeMatriz, proc (i, j) options operator, arrow; 1 end proc); HeatMap(RM, axis = [gridlines = [sizeMatriz, color = green], thickness = 2], color = [blue, yellow], size = [640, 480]);
Error, (in Statistics:-HeatMap) the 2nd argument should be of type {numeric, string}

How i made this?, is posible by other command that not Heatmap, other way? I try with sparsematrix:

restart;
sizeMatriz := 4; iter := 1000; with(Statistics); with(LinearAlgebra); randomize(); with(plots);
sizeMatriz := 4
iter := 1000
f := rand(1 .. 2);
RM := Matrix(sizeMatriz, sizeMatriz, proc (i, j) options operator, arrow; (-1)^f() end proc)
PA := sparsematrixplot(RM, matrixview, color = ["Blue","Red"]);

but this paint alls vaues matrix[i,j] +1 or -1 in the same color.

Regards.

## Random code "C " to -> Maple...

Hello I trie this code C:

```FUNCTION ran1(idum)
INTEGER idum,IA,IM,IQ,IR,NTAB,NDIV
REAL ran1,AM,EPS,RNMX
PARAMETER (IA=16807,IM=2147483647,AM=1./IM,IQ=127773,IR=2836,
* NTAB=32,NDIV=1+(IM-1)/NTAB,EPS=1.2e-7,RNMX=1.-EPS)
“Minimal” random number generator of Park and Miller with Bays-Durham shuffle and
added safeguards. Returns a uniform random deviate between 0.0 and 1.0 (exclusive of
the endpoint values). Call with idum a negative integer to initialize; thereafter, do not
alter idum between successive deviates in a sequence. RNMX should approximate the largest
floating value that is less than 1.
INTEGER j,k,iv(NTAB),iy
SAVE iv,iy
DATA iv /NTAB*0/, iy /0/
if (idum.le.0.or.iy.eq.0) then Initialize.
idum=max(-idum,1) Be sure to prevent idum = 0.
do 11 j=NTAB+8,1,-1 Load the shuffle table (after 8 warm-ups).
k=idum/IQ
idum=IA*(idum-k*IQ)-IR*k
if (idum.lt.0) idum=idum+IM
if (j.le.NTAB) iv(j)=idum
enddo 11
iy=iv(1)
endif
k=idum/IQ Start here when not initializing.
idum=IA*(idum-k*IQ)-IR*k Compute idum=mod(IA*idum,IM) without overflows by
if (idum.lt.0) idum=idum+IM Schrage’s method.
j=1+iy/NDIV Will be in the range 1:NTAB.
iy=iv(j) Output previously stored value and refill the shuffle taiv(
j)=idum ble.
ran1=min(AM*iy,RNMX) Because users don’t expect endpoint values.
return
END

```

How does this code in Maple?.

There are any sintaxis as *Value(point of addrees) that i  dont know this in Maple.

best Regars,

 1 2 3 4 5 6 Page 1 of 6
﻿