# Help debugging code to get computational components

**URL:** <https://community.wolfram.com/t/help-debugging-code-to-get-computational-components/25036>\
**Category:** Questions\
**Tags:** calculus, tuning-and-debugging\
**Created:** [January 23, 2025, 12:19pm UTC](https://community.wolfram.com/t/help-debugging-code-to-get-computational-components/25036 "2025-01-23T12:19:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepkumary092](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@sandeepkumary092](https://community.wolfram.com/u/sandeepkumary092)\
**Post date:** [January 23, 2025, 12:19pm UTC](https://community.wolfram.com/t/help-debugging-code-to-get-computational-components/25036/1 "2025-01-23T12:19:24Z")

</div>

(_Define variables and functions_)ClearAll[t, x, alpha, s, f]  
t = Symbol[“t”, Positive → True];  
x = Symbol[“x”, Positive → True];  
alpha = Symbol[“alpha”, Positive → True];  
s = Symbol[“s”, Positive → True];  
n = Symbol[“n”, Integers → True];  
f[n\_, x\_, t\_] := f[n][x, t];

```
(*Define Elzaki Transform*)
elzakiTransform[func_, var_, transformVar_] := 
 Integrate[
  transformVar*func*Exp[-var/transformVar], {var, 0, Infinity}]

(*Define Inverse Elzaki Transform*)
inverseElzakiTransform[transformFunc_, transformVar_] := 
 InverseLaplaceTransform[transformFunc, transformVar, t]

(*Define the functional correction method*)
correctionFunctional[fPrev_, x_, t_, alpha_] := 
 Module[{delayTerm, rhs, transformedRHS, correctedTransform, 
   correctedFunction},(*Define the delay term*)
  delayTerm = fPrev /. t -> t - 1;

  (*Define the RHS of the equation*)rhs = x^2*t - delayTerm;

  (*Apply Elzaki Transform to RHS*)
  transformedRHS = elzakiTransform[rhs, t, s];
 
 (*Multiply by s^alpha for fractional derivative correction*)

  correctedTransform = s^alpha*transformedRHS;
  (*Apply inverse Elzaki transform to get back to time domain*)

  correctedFunction = inverseElzakiTransform[correctedTransform, s];
  (*Add the initial condition x^2*)correctedFunction]

(*Example:Initialize f_0(x,t)*)
f0 = x^2;

(*Compute iterations*)
iterations = 3;
fPrevious = f0;

For[i = 1, i <= iterations, i++, 
 fCurrent = correctionFunctional[fPrevious, x, t, alpha];
 Print["Iteration ", i, ":"];
 Print[TraditionalForm[fCurrent]];
 fPrevious = fCurrent;]

```

---

<div class="post-metadata">

**Author:** ![drjbaldwin](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@drjbaldwin](https://community.wolfram.com/u/drjbaldwin)\
**Post date:** [January 23, 2025, 3:21pm UTC](https://community.wolfram.com/t/help-debugging-code-to-get-computational-components/25036/2 "2025-01-23T15:21:19Z")

</div>

It would help if you explicitly described the issue you’re having. Are you getting an error message? What error message? Do you get no output? Does the code run forever?

---

<div class="post-metadata">

**Author:** ![sandeepkumary092](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@sandeepkumary092](https://community.wolfram.com/u/sandeepkumary092)\
**Post date:** [January 23, 2025, 4:03pm UTC](https://community.wolfram.com/t/help-debugging-code-to-get-computational-components/25036/3 "2025-01-23T16:03:54Z")

</div>

Sure, the code runs forever, but it gives symbolic components that are not in proper form. Just want to know why this inverse function does not work properly, although I do a dry run of this code step by step. The components are below:

Iteration 1:

x (- InverseLaplaceTransform(s^ α + 2 , s, t, None) + InverseLaplaceTransform(s^ α + 3 , s, t, None))

Iteration 2:

x (- InverseLaplaceTransform(s^ α + 2 , s, t, None) + InverseLaplaceTransform(s^ α + 3 , s, t, None))

Iteration 3:

x (- InverseLaplaceTransform(s^ α + 2 , s, t, None) + InverseLaplaceTransform(s^ α + 3 , s, t, None))
