jaytreiman

273 Reputation

12 Badges

20 years, 35 days

MaplePrimes Activity


These are answers submitted by jaytreiman

I downloaded the procedure and ran it.  Attached is a copy of my results.

It appears that you are calling decom from within decom where the first argument is decremented by 1 with each level of recursion.  This eventually leads to calling decom with a first argument of 0.

I got your error once and then got the error as demonstrated in the attachment with an added print command.

Does this help?

 

restart;

decom:=proc(n::posint,m::posint)
 local a,c,d::posint,e,f,i,j,k,l,s,t,u;s:=[];t:={};u:={};
 print(nops(decom(n-1, m)));
 if m=n then return [[1$m]];fi;
  for i from 1 to nops(decom(n-1,m)) do  
   a[i]:=op(i,decom(n-1,m));# a is a list
   c[i]:=[op({op(a[i])})];
   #d[i,j]:=coun(a[i],op(j,c[i]));#c:unrepeated numbers in a. d:number of repeatance
    for k from 1 to nops(c[i]) do
     e[i,k]:=aadd1(c[i],k);
     for l from 1 to nops(e[i,k]) do
       f[i,k,l]:=[op(l,e[i,k])$(coun(a[i],op(j,c[i])))];s[i,k]:=[op(s[i,k]),op(f[i,k,l])];
      od;
    u[i]:=u[i] union {s[i,k]};
    od;
   t:=t union s[i];
   od;
 return [t];
 end;

proc (n::posint, m::posint) local a, c, d::posint, e, f, i, j, k, l, s, t, u; s := []; t := {}; u := {}; print(nops(decom(n-1, m))); if m = n then return [[`$`(1, m)]] end if; for i to nops(decom(n-1, m)) do a[i] := op(i, decom(n-1, m)); c[i] := [op({op(a[i])})]; for k to nops(c[i]) do e[i, k] := aadd1(c[i], k); for l to nops(e[i, k]) do f[i, k, l] := [`$`(op(l, e[i, k]), coun(a[i], op(j, c[i])))]; s[i, k] := [op(s[i, k]), op(f[i, k, l])] end do; u[i] := `union`(u[i], {s[i, k]}) end do; t := `union`(t, s[i]) end do; return [t] end proc

(1)

decom(7,2);

Error, (in decom) invalid input: decom expects its 1st argument, n, to be of type posint, but received 0

 

 

 

Download rhenskyyy.mw

Try looking at the help for LinearAlgebra,LinearSolve (as suggested before) and LinearAlgebra,SubMatrix.  They should help.

In this case the conditions are that diff(wave,theta)=0 and diff(wave,phi)=0. when wave <> 0.  Solve those two equations to find the points.

Your problem is related to the seed for the pseudo-random number generator and the fact that a new instance of Maple is started each time you call maple.  Try the following idea to see if it helps.

$seed=range(1,1000000,1);

$A=maple("RandomTools:-SetState(state=$seed);LinearAlgebra:-RandomMatrix(2,2,generator=rand(-9..9))");

You will need a different seed for each random matrix.

After a lot of trial and error, mostly on the error side, the problem appears to be with the Java aplets and incompatiblities with open Java.  Uninstalling the open java that is part of standard linux distributions and installing Sun Java 1.6 for all uses causes most of the problems to disappear.

Jay Treiman

 

When I work with differential equations I use the following format for the DE,

diff(y(t),t) = x(t) + y(t) (1 - x(t)^2 - y(t)^2);

 

One can then substitute for x(t) and y(t) very easily with

eval(%,{x(t) = r(t)*cos(Theta(t)), y(t) = r(t)*sin(Theta(t)) });

 

Since you did not give the whole problem, I cannot go much further.

 

It can be done, if you know the form you want.  For example, try

a2 := op(eliminate({x=cos(v), y=sin(v)},{v})[2]);

solve(a2,{y^2});

 You get a nice warning message, but it works.

 

Is there a reason why you need the "usual" form?

 

Try the following format.  Notice that I have given "u" a value.

ode1:= diff(y(t),t$2)- 5*(1-(y(t)^2))*diff(y(t),t) + y(t)=0;
ics1:=y(0)=0.2, D(y)(0)=0;
dsolve({ode1,ics1},y(t),numeric);
 

To get the ellipse you can note that you are solving two equations in three unknowns.  Eliminating y gives you the equation of the ellipse.

The axis option in Maple 11 does what you want.  Since I do not have Maple 10 up on the machine I usually use, I do not know if it has what you want in Maple 10.  Maybe someone has 10 easily avaiable and can check.

From what I have seen, if you want to get different number or other random thing from Maple commands in MapleTA you need to use the

RandomTools:-SetState

command with a random seed from MapleTA.  For example, you could use something like the following:

 

$a=range(1000,10000000,1);

$b=maple("RandomTools:-SetState( state=($a));RandomTools:-Generate(polynom(nonnegint(range=10),x,degree=5);");

This generates random polynomials of degree 5 that are determined by the seed, $a.

Did you try

deq[i,XMethanol]

instead of

deq(i,XMethanol) ?

 

Your code gave me an answer of  "0, 0" with Maple 11on 64 bit Linux.  Which seems OK, but not perfect.

 

What version of Maple are you using?

The extra semicolons are from force of habit with Maple and the extra lines are put in by the MapleTA question editor.

 

Your understanding is the same as mine.  The $e is a Maple variable, with its formatting.  The $f is a MapleTA variable, with its formatting.

Can you generate the names using cat?

 

cat("file",i,".txt");

 

 

1 2 3 4 5 Page 3 of 5