Joe Riel

9660 Reputation

23 Badges

20 years, 2 days

MaplePrimes Activity


These are replies submitted by Joe Riel

How is s^ to be interpreted?  It would be helpful if you wrote the expressions using Maple syntax.

@Frankoldstudent My questions don't seem to apply to your situation, but I'll explain. Standard Maple (the GUI interface) can be configured to use separate Maple kernels for each worksheet, or to a share a common kernel.  I always use separate kernels. Sharing a kernel means assignments in one worksheet can be seen in another.  I thought that might have been what you are doing, but now doubt it.  It appears that your goal is to easily recreate a particular setup: selected worksheets open to particular sections with the state of them restored. I don't know whether that is doable; I don't use worksheets in that fashion.

A Maple archive is a file (with extension mla, short for Maple library archive) that stores Maple assignments, generally modules and procedures. It's how the Maple code library is distributed.  You can create and use your own archives to reuse procedures, however, that doesn't appear to be your interest.

@tomleslie Note, further, that
 

type(x^2*y,  `&*`(identical(x)^2, name));
                              true

 

Try

Solve("file://c:\\load_imp_calc.cir", ... );

There is a bug in Syrup's handling of the .inc statement; it doesn't ignore the first line of the included file. If you edited the included .cir file to remove that first line the original should work.  I need to investigate how this should be handled.  Alternatively, and probably better, insert an asterisk as the first character of the first line of any include files; that will ensure they are comments and are ignored.
 

@jrive Not quite sure about your methodology. Note that the differential equations are third order.  Regardless, you should be using -1/(omega*C1) as the reactance of capacitor C1, not 1/(omega*j*C1).  Reactance is the imaginary part of impedance, it doesn't include the imaginary unit as a factor.

@jrive Did you go through the example worksheet that is included with Syrup.  Look for help page Syrup,Examples.

So far as understanding specific Maple commands, that takes some study and help page reading.  Here I'll explain what they do.  Given

Ckt := [v1(4), R1(50) &+ L2(0.9600), Cp(0.8200), L1(0.5000) &+ R2(0.2000), RL(1.3430) &+ LL(0.1550)]:

we want to generate a set of equations that specify the parameters, {v1 = 4, R1 = 50, ... }.  To do that I first used the indets command, which returns a set of the indeterminates in the given expression (Ckt) of the specified type, here function(numeric), meaning a function with numeric arguments.  That returns a set,

indets(Ckt,'function(numeric)');
   {Cp(0.8200), L1(0.5000), L2(0.9600), LL(0.1550), R1(50), R2(0.2000), RL(1.3430), v1(4)}

It might appear as though I could have used the simpler type function, to match any function, however, that doesn't work because, for example,  R1(50) &+ L2(0.9600) is actually internally represented as a function call and is only displayed in operator form.

The map(f -> op(0,f) = op(f), ... ) call applies that function to each element of the set. The op(0,f) expression is the function name of the function, e.g. op(0, R1(50)) evaluates to R1.  The op(f) expression is the arguments of the function, e.g. op(R1(50)) evaluates to 50.  Together the function converts R1(50) to the equation R1 = 50.   So we get a set mapping the element names to their corresponding values.

The subsindets function is sort of like the indets function, but instead of returning a set of matches, it applies a given transformation, the third argument, to all the matching types in the expression (Ckt).  In this case, every function call, R1(50), is replaced with the symbol of the function, R1.

@jrive I'm copying from command-line maple, which is "type-set" with a fixed-width font, so results are a bit ugly but readable. 

I'll look into adding a command to the Syrup package to return a set of equations for the defined parameter values. Will post here (on MaplePrimes) if and when it is uploaded.

@dharr MapleSim would not be applicable for this.

Concerning your final comment about the "zero or more occurences" phrase in the help page type,structure, the asterisk refers to the usage in the formal definitions in that help page, i.e. to the right of the `::='.  For example, the very first rule is "type ::= {type*}"; that means that zero or more occurrences of any type in a set construct is a type; the comment to the right describes it as the alternation type, meaning it matches any of the types in the set.  My point is that this refers to the formal definitions only; there is no implication that there is a zero or more occurrence operator for type matching. 

@mmcdara An example (input and output) of what you want is frequently helpful. You gave the input, but the precise output was unclear to me.

@tomleslie I think you are missing a "not" from your first sentence.  While SPICE netlist notation is fairly easy to write, given a schematic, the opposite is not the case. I've wasted too many hours, as an electrical engineer, attempting to verify or otherwise debug a given netlist.  The advantage of the ladder notation is that, with the Draw procedure, one can easily verify that it is correct. Of course, there are schematic capture tools that will produce a useful netlist from a nicer schematic. But for the small circuits that are usefully analyzed symbolically, I prefer the simplicity of the ladder notation.  I might be biased 8-).

@jrive A few points.  For reasons unknown, there is a space between the with and (Syrup), which 2D math interpreted as multiplication.  Removing the space fixed that. Similarly with the other with.  I avoid 2D math for this and other reasons.

I'm assuming you want to do an ac analysis (which is the default for the Syrup:-Solve procedure).  As such, you don't want to assign the value of the voltage source as a function of t (2*sin(2*Pi*f*t).  Instead assign it to 1.  Or use 2, but scale the result. 

To get the result for a given node, say node 6, use

vnode6 := subs(sol, v[6]):

To plot the transfer function from the driving source (with amplitude 1), you can use DynamicSystems.
 

tf := TransferFunction(vnode6):
BodePlot(tf);

 

A sidenote.  There should be double quotes around the file names.

@jrive What version of Maple and O/S do you have?  Just to clarify, those commands work only when executed in that particular worksheet (actually a Maple book) from the Maple Cloud.  From any recent Maple you should be able to do

PackageTools:-Install(6271537930305536,'overwrite'=true):

Let me know if you have problems and I'll investigate.

@dharr A downside of that approach is that it doesn't work properly if foo is saved to a Maple archive.  The procedure actually contains ST, not StringTools, so a subsequent evaluation, in a different session or following a restart, won't work unless ST is reassigned.  For example
 

(**) restart;
(**) ST:=StringTools:
(**) foo := proc(s) ST:-UpperCase(s); end proc:
(**) savelib(foo,"foo.mla"):
(**) restart;
(**) libname := "foo.mla",libname:
(**) foo("a");
Error, (in foo) `ST` does not evaluate to a module

 

First 7 8 9 10 11 12 13 Last Page 9 of 195