Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hello people in Mapleprimes,

 

I want to know how to use apply rule in the following problem.

Please tell me how to do about this.

applyrule(2*F(K,L)=F(2*K,2*L),2*F(K,L));

returns F(2*K,2*L), which is right.

But, what I want to do is to apply the rule with holding n as general variable of real number.

But, what I can get through 

applyrule(n*F(K,L)=F(n*K,n*L),2*F(K,L));

is only 2*F(K,L) not F(2*K,2*L).

 

What should I write additinally to the above to have Maple calcurate and produce the outcome as F(2*K,2*L), F(3*K,3*L) and so on?

 

Best wishes.

 

Taro

 

 

I'm brand new to Maple and was assigned a problem to modify a code provided by my professor to incorporate variable window size. However, I don't know where to begin or what I'm doing. I've attached the link to the problem below. Plz help.  NA1_Project_IDW_01.2014_Fall.pdf

Hi, I've written some matrix computation in maple 18 . I wanna open this file in maple 16 ? how is it possible ? any help is appreciated in advance.

Hello, all.

I would like to plot a weighted graph.

Edge weights are floating point numbers (for example, 1,0; 2,0, 3,0, ...).

I tried:

>M := MATRIX([[0., 2.0, 1.0], [2.0, 0., 3.0], [1.0, 3.0, 0.]]);

> with(GraphTheory):
> G := Graph(undirected,weighted,M);

But it doesn't work.

Of course, I can take the edge weight and multiply it by 10 or 100.
May be somebody could provide a more simple solution.

I'd like to pay attention to the recent article "The Misfortunes of a Trio of Mathematicians Using Computer Algebra Systems. Can We Trust in Them?"

In particular, the authors consider the integral

int(abs(exp(2*Pi*Ix)+exp(2*Pi*I*y)),[x=0..1,y=0..1]),

stating "Both Mathematica and Maple return zero as the answer to this calculation. Yet this cannot be correct, because the integrand is clearly positive and nonzero in the indicated region". Unfortunately, they give only the Mathematica command to this end.

Of course, the integral under consideration is complicated so the the simple-minded trials

int(evalc(abs(exp((2*Pi*I)*x)+exp((2*Pi*I)*y))), [x = 0 .. 1, y = 0 .. 1]);

and

VectorCalculus:-int(evalc(abs(exp((2*Pi*I)*x)+exp((2*Pi*I)*y))), [x,y]=Rectangle( 0 .. 1, 0 .. 1));

fail. However,this can be found with Maple (I think with Mathematica too.) in such a way.

 

A := evalc(abs(exp((2*Pi*I)*x)+exp((2*Pi*I)*y)))

((cos(2*Pi*x)+cos(2*Pi*y))^2+(sin(2*Pi*x)+sin(2*Pi*y))^2)^(1/2)

(1)

NULL

B := simplify(A, trig)

(2*cos(2*Pi*x)*cos(2*Pi*y)+2+2*sin(2*Pi*x)*sin(2*Pi*y))^(1/2)

(2)

op(B)[1]

2*cos(2*Pi*x)*cos(2*Pi*y)+2+2*sin(2*Pi*x)*sin(2*Pi*y)

(3)

combine(op(B)[1], x)

2*cos(2*Pi*x-2*Pi*y)+2

(4)

C := eval(B, op(B)[1] = combine(op(B)[1], x))

(2*cos(2*Pi*x-2*Pi*y)+2)^(1/2)

(5)

int(C, [x = 0 .. 1, y = 0 .. 1])

4/Pi

(6)

``

 

Download int.mw

 

 

Hello,

 

I have the following condition with two unknowns: t1 and t3:

-N*exp(Q1*alpha*eta*t1/(N*w))*exp(-(((N*w-z)*t1^2+((-N*w+z)*t3+2*Q1)*t1+(1/2)*t3*(t3*(N*w-z)-2*Q1))*alpha-2*N*w*C[max]*(t1-(1/2)*t3))*eta/(N*w))*S1*upsilon*w+N*exp(Q1*alpha*eta*t1/(N*w))*exp(-(((N*w-z)*t1^2+((-N*w+z)*t1+2*Q1)*t1+(1/2)*t1*((N*w-z)*t1-2*Q1))*alpha-2*N*w*C[max]*(t1-(1/2)*t1))*eta/(w*N))*S1*upsilon*w+K1^2*exp((1/2)*t1^2*alpha*eta*z/(N*w))*exp(-(1/2)*t1^2*alpha*eta)*exp(t1*eta*C[max])*alpha*eta*t1*z-K1^2*exp((1/2)*t1^2*alpha*eta*z/(N*w))*exp(-(1/2)*t1^2*alpha*eta)*exp(t1*eta*C[max])*alpha*eta*t3*z+K1*exp((1/2)*t1^2*alpha*eta*z/(N*w))*exp(-(1/2)*t1^2*alpha*eta)*exp(t1*eta*C[max])*S1*alpha*eta*t1*z-K1*exp((1/2)*t1^2*alpha*eta*z/(N*w))*exp(-(1/2)*t1^2*alpha*eta)*exp(t1*eta*C[max])*S1*alpha*eta*t3*z = 0

