- Документация
- Запустите программное обеспечение Simulink
- Запустите программное обеспечение MATLAB
- Сконфигурируйте MATLAB , чтобы запустить Simulink
- Откройте редактор Simulink
- Совет
- Откройте браузер библиотеки
- Примечание
- Связанные примеры
- Больше о
- Не работает Simulink, нужна помощь.
- Автоматический запуск Simulink из Matlab
- Рекомендуемые записи
- Добавить комментарий Отменить ответ
- feedback
- Syntax
- Description
- Examples
- Plant and Controller with Unit Feedback
- Plant with Controller in Negative Feedback Path
- Positive Feedback Loop with Plant and Controller
- Negative Feedback Loop with MIMO Systems
- Feedback Loop Based on I/O Names
- Specify Input and Output Connections in a Feedback Loop
- Input Arguments
- sys1,sys2 — Systems to connect in a feedback loop dynamic system models
- feedin — Subset of inputs to be used vector
- feedout — Subset of outputs to be used vector
- sign — Type of feedback -1 (default) | +1
- Output Arguments
- sys — Closed-loop system dynamic system model
- Limitations
Документация
Запустите программное обеспечение Simulink
Чтобы создать модели, используйте Редактор Simulink ® и Браузер Библиотеки.
Запустите программное обеспечение MATLAB
Прежде чем вы запустите Simulink, запустите MATLAB ® . См. Запуск и завершение работы (MATLAB).
Сконфигурируйте MATLAB , чтобы запустить Simulink
Первая модель, которую вы открываете в сеансе работы с MATLAB, занимает больше времени, чтобы открыться, чем последующие модели, потому что по умолчанию MATLAB запускает Simulink при открытии первой модели. Этот своевременный запуск Simulink уменьшает время запуска MATLAB и избегает ненужного использования системной памяти.
Чтобы ускорить открытие первой модели, можно сконфигурировать запуск MATLAB, чтобы также запустить Simulink. Чтобы запустить Simulink без вводных моделей или Браузера Библиотеки, используйте start_simulink .
В зависимости от того, как вы запускаете MATLAB, используете команду:
В startup.m MATLAB файл
В командной строке операционной системы, с matlab команда и -r переключатель
Например, чтобы запустить Simulink, когда MATLAB запустится на компьютере, запускающем операционную систему Microsoft ® Windows ® , создайте настольный ярлык с этой целью:
На Macintosh и компьютерах Linux ® , используйте эту команду, чтобы запустить Simulink, когда вы запустите MATLAB:
Откройте редактор Simulink
Чтобы открыть Редактор Simulink, вы можете:
Создайте модель. На вкладке MATLAB Home нажмите Simulink и выберите шаблон модели.
В качестве альтернативы, если вы уже имеете открытый Браузер Библиотеки, нажимаете кнопку New Model . Для дополнительных способов создать модель, смотрите, Создают Модель.
Откройте существующую модель. Чтобы открыть недавние модели, на вкладке MATLAB Home, нажимают Simulink.
В качестве альтернативы, если вы знаете имя модели, вы хотите, в командной строке MATLAB, вводите имя, такое как vdp . Для дополнительных способов открыть модель, смотрите Открытый Модель.
Совет
Редактор Simulink открывается сверх рабочего стола MATLAB.
Откройте браузер библиотеки
Используйте любой из этих методов, чтобы открыть Браузер Библиотеки Simulink из MATLAB:
На вкладке Home нажмите Simulink и выберите шаблон модели. В новой модели нажмите кнопку Library Browser .
В командной строке введите slLibraryBrowser .
Браузер Библиотеки открывает и отображает структурный вид библиотек блока Simulink по вашей системе. Когда вы кликаете по библиотекам в дереве, содержимое библиотеки появляется на правой панели.
Примечание
Simulink идет с библиотеками блоков в дополнение к Библиотеке Simulink. Эта поддержка библиотек, симулирующая предоставленные модели в качестве примера, которые содержат блоки из тех библиотек. Однако можно сгенерировать код или изменить эти блоки только с лицензиями соответствующего продукта.
Связанные примеры
Больше о
Документация Simulink
Поддержка
© 1994-2019 The MathWorks, Inc.
1. Если смысл перевода понятен, то лучше оставьте как есть и не придирайтесь к словам, синонимам и тому подобному. О вкусах не спорим.
2. Не дополняйте перевод комментариями “от себя”. В исправлении не должно появляться дополнительных смыслов и комментариев, отсутствующих в оригинале. Такие правки не получится интегрировать в алгоритме автоматического перевода.
3. Сохраняйте структуру оригинального текста — например, не разбивайте одно предложение на два.
4. Не имеет смысла однотипное исправление перевода какого-то термина во всех предложениях. Исправляйте только в одном месте. Когда Вашу правку одобрят, это исправление будет алгоритмически распространено и на другие части документации.
5. По иным вопросам, например если надо исправить заблокированное для перевода слово, обратитесь к редакторам через форму технической поддержки.
Источник
Не работает Simulink, нужна помощь.
Помогите ПОЖАЛУЙСТА. Срочно нужно моделировать в Simulink, а тут такое. Уже года 3 им не пользовался а сейчас диплом пишу и нужно моделировать. Установилось все нормально.
При запуске MatLab на экране в командном окне вот это:
Warning: C:\Program Files\MATLAB\R2011a\toolbox\local\pathdef.m not found.
Toolbox Path Cache is not being used. Type ‘help toolbox_path_cache’ for more info
Undefined function or variable ‘ispc’.
Warning: MATLAB did not appear to successfully set the search path. To recover for this session of MATLAB, type «restoredefaultpath;matlabrc». To find out how to avoid this warning the next time you start MATLAB, type «docsearch problem path» after recovering for this session.
Warning: Duplicate directory name: C:\Program Files\MATLAB\R2011a\toolbox\local.
Warning: Initializing Handle Graphics failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup,
which should be resolved as soon as possible. Error detected was:
MATLAB:UndefinedFunction
Undefined function or variable ‘ispc’.
Warning: Initializing Java preferences failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup,
which should be resolved as soon as possible. Error detected was:
MATLAB:UndefinedFunction
Undefined function or method ‘usejava’ for input arguments of type ‘char’.
> In matlabrc at 123
Warning: Failed to add default profiler filters.
> In matlabrc at 179
А это после запуска Simulink:
Warning: Undefined function or method ‘slwsprmattrib’ for input arguments of type ‘char’.
Undefined function or variable ‘slcustomize’.
. Undefined function or variable ‘libbrowse2’.
Simulink не работает. Из Matlab перестает выходить.
Нужна помощь. Кто может сказать в чем дело чего не хватает? Ибо я плохо понимаю.
Добавлено через 1 час 32 минуты
команда: ‘restoredefaultpath;matlabrc’ помогает, но каждый раз вводить это не дело, да и вообщем это же не нормально.
Помощь в написании контрольных, курсовых и дипломных работ здесь.
Источник
Автоматический запуск Simulink из Matlab
Использование современных программных средств, таких как Matlab/Simulink, позволяет существенно упростить анализ различных сложных систем. Скрипты Matlab позволяют в автоматическом режиме запускать схемы Simulink с изменением различных параметров.
Пройдите наш онлайн-курс по MATLAB/SIMULINK. Там вы научитесь пользоваться MATLAB как мощным калькулятором, создавать свои модели в SIMULINK, моделировать электрические цепи, а также сложные электроэнергетические системы с устройствами релейной защиты.
Такая задача может появиться, к примеру, при построении амплитудно-частотной характеристики (АЧХ) некоторого фильтра. Если фильтр достаточно сложный, то его аналитическое описание не всегда представляется возможным. В таком случае прибегают к численным методам анализа.
Simulink позволяет представить рассматриваемый фильтр в виде совокупности элементов, из которого он состоит, и сымитировать его работу при подаче на него определённого входного сигнала, например, напряжения.
Известно, что АЧХ представляет собой характеристику, описывающую амплитуду выходного сигнала в зависимости от входного при различных частотах. То есть для её построения необходимо изменять частоту входного сигнала при неизменной амплитуде и измерять амплитуду выходного сигнала. Это итерационная процедура, которая может быть автоматизирована.
Рассмотрим простейший фильтр, представленный на рис. 1. Параметры фильтра R = 1 Ом, L = 10 мГн, C = 400 мкФ.
Рис. 1. Исследуемый фильтр
Для построения АЧХ необходимо при известной амплитуде входного напряжения Uвх измерять амплитуду выходного напряжения Uвых при различных частотах входного напряжения и формировать замер
Для этого в Simulink собрана схема, представленная на рис. 2. Сама модель в Simulink: circuit.mdl.
Рис. 2. Схема в Simulink для построения АЧХ фильтра
Таким образом, схему по рис. 2 необходимо прогонять определённое число раз, при этом изменяя частоту источника ЭДС и измеряя выходное напряжение с помощью вольтметра Voltage. Для этого воспользуемся следующим скриптом Matlab (сам скрип вы можете скачать: simulink_start.m):
Для автоматического задания параметров элементов модели в Simulink в Matlab используется функция set_ param . Для запуска моделирования используется функция sim . После окончания работы скрипта формируется АЧХ, представленная на рис. 3.
Рис. 3. АЧХ исследуемого фильтра
Итак, в статье представлен пример использования запуска модели в Simulink с помощью скрипта в Matlab для построения АЧХ фильтра.
Рекомендуемые записи
Using modern software tools, such as Matlab / Simulink, can significantly simplify the analysis of…
The Matlab / Simulink software package allows you to simulate not only electrical networks, but…
Программный комплекс Matlab/Simulink позволяет моделировать не только электрические сети, но и многое другое, в том…
Добавить комментарий Отменить ответ
Для отправки комментария вам необходимо авторизоваться.
Этот сайт использует Akismet для борьбы со спамом. Узнайте, как обрабатываются ваши данные комментариев.
Источник
feedback
Feedback connection of multiple models
Syntax
Description
sys = feedback( sys1,sys2 ) returns a model object sys for the negative feedback interconnection of model objects sys1,sys2 .
From the figure, the closed-loop model sys has u as input vector and y as output vector. Both models, sys1 and sys2 , must either be continuous or discrete with identical sample times.
sys = feedback( sys1,sys2 , feedin , feedout ) computes a closed-loop model sys using the input and output connections specified using feedin and feedout . Use this syntax when you want to connect only a subset of the available I/Os of MIMO systems.
sys = feedback( sys1,sys2 ,’name’) computes a closed-loop model sys with the feedback connections specified by the respective I/O names of MIMO models sys1 and sys2 . Use the ‘name’ flag only when all the required I/Os in the set of MIMO systems are properly named.
sys = feedback( ___ , sign ) returns a model object sys for a feedback loop with the type of feedback specified by sign . By default, feedback assumes negative feedback and is equivalent to feedback(sys1,sys2,-1) . To compute the closed-loop system with positive feedback, use sign = +1 .
Examples
Plant and Controller with Unit Feedback
pendulumModelAndController.mat contains a SISO inverted pendulum transfer function model G and its associated PID controller C .
Load the inverted pendulum and controller model to the workspace.
Use feedback to create the negative feedback loop with G and C .
sys is the resultant closed loop continuous-time transfer function obtained using negative feedback. feedback converts the PID controller model C to a transfer function before connecting it to the continuous-time transfer function model G . For more information, see Rules That Determine Model Type.
Plant with Controller in Negative Feedback Path
For this example, consider two transfer functions that describe a plant G and controller C respectively.
G ( s ) = 2 s 2 + 5 s + 1 s 2 + 2 s + 3 C ( s ) = 5 ( s + 2 ) s + 1 0
Create the plant and controller transfer functions.
Use feedback to create the negative feedback loop using G and C .
sys is the resultant closed loop transfer function obtained using negative feedback with torque as the input and velocity as the output.
Positive Feedback Loop with Plant and Controller
For this example, consider two transfer functions that describe a plant G and controller C respectively.
G ( s ) = 2 s 2 + 5 s + 1 s 2 + 2 s + 3 C ( s ) = 5 ( s + 2 ) s + 1 0
Create the plant and controller transfer functions.
Use feedback to create the positive feedback loop using G and C .
sys is the resultant closed loop transfer function obtained using positive feedback with torque as the input and velocity as the output.
Negative Feedback Loop with MIMO Systems
Based on the figure below, consider connecting two MIMO transfer functions with two inputs and two outputs in a negative feedback loop.
For this example, create two random continuous state-space models using rss .
Use feedback to connect the two state-space models in a negative feedback loop according to the above figure.
The resulting state-space model sys is a 2 input, 2 output model with 6 states. The negative feedback loop is completed such that,
The first output of G is connected to the first input of C
The second output of G is connected to the second input of C
Feedback Loop Based on I/O Names
mimoPlantAndController.mat contains a 2 input, 2 output transfer function plant model G and a 2 input, 2 output transfer function controller model C to be connected as follows:
First, load the plant and controller models to the workspace.
By default, feedback would connect the first output of G to the first input of C and the second output of G to the second input of C . In order to connect the plant and controller according to the figure, name the respective I/Os of the two systems to ensure the correct connections.
Then use the ‘name’ flag with the feedback command to make the connections according to the I/O names.
The resulting closed loop negative feedback transfer function sys has the feedback connections in the required order.
Specify Input and Output Connections in a Feedback Loop
Consider a state-space plant G with five inputs and four outputs and a state-space feedback controller K with three inputs and two outputs. The outputs 1, 3, and 4 of the plant G must be connected the controller K inputs, and the controller outputs to inputs 2 and 4 of the plant.
For this example, generate randomized continuous-time state-space models using rss for both G and K .
Define the feedout and feedin vectors based on the inputs and outputs to be connected in a feedback loop.
sys is the resultant closed loop state-space model obtained by connecting the specified inputs and outputs of G and K .
Input Arguments
sys1,sys2 — Systems to connect in a feedback loop
dynamic system models
Systems to connect in a feedback loop, specified as dynamic system models. Dynamic systems that you can use include:
Continuous-time or discrete-time numeric LTI models such as tf , zpk , pid , pidstd , or ss models.
Frequency response models such as frd or genfrd .
Generalized or uncertain LTI models such as genss or uss (Robust Control Toolbox) models. (Using uncertain models requires Robust Control Toolbox™ software.)
The resulting feedback loop assumes
current values of the tunable components for tunable control design blocks.
nominal model values for uncertain control design blocks.
When sys1 and sys2 are two different model types, feedback uses precedence rules to determine the resulting model sys . For example, when a state-space model and a transfer function is connected in a feedback loop, the resulting system is a state-space model based on the precedence rules. For more information, see Rules That Determine Model Type.
feedin — Subset of inputs to be used
vector
Subset of inputs to be used, specified as a vector.
From the figure, feedin contains indices of the input vector of MIMO plant P and specifies which subset of inputs u are involved in the feedback loop. The resulting model sys has the same inputs as G , with their orders preserved.
feedout — Subset of outputs to be used
vector
Subset of outputs to be used, specified as a vector.
feedout specifies which outputs of MIMO plant G are used for feedback. The resulting model sys has the same outputs as G , with their orders preserved.
sign — Type of feedback
-1 (default) | +1
Type of feedback, specified as -1 for negative feedback or +1 for positive feedback. feedback assumes negative feedback by default.
Output Arguments
sys — Closed-loop system
dynamic system model
Closed-loop system, returned as a SISO, or MIMO dynamic system model. sys can be one of the following depending on the precedence rules:
Continuous-time or discrete-time numeric LTI models, such as tf , zpk , ss , pid , or pidstd models.
Generalized or uncertain LTI models such as genss or uss (Robust Control Toolbox) models. (Using uncertain models requires Robust Control Toolbox software.)
When sys1 and sys2 are two different model types, feedback uses precedence rules to determine the resulting model sys . For example, when a state-space model and a transfer function is connected in a feedback loop, the resulting system is a state-space model based on the precedence rules outlined in Rules That Determine Model Type.
Limitations
The feedback connection must be free of algebraic loops. For instance, if D1 and D2 are the feedthrough matrices of sys1 and sys2 , this condition is equivalent to:
I + D1D2 nonsingular when using negative feedback
I − D1D2 nonsingular when using positive feedback
For complicated feedback structures, use append and connect .
Источник