Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Convert a C program to matlab program. I am stuck. Please help. I want the values of Jacobian factor,its first and second derivative.

1 Ansicht (letzte 30 Tage)
for(int i=0;i<3;i++)
{
chi=fchi[i];
%%Shape function for axial effect
N1(chi)=(-1/2)*chi*(1-chi)
N2(chi)=(1+chi)*(1-chi)
N3(chi)=(1/2)*chi*(1+chi)
//First Derivative of Shape Function//
N1=chi-0.5
N2=-2*chi;
N3=chi+0.5;
//Second Derivative of Shape Function//
N11=1;
N22=-2;
N33=-1;
Lxn_dash=N1*x1+N2*x2+N3*x3;
mxn_dash=N1*y1+N2*y2+N3*y3;
nxn_dash=N1*z1+N2*z2+N3*z3;
Lxn_ddash=N1*x1+N2*x2+N3*x3;
mxn_ddash=N1*y1+N2*y2+N3*y3;
nxn_ddash=N1*z1+N2*z2+N3*z3;
%%Jacobian Factor
Jn(icounter)=sqrt(pow((Lxn_dash),2)+pow((mxn_dash),2)+pow((nxn_dash),2))
%%First Derivative of Jacobian Factor
Jn_dash(i)=(0.5/sqrt(pow((Lxn_dash),2)+pow((mxn_dash),2)+pow((nxn_dash),2))*(2.0*Lxn_dash*Lxn_ddash+2.0*mxn_dash*mxn_ddash+2.0*nxn_dash*nxn_ddash))
%%Second Derivative of Jacobian Factor
Jn_ddash(i)=-0.25*pow((Lxn_dash),2)+pow((mxn_dash),2)+pow((nxn_dash),2),-1.5*(2.0*Lxn_dash*Lxn_ddash+2.0*mxn_dash*mxn_ddash+2.0*nxn_dash*nxn_ddash)*(2.0*Lxn_dash*Lxn_ddash+2.0*mxn_dash*mxn_ddash+2.0*nxn_dash*nxn_ddash)+(0.5/sqrt(pow((Lxn_dash),2)+pow((mxn_dash),2)+pow((nxn_dash),2))*(2.0*Lxn_dash*Lxn_ddash+2.0*mxn_dash*mxn_ddash+2.0*nxn_dash*nxn_ddash))
  2 Kommentare
Virajan Verma
Virajan Verma am 3 Okt. 2018
Attempted to access N1(2); index out of bounds because numel(N1)=0.
Error in xz (line 25) N11=diff(N1(epsn)); This error is coming

Antworten (0)

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by