Items tagged with eval eval Tagged Items Feed

Hi again,

 

I am lost... again. I worked with the Physics package and have obtained my result in form of a lengthy equation of commutators of non-commuting objects. So basically my problem is solved, except that I now want to compute some examples to see, if everything is correct. For that purpose I want to replace now the non-commuting objects with explicit matrices, compute the result and see if it agrees with numerical studies. However, I have no clue which command to use, because if I try it with subs, then the multiplication is of the wrong type and Maple won't multiply my matrices. I tried to use eval but wasn't successful.

Here is an exampe to see what I mean.

Test2.mw

 

Thank you for your time

 

NOh

I am using Maple 12 in Win 64. I have some difficulties in evaluating expressions in Maple. For example simply writing cos(x) then differentiating it w.r.t x. After writing cos(x) in 2D Math mode, I do right click for selecting diff but it does not work. The pointer turns in to busy mode and nothing comes to select. Also, I tried this operation in the tutorial file teaching differentiation, however problem persists.

Hi all,

I have a problem when creating package by using 'read' function to concatenate package's elements

Case1: Create package normally, Proc1 and Proc2 are exported

restart;
###################################
# Define package Test contains 2 proc: Proc1 and Proc2
##################################
Test := module()
    option package;
    export Proc1, Proc2;

    Proc1 := proc()
        description "Proc1() is an element of package Test";
        printf("In Proc1\n");
    end proc;
    Proc2 := proc()
        description "Proc2 is an element of package Test";
        printf("In Proc2\n");
        Proc1();
    end proc;
end module;

#################################
# Try to call Proc1 from Proc2
#################################
Test:-Proc2();

Console output:

> Test:-Proc2();
In Proc2
In Proc1

==> The result looks OK

 

Case2: Split Proc1 into another file and include it into master file by using 'read' function, Proc1 and Proc2 are exported

restart;
###################################
# Define package Test contains 2 proc: Proc1 and Proc2
##################################
Test:= module()
    option package;
    export Proc1, Proc2;

    ###########################
    # Code to concatenate "Proc1.maple" here
    ###########################

    read "Test/Proc1.maple";

    Proc2 := proc()
        description "Proc2 is an element of package Test1";
        printf("In Proc2\n");
        Proc1();
    end proc;


end module;


#################################
# Try to call Proc1 from Proc2
#################################
Test:-Proc2();

Console output:

> Test:-Proc2();
In Proc2
                                    Proc1()

==> The Proc1 seem does not execute or evaluate

 

Case3: Split Proc1 into another file and include it into master file by using 'read' function, just export Proc2, not export Proc1

restart;

###################################
# Define package Test contains 2 proc: Proc1 and Proc2
##################################
Test:= module()
    option package;
    export Proc2;

    ###########################
    # Code to concatenate "Proc1.maple" here
    ###########################

    read "Test/Proc1.maple";

    Proc2 := proc()
        description "Proc2 is an element of package Test1";
        printf("In Proc2\n");
        Proc1();
    end proc;


end module;


#################################
# Try to call Proc1 from Proc2
#################################
Test:-Proc1();

Console output:

> Test:-Proc2();
In Proc2

In Proc1

==> The result looks good

 

Please help to explain the problem from case 2 and case 3. If I want to split package proc into many files, how can I do?

 

Hi All,

I'm a new Maple user and I just have a question about evaluating a formula.

Say that you have a formula y=45*r*t

and you know what "r" is, lets say r=5

What do I do if I want to evaluate this formula for the values t=2 all they way up to t=150.

Is there a simple command that lets me do this?

 

Yours

John.

 



I am trying to find out the stiffness matrix of composite by using iterative loop that sums over each laminate and adds the result to the previously calculated matrix 

D=null matrix

for i to 4 do Dply := evalf(evalm((1/3)*Q[i]*(z(i+1)^3-z(i)^3))); D := evalm(D+Dply) end do;
evalm(D);

although the values are coming out fine but in the diagonalm elements, it shows the true value + _rtable[4456495426] which I am not able to figure out why is it coming?

 

Hello,

I have a easy question I think but blocking for me.

I have a expression g(t):=f(x(t),alpha(t),beta(t))

I give 

x(t):=0.12
alpha(t):=0
beta(t):=0

I would like to evaluate g(t).

