I was wondering if there is a way to model an if-function into my model. I want to model an if-function which uses one input (1-12) and decides which controlpath to follow based on the given input.
I can't seem to find it in de control and signal library.
I think there are different ways to do this. It depends on what you mean with "which control path to follow".
I'm working on a gearbox model where the physical representation of the gearbox depends on which gear I engage. e.i. Gears 1-12. What I would like to create is a super component which has a shaft entry and exit, and a signal entry for which gear I'm in.
Inside the supercomponent, I want to model the 12 different physical models, and depending on the gear input, I want to drive one of these models.
I think the f(x) block would suit me nicely here?
I see, thanks for details.
For a gearbox:
- automatic: sounds like your case if you had a detailed model you would normally use a truth table to drive the different clutches which will automaticallu affect the inertia between input and ouput. For that, check the demo named AT6_RT_step1, the gear signal is converted into 6 outputs (with the truth table) to open/close clutches
- manual gearbox: you also have a demo (manual gearbox) ut here the synchronizer are directly piloted individually rather than with a signle 'gear' signal.
If you really prefer to define independent 'models' for each gear you could also open/close 'virtual clucthes' with a control signal, if it does the job and you're happy with it ok but, beware as the model won't be representative for gear change it would only be valid in a given gear.
Also if the structure of your 12 gear model was the same, I would rather use global parameters to change the parameters depending on the gear.
If the 12 models are actually very different, I show how such a model could look like:
Thanks for your thorough response. I think option 3 suits my needs the most. It's true I don't need automatic shifting between gears in the analysis, as I am interested in the situation when one certain gear is activated.
The model's will have a considerate different buildup physically, but I do plan to use the global parameters.
So if I'm correct , in your third and final option, you choose to drive all of the gears, except you unclutch eleven drive trains?
I'll go ahead with the 3rd option for now, and will post an update on monday! Thank you very much already.
As promised a little update:
I modelled 12 gears parallel to each other. With the function block I can (de)activate the clutches and the system seems to be working with a constant torque input and even with gear changes.
However, when I import it into my main model, AMESim detects an error in DASSL. The step size h is unacceptably small. Any ideas what causes this behaviour?
Thanks for your quick and thorough responses! You're helping me along quite well!
I had the model running and indeed it was a heavy model to calculate. So I'm instead turning my attention to the Dynamic Truth Table. One question about this part though:
- When I run an Eigenvalue analysis to determine resonance frequencies, will the "extra" inertia's disturb the results for this type of analysis? Or does it take into account which gear it will be in?
If it does disturb this process; then my next idea will be to create a supercomponent for the gears and to make each gear a submodel. But I would like to be able to switch gears in the parameters or simulation mode.
For the eigenvalues you are right, all the inertia on the sketch are always taken into account. So it makes it challenging to isolate your engaged gear.
The truth table will be helpful if you are modelling the real layout of the gearbox with its different shafts, epicyclics, clutches.
If you keep the model as it was on your previous screenshot, use global parameters. If you had several submodels for each gear under a supercomponent you wouldn't be able to easily switch from one to another in parameter/simulation mode. But, with an 'engaged gear' global parameter, you can change it or even make it a batch parameter easily. Your model would then look like this:
Then, to switch gear, just change the value of the top global parameter and all the other parameters will change accordingly. You can also run simulations batching on that same parameter.