I have a problem with the global parameters.
I'm using the TR1DVEH01A submodel to simulate my vehicle's speed and acceleration.
In the submodel I have to set the rolling resistance coefficient. I have done this with a global parameter. But now I have the problem, that this rolling resistance coefficient changes during the simulation because my vehicle drives on different grounds.
I can't change the submodel, I only want to change the rolling resistance coefficient as a function of time.
Is there any possibility to change a global parameter during the simulation?
Or has anybody an idea how I can solve my problem?
Thank you in advance!
Solved! Go to Solution.
Here you go. I have created a mini library which contains the modified vehicle. Port 8 allows you to drive the rolling resistance externally so you can now change its value dynamically. I quickly checked that it behaved correctly.
Unpack the archive in a location you will remember, something like an Amelib folder.
Then in Amesim add this path to your category path list (Modeling/Category path list...) so you can see the new vehicle. You can also change its default black colour with Tools/Options/Color preferences...
Thank you very much!
It works just like I want it.
Did you write some information in C-code just like it is said in the ameset help?
Or are this changes possible without changing the C-code.
If it is possible in an easy way, I would like to change the mass parameter as well like you did it.
You're welcome, I'm glad it's useful.
There was a minor change in the c code; by deleting the original real parameter (Rroll) and creating the new input (also named Rroll) I just had to change any reference to Rroll in the original code into *Rroll in the new one (Rroll is now an input to the function instead of being a local parameter). So, it's not that difficult code-wise, it's more tedious to change the component icon and its ports to be honest!
For the mass, theoretically you should be careful as the rate of mass change should also be taken into account in some equations. I suppose you wouldn't really care and just apply new mass at specific instants.
Same modification in the code: change mvehi into *mvehi when used in expression.
I attach the updated library, feel free to private message me for the c code of submodel.
It's really usefull!
I checked the new submodel and it works as well, thank you very much!
I tried to look at the c-code but I can't find the right one.
But because everything works, it doesn't matter...