# 简单的一阶系统¶

$\dot{x} = (1-x)$

model FirstOrder
Real x;
equation
der(x) = 1-x;
end FirstOrder;


der(x) = (1-x)


$\dot{x} = (1-x)$

## 添加文档¶

model FirstOrderDocumented "A simple first order differential equation"
Real x "State variable";
equation
der(x) = 1-x "Drives value of x toward 1.0";
end FirstOrderDocumented;


## 初始化¶

model FirstOrderInitial "First order equation with initial value"
Real x "State variable";
initial equation
x = 2 "Used before simulation to compute initial values";
equation
der(x) = 1-x "Drives value of x toward 1.0";
end FirstOrderInitial;


FirstOrderInitial模型展示了初始化系统的典型方式：为系统状态提供明确的初始值。事实上，没有确定初始条件的微分方程组并不完整。FirstOrderInitial模型可以用数学方程表示如下：

$\dot{x} = (1-x);\; x(0) = 2$

model FirstOrderSteady
"First order equation with steady state initial condition"
Real x "State variable";
initial equation
der(x) = 0 "Initialize the system in steady state";
equation
der(x) = 1-x "Drives value of x toward 1.0";


## 试验条件¶

model FirstOrderExperiment "Defining experimental conditions"
Real x "State variable";
initial equation
x = 2 "Used before simulation to compute initial values";
equation
der(x) = 1-x "Drives value of x toward 1.0";
annotation(experiment(StartTime=0,StopTime=8));
end FirstOrderExperiment;