0
$\begingroup$

I would like to write the matrix

v[s_,ss_,qi,qj] :=( {{a/(2 r) DiracDelta[s - ss], a/r(HeavisideTheta[(s - ss) + r] - HeavisideTheta[(s - ss) - r])}, {a/r(HeavisideTheta[(s - ss) + r] - HeavisideTheta[(s - ss) - r]), a/(2 r) DiracDelta[s - ss]}})

S[z_, i_, j_] := S[z, i, j] =Integrate[Sum[1/(M[[qi]]*M[[qj]])*u[s,i, qi]*v[s,ss, qi, qj]*udot[ss, qj, j], {qi, 2}, {qj, 2}], {ss, 0, z}], {s, 0, z}];

where

M[qi]={1,1,1,1} M[qj]={1,1,1,1}

$\endgroup$
  • $\begingroup$ What is s, did you mean to index it as well? Did you mean KroneckerDelta instead of DiracDelta? $\endgroup$ – Roman Jul 27 '19 at 9:30
  • $\begingroup$ I mean DiracDelta. $\endgroup$ – Dora Jul 27 '19 at 9:43
  • $\begingroup$ But the right expansion of S is:S[z_, i_, j_] = NIntegrate[ NIntegrate[Sum[1/(M[[qi]]*M[[qj]])*u[s, i, qi]*vqiqj[s - ss]*udot[ss, qj, j], {qi, 2}, {qj, 2}], {ss, 0, z}],{s, , 0, z}] $\endgroup$ – Dora Jul 27 '19 at 9:53
  • $\begingroup$ Please edit your question instead of giving info in the comments. $\endgroup$ – Roman Jul 27 '19 at 10:42
  • 2
    $\begingroup$ Some hints: 1. You are using the variables qi and qj outside of the integrals in which they are defined. 2. qi and qj are real-valued integration variables but you are using them as integer-valued indices. 3. You have too many underscores in your definition of S, see this tutorial. 4. There's an extraneous comma in your summation over z. 5. Your definition of vqiqj should be in terms of a variable ds=s-ss, not in terms of s-ss. There's probably more. $\endgroup$ – Roman Jul 27 '19 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.