Docsity

Nonlinear Dynamic simualtion on Matlab examples, Exercises of Engineering

Toggle sidebar
bg1
Home Work 1 Advanced Process Dynamics and Control Hilal AlQuabeh 100048067
15-Sep-2019
%% HW1_P1
% Please predict the dynamics of nonlinear Chua’s Circuit
% Hilal AlQuabeh
%% SOlve using ODE45
clear all;
clc;
s= [0;1;0]; %Steady state vector
ti=0; %Inital integration time
tf=100; %Final integration time
[t,v]=ode45('chua',[ti tf],s);
%% Plot the results
figure
plot(t,v(:,1))
xlabel('Time (s)');
ylabel('V(1)');
title('Dynamic Response of V(1)')
figure
plot(t,v(:,2))
xlabel('Time (s)');
ylabel('V(2)');
title('Dynamic Response of V(2)')
figure
plot(v(:,1),v(:,2),s(1),s(2),'o')
xlabel('V(1)');
ylabel('V(2)');
title('Phase Portrait of V(1)~V(2)')
pf3
pf4
pf5

Partial preview of the text

Download Nonlinear Dynamic simualtion on Matlab examples and more Exercises Engineering in PDF only on Docsity!

%% HW1_P

% Please predict the dynamics of nonlinear Chua’s Circuit % Hilal AlQuabeh %% SOlve using ODE clear all; clc;

s= [0;1;0]; %Steady state vector ti=0; %Inital integration time tf=100; %Final integration time [t,v]=ode45('chua',[ti tf],s); %% Plot the results figure plot(t,v(:,1)) xlabel('Time (s)'); ylabel('V(1)'); title('Dynamic Response of V(1)')

figure plot(t,v(:,2)) xlabel('Time (s)'); ylabel('V(2)'); title('Dynamic Response of V(2)')

figure plot(v(:,1),v(:,2),s(1),s(2),'o') xlabel('V(1)'); ylabel('V(2)'); title('Phase Portrait of V(1)~V(2)')

function f=Chua(t,v) %Constants R=10/7; C1=1/9; C2=1; L=1/7; Gb=-0.5; Ga=-4.5; E=1; d=45; %g(v1) gV1 = Gbv(1) + 0.5(Ga-Gb)*(abs(v(1)+E)-abs(v(1)-E));

f(1)=(((v(2)-v(1))/R)-gV1)(1/C1); f(2)= (v(1)-v(2))/R-v(3)(1/C2); f(3)= v(2)/L; f=[f(1);f(2);f(3)];

The corresponding results are plotted as shown on next page;

%% HW1_P

% Please plot the dynamic responses of the nonlinear boiler-turbine unit to a stepwise change of 0.3 insteam valve u2. % Hilal AlQuabeh clc; clear; close all % Inputs u1=[0.34;0.34]; u2=[0.69;0.99]; u3=[0.435;0.435]; u=[u1 u2 u3]; % Inital Vector x0=[108 66.65 428.0]; %% Before stepping 0 to 700 seconds [t1,X1]=ode45(@boiler,[0:1:700],x0,[],u(1,:));

p1=X1(:,1); po1=X1(:,2); rhof1=X1(:,3);

alfa1=(1-0.001538.rhof1).(0.8.p1-25.6)./(rhof1.(1.0394- 0.0012304.p1)); qe1=(0.854u(1,2)-0.147).p1+45.59u(1,1)-2.514u(1,3)-2.096; xw1=0.05(0.13073.rhof1+100.alfa1+qe1./9-67.975);

%% After stepping 700 to 1400 seconds y0=X1(end,: ); %take the state 1 as initial value of state 2 [t2,X2]=ode45(@boiler,[700:1:1400],y0,[],u(2,:));