f



partial differential equation #2

Hi,=20

If=20
lm=3D[623.2,624.5,665.3,778.2]=20
S=3Dss[0:300,0:400,0:18,0]   ;;; an image=20
compute=20

	x=3D=E2=88=91[(=E2=88=82^2 (s))/(=E2=88=82(lm)^2)]  ;;; image

How can I do it using IDL?
0
AGW
12/13/2016 8:49:41 AM
comp.lang.idl-pvwave 12260 articles. 2 followers. Post Follow

4 Replies
117 Views

Similar Articles

[PageSpeed] 36

On Tuesday, December 13, 2016 at 3:49:42 AM UTC-5, AGW wrote:
> Hi,=20
>=20
> If=20
> lm=3D[623.2,624.5,665.3,778.2]=20
> S=3Dss[0:300,0:400,0:18,0]   ;;; an image=20
> compute=20
>=20
> 	x=3D=E2=88=91[(=E2=88=82^2 (s))/(=E2=88=82(lm)^2)]  ;;; image
>=20
> How can I do it using IDL?

So S has 19 slices but lm only has 4 elements?  How is that supposed to wor=
k?  You can check out Wikipedia's article on finite differences.
0
Craig
12/13/2016 3:24:25 PM
On Tuesday, December 13, 2016 at 10:49:42 AM UTC+2, AGW wrote:
> Hi,=20
>=20
> If=20
> lm=3D[623.2,624.5,665.3,778.2]=20
> S=3Dss[0:300,0:400,0:18,0]   ;;; an image=20
> compute=20
>=20
> 	x=3D=E2=88=91[(=E2=88=82^2 (s))/(=E2=88=82(lm)^2)]  ;;; image
>=20
> How can I do it using IDL?

lm have 19 value, but I did not write all values, suppose=20
lm=3D[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]

else=20
x=3D=E2=88=91_i[(=E2=88=82^2(s))/(=E2=88=82 lm^2 )]]_i
0
AGW
12/13/2016 5:18:22 PM
On Tuesday, December 13, 2016 at 12:18:32 PM UTC-5, AGW wrote:
> On Tuesday, December 13, 2016 at 10:49:42 AM UTC+2, AGW wrote:
> > Hi,=20
> >=20
> > If=20
> > lm=3D[623.2,624.5,665.3,778.2]=20
> > S=3Dss[0:300,0:400,0:18,0]   ;;; an image=20
> > compute=20
> >=20
> > 	x=3D=E2=88=91[(=E2=88=82^2 (s))/(=E2=88=82(lm)^2)]  ;;; image
> >=20
> > How can I do it using IDL?
>=20
> lm have 19 value, but I did not write all values, suppose=20
> lm=3D[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]
>=20
> else=20
> x=3D=E2=88=91_i[(=E2=88=82^2(s))/(=E2=88=82 lm^2 )]]_i


Well, it's easy and it's hard.  If you read the Wikipedia article about fin=
ite differences, it's easy.  The expression for finite differences is,
   =E2=88=82^2(s))/(=E2=88=82 lm^2) =3D ( s(lm+h) - 2 s(lm) + s(lm-h) ) /h^=
2
That's easy to express in IDL,
   d2s_dlm2 =3D s*0  ;; Initialize to blank array
   for i =3D 1, 17 do begin
      h2 =3D (lm[i]-lm[i-1])*(lm[i+1]-lm[i])  ;; compute h^2 term
      d2s_dlm2[*,*,i] =3D (s[*,*,i+1]-2*s[*,*,i]+s[i-1]) / h2
   endfor

Note that it's not possible to compute the finite difference second derivat=
ive at the first and last LM position because there's not enough data to es=
timate it.

Now you want to sum it.  That's easy too,
   x =3D total(d2s_dlm2,3)

But the problem is that the sum of a second derivative is more or less equi=
valent to the integral of a second derivative, i.e. just a single derivativ=
e.  It's really equivalent to computing the mean slope of S.  You don't hav=
e to do any of the second derivative stuff to do this.  You should basicall=
y get the same answer by doing,
   x =3D (s(*,*,18) - s(*,*,0))/(lm(18)-lm(0))
This is not quite true if LM is unevenly spaced.

So you really have to decide if this is what you want.

Did you mean to take an absolute value? Or square the second derivative bef=
ore summing it?

CM
0
Craig
12/13/2016 5:35:09 PM
On Tuesday, December 13, 2016 at 10:49:42 AM UTC+2, AGW wrote:
> Hi,=20
>=20
> If=20
> lm=3D[623.2,624.5,665.3,778.2]=20
> S=3Dss[0:300,0:400,0:18,0]   ;;; an image=20
> compute=20
>=20
> 	x=3D=E2=88=91[(=E2=88=82^2 (s))/(=E2=88=82(lm)^2)]  ;;; image
>=20
> How can I do it using IDL?

Thanks=20

Of course I want  absolute value of [(=E2=88=82^2 (s))/(=E2=88=82(lm)^2)]

......
0
AGW
12/13/2016 5:50:39 PM
Reply: