Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

The round(x) statement rounds x to the nearest integer but if x has unirs it appears not to work. Known bug?

RoundUnits.mw
 

restart

a := 15; b := 5.3

c := (1/100)*a+b

5.450000000

(1)

c := round(c)

5

(2)

``

A := 15*Unit('cm'); B := 5.3*Unit('m')

C := A+B

15*Units:-Unit(cm)+5.3*Units:-Unit(m)

(3)

C := simplify(C)

5.450000000*Units:-Unit(m)

(4)

Cr := round(C)

round(5.450000000*Units:-Unit(m))

(5)

``


 

Download RoundUnits.mw

 

Hello, I am getting the following output from maple: (-ln(lambda)-gamma-ln(k+b))/(k+b) . I have all variables (lambda, k, b) but not gamma and I am not sure what actually it is. I believe it is some kind of Gamma function but I cannot find any expressions for that. Ussually for gamma function I get something like GAMMA(x). Does someone know what this lower case gamma is?

I wish to write a simple procedure to evaluate the Poisson quantile function, F, for many possible parameter values, lambda.

The Maple commands to evaluate F for individual lambda values works just fine, however, I have tried to write a simple procedure to evaluate F for prescribed lambda values (imported from Excel) but to no avail. I'm missing something quite basic, I'm sure.

Can anybody offer a suggestion please? Thanks.

 

Inverse_Poisson_Procedure.mw

i want to gain diff(p(t), t) and diff(q(t), t) and Jacobian matrix
 according to the attached pdf file.

please help me.

thanks

simplify.mw
 

k := diff(a(t), t) = -mu*a(t)-(1/4)*alpha6*a(t)*sin(gamma(t))

diff(a(t), t) = -mu*a(t)-(1/4)*alpha6*a(t)*sin(gamma(t))

(1)

j := a(t)*(diff(gamma(t), t)) = 2*a(t)*sigma-(6*(1/8))*(alpha1-alpha2+(1/3)*alpha3)*a(t)^3-(1/2)*alpha6*a(t)*cos(gamma(t))

a(t)*(diff(gamma(t), t)) = 2*a(t)*sigma-(3/4)*(alpha1-alpha2+(1/3)*alpha3)*a(t)^3-(1/2)*alpha6*a(t)*cos(gamma(t))

(2)

"p(t):=a(t)*cos(gamma(t))"

proc (t) options operator, arrow, function_assign; a(t)*cos(gamma(t)) end proc

(3)

"q(t):=a(t)*sin(gamma(t))"

proc (t) options operator, arrow, function_assign; a(t)*sin(gamma(t)) end proc

(4)

diff(p(t), t)

(diff(a(t), t))*cos(gamma(t))-a(t)*(diff(gamma(t), t))*sin(gamma(t))

(5)

(-mu*a(t)-(1/4)*alpha6*a(t)*sin(gamma(t)))*cos(gamma(t))-a(t)*(2*sigma-(6*(1/8))*(alpha1-alpha2+(1/3)*alpha3)*a(t)^2-(1/2)*alpha6*cos(gamma(t)))*sin(gamma(t))

(-mu*a(t)-(1/4)*alpha6*a(t)*sin(gamma(t)))*cos(gamma(t))-a(t)*(2*sigma-(3/4)*(alpha1-alpha2+(1/3)*alpha3)*a(t)^2-(1/2)*alpha6*cos(gamma(t)))*sin(gamma(t))

(6)

diff(p(t), t)

2*t

(7)

``


subs.pdf

Download simplify.mw

 

 

Hi

I am having some trouble with a procedure. One of the procedures arguments is a mathematical function g(var). For simplification lets say I wish to make a procedure which calculates some values of the unknown function, g: 

SomeProc:=proc(g,var:=x)
f(var):=g
return f(2)
end proc

This does not seem to work. No matter what value of var is inserted into f, the return is g(var). 

Any help would be much appreciated:

How do I combine log10 terms. I can do it with natural logs but I have not been able do do it with log10.

 

    

 

Hello, I would like to make my polynomial equation simpler by replacing every coefficient of each degree in s by any constant.

For example, one of the variable solutions it is:


How can i re-write this equation in the form, lets say, C0+C1*s+C2*s^2+C3*s^3?

I draw a 3d graph and now i want the table of this graph. how can we get a table from the data of a plotted graph.

May grapg was obtained from the following commands

 

restart;
plot3d(1/2*(q^(2*n)-5.*q^n+(2.*q-1)^n+3), q = 2 .. 15, n = 2 .. 20);
 

I am carrying out a research in dynamical system to which end I need to do optimal control. I have coded the control equations but its not displaying any result. I need guidance. The code is shown below....

 

restart;
with(plots);
r := 3; r[1] := 3; k := 10; a := 0.2e-1; b := 0.1e-1; c := 0.1e-1; beta := 0.3e-1; alpha := 0.3e-1; m := 0.5e-1;
z := 40; q := 5; p := 100; T := 3;
sigma := 0.1e-1; k[1] := 10; rho := 0.5e-1;

u[1] := min(max(0, z), 1); z := (a*m*k*lambda[2](t)*x(t)*y(t)-lambda[1](t)*r*(1+b*x(t)+c*y(t))*x(t)*x(t))/(z*k*(1+b*x(t)+c*y(t))); u[2] := min(max(0, q), 1); q := -lambda[1](t)*beta*x(t)*s(t)/q; u[3] := min(max(0, p), 1); p := -(r[1]*lambda[3](t)*s(t)*s(t))/(p*k[1]);
NULL;
sys := diff(x(t), t) = r*x(t)*(1-(1-u[1])*x(t)/k)-a*m*x(t)*y(t)/(1+b*x(t)+c*y(t))-beta*(1-u[2])*x(t)*s(t), diff(y(t), t) = -alpha*y(t)+a*m*x(t)*y(t)/(1+b*x(t)+c*y(t)), diff(s(t), t) = sigma*s(t)+r[1]*s(t)*(1-(1-u[3])*s(t)/k[1])-rho*s(t)*y(t), diff(lambda[1](t), t) = -lambda[1](t)*(r-2*r*(1-u[1])*x(t)/k-a*y(t)*(1+c*y(t))/((1+b*x(t)+c*y(t)) . (1+b*x(t)+c*y(t)))-beta*(1-u[2])*s(t))-lambda[2](t)*a*m*(1-u[1])*(1+c*y(t))*y(t)/((1+b*x(t)+c*y(t)) . (1+b*x(t)+c*y(t))), diff(lambda[2](t), t) = -lambda[1](t)*a*x(t)*(1+b*x(t))/((1+b*x(t)+c*y(t))*(1+b*x(t)+c*y(t)))+lambda[2](t) . (-alpha+(a*m*(1-u[1]) . (1+b*x(t)))*x(t)/((1+b*x(t)+c*y(t))*(1+b*x(t)+c*y(t))))+lambda[3](t)*rho*s(t), diff(lambda[3](t), t) = lambda[1](t)*beta*(1-u[2])*x(t)-lambda[1](t)*(r[1]-2*r[1]*(1-u[3])*s(t)/k[1]-sigma-rho*y(t)), x(0) = 100, y(0) = 200, s(0) = 100, lambda[1](T) = 0, lambda[2](T) = 0, lambda[3](T) = 0;
p1 := dsolve({sys}, type = numeric, method = bvp[midrich], abserr = .1);
 

Hi!

I have the following problem: to create a special elimination ordering which is a weighted degree ordering suitable for elimination + pure lexicographic ordering. Let me provide an example. Assume my variables are x,y,z,t,u,v and I want to eliminate x,y,z. For this purpose, I define the weight vector [1,1,1,0,0,0] and compare monomials wrt corresponding weighted degree. If such degrees are equal, I compare monomials by pure lexicographic ordering. This is exactly what I need. How to obtain such monomial ordering by the package Groebner? I have tried monomial orderings defined by matrices using command  'matrix'(M,vars) but it seems it does not work for 30 variables.

Any suggestion? Thanks in advance.

I am unable to the get the output  in ans2 , error is comming

 

restart:
with(DETools):
with(PDEtools):
u[o](r,z):=(-1/4)*diff(p[o](z),z)*(1-r^2):
ode:=gamma1*diff(u[o](r,z),z)+(1/r)*diff(v[1](r)*r,r)=0:
#dsolve( (ode), { v[1](r) } ):
IC1 := {v[1](0) = 0}:
ans2 := combine(dsolve(`union`(ode, IC1),{v[1](r)}));
 

Hi, I have a long expression (differential polynomial).

It may contain different functions a(x,y), b(x,y), c(x,y) and its derrivatives.

Visually i do not see variable a (and its derivative) in expression.

But I want to be sure. How can I check it automatically?

Also I don't know maximal order of derivative that could appear in this expression.

Hello!

Assume we have the first N positive integres, 1,..,N, and we assing to these numbers a (discrete) probability distribution p1,...,pN. Of course, p1+...+pN=1.

Then, How can we select a number in {1,..,N} according to the given probability distribution? That is, the number 1 can be chosen with probability p1, 2 with a probability p2, etc.

Many thanks in advance for your comments.

Hi,

I am collecting the coefficients of funciton terms(like sin, cos, log,exp,abs) form the expression. I was able to collect using the function 'coeff'. Initially am getting all functions in the expression using Indets[flat(expression, funciton)] then using seq and coeff trying to get all funcitons

expression := a*sin((a+b)/(a-b))*log(a/b)/c+a*b/c+2*sin(a+b);
numOfFuncs := numelems(indets[flat](expression, function));
Funcs := convert(indets[flat](Expression, function), list);

funcCoeffList := [seq(coeff(Expression, Funcs[i]), i = 1 .. numOfFuncs )];

funcCoeffList := [a*sin((a+b)/(a-b))/c, a*ln(a/b)/c, 2]

When there are terms of form funtion*function I would like to collect the coefficient for function*function as one term rather than two terms. simply I want to write a code which reads the functions having product between them as one term gives me back the coefficient.

Looking for the output as : [a/c,2] or [a/c,1,2];

Hello

I have an expression which invokes the LambertW function.

LambertW(-ln(1+i)*EP*p*(1+i)^(-(365*EP*hr*kw*p+SC*i)/(365*FIT*hr*i*kw*(-1+p)))/(FIT*i*(-1+p)))

I was trying to import this expression into Excel, but my version doesn't have LambertW.

Does someone know an analagous function in a form Excel can compute?

According to wiki The Lambert W relation cannot be expressed in terms of elementary functions.

I have gotten around the problem using Newton-Raphson method, but it takes a few cells to converge....

 

First 623 624 625 626 627 628 629 Last Page 625 of 2097