Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Scaling arrays
Posted 2017年1月11日 GMT-5 08:08 Geometry, Parameters, Variables, & Functions Version 5.2a 7 Replies
Please login with a confirmed email address before reporting spam
For my model I have to produce an array of equidistant features, where each element is scaled (say linearly) with its position. I do not see such an option, except of manually doing it (but I might have hundreds of features).
Any idea on how to manage that?
Thanks
Please login with a confirmed email address before reporting spam
You could achieve such a geometry either with MATLAB (assuming you have LiveLink for MATLAB) or with a method in an application (assuming you use COMSOL on a Windows computer so you have the Application Builder).
Best regards,
Jeff
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
Jeff
Please login with a confirmed email address before reporting spam
The app consists essentially in just one method. That method is triggered by one button. The method is written to create 7 equally spaced blocks of increasing sizes.
There is a Save menu that lets you save the mph file under a new name.
You can then open that mph file in a fresh GUI and add physics, mesh, etc. Alternatively, you can use "Insert Sequence" in an existing model file to import the 7 blocks. See PS below.
Using this approach, you can quickly generate geometries that would be tedious to put together in the GUI. You can also use this approach to generate randomized geometries - something that cannot be done in the GUI.
I hope this helps.
Best,
Jeff
PS: Yet another alternative is to, in the app, export the geometry as a .mphbin file instead of saving it in a .mph file. You then Import the .mphbin file into a new mph file. This has the benefit of not populating your new mph file's Geometry branch with lots of nodes you don't need.
Attachments:
Please login with a confirmed email address before reporting spam
But if we have never used JAVA scripts before? How could we use the application builder as mentioned ?
Thanks
Please login with a confirmed email address before reporting spam
There have been a few webinars that discuss some of these capabilities. You can find archived webinars on the App Builder here:
www.comsol.com/events/webinars/archive?eventtype%5B%5D=event_webinar&startTime=8&endTime=20&eventtopic%5B%5D=application-builder&view=cards&events_sort=date
Best,
Jeff
Please login with a confirmed email address before reporting spam
Kind regards Jeff
Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.
Suggested Content
- BLOG Using Deformations to Visualize Physical Motion
- BLOG Students Use Simulation to Optimize Hyperloop for Design Competition
- KNOWLEDGE BASE Manually Setting the Scaling of Variables
- FORUM Troubles with operations on vectors/arrays
- BLOG How to Analyze Beam Sections Using the Beam Section Calculator