Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I want to write maple code of the following algorithm with

the following parameters and initial values please help me.

T0 = 5.5556 × 107 cells, I0 = 1.1111 × 107 cells, V0 = 6.3096 × 109 copies/ml,

A1=A2=1,

c = 0.67, h = 1, d = 3.7877 × 10−3, δ = 3.259d,

λ = 2/3× 108d, R0 = 1.33,

p = (cV0δR0)/λ(R0−1)

and β = dδcR0/λp .

 

Algorithm
step 1 :
T(0) = T0, I(0) = I0, V (0) = V0 λi(100 ) = 0 (i=1, ..., 3), u1(0) = 0 =
u2(0).

step 2 :
for i=1, ..., n-1, do :
Ti+1=(Ti + hλ)/(1 + h[d + (1 − u1i)βVi]),

Ii+1 =(Ii + h(1 − u1i)βViTi+1)/(1 + hδ),

Vi+1 =(Vi + h(1 − u2i)pIi+1)/(1 + hc),

λ1n−i−1 =(λ1n−i + h[1 + (1 − u1i)βVi+1])/(1 + h[d + (1 − u1i)βVi+1]),

λ2n−i−1 =(λ2n−i+ hλ3n−i (1 − u2i)p)/(1 + hδ),

λ3n−i−1 =(λ3n−i + h(λ2n−i−1− λ1n−i−1 )(1 − u1i)βTi+1)/(1 + hc),

R1i+1 =(1/A1)(λ1n−i−1−λ2n−i−1 )βVi+1Ti+1,

R2i+1 =−(1/A2)λ3n−i−1 pIi+1,

 

u1i+1 = min(1, max(R1i+1 , 0)),

u2i+1 = min(1, max(R2i+1 , 0)),

end for

 

step 3 :
for i=1, ..., n-1, write
T(ti) = Ti, I(ti) = Ii, V(ti) = Vi,

u1(ti) = u1i, u2(ti) = u2i.

end for

hello. before I used Mapple 15. But then I`ve run Mapple 16 and now I`ve a problem. I can`t use this program. I open the program, everthing is in the rule, but if I want to write any mathemathical function, or a letter, such as- x or x+2, the program does`t give any reaction. program only gives reaction the numbers.

