0

Suppose we have a set of 2 functions with multiple common arguments (x,y,z), let f_i(x,y,z) be one of those functions. When these arguments are evaluated by specific real numbers, Mathematica provides a solution which contains a real part and a very small irreal number (which I think is a calculation error), for the two functions.

I would like to create a new function with the same arguments that, when evaluated, chooses only the real part of the result of the function whose real result satisfies a certain criteria (e.g. be between -1 and 0).

This final function should allow me to plot the real part that matches the criteria in terms of any of its variables and to create other new functions.

I have tried the Chop and If functions in multiple orders without any success. My problem is that the chop function operates directly on the unevaluated functions and thus, does not allow me to attain the mentioned objective.

f[x_, y_, z_] =If[-1 <= Chop[f_1[x, y, z]] <= 0,Chop[f_1[x, y, z]],Chop[f_2[x, y, z]]]  

Thank you very much.

Natxo
  • 1
  • 1
  • Use [SetDelayed](https://reference.wolfram.com/language/ref/SetDelayed.html) rather than `Set`. – Alan Apr 14 '20 at 18:08
  • You cannot use underscores in your symbols as this is pattern `Blank` in Wolfram Language. This is likely causing you some issues. – Edmund May 01 '20 at 23:42

0 Answers0