MaplePrimes Questions

Hello,

While doing some tests, we encountered an issue with LinearAlgebra[ConditionNumber], possibly caused by another routine in the LinearAlgebra package (MatrixInverse?). I include an example worksheet bug-maple.mw for easy testing.

To reproduce, you should start by creating this matrix:

restart;
with( LinearAlgebra ):
Digits := 50:
n := 4;
M := [ seq( cos( Pi*j/n ), j=0..n ) ];
V := VandermondeMatrix( M );

Now compute the condition number (infinity-norm) of V:

c1 := ConditionNumber(V);
c1 := simplify(%);
evalf(c1); # this gives exactly 40

We can still compute this exactly and get 40.

This is the same result as with linalg[cond]:

c2 := linalg[cond](V);
c2 := simplify(%);
evalf(c2);

Now increase the value of n to 5 and redo the test.
The exact result should be 120, but LinearAlgebra[ConditionNumber] gives the wrong result!
On the other hand, linalg[cond] gives the correct, exact result (after simplification).

n := 5; # this gives a wrong result :-(

We could use Norm(V) * Norm(Inv(v)) since this should be equal to the condition number.
But then it seems there's something bad inside the MatrixInverse routine.
Again, linalg[inverse] gives the correct, exact result.
So compare the two results:

n := 4;
simplify(MatrixInverse(V));
linalg[inverse](V);

Finally, to make matters even worse, ConditionNumber gives completely wrong results when using a float-matrix, while linalg[cond] does not:

n := 3;
V := VandermondeMatrix( evalf(M) );
c1 := ConditionNumber( V );
c2 := linalg[cond]( V );

For n=3, we get c1=10.6 and c2=16.
For n=4, we get c2=5 and c2=40.
For n=5, we get c1=68.07 and c2=119.999.

Is this what it looks like? With it being a really, really ugly bug?

-- Many thanks for your reply,

Franky

This is my code

 

am:=proc(dx,Nminus,Nplus)
global k_r,n,tau,a2,m;
k_r:=1/2;
a2:=a/2;
k=0;
u:=[]:
for n from Nminus to Nplus do
k:=k+1:
u(k):=max(exp((0.5*(k_r+1)^2)*0)*(exp(0.5*n*dx*(k_r+1))-exp(0.5*n*dx*(k_r-1))),0);
u:=[op(u),u(k)];
end do;
end proc;

 

I keep getting the error.

Error, (in am) invalid left hand side in assignment.

 

I would like to fill the array u with [u(1),u(2),...,u(Nplus-Nminus)]

 

Please help!

Dear friend,

Recently I noticed, that numerical integration returns different values for the same function.

For example the code

restart;
evalf(int((exp(x)*(4420*cos(4)*sin(4)-544*cos(4)^2+148147*exp(-1)-4225*cos(4)-215203)/(71825*exp(1)-71825*exp(-1))-exp(-x)*(4420*cos(4)*sin(4)-544*cos(4)^2+148147*exp(1)-4225*cos(4)-215203)/(71825*exp(1)-71825*exp(-1))+(32/4225)*cos(4*x)^2+(1/71825)*(4225+(2210*x-6630)*sin(4*x))*cos(4*x)+x^2+8434/4225)^2, x = 0 .. 1));

each time returns values

0.0005951015934
0.0005950850548
0.0005950974588
0.0005950960805
0.0005951297843 etc.

Maybe, evalf uses a stochastic algorithm for integration?

So I am trying to apply the Optimization function to a rather complicated problem I am currently working on, and having some trouble getting maple to cooporate. This is the part of the code that is giving me the error, with error included. All of the variables imputtet when calling OptimizeSpring are constants. If there is any other details I should add, please say so and I will add them promptly :) Thanks alot!
Maple problem

I suspect that it might be related to this suggestion, but I am not sure how to apply it http://www.mapleprimes.com/posts/95113-Optimization-Workaround-For-Operator-Form

