jmichaelb / PublicationArchive

Directories within have code associated with publications
3 stars 1 forks source link

Excuse me, I have a little problem on running code #1

Open antidote36 opened 2 years ago

antidote36 commented 2 years ago

(1) Excuse me, I have a little ablility on write code. But I have some request on use the code on solving elasticities with measured velocities data. But there are some mistakes in running the code. The result is as follows:

[Cout,eaout,Results]=Velocities2Cij(Input,Co,'n',ea,'n','LM'); % just calculate results for input moduli

Error:File: velocities2Cij.m Line: 64 Column: 8 Identifier 'DataSource' is not a function or a shared variable. To share 'DataSource' with a nested fuction, intialize it in the current scope for more information, see Sharing Variables Between Parent and Nested Functions.

(2) The second question is that we want to run the code in solving the elasticities like orthorhombic structure, but we can't find out a instruction to revise it. Maybe I don't find it.

Thank you so much! Looking forward to your reply. Best wishes

jmichaelb commented 2 years ago

Hi

I am so glad you are trying the code. But I am sorry you are having difficulties

To figure out what is going on, we need to work through the details of what you have tried.

  1. In what environment are you running the code? Matlab or Octave? and what version? I’ve tested both but there is a possibility that you are running a version that I have not tested.

  2. Are you running the example “live” script? You pasted in the call to Velocities2Cij but do not include the necessary prior call to load data. It is unclear what the full setup of the problem is

  3. My distribution includes several example datasets - but I see I did not include an orthorhombic example. I can send you an orthorhombic example. But we should first find the source of your current problems and verify that you can reproduce the results published in the paper.

Here is a copy of the paper for reference - it provides an additional tutorial in running the code Brown2018_ultrasonics.pdf

antidote36 commented 2 years ago

Hi

I am very glad to receive your reply.

  1. The enviroment running the code is Matlab (vision R2021a).

  2. Yes, I run the "DemonstrationScriptLive.mlx" that seems like the data import successfully. The test is as follows. But the next step can't proceed. ([Cout,eaout,Results]=Velocities2Cij(Input,Co,'n',ea,'n','LM'))

display(Input.opts) struct with fields:

  constants: [237.8000 83.5000 80 9 183.6000 59.9000 9.5000 229.5000 48 76.6000 8.4000 73 81.6000]
       ifit: [1 2 3]
     iconst: [1 2 3 4 5 6 7 8 9 10 11 12 13]
eulerangles: [3×3 double]
  1. Yes, I see the datasets. Thanks for your supply.

I have read the paper. This is a great study that points out several methods for uncertainty analysis of solution elasticity and evaluation of global optimal solutions. But I have a confusion about how to calculate the reduced chi-square χ2 – thesum of the square of misfits weighted by uncertainty and normalized by the number of data in your paper. I have searched for a few paper but a little information abut it.

Thank you so much! Looking forward to your reply. Best wishes

jmichaelb commented 2 years ago

My apologies. I find that the version I last uploaded had a line missing that initialized the variable DataSource. The quick fix that I will correct in the GitHub directory is to add a line of code to Velocities2Cij after line 20 (at the beginning of the code after the comment section). Simply paste in the following as a new line 21:

DataSource='SurfaceWaves'; % Need to initialize

I think this will fix the error problem. Let me know and thanks for helping fix the repository.

jmichaelb commented 2 years ago

With regard to the reduced chi-square, the wikipedia summary is OK but my primary reference for statistics is: Bevington, Philip R. (1969), Data Reduction and Error Analysis for the Physical Sciences, New York: McGraw-Hill, p. 89, For χ2 tests, χν2 should be approximately equal to one.

antidote36 commented 2 years ago

ok, the error problem has been fixed.

antidote36 commented 2 years ago

I will read it. Thank you very much.

antidote36 commented 2 years ago

Could you add an orthorhombic example in the database so that I can run my data to test its uncertainties.

Thank you.

jmichaelb commented 2 years ago

I added an example with data for an orthorhombic crystal. I also fixed one other problem in Velocities2Cij where velocities for plots were not calculated correctly if the euler angles are optimized.

antidote36 commented 2 years ago

ok, I have runned the code successful. Thank you very much.

jmichaelb commented 2 years ago

Feel free to contact me at brown@ess.washington.edu to discuss any workflow issues or difficulties with particular datasets.

All the Best Mike