Maple 17 Questions and Posts

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

Please help me, here my problem:

 

Parsing a string works correctely like this:

ABC := 3443;

print("ABC = ", eval(parse(cat("A", "B", "C"))));

                

 

But using PROCEDURE it doesn't work:

myParse := proc ()

     local PEA;
   

      PEA := 4334;

      print("PEA = ", eval(parse(cat("P", "E", "A"))))

end proc;

myParse();

                        "PEA = ", PEA

 

I suppose to have "PEA = ", 4334

Hi Everybody,

I'm having some problems simulating an algebraic system in Maple.  I want to do this for a larger system of equation (~20 equations/20 variables, with 3 inputs), but I'd like to get an idea of the form this should be in.

So, using an example out of Maple help:

with(DynamicSystems);

sys1:=AlgEquation([y=sin(x)],[x],[y],discrete=true,sampletime=0.001);

inp1:=Vector[column]([1,2,3,4,5,6,7]) * 0.1;

res:=Simulate(sys1,[inp1]);

Error, (in DynamicSystems:-Simulate) should never be here

 

I don't understand what this error means.  Reading the example in the help files, says the second argument should be a vector of input values.  What I would assume this would do is plugin x = 0.1, then solve y=sin(0.1), and output y.

Am I missing some syntax, or is my inputs wrong?  There are examples of how to set up an algebraic system in the help files, but no examples of how to simulate them.

 

Thanks in advance for any help!

 

 

 

 

Say I have the following loops:

for C from 1 to 10 do
    r:=[]:
    for K from 2 to 10 do
    r:=[op(r),2*K+2*C-3];
    end do:
    print(r);
end do:

for C from 1 to 10 do
    r:=[]:
    for K from 2 to 10 do
    r:=[op(r),K*C+K+C-2];
    end do:
    print(r);
end do:

I wonder how could I write a procedure, say use expressions "2*K+2*C-3" and "K*C+K+C-2" as input arguments?

so I can call up like :

 

myfun(K*C+K+C-2) or myfun("K*C+K+C-2")

myfun(2*K+2*C-3)

 

I dont care whether the output(s) are lists, tables, or matrices.

My main difficulty is to get the expression to be procedure inputs.

Though if the output can be a  10 by 9 matrix, it's better.

Thanks,

 

casper

 

 

we were given a function that counts the number of primes among the arguments after the
rst and returns the result in the rst argument. When calling this, you must make sure
that the rst argument is a name. 

this is it.

cp := proc (YY) local count, i ;
print("nargs=", nargs, "args=", args) ;
count := 0 ;
for i from 2 to nargs do
if isprime(args[i]) then
count := count+1 ;
end if ;
print("i=", i, "count=", count) ;
end do ;
print("count=", count) ;
YY := count ;
end proc ;

EX: cp('noprimes',2,4,5,6,7,9,19)

and this works grand, but then we were given this function with slight adjustments to it and asked to fix it. the hints we were given were to try and forve evaluation at the right places.

This is the function we have to fix...

xcp := proc (count) local i;
print("nargs=", nargs, "args=", args) ;
count := 0 ;
for i from 2 to nargs do
if isprime(args[i]) then
count := count+1 ;
end if ;
print("i=", i, "count=", count) ;
end do ;
print("count=", count) ;
end proc ;

 

any help is appreciated!

I want  to verify the following function expression

is indeed an antiderivative of the function expression

where  A>0 with B^2-4*A*C<0.

I have tried the command

>diff((2),x);simplify(%);

where (2) is the label of the antiderivative expression.  But the result is very awkarward and lengthy. How could I verify the antiderivative expression is indeed an antiderivative of the other function by using Maple 17? 

 

``

-(-2*N__1*`&omega;__2`*`&omega;__1`^2*lambda-8*N__2*lambda^3*`&omega;__2`-sqrt(4*N__1^2*lambda^2*`&omega;__1`^2*`&omega;__2`^2+16*N__1*N__2*lambda^4*`&omega;__2`^2+N__1*N__2*`&omega;__1`^2*`&omega;__2`^4+4*N__2^2*lambda^2*`&omega;__2`^4)*`&omega;__1`)/(4*N__1*lambda*`&omega;__1`^2*`&omega;__2`+16*N__2*lambda^3*`&omega;__2`)

-(-2*N__1*`&omega;__2`*`&omega;__1`^2*lambda-8*N__2*lambda^3*`&omega;__2`-(4*N__1^2*lambda^2*`&omega;__1`^2*`&omega;__2`^2+16*N__1*N__2*lambda^4*`&omega;__2`^2+N__1*N__2*`&omega;__1`^2*`&omega;__2`^4+4*N__2^2*lambda^2*`&omega;__2`^4)^(1/2)*`&omega;__1`)/(4*N__1*lambda*`&omega;__1`^2*`&omega;__2`+16*N__2*lambda^3*`&omega;__2`)

(1)

`assuming`([simplify(-(-2*N__1*`&omega;__2`*`&omega;__1`^2*lambda-8*N__2*lambda^3*`&omega;__2`-(4*N__1^2*lambda^2*`&omega;__1`^2*`&omega;__2`^2+16*N__1*N__2*lambda^4*`&omega;__2`^2+N__1*N__2*`&omega;__1`^2*`&omega;__2`^4+4*N__2^2*lambda^2*`&omega;__2`^4)^(1/2)*`&omega;__1`)/(4*N__1*lambda*`&omega;__1`^2*`&omega;__2`+16*N__2*lambda^3*`&omega;__2`), 'size')], [all, positive])

(1/4)*(4^(1/2)*((N__1*lambda^2+(1/4)*N__2*`&omega;__2`^2)*`&omega;__2`^2*(N__1*`&omega;__1`^2+4*N__2*lambda^2))^(1/2)*`&omega;__1`+2*lambda*`&omega;__2`*(N__1*`&omega;__1`^2+4*N__2*lambda^2))/(lambda*`&omega;__2`*(N__1*`&omega;__1`^2+4*N__2*lambda^2))

(2)

`assuming`([combine((1/4)*(4^(1/2)*((N__1*lambda^2+(1/4)*N__2*`&omega;__2`^2)*`&omega;__2`^2*(N__1*`&omega;__1`^2+4*N__2*lambda^2))^(1/2)*`&omega;__1`+2*lambda*`&omega;__2`*(N__1*`&omega;__1`^2+4*N__2*lambda^2))/(lambda*`&omega;__2`*(N__1*`&omega;__1`^2+4*N__2*lambda^2)), 'size')], [N__1 > 0, N__2 > 0, `&omega;__1` > 0, `&omega;__2` > 0, lambda > 0])

(1/4)*(`&omega;__1`*`&omega;__2`*((4*N__1*lambda^2+N__2*`&omega;__2`^2)*(N__1*`&omega;__1`^2+4*N__2*lambda^2))^(1/2)+2*lambda*`&omega;__2`*(N__1*`&omega;__1`^2+4*N__2*lambda^2))/(lambda*`&omega;__2`*(N__1*`&omega;__1`^2+4*N__2*lambda^2))

(3)

 

``

``


Download question_13.12.06.mw

I have following expression

f:=t->((1/8)*s^2*sinh(4*t)+t+(1/2)*s^2*t+s*sinh(2*t))/(1+s*cosh(2*t))

which is 1 solution of the ODE

ode2 := -(diff(y(t), t, t))+(4-12/(1+s*cosh(2*t))+(8*(-s^2+1))/(1+s*cosh(2*t))^2)*y(t) = 0

Now I wanted to construct 2 linear independent solutions via:

f1:=f(t_b-t)

f2:=f(t-t_a)

and calculate the Wronskian:

with(LinearAlgebra); with(VectorCalculus)

Determinant(Wronskian([f(t_b-t), f(t-t_a)], t))

Since I know these functions are solutions of the second order ODE which does not contain any first order derivative the Wronskian should be a constant. Unfortunately Maple has a hard time to simplify it since the epxression is a little big. Is it my fault or has anyone an idea what to do?

 

