Maple 17 Questions and Posts

These are Posts and Questions associated with the product, Maple 17

I'm trying to write the cumulative distribution function into maple but I seem to get an error. The code is:

>with(Statistics):

>N:=RandomVariable(Normal(0,1)):

>CDF(N,t,inert=true);

I get an error message "Error, (in Statistics:-CDF) unexpected parameters: inert = true".

It used to work, maybe because I was using a newer version of Maple.

Can maple solve maximization problem like

q := proc (a, b, c) options operator, arrow; .2*b+.1*c end proc;
print(`output redirected...`); # input placeholder
(a, b, c) -> 0.2 b + 0.1 c
w := proc (a, b, c) options operator, arrow; .7*a+.1*c end proc;
print(`output redirected...`); # input placeholder
(a, b, c) -> 0.7 ab + 0.1 c
e := proc (a, b, c) options operator, arrow; .7*a+.2*b*c end proc;
print(`output redirected...`); # input placeholder
(a, b, c) -> 0.7 a + 0.2 b c

with(Optimization)

Maxmize(int(min(100+(.7*a+q)*(1/2), a), q)+int(min(100+(.2*b+w)*(1/2), b), w)+int(min(100+(.1*c+e)*(1/2), c), e)-a-b-c-ab-ac-bc)

Error, (in Optimization:-NLPSolve) cannot convert procedures to piecewise

 

 

Thanks alot if you can help me.Urgent! Really appreciate.

 

I am trying to perform the following manipulation (This is a minimum working example).

 

a < b  < c;
(1)*2;

Error, invalid terms in product: a < b and b < c

 Can anyone tell if it is possible to manipulate inequalities exactly as it is the case with equations?

 

Dear Maple users,

My problem is as follows:

I have a factor base [2,3,5,7,11,33,34,35,36,37,38,39,40]

The numbers from 2 till 11 are primes, the rest is not. 

Then I have to factor (H+c1)(H+c2) in numbers of the factor base , where c1 and c2 go from 1 to some pre-defined limit. H=32 in my case.
And then I have to put the powers of the numbers of the factor base in a matrix. For example: (H+1)(H+1)=33² but also (H+1)(H+1)=3²*11².

That will become in matrix form [0 , 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0 ] but also (!) [0 , 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0 ].

This is not what I want! I want no double representations....

What I want is that (H+c1)(H+c2) should be represented in primes in the matrix if possible and else just represented as the other numbers.

 

hope you guys can help me!

Hey guys,

I have a problem with this code:

d := Array(1 .. 15);

for i to s1 do

for c2 to 15 do

if `mod`(c2+(J+H)*(`mod`(1/(H+1), A[i])), A[i]) = 0 then d[c2] := d[c2]+l(A[i]) else d[c2] := d[c2]end if

end do

end do;

d;

