Mason's Rule Solver
===================
Mason.m uses mason's rule to simplify signal flow graphs. It takes a
file describing the network and produces a symbolic equation relating
a dependent output node to an independent input node.
Mason's rule is traditionally used for control system analysis but has
applications in microwave circuit design, filter design and many other
areas.
Theory
------
This program crunches down a signal flow graph to generate a symbolic
equation for the equivalent phaser relating an output node and an input
node. For example:
```
1 s21 2
*------>------*------------.
| | |
| | |
s11 v ^ s22 v R2
| | |
| | |
*------<------*------------'
3 s12 4
```
There are four nodes 1,2,3 and 4, and there are 5 Coefficients S11,S21,
S12,S22 and R2. If we set node 1 as an independent input node, and choose
node 3 as a dependent node we get the following simplification:
```
1
a ---> *
|
| R2
v b/a= s11+s21* -------- *s12
| 1-s22*R2
|
b <--- *
3
```
If we set node 1 as the independent input node, and node 2 as the
dependent output node we get:
```
1 2
a ---> *------>------* ---> b
s21
b/a = --------
1-s22*R2
```
This program generates these equations for a given network and pair of nodes.
Specifying the Network
----------------------
A network description file is used to specify the topology of the
flow diagram. Each node is assigned a number, and each branch is
defined a coefficient number. Each branch is described as one line
in a file, defined as follows:
```[Coefficient #] [Start Node #] [Stop Node #] [Coefficient Name]```
The Coefficient numbers must be in order (starting at 1 not 0). For example,
to describe the following diagram (where coefficient numbers are in brackets),
```
1 (1) s21 2
*------>------*------------.
| | |
| | |
(4) s11 v ^ (2) s22 v (5) R2
| | |
| | |
*------<------*------------'
3 (3) s12 4
```
we can use this file (where the white space are tabs, but any white
space should suffice):
```
1 1 2 s21
2 4 2 s22
3 4 3 s12
4 1 3 s11
5 2 4 R2
```
This is saved as 'example.net' in this directory
The coefficient name can be any valid symbolic expression used in Maple. If
the expression has multiple terms then enclose them in brackets. For example:
```(-D*z^(-1)) or (1+B)```
Using the Program
-----------------
It is important that the lines in the net file be ordered so that the
coefficient numbers count from 1 up. Don't use 0 to number the coefficients
or nodes! Once you have made the net file, run 'mason.m' from Matlab, as
described below:
```
USAGE:
[Numerator,Denominator] = mason(Netfile,StartNode,StopNode)
Netfile - is a string with the name of the netfile to load
StartNode - is the integer number describing the independent input node
StopNode - is the integer number describing the dependent output node
Numerator - is a string containing the equation for the Numerator
Denominator - is a string containing the equation for the Denominator
Try out the example network! To recreate the above examples use:
[Numerator,Denominator] = mason('example.net',1,3)
[Numerator,Denominator] = mason('example.net',1,2)
```
File Details
------------
```mason.m``` -- the mason's rule function. Type help mason for arguments.
```example.net``` -- the example network described in the theory section.
About the program
-----------------
I have tested this program with many different networks, and used it
a lot in my research. However don't assume it is perfect! If you find
any bugs, or if you find this program useful, give me a shout.
Rob Walton --- 2000
Written at TRLabs, Calgary, Alberta, Canada.
Update from 2016
----------------
Original code is here:
http://www.mathworks.com/matlabcentral/fileexchange/22-mason-m .
Mathworks recently asked me to update the license file on this. While doing
this I thought I might put it up here on github where someone might find it
useful. It is not beautiful but seems to have withstood the tests of time.
(Only this readme file differs from the code on mathworks.)
没有合适的资源?快使用搜索试试~ 我知道了~
系统相图matlab代码-mason:在MATLAB中使用梅森法则简化信号流图
共4个文件
m:1个
txt:1个
net:1个
需积分: 46 5 下载量 166 浏览量
2021-06-08
08:15:12
上传
评论
收藏 9KB ZIP 举报
温馨提示
系统相图matlab代码梅森规则求解器 Mason.m 使用梅森法则来简化信号流图。 它需要一个描述网络的文件,并生成一个符号方程,将相关输出节点与独立输入节点相关联。 梅森法则传统上用于控制系统分析,但在微波电路设计、滤波器设计和许多其他领域都有应用。 理论 该程序分解信号流图以生成与输出节点和输入节点相关的等效移相器的符号方程。 例如: 1 s21 2 *------>------*------------. | | | | | | s11 v ^ s22 v R2 | | | | | | *------<------*------------' 3 s12 4 有四个节点1、2、3和4,有5个系数S11、S21、S12、S22和R2。 如果我们将节点 1 设置为独立输入节点,并选择节点 3 作为从属节点,我们得到以下简化: 1 a ---> * | | R2 v b/a= s11+s21* -------- *s12 | 1-s22*R2 | b <--- * 3 如果我们将节点 1 设置为独立输入节点,将节点 2 设置为从属输出节点,我们得到: 1 2 a ---> *----
资源详情
资源评论
资源推荐
收起资源包目录
mason-master.zip (4个子文件)
mason-master
license.txt 1KB
mason.m 17KB
example.net 52B
README.md 5KB
共 4 条
- 1
weixin_38581308
- 粉丝: 2
- 资源: 893
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0