Output a primitive file and a MATLAB file based on a network of primitive files
How to output a Primitive File or a Matlab file
 
Step 1: Circuit Variable to Primitive Argument mapping The variables in the model with be the arguments for the primitive file. Note that when you create the Mason file which will generate the new primitive, the variables must have TWO underscores in front of the variable names.
 
Step 2: Choosing components You can only use primitive components as part of the circuit no Touchstone components allowed.  
Step 3: Circuit primitive variables All circuit values need to be mapped to a unique variable name. More than likely, you will need to use the calculation blocks. Map the Ref Des of the circuit first before starting the calculation block. The values for each component's argument is the "RefDes" + an underscore + "original argument name". Note, that is THREE underscores, since the original argument name (such as __c) has two underscores already. So the argument "__c" for "SEC1" is "SEC1___c". One of the arguments for the Flat Wire Inductor whose Ref Des is "FWI2" is "__width"... so the argument is "FWI2___width".  
Step 4: Defining calculations Calculations map the Circuit's variable block / Primitives arguments to the device parameters. The calculations are derived from the circuit's variable block. Ultimately, the last values of the calculation block should follow the pattern described in Step 3: "RefDes" + "_" + "argument. Note below, "SEC1___C" and "FWI___2" are defined in teh calculation block.  
Step 5: Ports Ports must be 50ohms.  
Step 6: Things to Avoid Do not attempt to mix optimization or statistical analysis when making new primitives. Do not make (or use) primitives that use SParameters in the calculations.
