Joe Riel

9660 Reputation

23 Badges

20 years, 3 days

MaplePrimes Activity


These are answers submitted by Joe Riel

If a is a list or set, a[] is equivalent to op(a), which returns the expression sequence of the list/set, that is, it removes the brackets/braces.

Followup

That doesn't really answer your question about why this works. If you consider that, for single integers i, and L a list or set, op(i,L) = L[i], then a reasonable extension, when i = NULL, is that op(NULL,L) = L[NULL], which is evaluates to op(L) = L[]. The equality fails, however, when i is a range, or list of integers. There is no reason they should be the same for all types of i; it is better to have different, useful, behavior for the two notations.

Note that when i is a list of integers, op returns an element at a specified depth, while, say, L[[3,2,2]] returns a list consisting of [L[3],L[2],L[2]]. That notation, using a list containing a list as the index, is useful for generating a permutation or other arrangement of list, set, expression sequence, or Vector.

 Note that after the for loop, jj is assigned M+1. I'm not sure that is the issue, you didn't provide enough input.

The $ operator is old and mostly deprecated, replaced by seq, which has more useful evaluation rules. An exception is as a repetition operator, for example, x $ 5 evaluates to x,x,x,x,x, where the x is not evaluated. For iterations it is generally better to use seq. 

PDETools[dchange] can be used for this task. You may or may not want to pass it the 'known' parameter, which determines how the functions w and phi are handled. As an example

 

 

PDETools:-dchange({x=X*l,t=T/(k/h)},eq,[X,T],params=[l,k,h]);
PDETools:-dchange({x=X*l,t=T/(k/h)},eq,[X,T],params=[l,k,h],known={phi,w});

There are a few ways you can do that.  The simplest is to click the !!! icon on the toolbar; doing so executes all the input regions in the worksheet.  Another way is to set the input region in which the assignment is located to autoexecute by putting the cursor on the assignment and clicking Format --> Autoexecute --> Set. Another approach, more applicable when assigning a procedure used in the worksheet, is to put the assignment in the startup code region. Do so by clicking the Edit startup code icon on the toolbar, then inserting the assignment in the code edit region that appears, then saving it.

Hard to say without seeing the model.  Note that MapleSim includes an example of a simple bridge rectifier, look in Examples --> Physical Domains --> Electrical --> Diode Bridge Rectifier

Take a look at Examples --> Electrical --> Simple DC Motor with Backlash.  It uses a PI controller to control the speed of a simple motor.

The presence of the x1(t) in the derivative prevents coeff from returning what you want.  You can use ?frontend for this,

frontend(coeff, [E,x1(t)]);
                 3*k

 

I have a fix and will email it to the poster.  There was an invalid character. I'll update my procedure to handle it.

It works if you use tty Maple (cmaple) rather than Standard Maple to generate the plots.  

You could linearize the equations at a point and then compute the laplace transform of that.  See the help page for DynamicSystems,Linearize.

an := 1/2/Pi*int(x^2*cos(n*x),x=-Pi..Pi) assuming n :: integer;
bn := 1/2/Pi*int(x^2*sin(n*x),x=-Pi..Pi) assuming n :: integer;
a0 := 1/2/Pi*int(x^2*cos(0*x),x=-Pi..Pi);
a0 + sum(an,n=1..infinity);

The following works, but I'm questioning its efficiency. I don't have any better ideas at the moment.

list_minus := proc(L,E)
local R;
    R := Array(E);
    remove(proc(e)
           local p;
               if member(e,R,'p') then
                   R[p] := NULL;
                   true;
               else
                   false;
               end if;
           end proc, L);
end proc:

list_minus([1,2,4,6,2,1,3,6,2],[7,4,2,5,2]) = [1,6,1,3,6,2];

A more compact, but essentially equivalent, implementation is

list_minus := proc(L,E)
local R,p;
    R := Array(E);
    remove( e -> member(e,R,'p') and assign('R[p]') = NULL, L);
end proc:

 

It would be helpful if you posted a model of interest.  One approach is to use the Linearization template to create a linearized model, then use the LinearAnalysis template to inspect its poles.  

Is this for documentation?  Or do you expect to evaluate the expression in Maple? For documentation you can, in a text region, type C-r to enter inert math, type sum, then use completion (C-shift-space on Linux, not sure otherwise), select the summation symbol with over/under scripts, enter k >= 0 and k <> p in the underscript and the summand in its place.

First 28 29 30 31 32 33 34 Last Page 30 of 114