problem with chili

A place to report and discuss potential bugs
Post Reply
Emilien
Resident User
Posts: 59
Joined: Mon Apr 20, 2015 12:13 am

problem with chili

Post by Emilien »

Hi,
I tried to perform chili simulation using the weight field and I obtained strange results...
Here is a simple example:
we have 3 spin systems (with Exp in the attached test.mat) :
1) Sys1: a radical with an hyperfine coupling (14N). weight=1
2) Sys2: a radical with two hyperfine couplings(14N and 1H). weight=1
3) Sys3: same as Sys1 but weight=0.2

Code: Select all

[x1,y1]=chili(Sys1,Exp);
[x2,y2]=chili(Sys2,Exp);
[x3,y3]=chili(Sys3,Exp);
Let's look the plot:

Code: Select all

plot(x1,y1,'k',x3,y3,'m')
results in
Sys1and3.jpg
Sys1and3.jpg (7.64 KiB) Viewed 5827 times
It looks good, because the proportions seem to be ok.

Code: Select all

plot(x1,y1,'k',x2,y2,'m')
results in
Sys1and2.jpg
Sys1and2.jpg (10.83 KiB) Viewed 5827 times
In this case, the weights are equal so that the amplitude of the broad signal from Sys2 should be lower than the amplitude of Sys1. That is clearly not the case...

Moreover, the pepper and garlic functions seem to give signals in the right proportions...

What is wrong?
Thanks in advance!
Attachments
test.mat
(908 Bytes) Downloaded 473 times
Stefan Stoll
EasySpin Creator
Posts: 1050
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: problem with chili

Post by Stefan Stoll »

This is a non-obvious consequence of the convolutional broadening with a extremely narrow almost delta-like Gaussian.

You are using Gaussian convolutional broadenings of 0.01 mT in Sys1.lw and 0.04 mT in Sys2.lw. Your field increment is dB = 20 mT/1024 = approx 0.02 mT. So both one of your Gaussian lineshapes is narrower than a single field increment and will essentially look like a delta spike:

Code: Select all

B = linspace(340,360,1023);
lw = 0.01;
y = gaussian(B,350,lw);
plot(B,y);
This leads to numerical problems during the convolution.

For now, you can fix this in several ways: (1) remove the Gaussian broadening - clearly not needed if it's really this small; (2a) make lw(1)/dB >=2 by increasing the FWHM of the Gaussian broadening; (2b) make lw(1)/dB>=2 by shrinking dB through increasing the number of points (Exp.nPoints).

In the next release, chili (as well as garlic and pepper) will detect this situation automatically and take care of it. Thanks for reporting!
Emilien
Resident User
Posts: 59
Joined: Mon Apr 20, 2015 12:13 am

Re: problem with chili

Post by Emilien »

Hi,
I'm facing this problem again with easyspin-5.2.16...
Do you plan to fix it in the future?
Thanks,
Emilien
Stefan Stoll
EasySpin Creator
Posts: 1050
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: problem with chili

Post by Stefan Stoll »

In general, we recommend to use broadenings that are larger than a few increments, since narrower ones have no effect on the spectrum. If you want to use narrow lineshapes, increase the number of points.
Emilien
Resident User
Posts: 59
Joined: Mon Apr 20, 2015 12:13 am

Re: problem with chili

Post by Emilien »

OK tanks...
If I'm not mistaken, old versions of simulation functions required linewidth... I thought that lw or lwpp is also mandatory with chili. But the algorithm behind generate linewidths, isn't it?

(Moreover I did not realize that the sampling of the magnetic field range was used for setting the gaussian/lorentzian line used as input of the matlab conv function.)

Your advice could be to start chili simulations with lw=0? And introduce lw after if necessary?

Thanks for your help!
Stefan Stoll
EasySpin Creator
Posts: 1050
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: problem with chili

Post by Stefan Stoll »

Unless you are in the fast-motion regime, leaving the convolutional broadening out should work fine.
Post Reply