Dear Dave,

Thank you for sending me this code.

I tried to apply the second method under solution but the result that I got is a contour plot ofÂ Â variable elastic modulus which the maximum in the outer layer with the value which is obtained from the default value of the elastic modulus (that I had to defined in engineering data). However, I had added the command macro under the geometry to overwrite the default material data and the solution were done based on those new values of material data ( the elastic modulus as a function of radius(. So, I need to show those values of overrided elastic modulus on a contour plot-The values are changing from 0.02 to 0.25 MPa. How can I modify your code to make ansys to get the new material data not the default one? I would appreciate if you could help.

And, here is the code that solve the problem with the elastic modulus as a linear function of radius.

MPDELE, elastic,all

TBDELE,elastic,all

Â csys,1

Â esel, all

cm,remainingelem,elem

matid=1

*Do,ee,1,100000

*get,nextElem,ELEM,0,nxth

*get,elemxposition,ELEM,nextElem,cent,x

esel,r,cent,x,elemxpositionÂ

cm,elementXgroup,elem

*SET,x_pos,elemxposition

E_X=0.46*x_pos-2.74

Â Tb,elastic,matid,,2,Isot

Tbdata,1,E_X,0.49

MPCHG,matID,all

*get,count_control,elem,,count

Â cmsel,s,remainingelem

cmsel,u,elementXgroup

cm,remainingelem,elem

Â *get,Element_count,elem,,count

Â *if,element_count,eq,count_control,exit

Â matid=matid+1

Â *enddo

matid=matid+1

Â *get,nextElem,ELEM,0,nxth

*get,elemxposition,ELEM,nextElem,cent,x

esel,r,cent,x,elemxpositionÂ

cm,elementXgroup,elem

Â *SET,x_pos,elemxposition

E_X=0.46*x_pos-2.74

Â Tb,elastic,matid,,2,Isot

Tbdata,1,E_X,0.49

Â MPCHG,matID,all

esel,all

Â

Â