Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Jacobian Matrix of B with respect to H (Accessing External Material Models)
Posted 31.07.2017, 09:00 GMT-4 Low-Frequency Electromagnetics Version 5.3 1 Reply
Please login with a confirmed email address before reporting spam
Dear all,
in the scope of research project, I'm checking out COMSOL's abilty of accessing external material models. There's an example code available via www.comsol.com/model/external-material-ac-dc-module-general-hb-bh-relation-32321 . What I'm trying to do now is to understand that referred example. I'm aware of what's happening during the interpolation routine, but I don't understand how the Jacobian Matrix is built:
// Write Jacobian of B with respect to H
if (normH>0) {
for (i=0; i<3; ++i) {
for (j=0; j<3; ++j) {
Jac[i*3+j] = dNormB*H[i]*H[j]/(normH*normEpsH)+normB*(-H[i]*H[j]/(normEpsH2*normEpsH)+(i==j ? 1.0/normEpsH : 0.0));
}
}
} else {
for (i=0; i<3; ++i) {
for (j=0; j<3; ++j) {
Jac[i*3+j] = (i==j ? dNormB : 0.0);
}
}
}
I know that a Jacobian Matrix contains the partial derivatives of a vector valued function, but I don't really understand the procedure in the code-snippet above. Can anyone help me out and explain it to me or post a link to a literature reference (with an explanation of the procedure)?
Thanks in advance and best regards
Michael
in the scope of research project, I'm checking out COMSOL's abilty of accessing external material models. There's an example code available via www.comsol.com/model/external-material-ac-dc-module-general-hb-bh-relation-32321 . What I'm trying to do now is to understand that referred example. I'm aware of what's happening during the interpolation routine, but I don't understand how the Jacobian Matrix is built:
// Write Jacobian of B with respect to H
if (normH>0) {
for (i=0; i<3; ++i) {
for (j=0; j<3; ++j) {
Jac[i*3+j] = dNormB*H[i]*H[j]/(normH*normEpsH)+normB*(-H[i]*H[j]/(normEpsH2*normEpsH)+(i==j ? 1.0/normEpsH : 0.0));
}
}
} else {
for (i=0; i<3; ++i) {
for (j=0; j<3; ++j) {
Jac[i*3+j] = (i==j ? dNormB : 0.0);
}
}
}
I know that a Jacobian Matrix contains the partial derivatives of a vector valued function, but I don't really understand the procedure in the code-snippet above. Can anyone help me out and explain it to me or post a link to a literature reference (with an explanation of the procedure)?
Thanks in advance and best regards
Michael
1 Reply Last Post 01.08.2017, 04:19 GMT-4