MaplePrimes Questions

I am very confused about function is():

 

1. is(a-b=0) assuming a::real,b::real,a^2=b^2,a>0,b>0;

2. is(a-b=0) assuming a::real,b::real,a^2=b^2,a>=0,b>=0;

 

the first command gives me false, and the second command gives me true...

 

any thoughts?

I have an expression like this (from an earlier computation):

2*(sum(A*cos(omega*t)^2+cos(omega*t)*B*sin(omega*t)-cos(omega*t)*ymeas(t), t));

I want to distribute the sum over the terms in the expression, i.e.

sum(A*cos(omega*t)^2,t)+sum(cos(omega*t)*B*sin(omega*t,t)+sum(cos(omega*t)*ymeas(t), t)));

I suspect defining a rule and using applyrule should be the way to go, but for the heck of it I can't figure how to do it. The best I can manage is getting the Maple kernel hung with the following construct:

distSum:=sum(A::algebraic+B::algebraic+C::algebraic,D=algebraic)=sum(A,D)+sum(B,D)+sum(C,D);

applyrule(distSum,(5)); # (5) referrs to the expression on line 2 (and it is a proper label in my Maple wrkbook).

I have asked similar questions before and gotten answers; but I am not able to find what I need in MapePrimes (or my faorites, for that matter).

Thanks for any help,

Mac Dude

 

Hi everyone,

I would like to use structs

    struct sname {
        smem1;
        smem2;
    }

in my C code defined elsewhere. How do I get CodeGeneration to produce variable names like

    sname.smem1

?

The appoach to use the respective maple data type

  sname := Record('smem1', 'smem2'):
  CodeGeneration[C](sname);

results in

    Warning, procedure/module options ignored
    double smem1;
    double smem2;

and the appoach to define it as name

    CodeGeneration[C](`sname.smem1`);

results in

    Warning, the following variable name replacements were made: sname.smem1 -> cg0
    cg = cg0;

Your answer is appreciated

Fabian

hi everyone,
I wanna to solve this equation using maple 12 but I receive this warning message

cos(x)*cosh(x)=1

cos(x)*cosh(x)=-1

tan(x)=tanh(x)

thanks in advance

how to get maple to do linear algebra in Z_2 (integers modulo 2)

I don't want it to solve and then reduce mod 2 I want it to work over Z_2 so basis([ [1,1,1], [1,-1,1 ]) = [1,1,1]  etc


How do I check in maple if a series, is convergent or divergegent?

 

f:=((n-1)/2)/(1+((n-1)/2)^2);

 

is this function convergent or divergegent, and is it posible to decide only for odd n?

Greetings,

I need some help/advice because I think I am going crazy..!

I am trying to solve numerically a system of two PDE's. My initial condition is a gaussian and I apply cyclic boundaries.

With Maple 18 and pdsolve/numeric I am waiting a considerable amount of time and the result is a bell shaped travelling wave that increases its height over time. The clush between two such waves leaves them almost unaffected (the big pass through the small one).

 

With Mathematica 10 and NDSolve the waiting time is almost zero and the result (after few timesteps) is a shock wave travelling with steady height. Moreover, the clush between two of them is fully plastic (the big "eat" the small one)

 

I double-triple check the equations and the boundary conditions and I assure you that are the same..Any ideas what is hapening? Is there any way to check that the Maple results are correct?

Hi,

I just started to use Maple and I have a question if there exists in it an equivalent function to Mathematica's FindInstance? In general, I have an inequality and I would like to find few first solutions to it.

Hello,

In a worksheet, I don't know why the brackets like this "[" where normally I put my maple inputs and generally before the symbol ">" are not present (or displayed).

1) Are these brackets important for the computation of calculations in a worksheet ?

2) How can I do to display them again?

Thank you foryour help.

 

I am trying to integrate a very large matrix. In order to increase the speed I am using Grid[Map] to integrate the elements of the matrix in parallel. 

The only problem that I am having is that no matter what precision I set, it reduces to 10 digit when I use Grid[Map] package. This only happens if there are floating coefficients involved.

Let me show you by an example:

In the first example, I am not putting any coeffcients before the function:

Digits := 30;
Integrands := [seq(sin((1/10)*k*x), k = 1 .. 2^8)];
evalf(Grid[Map](int, Integrands, x = 0 .. Pi));

Here are the first 5 elements of the output: 
[0.489434837048464278835606666210,
0.954915028125262879488532914080,
1.374049159025089569437646817870,
1.727457514062631439744266457040,
2.000000000000000000000000000000,, ....]

as we see here the precision is 30 as we defined

 

Now let's run it again, but this time put a random 30 digit (or any other digits) coeficient before sin function :

Digits := 30; 
Integrands := [seq(1.000000000000000000000000000000*sin((1/10)*k*x), k = 1 .. 2^8)]; 
evalf(Grid[Map](int, Integrands, x = 0 .. Pi))

Now the first 5 elements of the output change to:

[.489434837000000000000000000000, 
.954915028100000000000000000000, 
1.374049159000000000000000000000, 
1.727457514000000000000000000000, 
2.000000000000000000000000000000,...]

 

