Joe Riel

9575 Reputation

23 Badges

19 years, 52 days

MaplePrimes Activity


These are replies submitted by Joe Riel

@Thomas Dean Interesting.  I can reproduce the issue here.  Have probably never attempted a plot using the maple interface from emacs. Will look into it when I get some time.

What have you tried?  You can post a worksheet here; use the green up-arrow when responding.  The DynamicSystems package has commands that can simulate a linear state-space system with constant matrices.

@Preben Alsholm Thanks. Had to stare at that and the original for a while to spot the difference.  Should have just pasted into Maple.

@acer A named procedure might be easier to remember than the knowledge that the sequence of local variables is the second operand of a Maple procedure expression.  On the other hand, I know where to look for the info and probably won't recall a new procedure name.

Am trying to figure out what your sure suggests.  Maybe that the returned sequence would also include any type declarations that should probably be elided.  For example,

foo := proc() local k :: integer; k; end proc:
op(2, eval(foo));
                              k::integer

 

@charlie_fcl That error message is a concern; it shouldn't be displaying %1 but the subset of global variables that Syrup uses (i, v, s, and t) that are assigned. Strange.

@TX My point is that switch1 is doing effectively nothing.  You can short it out and the operation of the circuit is precisely the same (other than the voltage across the current source, which isn't an issue). Another way to think about this is that an ideal current source has infinite impedance; adding a switch in series with it has no effect, the current just keeps flowing.

@rcorless They (procname and thisproc) should behave the same in a compiled procedure, I believe.  I originally missed the part where you used procname.

A trivial solution is to use only one one-ohm resistor.

@C_R Note that I used %piecewise rather than piecewise to expression the conditional. The former is an inert version of the latter, it avoids

piecewise(b, 1, 2);
Error, (in PiecewiseTools:-Is) wrong kind of parameters in piecewise 

That could be worked around by using

piecewise(b=true, 1, 2);

but generally it is easier to use the inert version.

While there isn't a way to directly use if-statements, because Maple doesn't have inert if-statements, there is an undocumented way to handle this. Here's a somewhat more general example that illustrates the idea

eq := [`msim/IF`(b1, [x(t)=sin(t), y(t)=t], b2, [x(t)=cos(t),y(t)=1], [x(t)=0, y(t)=0])];

The generated modelica equations are
 

    if b1 then 
        x = sin(time);
        y = time;
    elseif b2 then 
        x = cos(time);
        y = 1;
    else 
        x = 0;
        y = 0;
    end if;

 

@awass Note that convert/integer isn't a documented Maple conversion.  What is happening is that it is doing, essentially,
 

proc(expr)
     ... 
   if expr :: indexable then
        map(thisproc, expr);
   end if;
  ...
end proc:  

Because a string is indexable, the call to map is executed.  Mapping a function over a string just applies the function to the string, so this leads to an infinite recursion.  The code should probably be modified, but the input (a string) is unexpected.

@AHSAN You could zip it, then upload it. 

@nm I know little about the Maple 2D parser.  With that in mind, the conversion you are hoping for will likely never exist, at least not from an ascii file containing the characters used to generate the 2D math. It could be made to work for a limited subset, in particular the use of primes (apostrophes) to indicate differentiation with respect to x.  That's because, for that particular case, the typed text looks pretty much the same as the 2D output.  That isn't the case with other expressions (say fractions or powers).

@C_R Clicking the icon you highlighted enables/disables the appearance of the warning dialog.  With it disabled you won't be warned, but can still select the connection to choose which vector element to connect to.

@TX I had no problem connecting the output of N1 to the input of N2.  Does the green dot flash when hovering over the input to N2?  Can you connect the output of N2 to its input? What version of MapleSim do you have?

@TX Could you upload the msim file with the components you cannot connect?

4 5 6 7 8 9 10 Last Page 6 of 195