Jump to content

RoKet

Moderators
  • Content Count

    46
  • Joined

  • Last visited

Everything posted by RoKet

  1. RoKet

    Showing h3d-file after simulation

    No ideas? I have tried to call the h3d-file directly from an omlcustomblock at the end of a simulation, but it failed. Also the attempt to call the h3d-file from oml command window went wrong.
  2. I'm using the 'MotionSolve Signals' block for a co-simulation between Activate and MotionSolve. Now I'd like to show animation results (h3d-file) automatically after simulation run, e. g. with HyperView Player instead of loading result in HyperView manually (or clicking on apply for update of reusults). Does anybody have an idea how this can be done?
  3. RoKet

    MoCustomComponent block

    At the top of package Translational SI is defined as placeholder for Modelica.SIunits. import SI = Modelica.SIunits; Everywhere else in this file you can use SI instead of Modelica.SIunits.
  4. RoKet

    OmlCustomBlock for 1dof spring-mass model

    Hi Minoru, I don't know why, but if you change the advanced parameter 'Activation mode' from 'Standard mode' to 'Always Active mode' the expected result is calculated. Regards, Ronald
  5. RoKet

    gerber file export

    Hi elaiyabharathi, Which geometry do you mean? There is no geometry in Activate to be exported. Your other posts are in forum FEKO, maybe you have confused the forum?
  6. RoKet

    Preference file of Activate

    Hi Minoru, Working directory and load/save directory are two different things. In working directory e. g. oml-scpripts are searched for. In the GUI you set the directory in the File Browser The load/save directory is always the last directory you have used for opeing or saveing a project. The setting can be found in c:\users\<username>\.altair\Activate<version>\hwx\settings.xml in section Session <section name="@Session"> <section name="DirectoryBrowser"> <entry name="Open Directory" value="D:/home/ActivateLibrary/_demos/Circuit models/" type="string"/> <section name="History"> <entry name="@name" value="D:/Hub/Christian" type="string" current="1"/> ... If you can set your preferred directory automatically e. g. in the startup script, I don't know.
  7. I'm playing around with the new demo models for Inspire and MotionSolve (https://altairhyperworks.com/motionsolve-models/) and export the model "Landing Gear - 4 Wheels" to MotionSolve. When I open the model (.mdl) in MotionView, the connections between graphics and the components in x_t-file are broken (no box checked in the Components list). Also the names of the componets are not the same as in x_t-file, otherwise I could restore the connections by name. How can I avoid this problem? Thanks for help, Ronald Landing_Gear_4 wheels.mdl Landing_Gear_4_wheels_x_t.74525011bdbc603bdf22cb4881e16717
  8. Hi asajd, Thanks for solving the mapping problem. With your files it now works fine. I just had to rename the file "Landing_Gear_4_wheels_x_t.8bbc17520c5a14e4688199a9da4b1a66" into Landing_Gear_4_wheels.x_t". Ronald
  9. RoKet

    Brake Modelica Block in Activate

    Yubuchi-san, ad 1) I think you are right. Somehow the explanatory texts have shifted. The Modelica source code contains e. g. Modelica.Blocks.Interfaces.RealInput f_normalized "Normalized force signal 0..1 (normal force = fn_max*f_normalized; brake is active if > 0)" ad 2) Your model should work, but OpenModelica also has its numerical difficulties with it. If you add a mass at support port, the model works fine (see Brake04.scm). Best regards, Ronald Brake04.scm
  10. RoKet

    launching Activate in batch from Compose

    Hi Lorenzo, Thanks for the cool example for combining Compose and Activate. Do you know a method to modify parameters in the Activate model from Compose? For the case of an interactive working with the simulation model Andyer posted another interesting proposal in the Activate forum (running Activate in batch with OML file input- example and a few questions). As I understand it you can do similar things directly with the oml scripting in Activate. Ronald
  11. RoKet

    Unknown value using compose

    Sorry, I assigned the result to variable x. If you replace x by Nf in line 16, you get Nf.
  12. RoKet

    Unknown value using compose

    Hi Arul, I have modified the script a little bit according to the help of 'fzero' clc,clear function output = equation(Nf) dEps = 0.5; Eps = 0.8; Sigma = 90; E = 30; c = 0.8; b = 0.9; output = Sigma/E*(2*Nf)^b + Eps*(2*Nf)^c-dEps/2; end options = optimset('TolX', 1.0e-8); interval = [0, 6]; [x,fval] = fzero(@equation, interval, options) It's running in 2017.3 without any problem.
  13. RoKet

    Populate a lookup table in Activate

    Yes, I forgot to mention. I check it with this simple model The script part is sometimes a little bit tricky. Unfortunately I have no example, perhaps someone else can help with a code snippet?
  14. RoKet

    Populate a lookup table in Activate

    Hi Vinivici, The definition of inputs and output looks like this: Assuming n=2 (x-axis), m=2 (y-axis), k=2 (z-axis) Then output vector with size n*n*k: [f(x1,y1,z1), f(x2,y1,z1), f(x1,y2,z1), f(x2,y2,z1), f(x1,y1,z2), f(x2,y1,z2), f(x1,y2,z2), f(x2,y2,z2)] Reading of csv and populating inputs and output have to be done as a script in 'Diagram Home Context' or 'Model initialization'. Best Regards.
  15. RoKet

    Animated plot in 2D

    Thanks, L Moretti. That's a really cool and useful example with a time delay in drawing and repainting in different colors. BR, Ronald
  16. Hi Yugang, The model is setup with Activate 2019. Which version are you using? More information about the Modelica custom block and how to use it you can get from "Activate Extended Definitions", a pdf with very helpful information about Activate. It is linked in the help of the custom block (Activate Extended Topics Guide). BR Ronald
  17. RoKet

    Using C Block for Event Activation

    Hi Saurya, I misunderstood the function of evout. It is the relative time between current activation and output of activation (and not the signal itself as I supposed). Best regards, Ronald
  18. RoKet

    Automated simulation and capturing data

    Hi Syurya, I have no exact solution for your task, but look at the example "moonlanding_opt.scm" in Demo Browser, Activate, Games. The combination of elements in super block "next last" and "Restart" in "optimize" allows you to run a defined number of simulations. The ToCSV block overwrites the file at every new simulation . I suggested a modification to the development team, but expect it not before next release. You can try to write your own C block with fopen(filename, 'a') (or similar). It should be easier than the output of an event activation Best regards, Ronald
  19. Just a few seconds too late ...
  20. In palette ActivationOperations component SimulatorInfo. Possible infos are (according to help): step-size: provides last accepted step-size in the simulator. hot-restart: if the solver is [re]started forgetting all past memory about the solution. phase: the phase with which the model is called/evaluated. effective-time-tolerance: the real value of "Time-Tolerance" used by the simulator if it is set to AUTO Best regards, Ronald
  21. RoKet

    To base, From base block question

    My understanding of 'Base' blocks is: - if they are not activated externally 'To Base' writes its input at the end of simulation run, 'From Base' reads the value at the beginning of a simulation run - if 'A' isn't defined in base context (see Variable Browser), the default value is used (first simulation run, after that the variable is defined automatically) - in case of external activation you can exchange values at certain events. In contrast 'Signal In' and 'Signal Out' exchange their values permanently.
  22. RoKet

    Using C Block for Event Activation

    I don't know the exact solution, but you start with definition of numer of output event ports: If you generate the skeleton of the c function code you get: #include "vss_block4.h" VSS_EXPORT void CBlockFunction(vss_block *block,int flag) { SCSREAL_COP *in=(SCSREAL_COP *)GetInPortPtrs(block,1); int min=GetInPortRows(block,1); int nin=GetInPortCols(block,1); SCSREAL_COP *out=(SCSREAL_COP *)GetOutPortPtrs(block,1); int mout=GetOutPortRows(block,1); int nout=GetOutPortCols(block,1); int nevprt=GetEventCode(block); SCSREAL_COP *evout=GetNevOutPtrs(block); switch (flag){ case VssFlag_Initialize: break; case VssFlag_Reinitialize: break; case VssFlag_Terminate: break; case VssFlag_OutputUpdate: break; case VssFlag_EventScheduling: break; } } Now *evout is the variable to be used for the event, e. g. *evout = 1;. It has to be set with flag == VssFlag_EventScheduling. I try to set up a small example, where I set the output event depending on an input value (x > const), but the event occurs sometime, but not at the expected point of time. Here I need the help of someone else.
  23. I found the solution at one of Thierry's demo model. The optimization block is communicating with Base variables, but you can read these variables in the Model context using ModelContextVariable = GetFromBase('BaseVariable',1); or in your case k = GetFromBase('k',3); The variables may have the same name.
  24. I see. That's the typical task of optimizing a parameter e. g. of a controller. But I can't find a way to set a Model variable without beeing reset at next simulation run. My idea was to use "From Base" and "To Base" with optimization block and write the result back to model variable with the custom block. But the definition in Model scope overwrite every change of the variable at initialization. Does someone else know a solution?
  25. Hi Seoksan, 'From Base' has to be used with 'To Base', they form a kind or pair. The variable is placed in base scope, not in 'Model' scope. You can see the variable in the 'Variable Browser', whereas 'Model' variables are not visible in the 'Variable Browser'. The demos in 'tutorial_models - Extended_Book_Models - Chapter_5_Optimization' show the usage of design variables for optimization. I hope that helps, regards, Ronald
×