Differential equation solve

The differential equation I'm solving for is:

Differential Equation

 

I am having some difficulty animating the function shown in the attached file.  I am going to create an animation which will show the curve as a function of t.  My first question is that there is no way to compute K_n because the initial conditions I have are only given as arbritary functions F(z),G(z).  So I am not really sure how to proceed here.

My second question is that I also want to plot the Z dependent part of y as a function of z/b.  I have tried to incorporate this into Maple, however, all I get back is that there are 'unexpected variables present'

Thanks.

I have a bit of an issue.

 

I'm trying to solve this:

eq1:= exp(-lambda)*exp(k)/factorial(k) > .95

lambda:=2

solve(eq1,k)

Warning, solutions may have been lost

Good afternoon sir.

 

I request your kind support to the above cited query.

 

 

With thanks & Regards

 

M.Anand

Assistant Professor in Mathematics

SR International Institute of Technology,

Hyderabad, Andhra Pradesh, INDIA.

Consider the differential equation zZ'' + Z' + a2Z = 0,  where Z = Z(z).  Using the change of variables x = \sqrt{z/b}with b a constant,  obtain the differential equation Z'' + (1/x)Z' + c2Z = 0, where Z = Z(x) and c = 2a \sqrt{b}.

I tried Maple help and it offers the dchange command, and what I have tried is shown below;

with(PDEtools):

DE:= ...

tr:= {z = x2b}

dchange(tr, DE)

This did not return anything however.  I am thinking I need to specify that b is a constant, however, I am a little unsure on how to do this. Is the above the correct way to proceed?  I don't see how I have specified anywhere that in the final PDE, I require Z=Z(x).

Thanks for any help.  This is my first post here, so apologies for the typesetting. If there is inbuilt latex, I will use it next time.

I need help writing a function which takes a number of integers (which are greater than or equal to 2) and returns a list where the nth entry in the list is given by the number of arguments which can be expressed in the form of x^n where x is an integer. The function must also disregard all of the terms after the final integer greater than 0 is produced ie does not show 0, 0, 0, 0, at the end of the list.

Eg if f was the function f(27) = [1,0,1]

f(2,3,4,9,81,1024) = [6,4,0,1,1,0,0,0,0,1]

Hello,

I am using Maple Physics for symbolic tensor computations. However, I fail to simplify quite a simple expression.

Consider the following code:

    with(Physics):with(Library):

    Setup(spacetimeindices = lowercaselatin):

    Define(F[a]);

    read "example2.txt"; 

    Simplify(%);

Here is a file with expression: example2.txt.

The expression in the example2.txt is equal to zero. The following steps allow to obtain this result: expand, contract Kronecker deltas and metric tensors and collect similar terms. This also can be verified using another software (Cadabra, Mathematica xAct, etc.). As one can see, the result of Maple Simplify(%) contains terms like -462661905780*F[k]*F[~k] - 5856479820*F[m]*F[~m] which can be futher simplified, but Maple does not do this (even when I invoke Simplify(%) several times).

What is the right sequence of manipulations needed to obtain zero?

I use the latest Physics package (39.2, updated on November 30).

Thanks,

Dmitry.

Dear users

A friend of of mine has a problem with an integral and since it's for his thesis, it's pretty important. 

That's why I ask it here cause I don't know where to ask it elsewhere, so if it's wrong posted, completely my bad.

l:=(y*o)/(v);

R:=(Phi*o)/v;

A:=5*(a*ln(R)+b);

P:=sqrt(1+4*k^2*l^2*(1-exp^(-l/a)));

M:=int((2)/(1+P),o);

With other words, I want to integrate the wole thing to the variable o, who appears in the variables l and R.

Somehow, when I put this in Maple, it won't solve it. Probably it's just a stupid fault or i just forget something, but i don't find it. Does anyone knows how to solve it?

Already a lot of thanks!

 

First 42 43 44 45 46 47 48 Last Page 44 of 61