It is visible that the precision changes to 10 numbers (not even 10 digits!)...It is really important for my problem to keep the calculation at least up to 30 digits...

Does anyone know why such a problem occurs? and how to solve it?

Thanks in advance...


Below is a Maple ws describing the problem. I have some fixed values pr0 and pr1, and a four variations of a function "pdf". The problem is that when I use the function in a sum (either the "sum" function or the sigma notation), the result is different than if I write out the sum explicitly. It's very puzzling as to why they woudl be different in the first place, but even more strange is that the different versions have *different* deltas. Even version 3, with a delta of 10^-100 is too much for my application (moreover the delta gets larger when I sum over more terms).

 

In the worksheet below, I compare "sum(f(x),x=3..3)" to "f(3)". I expect this should always be identically 0, but that is not true for any of the four versions of my function. (The same is true for "Sum(f(x),x=3..3)".) However, "sum(f(3),x=3..3)" *is* (blessedly) identically "f(3)". What gives?

restart

pr[0] := .499999999999999999999852096538403821434745813543502066245832554193147476551830440227306019620687012523264913799181385911651886999607086181640625:

pr[1] := .43394228095117646589504674154844928036961264935215813494922283329725383492977635163048065719014507668417797436877236805230495519936084747314453125:

pr0 := .499999999999999999999852096538403821434745813543502066245832554193147476551830440227306019620687012523264913799181385911651886999607086181640625:

pr1 := .43394228095117646589504674154844928036961264935215813494922283329725383492977635163048065719014507668417797436877236805230495519936084747314453125:

pdf1 := proc (x) local j, prob, y; prob := 1; y := x; for j from 0 to 1 do if `mod`(y, 2) = 1 then prob := prob*pr[j] else prob := prob*(1-pr[j]) end if; y := floor((1/2)*y) end do; return prob end proc:

Maple doesn't always like subscripted variables. Is that the problem?

pdf2 := proc (x) local prob, y; prob := 1; y := x; if `mod`(y, 2) = 1 then prob := prob*pr0 else prob := prob*(1-pr0) end if; y := floor((1/2)*y); if `mod`(y, 2) = 1 then prob := prob*pr1 else prob := prob*(1-pr1) end if; return prob end proc:

Maybe it's the binary expansion that's the issue

pdf3 := proc (arr) options operator, arrow; product(arr[2-j]*pr[j]+(1-arr[2-j])*(1-pr[j]), j = 0 .. 1) end proc:

No procedures, no arrays

pdf4 := proc (x) options operator, arrow; (`mod`(x, 2))*pr0+(1-(`mod`(x, 2)))*(1-pr0)+(`mod`(floor((1/2)*x), 2))*pr1+(1-(`mod`(floor((1/2)*x), 2)))*(1-pr1) end proc:

evalf[100](sum(pdf1(i), i = 3 .. 3)-pdf1(3));

0.660577190488235341051011619131468981956415371043397988049446125095986885183932081422133231891679108e-1

 

0.660577190488235341051011619131468981956415371043397988049446125095986885183932081422133231891679108e-1

 

0.

(1)

``

evalf[100](sum(pdf2(i), i = 3 .. 3)-pdf2(3));

0.660577190488235341051011619131468981956415371043397988049446125095986885183932081422133231891679108e-1

 

0.

(2)

evalf[100](sum(sum(pdf3([i1, i2]), i2 = 1 .. 1), i1 = 1 .. 1)-pdf3([1, 1]));

0.1e-99

 

0.

(3)

evalf[100](sum(pdf4(i), i = 3 .. 3)-pdf4(3));

-0.5916138463847142610167458259917350166697832274100937926782390907759215172519498e-21

 

0.

(4)

``

``

``

``

 

Download maple_bug.mw

I've used a data table component connected to an existing matrix that is updated running a loop.

However, the data table component is only refreshed after the loop, not within.

In the Data Table Properties, Enabled is on. 

What else can I do to update the table while running the loop?

I tried to use 

DocumentTools:-SetProperty("PerformanceTable", 'value', PM, 'refresh'=true);

but it doesn't seem to know 'value' as a property.

PM is the matrix it is connected to.

Hi,

a researcher at our department starts multiple Maple programs in parallel on our Linux servers.

Sometimes a high percentage of the resulting mserver processes hang. ps shows their state as

SNl (sleeping, multithreaded). strace to the processes shows that every one is waiting on a

futex without timeout. The problem occurs in versions 16 and 18. This is annoying.

 

Is there a fix for this?

 

Matthias Bauer

hi I am tying to create a matrix: 

 

for i from 1 to 5 do

for j from 1 to 5 do

 A[i][j]:=i+j;

od

od;

 

But it doesn't create a matrix. As when I tried inverse operation it doesn't work. How can I create a matrix? Also can the index start from 0??

thanks

sol := b*c+a*b
v := parametrization(sol, a, b, c, t);

First 1260 1261 1262 1263 1264 1265 1266 Last Page 1262 of 2429