I’m new to grasshopper and would appreciate your help. I’m trying to scale a geometry to a target volume, while maintaining the same height. It should scale equally in the x and y dimensions, while maintaining same z dimension. The idea is to make it work for different shapes that are not defined by a single volume equation (like a box where volume is length x width x height).

I know the geometry can be scaled uniformly like this:

But my attempts at non-uniform scaling have not been successful, and I am only guessing the scaling factors at this point. How can the scaling factors be determined for x and y so that z=1 and the target volume is reached?

on the right(scale in xyz), the geometry is scaled in all directions as in the picture above.
On the bottom (scale non-uniform), I tried using non-uniform scaling components from pufferfish and grasshopper. I’m stuck here and I’m not sure how to proceed. Any help is appreciated.
Here is the bottom part of the script up close:

There are an infinite number of solutions, if I understand you correctly. The original volume is 13439 and the target is 10000, so you first of all want it reduced by that ratio, = .744. Since z stays the same (=1) the factors for x and are such that x*y = .744. So choose an x and then y=x/.744
If you want x=y, then do as @davidcockey says and x^2=.744, so x =sqrt(.744) = .863

Trial and error the Galapagos way. For more precision, I increased the slider from 2 to 5 decimal points. It might be faster if the range of the slider was reduced?