I have a question for the pump experts.
I have two pumps in parallel, connected in modelica to pressure sources as boundaries, in such a way that both pumps are connected downstream to the same sink, but they have separate volume sources.
The control strategy is as follows. One pump turns on, whilst the other is off, and after 90 seconds, with a filter and smooth ramp, like in a three ways valve, the second pump starts to spin on, and the first one is shut down.
My question in fact is, why if power and torque signals in the pumps go down or up to or from zero, then the speed in both pumps is not zero, in any of the cases, either when pump 1 is on and 2 off and vice versa? There is a sort of drag or resistance that pulls the pump and makes it spin even though there is not load or torque demand?
Looking forward to your answer.
Victor
Related
I've been playing with solar system simulation lately using Barnes-Hut algorithm to speed things up.
Now simulation works fine when feed with our solar system data, but I'd like to test it on something bigger.
Now, I tried to generate 500+ random bodies, and even add initial orbital motion around center of gravity - but every time after short time while most of the bodies end up ejected far away into space.
Are there any methods to generate random sets of planets/stars for simulations like this that will remain relatively stable ?
You should probably ask this question on the Physics or Mathematics stackexchange.
I think this is a very difficult question, to the point that great mathematicians have studied the stability of the solar system. Things are "easy" for the two body problem, but the three body problem is notorious for its chaotic behavior (Poincare studied it carefully and in the process laid out the fundament of the qualitative theory of dynamical systems). If I am not mistaken (feel free to check this online), instability of orbital dynamics of large number of bodies (large meaning three or more) is a condition, whose probability of occurrence is very high. Meanwhile, coming across stable configurations has a vary low probability.
Now, for so called integrable systems ("exactly solvable"),
like n copies of decoupled sun-one-planed models of a solar/star system, small perturbations are more likely to yield stable dynamics, due to the Kolmogorov-Arnold-Moser's theorem. So I can say that it is more likely for you to come across stability, if you first set up the bodies in your simulation to be comparatively small gravity sources orbiting one significantly larger gravitational source. Each body has one dominating force from the large source and many much smaller perturbations from the rest of the bodies (or the averaged sources of your Barnes-Hut algorithm). If you consider only the dominating force, and turn off the perturbations, you would have a solar system with n decoupled two-body systems (each body following elliptical motion around a common gravitational center). If you turn on the perturbations, this dynamics changes, but it tends to deviate from the unperturbed one very slowly, and is more likely to be stable. So start with highly ordered dynamics and start changing slightly the body's masses and their positions and velocities. You could follow how the dynamics changes when you alter the parameters and the initial conditions.
One more thing, it is always a good idea to place the inertial coordinate system, with respect to which the positions and the velocities of the bodies are represented, in the center of mass of the group of bodies. This is more or less guaranteed when the initial momenta sum up to the zero vector. This set up yields the center of mass of the system is always fixed at some point in space, so a simple translation will move it to the origin of the coordinate system.
What is the added value of simscape physical signals compared to normal simulink signals? As far as I can see, from a functional perspective there is no difference between the two types of signals: I can add units to both types, they both have a direction of flow, and they both have similar function blocks like adding, substracting... Only for physical signals the available types of blocks is very limited. Why didn't the matlab guys just use normal simulink lines instead of the physical signals?
Physical signals, unlike Simulink signals, have units associated with them. This means that they follow a number of rules, for example to ensure that the right unit is used (e.g. you can't add kg and m/s). From the documentation:
Using the Physical Signal Ports
The following rules apply to Physical Signal ports:
You can connect Physical Signal ports to other Physical Signal ports with regular connection lines, similar to Simulink signal
connections. These connection lines carry physical signals between
Simscape blocks.
You can connect Physical Signal ports to Simulink ports through special converter blocks. Use the Simulink-PS Converter block to
connect Simulink outports to Physical Signal inports. Use the
PS-Simulink Converter block to connect Physical Signal outports to
Simulink inports.
Physical Signals can have units associated with them. Simscape block dialogs let you specify the units along with the parameter
values, where appropriate. Use the converter blocks to associate units
with an input signal and to specify the desired output signal units.
Any sensor block in Simscape (in whatever physical domain) will output a physical signal. You can then convert it into a normal Simulink for feed to your controller. Similarly, any source block in Simscape (in whatever physical domain) will take a physical signal as input.
I suggest you just read the Simscape product page
In particular,
Simscape components represent physical elements, such as pumps, motors, and op-amps. Lines in your model that connect these components correspond to physical connections in the real system that transmit power.
Accompanying that description is the following image, which shows how Simscape models can be far more intuitive to build than a model which uses standard signal. This means models are far more maintainable and clearer to, for example, engineers who may not have a comp-sci background.
Let's delve into what a "physical connection" is somewhat.
[Simscape] employs the Physical Network approach, which differs from the standard Simulink modeling approach and is particularly suited to simulating systems that consist of real physical components.
[ ... ]
Each system is represented as consisting of functional elements that interact with each other by exchanging energy through their ports.
You stated in your question that both methods have a flow direction. This is wrong!
Simscape blocks try and balance the energy between the inlet(s) and outlet(s). For instance a fixed orifice in a fluid system may have high pressure on one side. Simscape will try and solve the pressure balance each iteration. You would need some custom Simulink subsystem to achieve this if not for Simscape.
What is the added value of simscape physical signals compared to normal simulink signals?
What is it that you think Simscape physical signals provide? Is it one number? How do you solve a mass-spring-damper system with just position? It's position AND it's speed AND it's acceleration.
I can add units to both types
No you can't. You put whatever you want in Simulink. You don't get to choose anything about what's in the physical signal in Simscape. You can specify units in the blocks that the signals connect, but you don't get to pick what the pipe itself is carrying.
they both have a direction of flow
No they don't. Your head and your torso are connected. There's no directionality to this. They're just connected. The physical signal is likewise just showing that (things) are physically connected. Again, the mass-spring-damper system: If the damper points to the mass, and the spring points to the mass, then is there any possibility that the damper could affect the spring? Yes, of course. The damper affects the spring because the damper affects the mass and the mass affects the spring.
The spring affects the mass, and the mass affects the spring. The signal is bidirectional. You're confusing signal directionality with kinematic chains.
they both have similar function blocks like adding, substracting
If you're on a train that's going 30 mph, and you're walking forward at 3 mph, how fast are you going relative to the world frame? What if you're walking backward? There is a physical meaning in adding and subtracting physical signals.
[For] physical signals the available types of [function blocks are] very limited
What is it that you're thinking they're missing? Can you also provide a description of what the physical meaning of that function block would be?
Why didn't the matlab guys just use normal simulink lines instead of the physical signals?
Because they're not the same. The biggest point is probably that Simscape is signal + derivative + second derivative, but again they're just conceptually different. Simulink is an easy way to write code - do this step, move along the arrow, do the next step, etc. Simscape is a pictorial representation of a physical system. The physical signal lines just show that things are connected. The system gets solved simultaneously.
I don't think it's mainly about the enforcement of physical signal units, nice though this is.
I think it's about the solver - and before it gets to the solver, about the choice of states and equation causality - rearranging the equations ready to be solved.
Simulink doesn't have any truck with this and just gets straight on with integrating signals as a succession of samples. I know it gets complicated with variable step solvers, but they are only doing extra fancy numerical analysis with the sampled data. Integration and the here-and-now is what it's all about!
Simscape just starts with a bucket of variables and a bucket of equations that variously depend on said variables. A 'bipartite graph', I believe they call it.
Just as we have to navigate a route through simultaneous equations to pick off the simple ones and substitute (or the matrix equivalents of this) Simscape has to do likewise in software so wants to keep alive augmented info on signals like which equations they are in and whether it knows or can easily obtain their derivatives, what they are, etc. Physical signals behave for us users just like Simulink signals, but I reckon they are there to provide the valuable service to Simscape of keeping this augmented info alive and linked between blocks so that one massive matrix equation can be formed for the whole system, not separate ones that get sampled as Simulink systems between Simulink blocks.
This rearrangement of equations ready for the more conventional solver getting stuck in is a black art indeed! We learn very little of how Simscape does it from the MathWorks docs, but you can install OpenModelica for free and see how that does it.
I am new to neural nets, and am creating a LSTM from scratch. I have the forward propagation working...but I have a few questions about the moving pieces in forward propagation in the context of a trained model, back propagation, and memory management.
So, right now, when I run forward propagation, I stack the new columns, f_t, i_t, C_t, h_t, etc on their corresponding arrays as I accumulate previous positions for the bptt gradient calculations.
My question is 4 part:
1) How far back in time do I need to back propagate in order to retain reasonably long-term memories? (memory stretching back 20-40 time steps is probably what I need for my system (although I could benefit from a much longer time period--that is just the minimum for decent performance--and I'm only shooting for the minimum right now, so I can get it working)
2) Once I consider my model "trained," is there any reason for me to keep more than the 2 time-steps I need to calculate the next C and h values? (where C_t is the Cell state, and h_t is the final output of the LSTM net) in which case I would need multiple versions of the forward propagation function
3) If I have limited time series data on which to train, and I want to train my model, will the performance of my model converge as I train it on the training data over and over (as versus oscillate around some maximal average performance)? And will it converge if I implement dropout?
4) How many components of the gradient do I need to consider? When I calculate the gradient of the various matrices, I get a primary contribution at time step t, and secondary contributions from time step t-1 (and the calculation recurses all the way back to t=0)? (in other words: does the primary contribution dominate the gradient calculation--will the slope change due to the secondary components enough to warrant implementing the recursion as I back propagate time steps...)
As you have observed, it depends on the dependencies in the data. But LSTM can learn to learn longer term dependencies even though we back propagate only a few time steps if we do not reset the cell and hidden states.
No. Given c_t and h_t, you can determine c and h for the next time step. Since you don't need to back propagate, you can throw away c_t (and even h_t if you are just interested in the final LSTM output)
You might converge if you start over fitting. Using Dropout will definitely help avoiding that, especially along with early stopping.
There will be 2 components of gradient for h_t - one for current output and one from the next time step. Once you add the both, you won't have to worry about any other components
I currently work in an experimental rock mechanics lab, and when I conduct an experiment, I record the output signals such as effective torque, normal force and motor velocity. However, the latter quantity causes significant cross-talk over the recorded channels, and I want to filter this out. Let me give an example:
Here the upper plot is the strong signal (motor velocity), and the lower is an idle signal that is affected by the cross-talk (blue is raw signal, red is median filtered). The idle channel is only recording noise. We see three effects here. When the motor voltage changes:
the amplitude of the noise increases
the idle signal's median shifts
there is a spike that lasts approximately 0.1 seconds
If we zoom in on the first spike that occurs at around 115 seconds, we get the following plot. This does not seem to be your typical delta-function type of spike, but rather some kind of electronic "echo".
I have seen much work on blind source separation through independent component analysis (ICA), but that did not prove to be effective in my situation. However, since I know the shape of the signal that is causing the cross-talk, there may be better ways to include this information. My question is this: is there a filter or a combination of filters that can tackle the effects mentioned above?
As I am a geologist and not an electrician or mathematician, I don't have a proper background for this kind of material, so please bear with me. I write Python, MATLAB and C++ quite well, so suggested algorithms written in any of those languages is preferred (but not required).
The crosstalk you encounter, results from a parasitic transmission line. Just think of your typical FM-receiver - where the wires equal the antennae. These effects include parasitic and inductive coupling, and form an oscillator (which is the reason, why you cannot see, the theoretically ideal delta spike)
I recognize two different approaches:
use a hardware filtering circuit
use a software-implemented filter
ad 1:
depending on the needed bandwith (maximum frequency/rate of change) on the idle channel, you can determine the corner frequency, as well as the required filter-order, for a given rate of suppression
ad 2:
you can implement several types of filters (IIF, FIR) which resemble these circuits.
Additionally, if you are measuring the aggressive signal anyways, you can use the measurement on the idle channel to determine system-parameters for a mathematical model of the crosstalk. With this model you'd be able, to exclude the interference by calculation
I am currently working on my project quadrotor. I am using ADXL335 accelerometer and L3G4200D gyroscope interfaced with an atemga 128. When I check reading from accelerometer without running motors, values are accurate and stable. But when I start motors, values start to fluctuate. The more I increase the speed the more they fluctuate. I tried Kalman filter, the results seem same just less fluctuating but still not enough for a stable flight. My gyroscope readings also give too much drift. Is this suppose to happen or am I doing something wrong.
It is quite difficult to help you as "fluctuations" can be caused by several things.
Just checked out the datasheet of the ADXL335 accelerometer. Have you added the bandwidth limiting capasitors on the output Cx,Cy and CZ. If not, they might help you in reducing the fluctuations.
Another thing that might cause your fluctuations interference from the motor cables to the signal cables.
If you havent used screened/shielded cables for the accelerometer change them and make sure that you try to reduce whatever interference you might find.
You might find some hints for how to do good emc design Here
From your statement, I would assume that the motors would be causing the interference. The way I see it, it could be caused one of two ways:
The PCB was custom designed, houses both power electronics and the sensitive measurement units and not enough care was taken to isolate the sensitive parts from the interference generated on the board.
The magnetic field from the motors are causing the fluctuations. This could be because the IMU is too close to the motors, improperly isolated or improperly positionned. Try avoiding installing the IMU on the same plane as the motors. We currently have our IMU placed about 20 cm above the center of gravity of our drone. I cannot confirm that it caused the accelerometer to fluctuate, but it did have enormous influences on the compass when it was placed only 10 cm above the center of gravity.