필터 지우기
필터 지우기

Effects of parameter on oscillatory behaviour.

조회 수: 1 (최근 30일)
James Marlom
James Marlom 2018년 3월 15일
댓글: Star Strider 2018년 3월 16일
How can I keep changing only Kc value (1 to 5) and using it in the Differential Equation.
if true
clc; clear all;
A=2; %Cross Sectional Area of the Tank [m^2]
Kc=1; %Proportional gain [m^2/min]
t1=0.1; %Integral Time Constant [min]
syms t y(t)
ode= A*diff(y,t,2)+Kc*diff(y,t,1)+(Kc/t1)*y==0;
Dy=diff(y);
cond1 = y(0) == 0;
cond2 = Dy(1e-10) == 2;
conds=[cond1 cond2];
sol=dsolve(ode,conds,t)
ezplot(sol,[0,20])
end

채택된 답변

Star Strider
Star Strider 2018년 3월 15일
Leave ‘Kc’ as a symbolic variable. Then you can vary it in your fsurf call:
A=2; %Cross Sectional Area of the Tank [m^2]
% Kc=1; %Proportional gain [m^2/min]
t1=0.1; %Integral Time Constant [min]
syms Kc t y(t)
ode= A*diff(y,t,2)+Kc*diff(y,t,1)+(Kc/t1)*y==0;
Dy=diff(y);
cond1 = y(0) == 0;
cond2 = Dy(1e-10) == 2;
conds=[cond1 cond2];
sol(t,Kc)= dsolve(ode,conds,t)
fsurf(sol,[0,20,1,5])
xlabel('t')
ylabel('Kc')
view(30,30)
  댓글 수: 2
James Marlom
James Marlom 2018년 3월 16일
Thank you
Star Strider
Star Strider 2018년 3월 16일
As always, my pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by