I know that this condition holds when t1=t3. Does there exist an additional solution for t1 and t3 which satisfies this condition?

Thanks,

Dmitry

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

M:=Array([[a+2*b,b],[x1+y1,z1+z2]]);
pars:=indets(M);
npars:=numelems(pars);

myRand:=RandomTools[Generate](float(range=-3..3),makeproc=true):

set1:={seq(pars[i]=myRand(),i=1..npars)};
numM:=subs(set1,M);
LinearAlgebra:-Rank(numM);

is there a way to make sure that the random values generated from myRand(), subs into M, to make sure that each cell of M is between 0 and 1?

Basically, what I need is being able to simulate some values, subject to each cell of M is between 0 and 1, and find the rank of M. I want to do that efficiently 20 times (or more possibly). Those values that make the cells out of 0 and 1 do not count as 1 of the 20 simulations.

 

Thanks,

 

casper

 

 

Mytest:=module()
    option package;
    
    export
        mymain
        ;
        
        
    # local a,b,c;

    uses LinearAlgebra;
    
    interface(rtablesize=infinity);
    
    
    mymain:=proc(n::integer)

        local ans;
        
        ans:=Vector(n);

        return ans;

    end proc;

end module;

Here is a short piece of code to create a Maple package. It runs fine. Is that possible to hide the code from print() ?

 

with(Mytest);

print(mymain); # which displays the source code

 

Could I hide some of the code? Say I want to use the function mymain() for debugging purpose, but I dont want to make it local to the package. Instead I keep it in "export", but I dont want users to see its code.

 

Thanks!

Is it possible in Maple 15 to solve an equation with a parameter for a given set of parameters? How can this be passed to the solve function, should I use some kind of list?  After obtaining the solution how can I assign the solutions to variables such as x1 for the first value of the parameter, x2 for the second value of the parameters and so on. Furthermore, is this possible with the fsolve command?

 

Thanks

Hello I am a Maple 15 user and I am using the command fsolve to solve for the intersection of two curves over a specified interval in x, namely from 0 to the lim defined in the Maple document. The specified interval contains asymptotes and when I specify the full interval only one of the three solutions is returned even if I can see that there are three distinct solutions by looking at the plot of RHS and LHS. Should I use another technique to find the solution or is my implementation of fsolve command wrong?

Thanks in advance


restart

with(ListTools):

n1 := 1:

n2 := 1.50:

n3 := 1.40:

lambda := 1.3:

k0 := 2*Pi/lambda:

d := 3:

x0 := k0*d:

arg1 := sqrt(x0^2*(n2^2-n1^2)):

arg2 := sqrt(x0^2*(n2^2-n3^2)):

lim := FindMinimalElement([arg1, arg2]):

sqr1 := sqrt(x0^2*(n2^2-n1^2)-x^2):

sqr2 := sqrt(x0^2*(n2^2-n3^2)-x^2):

LHS := tan(x):

RHS := (sqr1+sqr2)/(x*(1-sqr1*sqr2/x^2)):

plot([LHS, RHS], x = 0 .. lim, y = -6 .. 6)

 

fsolve(RHS = LHS, x = (1/2)*Pi .. 3*Pi*(1/2))

2.634254816

(1)

fsolve(RHS = LHS, x = 3*Pi*(1/2) .. 9*Pi*(1/4))

5.222527128

(2)

fsolve(RHS = LHS, x = 9*Pi*(1/4) .. lim)

7.598486053

(3)

``


Download HW4Q2.mw

Hey guys,

i'd like to create a custom component for maplesim. I opened the template in maple18 and defined the following equations:

eq := [p(t) = p__0+rho*g*h(t), Q(t) = A*(diff(h(t), t)), L(t) = 100*h(t)/h(0)]

These equations describes a tank with a liquid in it. Now I tried to define a function L(t) (above) that gives the level of the tank in percentage. Therefore I need the initial height value at t=0. The function defined above (h(0)) does not work, cause maple tells me that the function does not exist.

Any hint how to get an initial value or a value at t=0? Or maybe another way to solve my problem?

Hopefully I described right. :-)

Best regards

Christian

Hey guys.

Basically I want to tranverse the syntax tree, replace an indexed expression based on some rule, then return the modified expression. Here is what I am trying to do. Psuedo code below --

applyRule(expr)
   if isSymbol(expr) then
       return expr;
   elif isIndexed(expr) and ruleSatisfied then
       return modified_expr;
   else
      # Apply operator on the sub-expressions
      # This is the part im having trouble with
      return op(0,expr)(op(map(applyRule, [op(expr)])));
   end if:
end proc:

The line marked with the comment above works MOST of the time, but it'll fail for indexed objects (A[i,j] becomes A(i,j)). The unapply function looked promising, but that also has some corner cases (e.g. if I try to deconstruct the expression A = B*C it will fail)

Kind regards,

woggy

I'm trying to resolve a differential equation system and plot it. But when I use the "odeplot" command, just appear the words in blue and there's no graphic. Does anyone know whats happening?

 

First 1299 1300 1301 1302 1303 1304 1305 Last Page 1301 of 2224