Science topic

Python Scripting - Science topic

Explore the latest questions and answers in Python Scripting, and find Python Scripting experts.
Questions related to Python Scripting
  • asked a question related to Python Scripting
Question
3 answers
Is there a python script to calculate the flame displacement velocity?
  • asked a question related to Python Scripting
Question
3 answers
Does anybody have any idea how to execute an user defined python script in the middle of a mininet wifi script just after the topology is created and then manipulate the nodes based on the results of user-defined python script. Please help. If anybody knows then please send me the steps or an example script.
Relevant answer
Answer
with the help of sage you can explore too much.
  • asked a question related to Python Scripting
Question
3 answers
Hello all,
TL;DR
I made a Python package that allows Lifespec .FL files to be parsed. It also installs a command line tool for converting .FL files .csv.
-----
We use a Lifespec machine in our lab to perform TRPL and other measurements. It appeared that the only way to save the data from the .FL format was to manually use their F980 software to convert each file manually. This became tedious so I created a Python package and command line tool for converting them.
The Python package uses another package called `parse_binary_file` to parse the .FL file. You can then load the data from the .FL file directly into your Python script for analysis.
The command line tool is installed when you install the package. It converts .FL files to .csv, and can do it in batch with several options on how to output the data.
I thought this may be a useful tool for others, so wanted to share here. If you have any questions or comments the best place to post them is on the Issues page of the project's GitHub repo (https://github.com/bicarlsen/lifespec_fl/issues)
Relevant answer
Answer
great effort very nice
  • asked a question related to Python Scripting
Question
2 answers
I am working on the Abaqus model for 3D porous structure. Is there any well used script for generate a porous structure with different porosity?
Relevant answer
Answer
Hi Haozhe Zhang,
I don’t know a written script for this purpose. However, if you know the equations and the relations of your model, you can write the script by yourself. Check the links below. They might be of help in writing the python code you need. Again, you must know the equations of your model.
Best wishes.
  • asked a question related to Python Scripting
Question
1 answer
Dear all,
I have the following problem when I am working with an Abaqus python script:
- Everytime I update a module that is loaded as a part of my main script, after compiling the corresponding module (and generating the associated *.pyc file) in order to test it, I have to close and open Abaqus GUI, otherwise, the new *.pyc file version is not loaded into the system.
I am formulating this question because during the debugging phase of my code, everytime a new change is done, the fact of closing and reopening Abaqus interrupts the workflow (as it takes time to start Abaqus GUI).
Thanks in advance.
Relevant answer
Answer
I have the same issue and I found a solution using the built-in function reload() (for python2.7 only). In the main file I would write:
import myfunctions as myfunc
reload (myfunc)
where myfunctions is the python file myfunctions.py, in the same folder as the main file. This way in each run the file is reloaded and a new compiled myfunctions.pyc is created.
However reloading each time, might be time consuming and it is better to disable reloading when you are done changing myfunctions.py
If you already found another better solution please share it.
  • asked a question related to Python Scripting
Question
10 answers
Is there any online tool to convert python scripts to MATLAB ?
Relevant answer
Answer
I hope that this "Ask the Expert Video" may answer a question about how to call Python® libraries from MATLAB and vice versa.
  • asked a question related to Python Scripting
Question
6 answers
Hi,
I would like to create a set similar to the one below.
Using the findAt method is time consuming because it would require to enter the coordinates of all the edges that I need.
Instead, using the getByBoundingBox method, I can get all the edges lying inside a box without struggling to find the exact coordinates.
The issue is that I would like to exclude certain entities from the "BoundigBox". So I'm looking for the method equivalent to pressing Ctrl to unselect entities in th GUI. When I record a macro or through the journal file there is no such a method. Instead, when I use Ctrl to unselect entities, an new set (in this case) is created.
Does anyone know of a built-in Abaqus python method to reproduce the unselect operation?
Otherwise, does anyone have any suggestions for an efficient way to add entities to python scripts without using the findAt method? It gets messy when dealing with many entities, and specially if one needs to parametrise the code...
Thank you,
Sérgio
Relevant answer
Answer
Totally agree with Martin Pletz (was writing the same :) ). For this specific case (where both sets can be created quickly) using "SetByBoolean()" seems like your best option ;)
  • asked a question related to Python Scripting
Question
4 answers
I have attached the screenshot of the error i am receiving, it says file not found errno2, however i have run foldx plugin before without any issue. I recently reset my PC and conducted a clean install of yasara and foldx as well as python. but since then i cant run the stability program or anyother attached modules of foldx in yasara. can anyone help me understand whats the issue?
Relevant answer
Answer
David Eugene Booth Thanks for your suggestions, i did a combination of installations of both the programs and reinstalled the latest foldx5 which has fixed the problem. Thanks a lot.
  • asked a question related to Python Scripting
Question
1 answer
I wanted to add a stiffener to the rectangular plate by considering the maximum deflection node to the nearest minimum deflection node.
I can add the stiffener by considering the maximum deflection node (coordinates) to the minimum deflection node (coordinates), but it is not the nearest one.
Could anybody tell me how can I get the nearest minimum deflection nodes???
Odb Abaqus script for maximum and minimum deflection nodes but not nearest
stepframe = odb.steps['Step-1'].frames[-1]
displacement = stepframe.fieldOutputs['U']
field=displacement.getScalarField(componentLabel='U3')
maxp = max([(g.data,g.nodeLabel) for g in field.values ])
minp = min([(g.nodeLabel) for g in field.values])
nodel_label_01=minp
nodel_label = maxp[1]
coordinate = f.nodes[nodel_label].coordinates
coordinate_01 =f. nodes[nodel_label_01].coordinates
Maximum_deflection = maxp[0]
p_1 = coordinate[0]
t_1 = coordinate[1]
g_1= coordinate_01[0]
w_1= coordinate_01[1]
Min_2_x.append(g_1)
Min_2_y.append(w_1)
Max_2_x.append(p_1)
Max_2_y.append(t_1)
Relevant answer
Answer
Can you share your Abaqus model (.inp)?
  • asked a question related to Python Scripting
