Clear Filters
Clear Filters

How to Simulate Nonlinear Model Discrete Time?

1 view (last 30 days)
This is My Nonlinear Model
function [PositionN, VelocityN, TorqueN] = traindiscretemodel(u,Tim_step,Position,Velocity,Torque,Mass,Ca_0,Ca_1,Ca_2,Tao,R,Eta)
% Train Model
PositionN = Position + Velocity*Tim_step;
VelocityN = Velocity + 1/Mass *(Eta*Torque/R - (Ca_0 + Ca_1*Velocity + Ca_2*Velocity^2))*Tim_step;
TorqueN = Torque - 1/Tao*Torque*Tim_step + 1/Tao*u*Tim_step;
end
This is parameters i used
clc;clear;close all;
Eta = 0.96;
% Parameter Massa
Mass = [8095;8500;8457;8500;8443;8396;8491];
Tim_step = 0.01;
R = [0.290736184319659;0.295289596853781;0.256349340814675;0.295668792806951;0.281617962311270;0.254877020249970;0.263924910943352];
Tao = [0.744417105917954;0.771737581122686;0.538096044888052;0.774012756841706;0.689707773867623;0.529262121499823;0.583549465660115];
Torquebound = [-3297.53650110286,3297.53650110286;-3517.25332991404,3517.25332991404;-1805.63954664794,1805.63954664794;-3535.78455981619,3535.78455981619;-2873.13552926226,2873.13552926226;-1748.36142518872,1748.36142518872;-2108.92205347325,2108.92205347325];
% Parameter Resistansi
Ca_0 = [5.2;5.2;5.2;5.2;5.2;5.2;5.2;];
Ca_1 = [0.038;0.038;0.038;0.038;0.038;0.038;0.038;];
Ca_2 = [0.00112;0.00112;0.00112;0.00112;0.00112;0.00112;0.00112;];
v0 = 20;
cd('G:\Ivan\Semester 10\Tugas Akhir II\matlab\Train Model Open Loop');
save parametersvalue.mat
with that discrete time model and parameters i used, I want simulated the model open loop. Can i used ode45?

Answers (0)

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!