Hey guys! Can anyone help me with solving one of these Differential Equations ?
Thanks.

!

[Here's the original Question, restored as best I could.--Carl Love]


restart; with(GroupTheory)

``

d := Perm([[1, 2, 3, 4, 5]]);

Perm([[1, 2, 3, 4, 5]])

 

Perm([[1, 3], [4, 6], [5, 7]])

(1)

G := PermutationGroup({d, e});

GroupTheory:-PermutationGroup({thismodule, object}, )

(2)

H := Elements(G):

"A:=select(H[i]->PermOrder(H[i])=4,i=1..nops(H));"

Error, invalid operator parameter name

"A:=select(H[i]->PermOrder(H[i])=4,i=1..nops(H));"

 

 

 

``

``


[The question was, of course, How to avoid the error?--Carl Love]

Download subgrouplattice_(1).mw

Hi

how to say 

i from 1 to 4 in maple

for example

if I have this eqauation

and I need to sub i in this equation to get 4 equation

Many thank

I'm trying to solve a beam vibration problem. I am relatively new to Maple and trying to solve PDE's. I feel like I'm pretty close, but I don't understand what's wrong here.

This is my maple file.

Thesis_Pde2_attempt.mw

as a note, I made some simplifying assumptions. I am just using part of this equation since it is less complex. And my boundary conditions are simply supported on both ends so no displacement and no 2nd derivative at the ends.

 

Any help would be greatly appreciated!!

Hi!

I have a problem recently with running RootFinding:-Isolate inside a procedure which is run on threads. I have many polynomial systems to treat so I would like to balance computations between cores. Unfortunately, my code always breaks computation kernel with the error:

java.lang.NullPointerException

at com.maplesoft.mathdoc.model.WmiModelLock.acquireLock(Unknown Source)
at com.maplesoft.mathdoc.model.WmiModelLock.writeLock(Unknown Source)
at com.maplesoft.worksheet.connection.WmiOutputUpdateBuffer$UpdateSynchronizer.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

 

I wrote a small example below

f:=proc(n)

   local i;

   for i from 1 to n do
    try

      RootFinding:-Isolate([a^2+b^2-1/3c^2,a^2-1/3b^2+c^2-1/3,a^2-1/3b^2-1/3c^2+1],[a,b,c]):

   catch "":
     next:
   end try:
  end do:
end proc:

Threads:-Task:-Start ( null, Task[f,10000], Task[f,10000], Task[f,10000]);

 

I have no much of experiences with threads in Maple so I would not be surprise if I'm trying to do something completely wrong here. Any hint or advice will be appreciate. 

hi,

 

having some issue using the codegeneration function in maple. I have a script written in Maple that I would like to do in Python 2.7. I knew to maple and not sure if my syntax is incorrect or if the program doesnt support the conversion, as an example,

 

q[Fick] := proc (t) options operator, arrow; -hm0(t)*(ps(T[C5](t))-p[inf]) end proceq2 := m[C5](t)*Cp[C5l](T[C5](t))*(diff(T[C5](t), t)) = q[heat](t)

 

thanks

Hello,

I would like to plot an non coupled non linear oscillator.

The equations are the following:

K:=Matrix([<0, -1, 1, -1>,<-1, 0, -1, 1>,<-1, 1, 0,-1>,<1, -1, -1,0>]);
omega[sw]:=beta/(1-beta)*omega[s];
for i to 4
do
r[i]:=sqrt((u[i](t)/(L/2))^2+(v[i](t)/H)^2):
omega[i]:=omega[st]/(1+exp(b*v[i](t)))+omega[sw]/(1+exp(-b*v[i](t))):
Equ[i]:=diff(u[i](t),t)=Au*(1-r[i]^2)*u[i](t)+omega[i]*(L/2)/H*v[i](t):
Eqv[i]:=diff(v[i](t),t)=Av*(1-r[i]^2)*v[i]+omega[i]*(L/2)/H*v[i](t)+MatrixVectorMultiply(K,<seq(v[i](t),i=1..4)>)[i]:
EqSys[i]:=[Equ[i],Eqv[i]]:
end do:

My parameters are the following:

paramsGeo:=L=0.015,H=0.015,beta=0.5,Vf=0.3;
omegaS:=eval(Pi*Vf/L, [paramsGeo]);
paramsCycle:=omega[s]=omegaS,Au=1,Av=1,b=100;
params:=paramsGeo,paramsCycle;

I'm not sure with my initial equations. But, may be it is possible to start with:

ic:=[u[1](0)=0.8, v[1](0)=0,u[2](0)=0.8, v[2](0)=0,u[3](0)=0.8, v[3](0)=0,u[4](0)=0.8, v[4](0)=0];

For these equations, I would like to obtain the following plots:
- plot 1: horizontal axis : u[1](t) vertical axis : v[1](t).
- plot 2: horizontal axis : u[2](t) vertical axis : v[2](t).
- plot 3: horizontal axis : u[3](t) vertical axis : v[3](t).
- plot 4: horizontal axis : u[4](t) vertical axis : v[4](t).
- plot 5: horizontal axis : t, vertical axis : v[1](t), v[2](t), v[3](t), v[4](t).

For this last plot, I would like to obtain this kind of curve:

I image that since my equations are coupled i can not use directly use Deplot function but Dsolve.

May you help me for defining a good syntax for solving my system and then deducing the following plots?

Thanks a lot for your help

guys,

how can i compute a tensorial term ( dAlembertian ,..) in anholonomic frame ?

 

On.mw

thanks in advance

Hello,

I would like to know how to do the following. If I received a plot of a graph, but I did not know it function, how could I get an accurate value for its maximum and minum points? Any help is greatly appreciated! Thank you in advance!

Kind regards,

Gambia Man

Hello everyone, 

I have some problems with the "isolve" command on Maple. I am trying to solve for integer a very easy system of equations. When I type the commands

 

restart; 

n := 2;
isolve({sum(a[k], k = 1 .. n)-1 = 1}, d)


I get the expected {a[1] = 2-d, a[2] = d}. However, if I add conditions a[1],a[2] >= 0, that is the commands



restart;
n := 2;
isolve({ge(a[1], 0), ge(a[2], 0), sum(a[k], k = 1 .. n)-1 = 1}, d)


I get the warning "Warning, solutions may have been lost". What am I doing wrong? Is there a way to get Maple to give me the possible values?

 

Thank you in advance,

David

I'm trying to solve a system of equations thats expressed as a summation (the original has the summation symbol as opposed to 'sum'):

d_actual := solve(W_actual = sum(W_guess(def-asp_rad_inverse[i], E, asp_rad[i]), i = 1 .. n), def);

When n<5, I get an answer after a few seconds, but when n is higher, the program sits and 'evaluates' forever...I've waited up to 30 min. 

Background:

I have a plate with a number of hemispheres on the surface (# of impacted hemispheres given a force = n). Each has a unique radius and they're listed from largest to smallest in 'asp_rad[]'. I have an equation for the deflection of a single hemisphere as a function of Force and material properties that I have rearranged with respect to Force (W_guess(deflection, E, r)). There's an opposing plate that stays parallel to the original plate while pushing down on the asperities with Force W_actual. The total deflection of the opposing plate is the sum of: 1) the difference between the tallest radius and the impacted radius in question (asp_rad_inverse[]), and 2) the deflection of the impacted radius in question. 

I'm attempting to solve for the total deflection of the opposing plate via solving for the 'def' in the summation above, but when I run it, the program is not able to compute a solution.

Thanks in advance.

First 1192 1193 1194 1195 1196 1197 1198 Last Page 1194 of 2428