Question
4 answers
Hello,
I'm using for loops in a python script to run a parameter study in Abaqus, that is I submit a job using:
mdb.jobs[jobName].submit(consistencyChecking=OFF)
I then change some parameters and submit a new job with a different jobname, etc. When I'm doing this on my own pc Abaqus is able to utilize all the resources I have available, for example if I have a 6 core 12 thread cpu and submit a bunch of 2 cpu jobs, I can have 6 jobs running simultaneously.
If I try the same method on my institution's cluster, I request 12 cpu cores for a slurm job and submit my python script for analysis, there's only 1 job running at a time instead of 6, meaning 1 parameter job starts and finishes before the next one starts (I'm not using the .waitforcompletion() method).
I'm aware it's a rather open question, but have anyone experienced this unintentional non-parallel behaviour on a cluster before, and how might I be able to solve it?
Best regards, Jens
Relevant answer
Answer
Hi Jens Jensen,
If you still cannot run multiple jobs simultaneously, I have another solution for you. Refer to the link below:
This contains a Batch file in which you can program your jobs so they can be executed sequentially. With this method, there is no need for you to execute them individually or run them simultaneously, which can cause software malfunctions. This could save your time.
Best wishes.
  • asked a question related to Python Scripting
Question
9 answers
I am trying to run the python script in my command prompt and the following error is showing:
Traceback (most recent call last):
File "Linear.py", line 14, in <module>
class simpleMultiLinkTopo( Topo ):
File "Linear.py", line 21, in simpleMultiLinkTopo
s1 = self.addSwitch( 's1' )
NameError: name 'self' is not defined
Can anyone tell me the solution?
Relevant answer
Answer
It looks like you copied that part of the code from another class.
In Python, by convention (PEP 8), "self" refers to the current instance of an object. If your code is outside of a class, self will not be defined, as there is no instance.
  • asked a question related to Python Scripting
Question
1 answer
I am trying top prepare pseudogenome alignments from VCF file after mapping reads to reference genome. I yried to use python script for that but it does not work. I was wondering if anybidy here has bash script to prepare pseudogenome alignemnts.
Thank you.
Krishna
Relevant answer
Answer
Krishna Prasad Acharya Mapping an experiment's reads to a reference genome is a critical step in current genomic data interpretation. With mapping, readings are given to a specific site in the genome, and information such as gene expression levels may be obtained.
Take a look as well: https://nf-co.re/bactmap
  • asked a question related to Python Scripting
Question
1 answer
Where could I find python script examples or information in general where heterogeneous reactor kinetic models have been developed? In particular, I am trying to replicate a theoretical model to describe the catalytic process of biogas dry reforming.
Relevant answer
  • asked a question related to Python Scripting
Question
5 answers
Hi,
I am trying to write a python script for ABAQUS to automate the run multiple small strain FE analysis with re-meshing and interpolation technique in which an input file is produced for each run and a MAP SOLUTION function is written there and executed from the cae module . However, I got a message: "the file for analysis with the rezone option was specified. The abaqus analysis cannot be executed."
I wonder if any one can help to resolve this issue? Any referral to an already written script that deals with similar problems would be appreciated.
Many thanks
Relevant answer
Answer
Dear sir:
Also, you can take a look at this valuable link, you will find the answers to any problem you will face on this topic.
###########
Best regards...
  • asked a question related to Python Scripting
Question
7 answers
Hi,
I am new to ABAQUS python scripting and I wanted to know if it is possible to get the coordinates of an element center? This is in preprocessing. I have a 2D tapered geometry of a composite material and based on the element location I want to create an element set. I will then assign material orientation to these sets.
Regards,
Sukirti
Relevant answer
Answer
Sukirti Dhital Script execution
1. At the system prompt, type abaqus python scriptname.py. The following statement must be included in the script: import from odbAccess *
2. Select FileRun Script from the Abaqus/CAE main menu bar, and then browse to the file you want to run. The following statement must be included in the script: import from visualization *
  • asked a question related to Python Scripting
Question
4 answers
Hi All,
I'm developing python script to read simulation results from Vissim. I'm following this paper which has sample code how to read the data from DataCollectionMeasurements and VehicleNetworkPerformanceMeasurement. But the simulation is not generating any output, always returns None.
I need to observe the following details every 60 seconds for each node,
1. Arriving vehicles and time
2. Speed
3. Signal controllers cycle time, phases
4. Queue service time
5. Saturation headway
Please advise.
Thanks
Viji
Relevant answer
Answer
  • asked a question related to Python Scripting
Question
4 answers
When I run the script with a particular mesh size I get the result but when I change the mesh size in python script to generate input function in Abaqus I get the following error, why?
***ERROR: in keyword *EQUATION, file "hom_single_mesh_0003.inp", line 1835:
Unknown part instance set TABLET-1."CT 61"
***NOTE: DUE TO AN INPUT ERROR THE ANALYSIS PRE-PROCESSOR HAS BEEN UNABLE TO
INTERPRET SOME DATA. SUBSEQUENT ERRORS MAY BE CAUSED BY THIS OMISSION
***ERROR: in keyword *EQUATION, file "hom_single_mesh_0003.inp", line 1835:
Unknown part instance set TABLET-1."CB 18"
***ERROR: in keyword *EQUATION, file "hom_single_mesh_0003.inp", line 1841:
Unknown part instance set TABLET-1."CT 559"
....................................................................................................................& so on
Relevant answer
Answer
I have created 44 Video Lectures for ABAQUS Python Scripting:
suitable for beginners and experts.
The corresponding Code can be found at github:
  • asked a question related to Python Scripting
Question
3 answers
Hello Everyone,
How to eradicate the error
File "E:/........", line 320, in <module>
p.PartitionFaceBySketch(faces=pickedFaces , sketch=s1)
Feature creation failed.
Thanks in advance.
Relevant answer
Answer
I have created 44 Video Lectures for ABAQUS Python Scripting:
suitable for beginners and experts.
The corresponding Code can be found at github:
  • asked a question related to Python Scripting
Question
2 answers
I want to do a parametric study, for which I want to create several Input files. And then run them in batch mode. I already created a python script which creates several input files, but just when I run that script in abaqus and that takes quite long already for 3 different parameters and I want to make way more. I am new to coding, so maybe there is an easy solution for this.
Relevant answer
Answer
I have created 44 Video Lectures for ABAQUS Python Scripting:
suitable for beginners and experts.
The corresponding Code can be found at github:
  • asked a question related to Python Scripting
Question
2 answers
Hello everyone,
I'm trying to mesh a structure with complex partitions using mesh controls. When doing it on the user interface I'm first selecting all cells. In the following, I have to accept that the regions which are too complex for sweep meshing are removed from the current list of selected regions (see attached screenshot). So, this works fine.
For my python script I'm using the getByBoundingBox() Feature in order to select all cells. In the following it would be necessary to remove all regions which are too complex for meshing otherwise the script breaks with the following error message: Some regions cannot be Swept/Reolved.
Relevant answer
Answer
I have created 44 Video Lectures for ABAQUS Python Scripting:
suitable for beginners and experts.
The corresponding Code can be found at github:
  • asked a question related to Python Scripting
Question
3 answers
Greetings,
I am looking for an Abaqus scripting procedure to access the nodal forces of a set of shell elements. It seems I can only reach the nodal displacements. Besides how can I read the data regarding the initial geometry (dimension) of every mesh?
BR.
Relevant answer
Answer
I have created 44 Video Lectures for ABAQUS Python Scripting:
suitable for beginners and experts.
The corresponding Code can be found at github:
  • asked a question related to Python Scripting
Question
1 answer
Any one using OpenMM dynamic simulation should help with the steps and python script for integrating ligand to the protein in PDB.
Also, I find that Charmm parameterization for ligand has no template for NH3 which is in my ligand. Is there any way out?
Thanks
Relevant answer
Answer
  • asked a question related to Python Scripting
Question
8 answers
Dear all,
I have performed 500ns MD simulation of a protein-ligand complexes using academic maestro version. Now I want to perform MM/GBSA onto this trajectory. Can anyone please help me with that ? is there any MM/GBSA python script available for my purpose please ?
#MM/GBSA #DESMOND #MM/GBSA Python Script
Relevant answer
Answer
$SCHRODINGER/run thermal_mmgbsa.py  xx-out.cms -j energy-calc -start_frame 4000 -end_frame 8000 -step_size 50 -HOST localhost:8 -NJOBS 8 > output
  • asked a question related to Python Scripting
Question
3 answers
I am using following code in python script in abaqus to get the stress data at nodes. How to get it according to global node number so it is easier to plot.
All_points = odb.steps['Step1'].frames[-1].fieldOutputs['S'].getSubset(region=sett,position=ELEMENT_NODAL).values
This gives output according to local node number.
Thank you!
Relevant answer
Answer
Hi Krupal,
I hope the following snippet of code shows how it possible to find the node label of a location in the fieldOutputs. I assume you could use this to find the entry that refers to the node of interest. Once the location is known, the values at that location can be found. It's a slow method, but it might help.
Regards,
Simon
  • asked a question related to Python Scripting
Question
4 answers
Hi everyone. Is it possible to use python scripts for machine learning into OMNET++ or NS3?
I want to simulate VANET which I used machine learning (based on python) and now I confused how to use python scripts in omnet++.
Relevant answer
Answer
Well Done !!! Interesting...
  • asked a question related to Python Scripting
Question
3 answers
Dear All
I am translating a software interface from MATLAB to Python and I am into an excruciating corner.
How do I enlarge the serial buffer in Python?
is there a library to add a "Listener" to a specific serial event so a function is executed? My current solution is to launch a parallel thread and fundamentally probing the serial frequently not very smart and not very fast!. I was wondering if there is a library that can handle an "Object" serial with callback responses at specific events.
To give you a parallel I am very familiar with, MATLAB the serial is a concurrent object (as most of the interface objects in MATLAB) and the actual buffer can be all the memory of the computer. In essence, all the calls to the buffer are non-blocking and you can realise complex listeners that wait for a specific event in the communication to happen.
Thanks for the help
Marco
Relevant answer
Answer
Dear Marco,
pySerial uses the computer drivers to determine the serial buffer size, so the best way to enlarge the buffer would be through the device manager for windows or TIOCSSERIAL for linux.
You are also correct that threading is the proper approach for the listener you are attempting to implement. There are several APIs in pySerial that will be very helpful here.
I hope this was helpful, and best of luck,
Nathan
  • asked a question related to Python Scripting
Question
2 answers
from odbAccess import *
from abaqusConstants import *
MyOdb = openOdb(path='python_test.odb')
specimen = MyOdb.rootAssembly.instances['TEST]
centerOfMass = MyOdb.rootAssembly.elementSets['TEST-EDGE'].getMassProperties()['mass']
When I ran this script, it kept giving an error message;
AttributeErrorL 'OdbSet' object has no attribute 'getMassProperties'
Please advise how to solve this error.
Relevant answer
Answer
Thank you, Haseed!
  • asked a question related to Python Scripting
Question
3 answers
Dear All,
I'm working on the model to optimize the traffic light timing. I'm using the simulator SUMO for the development. To update cycle time and offset, my understanding so far is that,
  • Set the cycle time and offset for each intersection in .net.xml file
  • Then during runtime, keep updating this value based on the optimized value.
Is this the only way? Or can it be controlled without updating .net.xml file?
Any other options how to update cycle time and offset through python scripts?
Thanks in advance
Viji
Relevant answer
  • asked a question related to Python Scripting
Question
4 answers
Hi I'm trying to make a python script to get MTF curve for the input image
Here is my algorithm to get MTF.
1. get Image
2. select ROI(High contrast region)
3. extract a center line out of image array.
4. differentiate the pixel value
5. apply fast Fourier transform and sort it.
6. apply polynomial fitting to get smooth curve
7. normalize 0~1
8. get the absolute value of number 7
Is this right way to get MTF?
I'm little confused.
this is the reference code I'm using
Relevant answer
Answer
Although it is late, it may be useful for other readers.
Getting MTF is pretty easy and the algorithm you describe is pretty complete.
The "edmund" link shared by Adnan Majeed has a solid description of it.
An other approach is to rotate the image along the slant angle. Advantage of this method is having more pixels for MTF calculation. (Actually ESF estimation). The not so hard but critical part of this approach may be slant tilt angle estimation.
You can check my MTF calculation python project on:
  • asked a question related to Python Scripting
Question
3 answers
Hello researchers and experts,
I would be really glad if someone can provide me with the MATLAB or Python script already develop to implement to find out the aerosol concentration and plasma temperature parameters.
Thank you
Relevant answer
Answer
Related to your query, a good option is to get some expertise via coding in MATLAB and employ your skills to such computations, see for example https://au.mathworks.com/help/matlab/ref/ode15s.html
  • asked a question related to Python Scripting
Question
4 answers
I have a 1489 spike protein sequence file. I want to extract codon sequences, of 6 amino acids from this with their respective header. I don't know any sort of programming, so can anyone help me with this?
A big thank you in advance.......
Relevant answer
Answer
  • asked a question related to Python Scripting
Question
2 answers
The project I am working on requires me to modify the Modle file (ModelName.inp ) after the Nth iteration while the optimization is running. It is possible to use checkpoint hooks during the optimization process in Tosca Structure to run python scripts during the optimization. I have used them to modify other files during the optimization process before.
So far I was able to modify the ModelName.inp file inside the automatically created optimization job folder. But it seems like the optimization process does not realize that the file has been modified. I have tried checkpoint hooks at different times of the iteration. But no success so far. I was thinking that I might be modifying the wrong file. Or is it possible that the ModelName.inp file only gets read at the beginning of the optimization, and therefore can't get modified during the optimization process?
Relevant answer
Answer
I am trying to run a topology optimization of a metal-polymer hybrid. The design space contains the metal insert. Whenever elements get removed from the insert due to the topology optimization, empty holes are created. In reality, these holes would not be empty but filled with the polymer matrix. Thus, I am trying to update the polymer matrix every Xth design cycle to fill these holes. My understanding so far is, to update the geometry of the matrix and other things like the design space, I would need to update the "ModelName.inp" file inside the working directory. The question remains if this is even possible.
  • asked a question related to Python Scripting
Question
5 answers
I request if anyone can provide me template python script to work on?
Thanks in advance
Relevant answer
Answer
You can invert the normalization like this:
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
X_scaled = scaler.fit_transform(X, feature_range=(0,1)) #scaling your X data between 0 and 1 values
print(X_scaled)
#invert scaling
X_scaled_inverted = scaler.inverse_transform(X_scaled)
print(X_scaled_inverted)
  • asked a question related to Python Scripting
Question
1 answer
Hi,
I'm trying to create several displacement data tables through iteration (see 2.PNG) but get an error for the second iteration (see script "Test of small codes.py"). However, the values for the first one are correct.
The main problem is the "#Displacement XY data" part (see 1.PNG), which does not create the second iteration.
Is there any method to solve the problem and be able to avoid getting error messages?
Any help is appreciated,
P.s. If you want to run the script, run "I-Profile_iteration_Test.py" first, and when it's done, run the second .py file.
Relevant answer
Answer
I believe you should be able to use a COM (component object model) library, as in this example for the specific case of interacting with iTunes:
# iTunes API
import win32com.client
import pandas as pd
import Cria_PL
import Proper
# CHECA PLAYLISTS
iTunesApp = win32com.client.Dispatch("iTunes.Application.1")
Sources = iTunesApp.Sources
# PLAYLISTS
for i in range(1,Sources.Count+1):
source = Sources.Item(i)
if source.Kind == 1:
playlists = source.Playlists
print("Select from the following playlists")
print("Number of playlists:",playlists.Count)
for j in range(1,playlists.Count+1):
playlist = playlists.Item(j)
playlistName = playlist.Name
print(j, ":",playlistName)
# LIST TO BE PROCESSED
result = input("Enter comma-separated lists to process: ")
print()
#result = 12
# SELECTED PL
read_PL = playlists.Item(result)
playlistName = read_PL.Name
print("Processing playlist",result,":",playlistName)
  • asked a question related to Python Scripting
Question
3 answers
A cell phone is used to record acceleration data with the Physics Toolbox Pro. It looks like, that the acceleration signal is not recorded with a constant sampling rate. Is resampling and filtering necessary before further processing of the acceleration signal? A double integration of the acceleration signals to obtain displacement signals is finally needed. A python script would be very helpful.
Relevant answer
Answer
Hello, Nils Wagner .
What are you trying to achieve? Wouldn't be an acceleration signal sufficient for your application? Double-intergation of the acceleration signal to the displacement is a highly unreliable process, as pointed out by Rolf Schirmacher .
If you need to estimate a total displacement (i.e. a static part of the signal), be vary that you don't know initial conditions (especially initial velocity) and there is practically no method to evaluate them based on acceleration data. There is also noise but it can be at least partially resolved by some smoothing/filtering.
Also note that Phyhox claims that "errors in the acceleration sum up in the velocity and hence have an even worse impact on the location. Usually, the noise of the sensors brings the results to absolutely unreasonable values within a short time."
  • asked a question related to Python Scripting
Question
3 answers
I have a cubical RVE and I want to cut multiple ellipsoidal holes in it. I have a python script for this but when I run the script in Abaqus it gives an error "Cutting operation failed because the base instance was not modified". Here is a piece of code I have used:
for i in range(len(ellipse)):
a.InstanceFromBooleanCut(name='Part-1',
instanceToBeCut=mdb.models['Model LM'].rootAssembly.instances['RVEInstance'],
cuttingInstances=(a.instances['LM_ellipsoid-'+str(i)],), originalInstances=SUPPRESS )
This performs the first cut but fails after the first one. Could someone please suggest how I can fix this?
Relevant answer
hey can you please help to generate random spheres in a unit volume using RVE ?
  • asked a question related to Python Scripting
Question
2 answers
Beta barrels have a characteristic right handed twist. I am interested in comparing different models of the same beta sheets by just how twisted they are against each other. Is there a python script to aid in analysis/measurement of these planar deviations in beta sheets?
Relevant answer
  • asked a question related to Python Scripting
Question
6 answers
Working on load flow analysis for the distribution system, I want to model a distribution system on any Simulation software and want to import all buses voltage magnitude and angle data in MATLAB script or PYTHON script.
Relevant answer
Answer
LABVIEW is the most suitable software that you can integrate your data to other software such as Matlab
  • asked a question related to Python Scripting
Question
10 answers
I am doing the parametric study and I have to optimize the structure for different parameters such as height, angle, and space between the ribs.
Does anybody has any idea, how can I apply fminsearch in python script for abaqus?
Relevant answer
Answer
I am working on 3d printed mold for concrete casting. For mold, I am considering the different parameters such as (rib height, space between the ribs, ribs angle) until now. I am considering only linear elastic analysis.
I want to optimize the rib's structure with a deflection as an objective function.
Objective function: deflection
I made a horizontal (slab or foundation or base) on which I attached a lot of ribs. I want to search for the minimum deflection. If the deflection is minimum at that point I want to remove the part of the rib.
I made a python script from which I can change the ribs angle and other parameters, but I have no idea about step involve in order to use fminsearch. Could you tell me the step required in order to use fminsearch?
I am not using abaqus topology optimization Hesham A. Hegazi
I have attached the .inp file.
  • asked a question related to Python Scripting
Question
1 answer
I have an Isight workflow which simply includes an optimization tool and an Abaqus component. My abaqus model is a single lap joint which has some pins. Thus, im trying Isight to calculate the maximum force the joint withstands (which i calculate from the odb file with an external python script) for a variable length of the pins.
However, when I run the workflow, i get the errors detailed in the picture.
Has anyone encountered a similar problem before? or has any idea of how to solve this?
Thanks beforehands!
Relevant answer
Answer
Talina Terrazas Monje Can you share your Abaqus model (.inp)?
  • asked a question related to Python Scripting
Question
6 answers
Deal All,
I have two series of time series data that I would to correlate. One data set is the deposits, by month, for a list of different account. The other is the balances, by month, for the same list of accounts. In essence, I have two matrices that I want to understand correlation for without having to strip out each account separately. Furthermore, I want to cross-section that data into different segments.
This is being done with the goal of being able to forecast account balances in the futures, by looking at their usage behavior (assuming there is a lag relationship).
How do I build an intermediate matrix of the correlations? Is there a way to do it in Python or R-Studio? Is there a way to do it in excel?
Thanks
Ryan
  • asked a question related to Python Scripting
Question
4 answers
Hello Everyone,
I have a comprehension question regarding the material orientation in ABAQUS. Specifically, I have a VUMAT for anisotropic material behaviour and would like to use that in a cylindrical 3D-model. I understand, in ABAQUS the cylindrical orientation is defined by x=radial, y=tangential and z=axial. Furthermore, I think sigma_11=x, sigma_22=y and sigma_33=z. However, I have determined the model parameters for x=0°, y=90° and z=thickness. So I need a coordinate system defined by x=axial, y=tangential and z=radial. Could someone please help me out on how to proceed? Of course, I can reverse the stress definition in the VUMAT, but that cannot be the solution. So where is my thinking error?
Many thanks in advance and kind regards
Stefan
PS: I am not using CAE since I use a small python script to create the inputfile depending on some variables.
Relevant answer
Answer
Hi Yunpei,
thank you very much. I am not so fit in CAE, but I think that creating a "datum coordinate system" with CAE results in an *ORIENTATION card in the input file. However, in a cylindrical system, X is given as the tangential direction and Z as the axial direction. There is obviously no way to change this.
Kind regards
Stefan
  • asked a question related to Python Scripting
Question
6 answers
I am trying to study modelling of AM process and is unable to create a randomly distributed powdered particles in ABAQUS. I was wondering anyone can help me with this..?
Thanks for your time and consideration.
Relevant answer
Answer
Muhammad Qasim Zafar not yet, im trying.
  • asked a question related to Python Scripting
Question
4 answers
Hello everyone,
A while ago I was working with single-point mutations in protein structures. At the time, I needed to open PDB files and replace a single amino acid using a Python script.
I tried to do this using Biopython's Bio.PDB package, but I got stuck trying to accomplish this using BIO.PDB objects.
Finally, I implemented the mutations by simply opening the PDB file with the open() function; I have erased the lines referring to the atoms in the side chain of the residue in question; I calculated the coordinates of the new atoms based on the main chain (which has not changed); and I recorded the new lines in a new PDB file (then, I used another tool to minimize the atoms' positions but these details are not so important here).
That worked!
Still, I had the feeling that this wasn't the most robust way to solve the problem.
Has anyone tried to do something like this using Biopython?
  • asked a question related to Python Scripting
Question
4 answers
I have a python script in which I can vary the pressure but what I want is to get wind map at 12m in order to do comparison with the observed data collected at that height. I attach the used script.
Relevant answer
Answer
Hello Miguel,
I am using python.
  • asked a question related to Python Scripting
Question
3 answers
I'm trying to create a python script to get the "real" resistance of columns through Finite Element Analysis, and I wonder if there is any possible way to extract the eigenvalue in "Buckle" analysis automatically and then use it in Riks analysis (non-linear) without the need to do it manually.
In Abaqus command line interface, i usually use this script to manually extract the eigenvalue e.g. 1st:
>>> import odbAccess
>>> a1=odbAccess.openOdb('Buckle.odb')
>>> a1.steps['Step-1'].frames[1].mode
1
>>> a1.steps['Step-1'].frames[1].description
'Mode 1: EigenValue = 5.02675E+05'
But how can i automatize it in Python script and automatically insert the chosen eigenvalue in Riks script as the new load applied, see screenshot below:
Also added buckle script
and Riks script (-NL)
Relevant answer
Answer
Qamar Ul Islam Thanks, but that covers the first step, what I'm after is automatically insert these eigenvalues as a load in Riks which the second step
  • asked a question related to Python Scripting
Question
1 answer
I want to select Node #1 and #2 in some parts thought the python script, but every time after I create a script, the code turns out in python script is different from one part to another, for example: 'nodePick=((i, 2, ('[#60 ]', )), )' for part 1 and that change to 'nodePick=((i, 2, ('[#3 ]', )), )' for another. So how use which function can I select directly select the node with the number from Abaqus?
  • asked a question related to Python Scripting
Question
1 answer
So, I am familiar with all the normal tools (google scholar, RSS feed, etc) but I was curious if anyone had a clever way to get daily updates from journals containing keyword that were recently published. For instance, if I wanted all papers published related to 2d perovskites, dion-jacobson/ruddleston-popper structures, etc. Is there a way to implement say a python script, or are there any nice chrome/safari add-ons, or some other method I'm not familiar with?? I can definitely do the brute force methods, but I was hoping to be more streamline with my updates ...thanks for any and all suggestions
Relevant answer
  • asked a question related to Python Scripting
Question
3 answers
I have already found a python script that uses geemap to add a netcdf file to a map. However, the netcdf that was tested with the script contained only 1 band.
I want to apply it to a .nc file that contains 12 bands each band represents data in one month.
the function netcdf_to_ee(nc_file, var_names, band_names=None, lon="lon", lat="lat")
i want to assign to band_names the bands of my file but i don't know how?
# Test with only one variable img = geemap.netcdf_to_ee(nc_file=nc_file, var_names='u_wind') palette=cm.palettes.YlOrRd Map = geemap.Map() Map.addLayer(img, {'min':-20, 'max':25, 'palette':palette, 'opacity':0.6}, "u_wind") Map
  • asked a question related to Python Scripting
Question
9 answers
I want my ABAQUS script to read values from excel (these values will be used to create the FE Model). After the analysis, I want to extract the results (for example, maximum displacement) and save it in another excel file.
Relevant answer
Answer
Excel is not a file format. The spreadsheet can simply be saved/exported as csv or tsv which can be used as any other normal file in any script.
  • asked a question related to Python Scripting
Question
2 answers
After meshing, I want to create a set comprising of all the nodes on a particular surface of a part (in my case, the top surface of a hollow cylinder). I successfully created the node set in the GUI but for a parametric study, I will be considering many different cylinders. So I want to generalize using a python script.
Relevant answer
Answer
Mesh size is not a parameter in my study.
Regards
  • asked a question related to Python Scripting
Question
15 answers
I'm trying to access the History output of a ongoing FSI simulation in Abaqus (Abaqus Standard/Abaqus CFD). I tried doing it in two ways:
1. XY Data - History Output
2. Abaqus python script
For both cases, the History output showed Zero. I noticed this problem didn't happen when the simulation (step) was completed.
For both cases, I checked that the frequency of the History output request was correctly defined. I requested the History output at approximate time steps of 0.0001 sec. I defined this through the "Interval" option (step time/number of intervals) which in my case was 0.2 sec/2000 intervals = 0.0001 sec
Therefore, my questions are:
1. Is there a way to access the History Output of an ongoing simulation?
2. If so, how?
Any suggestions are welcomed. Also, please let me know if you think I'm missing something.
Thanks,
Jose
Relevant answer
Answer
History output from an Abaqus/Standard analysis is available after 10 increments are written to the output database; history output from an Abaqus/Explicit analysis is available after 100 increments are written to the output database or after an Abaqus/Explicit heartbeat is triggered based on CPU time, whichever occurs first.
(From Abaqus documentation-I also just found out this fact)
  • asked a question related to Python Scripting
Question
5 answers
Running Abaqus 6.14-2 here. I have a complex sketch profile, but to illustrate my problem, I have a simple rectangular profile for extrusion that I created in the GUI and I have created two parameters, 'length' and 'width', in the parameter manager of the Sketch module.
I want to run a parametric study modifying the length and width, but I can't seem to find it anywhere via the Python scripting interface. I am able to control the extrusion depth via
mdb.models['Model-1'].parts['Part-1'].features['Sketch-1'].setValues(depth=0.05)
I can see the term 'parameters' if I run
mdb.models['Model-1'].parts['Part-1'].features['Sketch-1'].sketch.__members__
but I can't seem to access it. Where can I find the parameters that I created in the parameter manager?
Relevant answer
Answer
You are welcome. I hope you succeed.
  • asked a question related to Python Scripting
Question
5 answers
From Simulink subsystem after generating C code using Embedded coder wanted to find the number of lines the code will be executed considering the worst path ( lengthy path it the code can follow. Any algorithm or methods references available which can be used for the purpose ?
for e.g. :
1. If (a>b)
2. x=1;
3. y=2;
4 z=3;
5. else
6. a=4;
in this case possible maximum length is 1-->2-->3--4 .
maximum number of executed lines will be equal to = 4 in this case , considering if condition true .
If else condition get executed since number of lines under else condition is one total number of executed lines will be equal to 3
So the algorithm should return maximum number =4
Relevant answer
Answer
Hello,
maybe this Git project will help you out
Kind regards
  • asked a question related to Python Scripting
Question
3 answers
Please help me to build a python script I can use plotting wind map for a given zone.
Relevant answer
Answer
The following link can get you started:
Best regards,
Ebrahim
  • asked a question related to Python Scripting
Question
4 answers
I'm trying to create a python script to get the "real" resistance of columns, and I wonder if there is any possible way to extract the eigenvalue in "Buckle" analysis automatically and then use it in Riks analysis (non-linear) without the need to do it manually.
Basically, extract the eigenvalue from Linear Petrubation - Buckle analysis, and use it in another model with Riks analysis to get LPF and automatically and plot Force-Displacement plots.
Relevant answer
Here is a tutorial on eigenmode imperfections and newton raphson which may be helpful:
here is a tutorial on extracting the load displacement curve via python:
  • asked a question related to Python Scripting
Question
4 answers
I have protein data consisting of Degree, Closeness, Betweenness, Degree, And Eigenvector values in an XL sheet. Now my assignment is to make a Prediction with accuracy value using the machine learning approach. I'm not an expert in programming. I have downloaded Anaconda and R don't know which will be best.
-Can anybody please guide me on where do I get the algorithms or provide me some materials to do it?
-can anybody please tell me how to define train data and test data from my whole data sets?
-What type of classifier will be best to get a high accuracy?
- a Step-by-Step instruction will be easier to understand.
A big big thank you in advance
Relevant answer
Answer
There are plenty of options to use ML in R. I would recommend using the caret package. This package has the means to do a quick and efficient data split (training, testing) and offers multitude of machine learning algorithms both supervised, unsupervised. There are excellent tutorials available that given information on how to conduct ML step by step. Here is the comprehensive guide that outlines all the key steps.
The caret Package (topepo.github.io)
Once you get into caret package there are several advanced options to ensemble or stack your models.
Good luck with your project.
  • asked a question related to Python Scripting
Question
4 answers
Hi,
I am trying to understand Abaqus Benchmark example 1.19.2 - Crack proagation in a plate with a hole simulated using XFEM.
I ran the python script provided "crackprop_hole_lefm_xfem_cpe4.py" from the site: http://dsk.ippt.pan.pl/docs/abaqus/v6.13/books/bmk/default.htm?startat=ch01s19ach135.html
I want to try and output figure 1.19.2 - 4.
I have create a path --> each node starting from left to the end of the plate. Next, Tools > XYdata > Create Path > Selected defined Path (maybe issue here) > Define Field output and frame > Plot and I cannot get the same curve.
Potential Issue:
1. Crack path was not define properly.
2. Field output was defined wrongly. I'm assuming Mises?
3. Frame was defined wrongly. 
I just want to learn to plot a load vs crack length curve.
Any help is greatly appreciated!
Relevant answer
Answer
Can you explain how to get Phi from output or at least provide the Abaqus manual where it is explained.
Regards
Biswabhanu
  • asked a question related to Python Scripting
Question
3 answers
I need to generate random crystals that will create a credible structure within a specified boundary (e.g. a sphere or a box). It needs to have a material database. Can anyone suggest to me any python library?
  • asked a question related to Python Scripting
Question
7 answers
I have a cubical RVE. Multiple spherical and ellipsoidal holes have been cut in the RVE. I need an element set for each of their surface. It is difficult to do this manually for multiple spherical and ellipsoidal holes. Could someone suggest how I could do this with python scripting?
Relevant answer
Answer
I got it, now if you search about the "FIND AT" command, in Abaqus python scripting, you would find the solution.
"Find at", is an executable command in Abaqus which is related to finding different sections of a geometry based on their coordinates. In your case, the RVE has been constructed by python, so coordinates are available.
  • asked a question related to Python Scripting
Question
3 answers
I have calculated the ROTI from a dataset with my understanding, and I need to validate my results with some standard code results. Are there any sites to download the ROTI to confirm my code output to make sure I am not wrong? You can suggest the algorithm to calculate ROTI.
Relevant answer
Answer
Dear Ashok Silwal, you can find many data sets for running validations/comparisons from some past missions.
Here you can find some examples from the ESA GOCE and Swarm missions.
For further details, you can find many references browsing these web pages.
Good luck!
  • asked a question related to Python Scripting
Question
4 answers
Specifically, in deep reinforcement learning. I mean, I need some references about calculation of the computational complexity for action selection and training process? I need it for developing a python script to calculate the computational (time and space) complexity any deep reinforcement learning method by simply input some feature of the methods.
Many thanks.
Relevant answer
Answer
  • asked a question related to Python Scripting
Question
10 answers
Right now I am studying GRAVSOFT for geoid modeling to use it in my thesis, I tried to read the manual but it was not explaining the GUI Python version (it is explaining the Fortran version), so that I am still confused to understand the software clearly. I would like to understand clearly which data I have to use for determination geoid modeling and the steps (step by step) of doing that using GRAVSOFT programs.
please provide me any documents or any files that can let me understand all the programs inside the GRAVSOFT interface specifically for creating geoid modeling.
Thanks in advance and your comments are appreciated
Relevant answer
Answer
Anas Sharafeldin Mohamed Osman GEOCOL and GEOGRID for gross-error detection.
Good luck
  • asked a question related to Python Scripting
Question
12 answers
I have been trying to use the python command line below in for loop to extract stress for all elements at all frames, but it takes hours even for the normal size model. I have no more than 30,000 elements. Because it calls the same field object every single time again which is slow and probably takes 1-2 seconds everytime.
Stress=myOdb.steps[stepName].frames[fr].fieldOutputs['S'].getSubset(region=myInstance.elements[el],position=CENTROID, elementType='C3D8H').values
I will be checking each element, through various time frames for the calculation I want to perform. But just the data extraction is taking hours. And then calculations are just few minutes only.
Is there a better way to extract all stress values on all elements at all frames quicker? I know there should be a way because Abaqus/Viewer or Hyperworks don't take hours to plot the same Odb file. It takes just a few seconds and then I can probe each element or node very quickly and also run animations with contours.
So is there a better way to extract data faster?
Relevant answer
Answer
You probably already solved this, but BulkDataBlocks (as used in the link posted by Seyedmahdi Hosseinitabatabaei) should work best. They are only documented in the C++-based Scripting Reference Guide http://130.149.89.49:2080/v2016/books/ker/default.htm?startat=pt02ch61pyo05.html but work for Python, too. You can find a brief explanation of how to extract field output data using bulkdatablocks here: https://www.martinpletz.com/fe-scripting-4/
  • asked a question related to Python Scripting
Question
2 answers
In the g_mmpbsa method, at the end of the calculation, generally, we introduce two python script (MmPbSaStat.py and MmPbSaDecomp.py) to calculate the final contribution and decomposition. Did anyone modify those scripts to get expected results and avoid all of the other values which are not needed? If did, what is the procedure?
  • asked a question related to Python Scripting
Question
4 answers
I am trying for the first time to use Autodock4 and Autodock vina.
I found the Python scripting for Autodock Vina and in the first example, there is this sentence "In the case, you want to use another forcefield like AutoDock4 or Vinardo, just replace vina with ad4 or Vinardo".
I have read that the difference between autodock4 and Autodock vina is the score function, so using Python Scripting with the ad4 score function would be the same as using autodock4?
Relevant answer
Answer
  • asked a question related to Python Scripting
Question
4 answers
Hello, Please have a look to my current problem that i am facing while modelling using advance modeller tutorial. as they have not provided the python script for the all 3 that are pdb structure, query sequence and the new model multiple sequence alignment.
Relevant answer
Answer
@SAMEE ULLAH the tutorial video quality is too low to understand anything. Can you explain this with practical example?
  • asked a question related to Python Scripting
Question
1 answer
Hello
I am running a simulation on Abaqus based on a python script for a simple thermal model. The model is a shell box with nine surfaces total, based on partitions made. The density and conductivity are assigned. Boundary condition is a surface film condition for convection with sink temperature of 20ºC. Thermal load is a surface heat flux assigned to be from inside to outside as shown of image boxLoads.PNG, and the problem is that i was expecting a heat flux to be more distributed along the faces of the box instead of being concentrated only on the borders of the face shown on boxResultsHFL.PNG, so maybe i am doing something wrong on the python script.
The objective is to define a simulation that accounts for a heat flux from inside the box to the outside of the box, and it is supposed to be along all surfaces to study the effect of thickness in heat flux. Can someone help me finding the error behind this strange results focused on just one face?
The code in python as well as figures that show my pronblem are attatched here.
Thank you all in advance
Nuno
Relevant answer
Answer
Hi Nuno,
Here are a few notes on the model you have developed.
1. The model is made of shell elements and the elements have 5 integration points through their thickness.
2. Shell elements have inside and outside surfaces (in Abaqus these are often called SNEG and SPOS).
3. The surfaces of a shell element are defined in terms of the element normal. The SPOS side of the shell is on the side of the shell in the positive direction of the element normal.
4. All of the element normals on your box point outwards, so SPOS is on the outside of the box.
5. The heat flux is applied to the same "side" of the element as the film. For example, where the flux is applied to the side SPOS, the film is also applied to SPOS. (There is only one case where the film and flux are applied to the SNEG side.)
6. You are performing a steady state analysis. This means that the solution will only determine the temperature distribution equivalent to a long time.
7. I think that the steady state temperature distribution when the flux and film are on the same side is equal to the ambient because the flux just goes straight in and then leaves immediately without heating the box.
Therefore, I suggest that you should have the film on one face and the flux on the other face. Also, I think all fluxes should be one the same side (e.g. SPOS).
I hope this helps.