Please, help me. (my english isn`t very good, and I don`t know I`ve explained my opinion).

Greetings!

I only recently started to work with Maple17 and tried to test the Explore command. In Classic worksheet I tried a very simple function with a parameter, but after setting the inteval of the parameter in the Java pop-up window I have no result. In return I take: "Error, (in Explore) invalid input: rtable_dims uses a 1st argument, A (of type rtable), which is missing"

Has anyone encounter the same issue before?

Thanx

https://drive.google.com/file/d/0B2D69u2pweEvMV92SGhtRGZONFk/edit?usp=sharing

a error and code in this attachment mw

i can pdsolve it, but numeric pdsolve it get error

hey maple followers,

i need, please to find the method used in command "minimize".
i looked into help maple and i found "theorema mean values" as example
some help please
thanks!

P.s: minimize not Minimize

How to calculate c.d.f from probability mass function. Suppose that the pmf of a discrete random variable is given : f(x)=(2*x+1)/25, x=0,1,2,3,4

Hi -

 

    It is often useful useful to generate two procedures --- one to evaluate a function and one to evaluate its gradient.  The procedure codegen[GRADIENT] does not treat functions of array variables.  Why doesn't GRADIENT support array variables?  Would it be possible to replace the array variables by variables, apply GRADIENT, and then replace the array variables by variables again?

 

Best wishes,

David

 

I want to find  the volume contribution x^2+y^2=z and x^2+y^2=2x over xy with Maple.

Hello, I was trying to control color of a plot3d. 
I find this answer : http://www.mapleprimes.com/questions/148397-Plot3d-Color-Range
And this post of @Carl Love : 
"

Here's how to do it with a continuous transformation to your existing color function, which is presumed to return a value between 0 and 1 (the HUE color scale). Keeping it continuous is very very nice when you want colors to represent  numeric values. Let's say your existing color function is C, and your coordinate functions for a parametrized surface are FxFyFz.

Gamma:= 1.15:
plot3d(
     [Fx, Fy, Fz],  a..b, c..d,
     color=  [
          (x,y)-> (1-C(x,y))^Gamma/3, #Hue
          (x,y)-> 1-C(x,y)/4,         #Saturation
          (x,y)-> 1-C(x,y)/7,         #Value
          colortype= HSV
     ],
     lightmodel= NONE,
     style= patchnogrid     
);

There are several parameters that can be adjusted; I've chosen some of them by my personal taste for color .

  • Gamma controls the evenness of the distribution between red and green. I gave this one a name because this is a well-known concept (see the Wikipedia article "Gamma correction").
  • The 3 in the Hue selects the fraction (1/3 in this case) of the full color spectrum that you want. If you want green to red, it will need to be pretty close to 3.
  • The Hue value is subtracted from 1 to make the scale go green to red rather than red to green.
  • The 4 in the Saturation controls (to some extent) how "light" the light-green is.
  • The 7 in the Value controls (to some extent) how dark the dark-red is (lower values will make it darker).
  • lightmodel= NONE is used so that the colors will not change due to shadows when the plot is rotated. "


I made some test to see the impact of the Gamma parameter. 
And with Gamma = 1, it's odd. 

with(plots):

>

C := proc (x, y) x end proc;

proc (x, y) x end proc

(1)
>

Gamma := 1.15:

 
>

a := 1:

 

``


It looks like with gamma = 1, plot3d makes an automatic scaling of the colors.
But I don't understand why.
Does anyone know ?

Download oddity.mw

I'm writing a simple Maple program to test the Generalized Finite Element Method: main_screened_Poisso.mw

When trying to define the Neumann boundary conditions, I have to define a directional derivative dudn=dudx*n. However, I can't seem to define a unit vector normal to Gamma, which is defined by a LineSegments objects.

Other than that, the row reduction is very slow, even though I'm using floating point arithmatic and not exact arithmatic, I believe.

How can I solve these problems? Thanks in advance!

 

The following limit does not return a value. Then the evalf gives a wrong answer.

The answer should be "undefined" or -infinity .. infinity.

limit(exp(n)/(-1)^n, n = infinity) assuming n::posint; evalf(%);


                       /exp(n)              \
                  limit|------, n = infinity|
                       |    n               |
                       \(-1)                /

                               0.

The same happens if you delete the assumption.

 

A similar problem occurs with

limit(sin(Pi/2+2*Pi*n), n = infinity) assuming n::posint;
                            -1 .. 1
without the assumption this would be appropriate.

Hi!

 

I still have a problem and im looking forward to any suggestions

this is the previous code that i have wrote

P := array([[8, 4], [8, 3], [8, 2], [7, 1], [6, 0], [5, 0], [4, 0], [2, 1], [1, 1], [1, 4]]);


> for j from 2 to 5 do k[j] := j+1;

x[j] := add(P[j, 1], j = j-1 .. j+2);

X[j] := add(P[j, 1]^2, j = j-1 .. j+2);

y[j] := add(P[j, 2], j = j-1 .. j+2);

Y[j] := add(P[j, 2]^2, j = j-1 .. j+2);

xy[j] := add(P[j, 1]*P[j, 2], j = j-1 .. j+2);

cx[j] := evalf(x[j]/k[j]);

cy[j] := evalf(y[j]/k[j]);

c11[j] := evalf(X[j]/k[j]-cx[j]^2);

c22[j] := evalf(Y[j]/k[j]-cy[j]^2);

c12[j] := evalf(xy[j]/k[j]-cx[j]*cy[j]);

C[j] := evalf(Matrix(2, 2, [[c11[j], c12[j]], [c12[j], c22[j]]]));

E[j] := simplify(fnormal(LinearAlgebra[Eigenvalues](C[j])));

if E[j][1] > E[j][2] then a[j] := E[j][2]/(E[j][1]+E[j][2]) else b[j] := E[j][1]/(E[j][1]+E[j][2])

 end if;

a[j];b[j]

 end do;

 

now, my question is how to put the output from the above looping in a  matrix form.

in my matrix, i need to call a[j],b[j], E[j][1], E[j][2] and the coordinate points. so my matrix dimension 4 x 5

I guess its a simple task but i tried hard and didnt get it worked.

thank you.

 

https://drive.google.com/file/d/0B2D69u2pweEvU3NpWWQwS3U1XzQ/edit?usp=sharing
https://drive.google.com/file/d/0B2D69u2pweEvMnFabkdiX1hpYVk/edit?usp=sharing

 

a1 := Diff(x1(s,t),s$2) = a*x1(s,t)+b*x2(s,t)+c*x3(s,t)+d*u(t);
a2 := Diff(x1(s,t),t)=x1(s,t);
b1 := Diff(x2(s,t),s$2) = e*x1(s,t)+f*x2(s,t)+g*x3(s,t)+h*u(t);
b2 := Diff(x2(s,t),t)=x2(s,t);
c1 := Diff(x3(s,t),s$2) = i*x1(s,t)+j*x2(s,t)+k*x3(s,t)+l*u(t);
c2 := Diff(x3(s,t),t)=x3(s,t);
sys := [a1, a2, b1, b2, c1, c2];
sol := pdsolve(sys);

length exceed limit

hi, i have a problem with maple. i took the codes from a book, it should be true but even i copied and past exactly the same, again the maple gave me error which i couldnt solve. could you please help me? how can i correct it ? incorrect codes are below, but if you need all codes i can write here. i need a solution immediately :(

>relativefrequencies := proc(text, language)
evalf(frequencies(text, language)/StringTools:-Length(text))
end proc:
VigenereKeyFind := proc(ciphertext, max:=floor(StringTools:-Length(ciphertext)/15),
{language:=en})
uses StringTools;
local freqs;
freqs := map(x -> relativefrequencies(x, language),
map(Implode, partit(Explode(ciphertext),
keylength(ciphertext, max, ’:-language’=language))));
Implode(map(li -> frequencyanalysis(li, ’:-language’=language), freqs))
end proc;

>VigenereKeyFind(c);
Error, (in VigenereKeyFind) ``’`` does not evaluate to a module

First 1383 1384 1385 1386 1387 1388 1389 Last Page 1385 of 2224