Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

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 visualizzazione (ultimi 30 giorni)
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))

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by