And for the moment x(t), alpha(t) and beta(t) aren't replaced by their values.

How can i do in order to have the evaluation of g(t) ?

Thanks a lot for help.

 

I'm taking calculus and my professor introduced us to maple software. The professor asked us to plot the families of curves for this orthogonal equation:

dy/dx = (x^2) - (2y^2) - C = 0

This is what I had so far:

 

restart;

with(DEtools):

with(plots):

 

Function:=unapply(simplify(x^2-2y^2-C),(x,y)):

'Function'(x,y) = Function(x,y);

plotFunction:=C->implicitplot(eval(F(x,y),a=C),x=-5..5,y=5..5,scaling=constrained):

plot1:=display(seq(plotFunction(a),a=-5..5)):

display(plot1);

 

This is only display one family. How do I code for it plot the other families?

(The graph should look like curves converging from left, top and right sides toward to the origin of the axes)

Please help.

Hi there!

I wrote a piece of code which spits out the numerical datapoints (x,y(x)) corresponding to a function y(x). So that the result is accurate, I need quite a lot of data points - currently I am working with 5k.

In order to work with this function later, I interpolated it with a Spline. For instance, I would like to sample the function values on a fifferent grid, etc.. However the evaluation of this function really takes up hell of a lot of time, and the reason seems to be, that it, being a spline on 5k nodes, is simply a huge expression.

Is there a better way to do this? Are other fitting functions than a spline maybe better suited?

Thanks for help!

 

Does anybody know why the answer of a equation i am getting on maple is coming with "eval" written?

Example:

 

the answer should be a number ...

Why does it happen?

 

 

intergration

f:=Intat(1.0000000000000000000*(1.7969454312181156991*_f^1.2+1.80)^1.2/sqrt(-1.4974545260150964159*(8.9847271560905784954*_f^3+14.640368911168931285*_f^2+30.220202497712627297)^1.2), _f = 0);

 

I tried to use  value(f);  eval(f); simplify(f); expand(f), but non provide an answer, but return an integral unevaluated.

 

Is there a command to produce a  numerical result ?

Why does the following statement not evaluate, or better yet, how can I make it do so?

 

A:=value(floor(p)) assuming p>0,p<1,p::real;

or

A:=simplify(floor(p)) assuming p>0,p<1,p::real;

or any one of a lot of different attempts along the above lines, all of which seem (to me) that they should yield

A:=0

rather than

A:=floor(p)

which is what I get.

Thanks in advance

Hi all,

I am having some problems when solving high order polynomials. When oders are 'high' and systems involve multiple variables, Maple is slow to do so.

See in worksheet for detailed codes.

slow.zip

kappa - gives the vector that i am interested in

sC - a reparameterisation which has 'summation' in it

Aim is to verify that it works (it should!)

I currently ask...

Hi,

Say for a 126 by 18 symbolic matrix, substituting numerical values into the matrix DD1 takes about 10 seconds (using time() );

for a 62 by 16 matrix, take just about 1/5 second.

By when the matrix is about 254 by 20, it take much longer! More than a minute!

I never actually waited how long, but I am wondering if there is something wrong? Am I using the right command?

Say the matrix is DD1 with numpar:=[x=0.3,y=0.2,z=0.98,....]

 

Hello Community,

Wondering if anyone has run into the problem outlined in my code below. I am looking to evalute a commutator involving Pauli spin matrices. One of the matrices is squared. Such a commutator should evaluate to zero. However, the way I implemented it below doesn't give such a simplified result. See Result 7 below. Any suggestions as to how to get Maple to evaluate the exponential before the Commutator? Or to otherwise get to a final, simplified result?

hi, 

I am a newcomer user(maple16) and am trying to make a graph of energy * time forced oscillation
but I'm having this problem

script:

> restart;

> x := unapply(A*exp(-b*t/(2*m))*cos(`ϖ`*t+phi)
                  +Fmax*cos(psi*t-theta)/sqrt((k-m*psi)^2+b^2*psi^2), t);

> v := unapply(diff(x(t), t), t);

> E := unapply((1/2)*m*v^2+(1/2)*k*x^2, m, v, k, x);

> E2 := subs(v = v(t), x = x(t), phi = arctan(-vo/(xo*omega...
1 2 3 4 Page 1 of 4