Weighted average Taylor Factor?

135 views
Skip to first unread message

MTEXNewbie

unread,
Jul 12, 2018, 6:31:35 AM7/12/18
to MTEX
Versions: MATLAB 2016b and MTEX 5.1.1

Hi,

I am trying to calculate the average Taylor Factor weighted by grain area using the code below, but I am getting a dimension mismatch. M is [1×631] and grains.area is [1×642], and the dimension of the index of the most active slip system is [1×631].

%% Taylor model
csSF = ebsd('Iron fcc').CS;
% consider fcc slip systems
sS = slipSystem.fcc(csSF);
% and all symmetrically equivalent variants
sS = sS.symmetrise;
% some strain
q = 0.5;
epsilon = strainTensor(diag([-q -(1-q) 1]),'name','strain');
% compute Taylor factor for all slip systems
[M,b,mori] = calcTaylor(inv(grains('Iron fcc').meanOrientation) .* epsilon,sS);
% index of the most active slip system - largest b (along the rows)
[~,active] = max(b,[],2);
% Calculate mean taylor factor
mean(M)
% Calculate weighted mean taylor factor
N = 2; % Dimension for the mean
weightedMeanM = sum(M.*grains.area,N)./sum(grains.area,N)

Matrix dimensions must agree.

Error in Steel_90_cross (line 225)
weightedMeanM = sum(M.*grains.area,N)./sum(grains.area,N)

1. I was wondering why M is not being calculated for some grains?

2. How do I proceed with the weighted average calculation in my case?

Ralf Hielscher

unread,
Jul 12, 2018, 6:35:32 AM7/12/18
to mtex...@googlegroups.com
1) Not all grains belong to the phase  'Iron fcc' ....

********************************************************************
Ralf Hielscher                   Tel: +371-531-38556
Fakultät für Mathematik               +371-531-22200 (Sekr.)
Technische Universität Chemnitz  Fax: +371-531-22109
Reichenhainer Str. 39            E-mail: ralf.hi...@mathematik.tu-chemnitz.de
D-09126 Chemnitz                 http://www.tu-chemnitz.de/~rahi
********************************************************************


--
If you want to reduce the number of emails you get through this forum login to https://groups.google.com/forum/?fromgroups=#!forum/mtexmail, click "My membership" and select "Don't send me email updates". You can still get emails on selected topics by staring them.
---
You received this message because you are subscribed to the Google Groups "MTEX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mtexmail+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/mtexmail.
For more options, visit https://groups.google.com/d/optout.

MTEXNewbie

unread,
Jul 12, 2018, 6:58:53 AM7/12/18
to MTEX
Thanks Ralf, now I have used 

weightedMeanM = sum(M.*grains('Iron fcc').area)./sum(grains('Iron fcc').area)

It works, but does that look okay? The previous code with N is returning the same array M, instead of a scalar value.
Reply all
Reply to author
Forward
0 new messages