The problem is that my code stops running when I encounter that `mod`(1/(H+1), A[i]) doesn`t have an modular inverse. What I would like to have is that the loop just continues and does nothing when my array when it encounters an error.

Hope you can help me!

Please I need someone to help out with how to solve the below ODE numerically using finite difference method with the necessary maple code:

 

█( S〗_h〗^' (t)=Λ_h-αβ_m I_v S_h-μ_h S_h+πI_m,  

〖I_m〗^' (t)=αβ_m I_v S_h-(σ_m+π+μ_h ) I_m

〖 S〗_v〗^' (t)=Λ_v-αβ_v I_m S_v-μ_v S_v

〖I_v〗^' (t)=αβ_v I_m S_v-μ_v I_v )

The initial conditions can be assumed. Suppose i want to include controls, how do I solve the problem and equally plot the graph.

 

Thank you.

ADENIYI MICHAEL

 

hi..i am a problem with solving following ....please help me ....thanks alot

dsys3 := {10*f2(x)+12*(diff(f1(x), x))+14*f3(x) = 0, 2*(diff(f1(x), x, x))+4*(diff(f2(x), x))+6*(diff(f3(x), x)) = 0, 16*(diff(f3(x), x, x, x, x))+19*(diff(f3(x), x, x))+22*(diff(f1(x), x))+25*f2(x)+27*f3(x)+29*f3(x)+31+32 = 0, f1(0) = 0, f1(1) = 0, f2(0) = 0, f2(1) = 0, f3(0) = 0, f3(1) = 0, ((D@@1)(f1))(0) = 0, ((D@@1)(f1))(1) = 0, ((D@@1)(f2))(0) = 0, ((D@@1)(f2))(1) = 0, ((D@@1)(f3))(0) = 0, ((D@@1)(f3))(1) = 0}; dsol5 := dsolve(dsys3, 'maxmesh' = 500, numeric, range = 0 .. 1, abserr = .1, output = listprocedure); fy3 := eval(f3(x), dsol5); fy2 := eval(f2(x), dsol5); fy1 := eval(f1(x), dsol5)

ERROR.mw

error in( dsolve/numeric/bvp) unable to achieve the requested accuracy of 0.1e-5 with maximum 128 point mesh (was able to get 0.22e-4), consider increasing `maxmesh` or using larger `abserr`

 

The above is the error message displayed by maple 17. How do I correct this.

Thank you.

 

Adeniyi Michael

I am numerically solving a nonlinear system of nine equations. How long can I expect it to take?

I have run it for 30 minutes and it has not solved yet.

Here is the system of equations:

0=Lambda-mu.*S-beta.*(H+C+C1+C2).*(S./N)-tau.*(T+C).*(S./N);

0=tau.*(T+C).*(S./N)-beta.*(H+C+C1+C2).*(T./N)-(mu+mu_T).*T;

0=beta.*(H+C+C1+C2).*(S./N)-tau.*(T+C).*(H./N)-(mu+mu_A).*H;

0=beta.*(H+C+C1+C2).*(T./N)+tau.*(T+C).*(H./N)-(mu+psi.*mu_A+mu_T+lambda_T).*C;

0=lambda_T.*C-(mu+mu_A+rho_1+eta_1).*C1;

0=rho_1.*C1-(mu+mu_A+rho_2+eta_2).*C2;

0=eta_1.*C1-(mu+rho_1+gamma).*CT1;

0=eta_2.*C2-(mu+rho_2+gamma.*(rho_1)./(rho_1+rho_2)).*CT2+(rho_1).*CT1;

0 = N - S - T - H - C - C1 - C2 - CT1 - CT2;

and I have numeric values for Lambda, beta, tau, mu, mu_T, mu_A, rho_1, rho_2, psi, gamma. The only parameters left are eta_1, eta_2.

Thank you.

I keep getting an error about the while. It is calling it an invalid if statement.  It may relate to semi colons, but I cannot find any errors myself. Please help.

InterpolIDW2:=proc(n,rwin,mink,p,R,IR)       

local ix,iy,i,j,i0,i1,j0,j1,k;      

local count,wgt,top,bot,hp;      

print(`n=`,n,`rwin=`,rwin,`mink=`,mink,`p=`,p);      

hp:=p/2;        

for iy from 1 to n do      

for ix from 1 to n do           

if (IR(ix,iy)=0) then                

i0:=max(1,ix-rwin);  i1:=min(n,ix+rwin);                

j0:=max(1,iy-rwin);  j1:=min(n,iy+rwin);                 

k:=add(add(IR(i,j),i=i0..i1),j=j0..j1)                                                                

while (k<mink )do                              

if(i0>1) then                                       

i0:= i0-1;                                       

k:= k+ add(IR(i0,j),j=j0..j1)                              

end if;                              

if(i0<1) then                                        

i0:=i0+1;                                        

k:= k+ add(IR(i0,j),j=j0..j1)                              

end if;                              

if(j0>1) then                                        

  j0:=j0-1;                                       

  k:= k+ add(IR(i,j0),i=i0..i1)                         

  end if;                           

 if(j0<1) then                                

 j0:= j0+1;                                         

k:= k+ add(IR(i,j0),i=i0..i1)                             

end if;                         

end do;                  

top:=0;  bot:=0;                

for j from j0 to j1 do                

for i from i0 to i1 do                      

if (IR(i,j)<>0) then                           

wgt:=1/evalf[14](((ix-i)^(2)+(iy-j)^(2))^(hp));                           

top:=top+wgt*R(i,j);                           

bot:=bot+wgt;                      

end if;                

end do;                

end do;                

R(ix,iy):=top/bot;           

end if;      

end do;      

end do;  

end proc:

Hi there,

is it possible to have the legend of a pointplot accepting arguments?

Say I have an array of 3 values (e.g. p:=[1.5,2,2.5]) representing a given parameter for a function. When representing this function by means of a plot, I would like the legend (legend="Parameter " + value in array; legend=["Parameter", "Parameter", "Parameter") to accept the contents of the array, without entering the values manually:

Parameter 1.5

Parameter 2

Parameter 2.5

 

How can this be achieved?

 

Thanks,

jon

Hi! I have a matlab worksheet that i need to convert it to Maplesoft. Is it possible?

Regards

Hikmat

hi.i am a problem with following dsolve.please help me....thanks alot

dsys3 := {10*f2(x)+12*(diff(f1(x), x))+14*f3(x) = 0, 2*(diff(f1(x), x, x))+4*(diff(f2(x), x))+6*(diff(f3(x), x)) = 0, 16*(diff(f3(x), x, x, x, x))+19*(diff(f3(x), x, x))+22*(diff(f1(x), x))+25*f2(x)+27*f3(x)+29*f3(x)+31+32 = 0, f1(0) = 0, f1(1) = 0, f2(0) = 0, f2(1) = 0, f3(0) = 0, f3(1) = 0, ((D@@1)(f1))(0) = 0, ((D@@1)(f1))(1) = 0, ((D@@1)(f2))(0) = 0, ((D@@1)(f2))(1) = 0, ((D@@1)(f3))(0) = 0, ((D@@1)(f3))(1) = 0}; dsol5 := dsolve(dsys3, 'maxmesh' = 500, numeric, range = 0 .. 1, abserr = .1, output = listprocedure); fy3 := eval(f3(x), dsol5); fy2 := eval(f2(x), dsol5); fy1 := eval(f1(x), dsol5)ERROR.mw

 

 

 

the final result I want to get should be b*x

Thank you.

How can error of invalid range be corrected FDM.mw

First 29 30 31 32 33 34 35 Last Page 31 of 61