-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1s gfunction evaluation: numpy.linalg.LinAlgError: Singular matrix #231
Comments
I can create a function to check if the gfunction evaluation is at too small a timestep and make a PR, if you want to. |
This is an issue I had during the implementation of g-functions into modelica-ibpsa. The solution should still return values for all requested times, even if the result is zero. One option is to evaluate a threshold time value (e.g. I am of course open to other ideas. |
That can be an elegant solution, although linearisation will not solve the problem in and of itself I think. One can evaluate at 0.00001s so it will be 0 even with linearisation. Shouldn't there be a threshold below which the concept of gfunctions doesn't make sence anymore due to the fact that we are totally in the range of short-term effect? |
Regarding: "Shouldn't there be a threshold below which the concept of gfunctions doesn't make sence anymore due to the fact that we are totally in the range of short-term effect?"
Short time step g-functions (Yavuzturk and Spitler 1999) accounted for the transient conduction inside the borehole, based on 2-d radial-angular conduction, but did not account transit time or 3-dimensional effects. They worked reasonably well down to about 15 minute time-steps, depending on conditions, but would give aphysical results if the time-step was too low. This approach does, however, have the advantage of maintaining the same g-function definition, though the resulting borehole wall temperatures at low times might be thought of as an equivalent temperature.
To go lower requires consideration of the transit time effects. One approach is detailed in Mitchell and Spitler (2020). This recasts the g-function to give exiting fluid temperatures rather than borehole wall temperatures.
Mitchell, M. S. and J. D. Spitler. 2020. An Enhanced Vertical Ground Heat Exchanger Model for Whole-Building Energy Simulation. Energies 13(16): 4058. https://www.mdpi.com/1996-1073/13/16/4058
Yavuzturk, C. and J. D. Spitler. 1999. A Short Time Step Response Factor Model for Vertical Ground Loop Heat Exchangers. ASHRAE Transactions 105(2): 475-485.
From: Wouter Peere ***@***.***>
Sent: Tuesday, October 11, 2022 6:00 PM
To: MassimoCimmino/pygfunction ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [MassimoCimmino/pygfunction] 1s gfunction evaluation: numpy.linalg.LinAlgError: Singular matrix (Issue #231)
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe
That can be an elegant solution, although linearisation will not solve the problem in and of itself I think. One can evaluate at 0.00001s so it will be 0 even with linearisation.
Shouldn't there be a threshold below which the concept of gfunctions doesn't make sence anymore due to the fact that we are totally in the range of short-term effect?
-
Reply to this email directly, view it on GitHub<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMassimoCimmino%2Fpygfunction%2Fissues%2F231%23issuecomment-1275379138&data=05%7C01%7Cspitler%40okstate.edu%7Ce1a19051a6a94884896e08daabdc54d5%7C2a69c91de8494e34a230cdf8b27e1964%7C0%7C0%7C638011260051450452%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=aE17D68jYte7y5gDgSHqawod%2FqcMi%2B4u6v0X3Jglwp8%3D&reserved=0>, or unsubscribe<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAESOCDJNKPCBD534QCQQSMTWCXWPBANCNFSM6AAAAAARCIILAA&data=05%7C01%7Cspitler%40okstate.edu%7Ce1a19051a6a94884896e08daabdc54d5%7C2a69c91de8494e34a230cdf8b27e1964%7C0%7C0%7C638011260051450452%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=fmKUbt8q8kurWa2bsOdAgqzQ3mQP6vuAsJT2e8Gm2Sc%3D&reserved=0>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
@jeffreyspitler The paper you referenced was an interesting read. I think your comment is somewhat related to issues #149 and #44 (about the implementation of short-term g-functions). That would be indeed the most elegant solution in my opinion ... |
Thank you @jeffreyspitler. I also missed the (Mitchell and Spitler 2020) paper. There are 3 issues discussed here. The first one being the bug (this issue) and the other 2 related to short time steps. When considering short time steps, there are two classes of g-function definitions : (1) The "wall-to-ground" g-functionThis one relates the effective borehole wall temperature variation ( (2) The "fluid-to-ground" g-function (sometimes called the g*-function)This one relates the effective borehole wall temperature variation ( When using a steady-state thermal resistance to model the boreholes, the two approaches are equivalent : Ideally, both will eventually be available in pygfunction. For (1), only the cylindrical correction to the borehole geometry is missing (#44). For (2), we probably need the development of a new module into pygfunction (#149). |
@wouterpeere I fixed the error on the |
When I tried to evaluate a gfunction at 1 second, I got an 'numpy.linalg.LinAlgError: Singular matrix' error.
The problem is, I think, caused by getting a all-zero matrix when calculating the thermal response factors, leading to a singular matrix. Whenever I try to run the code with an evaluation at 2 seconds, the thermal response factors are small (10^-200) but non-zero ...
The code I used was
The text was updated successfully, but these errors were encountered: