cwEPR App for processing, simulating, and fitting CW EPR data

Programs, scripts and GUIs shared by EasySpin users
bruin
User
Posts: 23
Joined: Fri May 29, 2020 11:07 am

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by bruin »

Sure, no problem. The attached .mat file contains three simulations, but the problem I'm talking about concerns Sys1.
Sys 2 and Sys3 give spectrum exceed sweep range and the small spikes caused by that are normal. The problem is Sys1 (no error, and the big spike at 0 gauss is not present in esfit (if you also load the attached experimental spectrum).
Maybe it's a file name problem?

Attachments
JHB099b_test_schilfers_20K_att_20_1_dag_oud_60s_baseline_corrected_2.DTA
(117.19 KiB) Downloaded 1218 times
JHB099b_test_schilfers_20K_att_20_1_dag_oud_60s_baseline_corrected_2.DSC
(404 Bytes) Downloaded 1270 times
simulatie_1_day.mat
(2.28 KiB) Downloaded 1207 times
ThomasMCasey
User
Posts: 34
Joined: Tue May 26, 2015 1:50 pm

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by ThomasMCasey »

Bruin,
I think the ModAmp is the problem. The field is periodic about each given field point when you specify a ModAmp, and since you have a B=0 point and five more points within 0.5*ModAmp, when the simulation is calculating the spectrum within the first 5 points the field value is extending to less than or equal to 0. When I remove ModAmp the spike goes away.

Last edited by ThomasMCasey on Thu Oct 22, 2020 8:07 am, edited 1 time in total.
bruin
User
Posts: 23
Joined: Fri May 29, 2020 11:07 am

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by bruin »

Yes, indeed! Sorry for causing confusion. I didn't realise this. Couldn't reproduce the issue in EasySpin standalone, but I didn't specify ModAmp there. I didn't even think of this possibility, but make perfect sense. Thanks!
(apparently esfit called from the cwEPR GUI with ModAmp activated immediately removes the spike in the first fit).
Good to know this for future simulations!

ThomasMCasey
User
Posts: 34
Joined: Tue May 26, 2015 1:50 pm

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by ThomasMCasey »

Update available! https://www.mathworks.com/matlabcentral ... 3292-cwepr

v3.1 is compatible with easyspin v6.0.0-dev.26.
Other notable changes: no more need for external "helper_functions" and a new "Export Structs" button in the Tools tab for exporting all parameters to the workspace as they need to be arranged to use in a simulation or fit. The parameters go into a structure called 'cwepr' to avoid accidentally overwriting any existing Sys, Exp, Opt, Vary, FitOpt structures. Use them, for example, in this way: garlic(cwepr.Sys1, cwepr.Exp, cwepr.Opt). Also remember you can quickly import any existing structures using "import struct name" in the input edit fields. For example, if you have a Sys structure named "Sys2" in your workspace, import this under any Sys tab using "import Sys2" in the edit field. This is convenient for using the app with parameters from existing scripts without manually transferring all parameters.

bruin
User
Posts: 23
Joined: Fri May 29, 2020 11:07 am

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by bruin »

Great! Thanks a lot. Works fine so far! New export function is really handy.

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

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by Stefan Stoll »

Great tool!

ES v6 is still in the works, so there is a chance that there are bugs that we haven't caught yet. If you run into one of them, please post it on this forum or open an issue on EasySpin's GitHub repo.

bruin
User
Posts: 23
Joined: Fri May 29, 2020 11:07 am

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by bruin »

Hi Thomas,

It seems the cwEPR App has a problem with scaling in combination with easyspin 6.0.0 dev 43 & matlab 2021b.
(not 100% sure, but it seems I also had this problem with older version of easyspin, but did not test that thouroughly; the problem suddenly appeared)

However, changing the "rescale" function to "rescaledata" in all places seems to solve the issue.
(based on: viewtopic.php?f=3&t=836&p=2945&hilit=rescale#p2945).

If you have time, could you perhaps check and update the app? Not sure if/how this might affect compatibility with the stable version of easyspin.
Thanks!

ThomasMCasey
User
Posts: 34
Joined: Tue May 26, 2015 1:50 pm

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by ThomasMCasey »

bruin, I updated the app to address this issue and posted the new version (https://www.mathworks.com/matlabcentral ... 3292-cwepr). It should work fine for both the dev and stable versions. Let me know if there are any other issues. Thanks again for all of the feedback!

bruin
User
Posts: 23
Joined: Fri May 29, 2020 11:07 am

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by bruin »

Thanks a lot Thomas for the quick fix! Problem solved.
I'll let you know if I encounter any future problems.

bruin
User
Posts: 23
Joined: Fri May 29, 2020 11:07 am

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by bruin »

Dear Thomas,

When trying to use cwEPR and the latests development version of EasySpin (41), the esfit procedure doesn't work anymore.
Any chance this can be fixed easily? Seems to be caused by a changed input format in EasySpin.
If you could look into this, that would be great!

Thanks,
Bas

Post Reply