Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. Rule1 = {z -> Interpolation[Table[{i, i^2 + i}, {i, 0, 2, 0.1}]]};
  2.  
  3. Rule2 = {x -> Interpolation[Table[{i, Sin[i] + i}, {i, 0, 2, 0.1}]]};
  4.  
  5. func = Sin[x z]/(x + z)^2 /. Flatten[{Rule1, Rule2}]
  6.  
  7. Rule1z = Interpolation[Table[{i, i^2 + i}, {i, 0, 2, 0.1}]];
  8. Rule2x = Interpolation[Table[{i, Sin[i] + i}, {i, 0, 2, 0.1}]];
  9. fun[i_] = Sin[Rule2x[i] Rule1z[i]]/(Rule2x[i] + Rule1z[i])^2;
  10. fun[1.2]
  11.  
  12. (* -0.0267361 *)
  13.  
  14. Rule1 = {z -> Interpolation[Table[{i, i^2 + i}, {i, 0, 2, 0.1}]]};
  15. Rule2 = {x -> Interpolation[Table[{i, Sin[i] + i}, {i, 0, 2, 0.1}]]};
  16. RuleAz = z /. Rule1;
  17. RuleBx = x /. Rule2;
  18. fun2[i_] = Sin[RuleBx[i] RuleAz[i]]/(RuleBx[i] + RuleAz[i])^2;
  19. fun2[1.2]
  20.  
  21. (* -0.0267361 *)
  22.  
  23. fun3[i_] = Sin[x[i] z[i]]/(x[i] + z[i])^2 /. Flatten[{Rule1, Rule2}];
  24. fun3[1.2]
  25.  
  26. (* -0.0267361 *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement