Joe Riel

9660 Reputation

23 Badges

20 years, 1 days

MaplePrimes Activity


These are replies submitted by Joe Riel

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?

@nm Did you try

stoperror(traperror["module does not export"]);

which can typically be reduced to, say,

stoperror(traperror["module"]);

A minor correction.  % is assigned the last computed expression, not the last entry. You want to reinsert the last input, as a new input. Command line maple has access to the history, but not Standard.  A slightly more general operation would a short-cut that selected the input in an execution group.  You can select the execution group using Ctrl-Alt-Shift-E, but that also includes the output.

@yalda_amd It runs fine here.  Am thinking the issue is with your installation.  Maybe something is corrupted.  Contact Maplesoft support.

Could you upload the msim file.  Just reply and use the big green arrow (at this site).

It's probably not a bad idea to write-protect the DirectSearch.mla (after installing a new one) to prevent that from recurring. Of course, I've never bothered.  Have occasionally written to the wrong mla and wondered why subsequent restarts aren't doing what I expect.

How did you create the custom library?  From modelica source?  If you'd like you can upload here or email me the modelica and I can take a look.  What version of MapleSim do you have?

@Carl Love Oops.  Thanks.  Fixed it and added a condition to return true if both lists are empty.

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