Pierre-alexandre

10 Reputation

One Badge

6 years, 328 days

MaplePrimes Activity


These are replies submitted by Pierre-alexandre

@acer 

Hi Acer, can you explain me what is better with Embedded Components or with Maplets?

cheers

@acer 

I don't know what is embedded components.

I use maple to fit my research datas, and I already created few codes for different fitting process. It's just that other people from my research team would like to use my fitting procedure, but in a more friendly way ( without having to interact with a code itself), like using an interface. And before creating a small freeware for that, I want to try using maplet interface, because I saw that it's possible.

But tell me more about embedded components?

cheers

Nobody have any beginning of idea ?

@tomleslie

that's sound interesting,

yes, I can store in that

snapshot->moleculetype->moleculenumber->atomesite,

I'm trying that thanks :)

@tomleslie 

For example, see below an example of one full snapshot, I'm able to plot using your modified updated version,

here we can see in white "FSI" nuclei, and in the other color, the different C1,C2 ... nuclei.

What could be interesting therefore, is to be able in a first approach, to plot only one C1, and all FSI, to see the distribution of FSI point around this C1, to do the same for one C2, one C3...,
and then apply all of that, to every snapshot in order to see which C sites got the more or closer FSI, as a function of time (as different snapshot corresponds to different times).

And the final step will be to apply that to all C1 sites, all C2 sites and so on, in order to get a statistic distribution of FSI against the different C sites!

Is it clearer ?

thanks :)

@tomleslie 

Hi Tom,

I'm sorry if my questions begin to be annoying, in fact your two last answers were exactly what I was trying..
The whole code I try to make, will be big (at least in my point of view, I'm just a PhD in chemistry not na IT guy),
An there is several things and potential ways to do what I want to do,

Futhermore, I was trying to do things step by step, as I don't wnt you to spend your time, by doing the whole code,

Unfurtnately, yes, after some of your answers (which were acurrate), I think about other way to interprete the data, and I was trying to do this  (sphere plot), And I used the sphere function, because it was something I found on the maple help. As I don't really know and understand a lot of things on maple, I'm only trying yet, so yes for sure a lot of my attemps are probably wrong or unefficient or so on.

But okay , I will give you the whole idea of what I trying to do.

 

I f your not familiar with Molecular dynamics (MD) simulation:

The text file is a result of a MD simulation of a chemical system, fill with three types of molecules.

After appling some constraint beetween molecules, we let evolve this system, and acquire some snapshot of the sytem at different time.

Bassically each time the "1728" occur this corresponc to on snapshot of a molecular box system of around 300 molecules. And the "1728" occur thousands of time. Between each snapshots molecule moved.

My overall study is to understand how molecule of different types interact together (in the present file until the results of two of these molecules is present (C1,C2... corresponding to 1 type of molecule, and FSI corresponding to another).

The aim of this code is to try to exctract which "FSI" are close to which (C1,C2...), in fact C1 C2.. corresponds to different carbon sites of this type of molecule.

What I want to exctract and show, is that, after the FSI is either closer in space either more often around a specific C site ( closer to C1 or C2 or C3 ...).

As the text file give me the position of the different molecular types and sites, I want to extract all these positions, and see if I can get the "distance beetween sites".

There is a lot of way to have this kind of results, and can follow for example the same molecule type, let say the first group of carbon ( so the first C1,C1,C2,C2,C3,C4,C5,C6 occurence) over all the "snapshot" (so the first occurence of this group after each "1728", and then plot the postion of all the FSI, and extract all the distance between FSI and each C group.

And can also make it simpler and plot a "sphere" around the C group (with the center of the sphere corresponding to the barycenter of all the C position of the molecule), and record everytime a "FSI" enter in the sphere, and then extract the distance beetween these "FSI" to each C sites.

There probably other way to do such kind of things, this one, was according to me the better one,

I'm sorry in advance if this explanation is not clear enough...

But thanks anyway to had taken the time to help out already!

cheers

@tomleslie 

Hi tom, thanks a lot for that, that's quite interesting,

I'm now actually trying to plot alll these C1 position in a 3D plot as sphere,

my problem is when I want to use display, I need to put all sphere one by one if I want them to appear on the same plot,

I don't understand how to make them appear on the same one.. (testfile attach)

 

restart;
with(LinearAlgebra): with(CurveFitting): with(Optimization): with(plots): with(Statistics): with(ListTools): with(StringTools):
with(plottools):
with(ArrayTools):
with(FileTools):
with(SignalProcessing):
  fileToImport := "test2.txt":
  M1:=ImportMatrix( fileToImport):
#
# Get the row numbers where 1728 appears
#
  L:=[seq(`if`(M1[j,1]=1728, j, NULL), j=1..op([1,1], M1))];
#
# Split the input matrix into a list of matrices, bounded
# by where 1728 appears
#
  LM:= [M1[1..L[1]-1, 1], seq(M1[L[j]+1..L[j+1]-1,1], j=1..numelems(L)-1), M1[L[-1]+1..-1,1]];
#
# Strip the "generated by VMD" stuff
#
  F:=vec-> <seq(`if`(vec[j]="generated by VMD", NULL, <vec[j]>), j=1..op(1, vec))>:
  M2:=F~(LM[2..-1]);
#
# Parse each matrix in the list
#
  G:=mat->Matrix(sscanf~(convert(mat, list), "%s%f%f%f")):
  M3:=G~(M2);
#
# Retain only entries matching iden
#
  iden:="C1":
  H1:= mat-><seq(`if`(mat[j,1]=iden, mat[j,..], NULL), j=1..op([1,1],mat))>:
  H2:= mat-><seq(`if`(mat[j,1]=iden, mat[j,2..], NULL), j=1..op([1,1],mat))>:
  H1~(M3):
  C_1mat:=op(H2~(M3));
 op(M3(1,2,1));
C_1mat(1,1,1);
C_1:= (i)->[C_1mat(i,1,1),C_1mat(i,2,1),C_1mat(i,3,1)];
C_1(1);
rayon:=0.4;


display({sphere(C_1(1),rayon,color="black")},style=patchnogrid, axes=none);
display({sphere(C_1(1),rayon,color="black"),
sphere(C_1(1),rayon,color="black"),
sphere(C_1(2),rayon,color="black"),
sphere(C_1(3),rayon,color="black"),
sphere(C_1(4),rayon,color="black"),
sphere(C_1(5),rayon,color="black"),
sphere(C_1(6),rayon,color="black"),
sphere(C_1(7),rayon,color="black")},style=patchnogrid, axes=none);


 

 

@tomleslie 

Hi, I get what you re explaining but it's not that,

in the full text file, there is thousand of numbers beetween each "1728", and a just need to create a new matrix with the C1 numbers beetween each "1728".

In fact if you want to understand everything, each sequence between each "1728" correspond to a snapshot of a molecular system, fill with the same molecule (molecule with 8 Carbone, C1*2, C2*2, C3...) and this molecule is present several time,

the next snapshot correspond to the same system, after a certain time, thus, all C1,C2...  for each molecule have moved,

So I need to separate all the snapshot in order to be able to compare,

in fact I'm still trying to figured out how I will interpret the data...

cheers

@tomleslie 

Allright, it's actually working well now,

I will try to create the counter for the "1728" i norder to create the separate matrix!

Thanks a lot !

@tomleslie

I think I figured out the problem, 

it looks like to be due to the text on top:

"1728
 generated by VMD"

In fact this two phrase will occurs several times in the document, and that was something I was planning to try, but I will need maple to count everytime it see "1728", and create a another M2 matrix everytime it see this number.

 

@tomleslie 

Thanks a lot for that, M2 is exactly what I need, unfortunately, apparently Importmatrix cannot open my text file (attach)

Sorry I'm an early begginner of maple..

Page 1 of 1