0

I‘m quite bad at programming, so please bear with me. I‘m not even sure what the concept I need right now is called, so i don’t know what to google for or write in the title of this post.

My issue is, I numerically integrated a function on Mathematica and have a function F that depends on 2 inputs X and Y. Those inputs form a 2x2 grid. To visualize my solution, I would need a 3D graph.

Now I want to compare this to my analytical solution (/approximation) A, which I know only depends on one input Z, which is the ratio of X/Y. To visualize it, I only need a 2d Graph.

My issue now is, that I‘m not sure how to effectively filter that part of my numerical solution F so that I only consider the outputs with various ratios X/Y. This way, I could easily compare it to my analytical solution by only using a 2d graph.

I hope some of you understand my gibberish. I apologize for not being able to properly explain what I need in the correct language. I would be glad if some of you might be able to help me. Any help is appreciated.

Zyrax
  • 1

1 Answers1

0

Is my understanding correct? You have a numerically integrated function, F which maps a pair of numbers to a scalar:

F: (x,y) -> (z)

Then, there's another function, A, which takes a scalar and maps it to another scalar:

A: (b) -> (c)

and b is itself the ratio of x and y from before:

b = x/y

And you'd like to compare the outputs of F and A, i.e. compare z to c, as I've defined them here?

One thing you can do is sample the inputs to F that you already have, and then query A with the ratio of those inputs, and compare the output.

To put it another way, you can say, "for this x and this y, I know the output of F is this. Then, when I divide them and put them into A I get this."

Then, you could make a heatmap, say, where one of the axes is the x-value and the other axis is the y-value, and the color corresponds to F(x, y) - A(x/y)

David
  • 424
  • 3
  • 16