What is claimed is:
1. A method performed by a processor for control and co-simulation in a system comprising a plurality of subsystems, each subsystem representing a physical system, the method comprising:
in a first subsystem simulating a first physical system, providing a first time continuous output signal representing a property of the first physical system;
filtering the output signal using a continuous moving average filter as an anti-aliasing filter to form a filtered time continuous signal, wherein filtering the output signal comprises;
integrating the time continuous signal to form an integrated signal,
sampling the integrated signal,
for each sample, forming an average value from the current sample S 0 and a previous sample S 0−n , where n>0, divided by total sample time h*n, where h is sample period, and
forming a filtered time continuous signal from the average values; and
providing the filtered time continuous signal to a second subsystem simulating a second physical system.
2. The method according to claim 1 wherein n=2.
3. The method according to claim 1 wherein the first time continuous output signal represents a flow of the first subsystem.
4. The method according to claim 1 wherein each of the plurality of subsystems is characterized by a flow and an effort.
5. The method according to claim 1 wherein the first subsystem represents a first physical system having a higher impedance than the second physical system.
6. The method according to claim 1 further comprising, in the second subsystem:
receiving the filtered time continuous signal from the first subsystem;
simulating a behavior of the second physical system based on the received signal;
providing a second time continuous output signal representing a property of the second subsystem;
filtering the second output signal using a continuous moving average filter as an anti-aliasing filter to form a second filtered time continuous signal; wherein filtering the output signal comprises:
integrating the second time continuous signal to form an integrated signal;
sampling the integrated signal;
for each sample, forming an average value from the current sample S 0 and a previous sample S 0−n , where n>0, divided by the total sample time h*n, where h is the sample period;
forming a second filtered time continuous signal from the average values; and
providing the second filtered time continuous signal to the first subsystem.
7. The method according to claim 6 wherein, if the first physical system has a higher impedance than the second physical system, the first output signal represents a flow and the second output signal represents an effort.
8. The method according to claim 6 wherein, if the first physical system has a lower impedance than the second physical system, the first output signal represents an effort and the second output signal represents a flow.
9. A method performed by a processor for control and co-simulation in a system comprising a plurality of subsystems, each subsystem representing a physical system, the method comprising:
in a first subsystem simulating a first physical system, providing a first time discrete output signal representing a property of the first physical system, the first discrete output signal having a first sample rate;
filtering the output signal using a continuous moving average filter as an anti-aliasing filter to form a filtered time continuous signal, wherein filtering the output signal comprises
summing the time discrete signal to form a summed signal,
sampling the summed signal using a second sample rate lower than the first sample rate,
for each sample, forming an average value from the current sample S 0 and previous samples S −1 . . . S −(n+1) , where n>0, divided by total number of samples n, and
forming a filtered time discrete signal from the average values; and
providing the filtered time continuous signal to a second subsystem simulating a second physical system.
10. The method according to claim 9 wherein n is equal to the ratio between the first sample rate and the second sample rate.
11. The method according to claim 10 wherein the first sampling rate is a variable sampling rate.
12. A control and co-simulation system comprising a plurality of subsystems, each subsystem representing a physical system, the co-simulation system implemented in a processor and comprising:
a first subsystem simulating a first physical system and configured to provide a time continuous output signal representing a velocity or a torque of the first physical system;
an anti-aliasing filter connectable to an output of the first subsystem and configured to form a filtered time continuous signal, wherein the anti-aliasing filter comprises:
an integrator configured to integrate the time continuous signal to form an integrated signal,
a sampling module configured to continuously sample the integrated signal, and
an averaging module configured to form an average value for each sample from the current sample S 0 and a previous sample S 0−n , where n>0, divided by total sample time h*n, where h is sample period;
an output module configured to form a time continuous output signal from the average values formed by the averaging module; and
a second subsystem simulating a second physical system, the second subsystem connectable to the anti-aliasing filter to receive the filtered time continuous signal.
13. The system according to claim 12 wherein, if the first physical system has a higher impedance than the second physical system, the first output signal represents a flow and the second output signal represents an effort, and if the first physical system has a lower impedance than the second physical system, the first output signal represents an effort and the second output signal represents a flow.
14. The system according to claim 12 wherein, if the first physical system has a higher inertia than the second physical system, the first output signal represents a velocity and the second output signal represents a torque, and if the first physical system has a lower inertia than the second physical system, the first output signal represents a torque and the second output signal represents a velocity.