Solving double Integral with syms variables and matrices

Can anyone help in solving this double integral using matlab.
psi_1 and psi_3 are one-dimensional column vectors. The answer of the integral is expected to be a scalar.

6 Comments

Are psi_1 and psi_3 numerical vectors? If yes, then how do you expect the output to be a scalar?
If no, then share their definitions.
Yes I got psi from numerical computation.
If I use analytical definitions of psi, I get a scalar result.
Though my psi are matching both from numerical and analytical calculations, I am not able to solve this integral numerically.
Here is psi:
0 0 0
-0.584993079053260 0.208131563468098 0.149876699243745
-0.290486620561200 -0.214137384947414 -0.223983181855699
-0.108183768981741 -0.392469751081532 -0.238405376551858
-0.0358133605014240 -0.370934476006569 -0.0204181054346506
-0.0111146981696104 -0.277325207917570 0.211043024607751
-0.00331135402570018 -0.182237188739587 0.343118515890250
-0.000958727432157887 -0.109135906430501 0.356837074741565
-0.000270505089313882 -0.0590225354228204 0.279577120505687
-7.01510441359339e-05 -0.0253248445923513 0.149905365721335
0 0 0
"If I use analytical definitions of psi, I get a scalar result."
What is the analytic defintion of psi?
Why do you expect that getting a scalar result with analytic definition will translate into getting the same for numerical values?
If I understand it correctly, as psi_1 and psi_3 are constants, psi_1^2 and psi_3^2 will just come out of the integrations. And the result of the double integrals will be a scalar, which multiplied by a vector will return a vector.
psi is similar to wavefunctions of an infinite quantum well system . We have analytical expressions for the wavefunctions. And the integral can be solved in two dimensions.
I guess you have psi_2^2 and psi_1^2 evaluated over an x/y grid. But I don't know how to make sense of a single 11x3 matrix without listing the corresponding x/y coordinates and without stating to which psi the matrix belongs.
As OP initially stated that the values are column vectors, and provided an array for reference, I'd say it is safe to assume that the first and the third columns of the arrays are the values of psi_1 and psi_3 respectively

Sign in to comment.

Answers (1)

The answer is "NO", no-one can help you solve that integral to get a scalar result. Given column vectors, the result of the integral will be non-scalar.
The results of the integral are infinite except for locations where the ψ are zero.
consider the inner integral. ψ1 is constant so its square is constant. Integral of constant times x² is constant times 1/3 x³ evaluated over the limits which is is constant times 1/3 y³.
Multiply the y³ by the outer y and the constant ψ2² there to get constant times y⁴. Integrate to get 1/5 times some constant times y to the 5th. Evaluate over the infinite limits to get infinities except where the constants are zero
The results have the potential to be different if the two vectors are different orientations, but you specified that they are column vectors.

1 Comment

The whole thing does not make sense to me unless the ψare functions of x or y -- but if so then you cannot hope for a closed-form integral without knowing the formulaes for the ψ

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

AN
on 23 Nov 2023

Edited:

on 23 Nov 2023

Community Treasure Hunt

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

Start Hunting!