Jump to content

andyer

Members
  • Content Count

    10
  • Joined

  • Last visited

About andyer

  • Rank
    Beginner

Profile Information

  • Country
    United States
  • Are you University user?
    No
  1. Hi Liv, Thanks, I didn't see your response earlier. What I need is a command (if exists) to write create an image after each simulation run so I can programmatically script a series of simulations. Since the model report does something like this today I thought this may already exist and someone might know how to do this. Anyone? Thanks, Andy
  2. Howdy denizens of the Activate community.... I'm wondering if there is a command to save the plots of a single scope as an image. I searched "bde..." and "vss..." commands and see options to save diagram or blocks as images - the most promising option seems to be this: vssHtmlGenerateImageHtml(). Not sure -would this work for saving an image of a single scope? I'm looking for an example for syntax but I haven't found one yet. I search the Activate installation and found a hit but the arguments are not detailed enough to know what is expected. Does anyone have an example for this? FYI: I'm running parameter sweeps and would like to save scopes as images at the end of each run before the next one starts. (overlay is not an option since the next simulation curve covers last one). Thanks! Thanks, Andy
  3. Hi Activate friends, I'm working on a hybrid Activate model that has a lot of discontinuous (activation) events and uses zero crossings. After changing the the Solver settings for zero crossings (Zero-crossing threshold and Zero-crossing time tolerance) I'm able to get a better performance using a variable-step solver (e.g. LSODA). Can someone please define what "auto" means exactly for the zero-crossings? I haven't been able to find a definition for this yet. I would like to loosen these values as they seem to be too strict for my model as the Simulation slows in the middle for a long time before starting again with a variable-step solver. I'd like to know what they are current set to to understand how to vary this. Thanks, Andy
  4. So, it turns out that this command bdeSetBlockStatus () does not work on the current simulation (needs to be fixed). However, a colleague and I (thanks Liv!) were discussing this and he showed me that I can achieve the same behavior by using an Include block on Activate. What you do is to put the superblocks you want to use in your model with Status = off. Then use an include block to select which one you want to use and the Include block will automagically turn the Status = on to the one selected. You can use the commands below to get the name of the model so you can self-reference to the path required in the Include block, e.g.: model_path=bdeGetModelFilePath(bdeGetCurrentModel()); [current_dir,model_name,model_ext]=fileparts(model_path); model_nameTotal=[model_name,model_ext]; %<--- put this as the name of the "Model path" in the Include block so you can self reference in case you change the name of your model Happy simulating, and thanks again, Liv! Cheers, Andy
  5. Hello Activate friends, I'm running through some tests/reviewing the docs to understand what is possible when running Activate in batch with an OML file as the input. (Activate_batch.bat -f file.oml) Thanks, Hai, for the help with my first questions! Attached is an example attached here which is working - I can run on command line and Activate creates a .csv file and I can set/get variables. This is good. For anyone interested to run this, there are comments within the attached .oml and some notes on how to get additional information (see run_interactive_oml_in_batch.oml). This model was created/tested using Activate v2019. I would like to clarify a few features to understand what is supported or not to see if anyone has suggestions/additional information. Questions: 1. It appears that the OML "bde..." commands like are in some of the optimization examples in Chapter 6 of the "Extended Definitions..." documentation are not supported when calling Activate in batch (e.g., Activate_batch.bat -f name.oml, correct? Not sure I need these yet, but was reviewing some of the other examples and initially I tried to use the "bde..." commands unsuccessfully. Are there any other limitations for commands to be aware of? 2. If I would like to set Activate model variables, I can use the Model context to overwrite/reset variables this is done in the example attached here and described in the docs (Extended...Section: 6.4.1). Alternatively, if I would like to set variable instead in Diagram Context, can this be done in batch? Does anyone have an example of this? 3. The "Signal Out" block is used to get variables back from the Activate model to the OML script. Are there any other methods to get variables back, e.g., is it possible to also use the "To Base" block? Thanks, Andy run_interactive_oml_in_batch.oml example_run_Activate_in_batch.scm
  6. Here's a couple of commands to help you get the Full name of blocks: First, select the block you want by clicking on it. Then in the command window, use: blk=bdeGetSelectedBlock(bdeGetCurrentDiagram) bdeGetBlockFullName(blk) Voila!
  7. Looks like I figured it out with some trial and error. If the name of my block is 'SuperBlock', then you can do this with the following commands which deactivate (status = off) or activate, respectively: > bdeSetBlockStatus(bdeGetBlockByFullName('SuperBlock'), 'off') > bdeSetBlockStatus(bdeGetBlockByFullName('SuperBlock'), 'on')
  8. O learned denizens of the Activate forum, Is there a way to set the status of a block (Superblock in this case) programmatically? (e.g. to do this via GUI, right click on a block to select Status --> On/Off). I would like to control the topology of my model via some scripting if possible and wondering if I can do this by controlling the status (or if you have another suggestion I'm open to it, too). Cheers, Andy
  9. Hi everyone, I have a tip I think might be helpful to others as it is helpful to me to load external data files in my Activate models without having to worry about the file path to the data if the model is moved/shared with someone else. If you have data in external files (e.g. like a .mat file or whatever), you may load this into Activate with commands in the Model or Diagram Contexts. Here you need to either have a relative or absolute path to the file: load('my_model_data.mat') <-- must be in the directory set in "File Browser" or load('C:\my_absolute_path\my_model_data.mat') However, if you want to make your model more generic and portable to other directories, you can use the command "bdeGetCurrentModelFilePath", which returns the same path as your Activate model. Then, you can define the model data relative to your model path (e.g., like in the same directory, as below): my_path=bdeGetCurrentModelFilePath() file_path=strcat(my_path,'/../my_model_data.mat') load(file_path); This is nice when sharing models with others so the paths can be set automagically. Hope this helps someone... Cheers, Andy
  10. Hi Berker, I played around with this a bit : I've found that this works when I test our development build of the next release of Compose (2018.1). However, it is not yet available in 2017.3 so it doesn't help you currently. I'm not aware of a target date for the next release, but this is something to look for. Not sure if this helps, but note that you can rename the figure in 2017.3 by clicking on the name modifying it in the Project Browser. I'm not aware of another command to do this programmatically yet. Perhaps someone else can chime in... Best regards, Andy
×
×
  • Create New...