emendes

395 Reputation

6 Badges

7 years, 101 days

MaplePrimes Activity


These are questions asked by emendes

Hello

Since this is my first attempt to use plots[animate], please forgive if my question is silly.  

I want to use plots[animate] with RootLocusPlot to show the effect of variable.   Here is my attempt.

num:=10*(s+alpha);den:=s*(s^2+4*s+8);
plots[animate](RootLocusPlot,[NewSystem(subs(alpha=a,num/den))],a=1..10);

Of course, when issuing the commands, an error comes out:  

Error, (in plots/animate) symbolic value(s) in model: a
 

  • Although I could define sys using NewSystem with a symbolic value, alpha, I have no idea how to assign a value for alpha.  subs(alpha=2,..) does not seem to work.
  • If I remove the square brackets in the second argument of plots[animate], a different msg comes out.  Why do I need (or not) them? 

Many thanks.

 

Hello

I am trying to reproduce a simple result from Linear Control Theory using Laplace Transform.  Here are the steps:

assume(omega>0);assume(zeta>0 and zeta<1);
tf:=omega^2/(s^2+2*zeta*omega*s+omega^2);
y:=tf*1/s;
yt:=inttrans:-invlaplace(y,s,t);
dyt:=diff(yt,t);

So far, so good.  Now I need to find the values of t (time) such that the dyt=0.  

 

solve(dyt=0,t);

but Maple returns only the trivial solution, that is, zero.   How can I find the next one (Tp - peak time = Pi/(omega*sqrt(1-zetaˆ2)))?  

 

Many thanks

 

Hello

Although I have read the help file on how to use try-catch commands, I am not sure how they work exactly.  Here is an example of how I used them. (It is just a pseudocode).

myrout:=proc(arg1,arg2,arg3,args4,arg5)
try 
   .....
   timelimit(...)
   if condition then 
      ....
   else 
      timelimit(...)
      .....
   end if:
catch "time expired":
    return([a,b,c,d]):
finally
    .......
end try:
return([res1,res2]):
end proc:

Questions:

1) Does catch catch "time expired" from both calls of timelimit?  

2) Will the set of sequences under finally be executed when a "time expired" is caught? Somehow reading the help file i had the impression that it will.  If that is the case, how can it be avoided?  

 

Many thanks

Ed

Hello

Since my solutions are neither efficient nor concise, I wonder if someone could help me with the following problem. Suppose

 

L:=[[[],[],3,2,1,4],[1,4,[],5,8,[]],[5,6,7,8,[],1]]:

(Just a short and simplified version - L is a huge list). I need the elements to be rearranged as follows

newL:=[[1,5],[4,6],[3,7],[2,5,8],[1,8],[4,1]]:

that is, the first sublist of newL contains the first elements of all sublists of L without [], the second sublist of newL contains the second elements of all sublists of L without [] and so on.  

How can that be achieved without seq and remove?

Many thanks

Ed

PS. My solution 

newL:=[seq(remove(y->y=[],map(x->x[i],L)),i=1..nops(L[1]))]

The size of the sublists does not change.  

Hello

I need to check if the solution (sols) of a (nonlinear) polynomial system of equations (the coefficients are not numeric) has only one solution for, let's say, y and (one solution for y and one solution for z).  I cannot use allvalues (not threadsafe according to CodeTools:-ThreadSafetyCheck) and then count the number of solutions. 

I have removed all solutions that fit the command 

ormap(x->x=true,map(has,rhs~(op~(sols)),_Z))

(RootOf works too).  (Please tell me if I am using ormap correctly).  

Even using the above command and then checking if nops(sols)=1, not all one solutions are caught.  

Many thanks

Ed

 

 

 

 

2 3 4 5 6 7 8 Last Page 4 of 13