Skip to content
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

Sum of envelopes #92

Open
RoccoRaimo opened this issue May 15, 2024 · 2 comments
Open

Sum of envelopes #92

RoccoRaimo opened this issue May 15, 2024 · 2 comments

Comments

@RoccoRaimo
Copy link
Contributor

Hi @ccaprani!
I was playing around with the library, in particular with the envelopes results obtained from a static and a moving vehicle analysis.
I would like to suggest a new class method for envelopes class that permits the sum of multiple envelopes - instead of a single envelope of envelopes with augment. It would be very useful in some circumstances, i.e. when traffic load is applied with both distributed and concentrated loads or when a superposition of multiple vehicle is considered or - most likely - a superposition of traffic + snow distributed live loads is necessary.

Reading #6, #50 and #56, I think that the implementation could be very much similar to the augment method in envelopes class.
Something like:

    if self.npts != env.npts or self.nsup != env.nsup:
        raise ValueError("Cannot sum with an inconsistent envelope")
    self.Vmax = np.add(self.Vmax, env.Vmax)
    self.Vmin = np.add(self.Vmin, env.Vmin)

    self.Mmax = np.add(self.Mmax, env.Mmax)
    self.Mmin = np.add(self.Mmin, env.Mmin)

    self.Rmaxval = np.add(self.Rmaxval, env.Rmaxval)
    self.Rminval = np.add(self.Rminval, env.Rminval)

    if self.nres == env.nres:
        self.Rmax = np.add(self.Rmax, env.Rmax)
        self.Rmin = np.add(self.Rmin, env.Rmin)
    else:
        # Ensure no misleading results returned
        self.Rmax = np.zeros((self.nsup, self.nres))
        self.Rmin = np.zeros((self.nsup, self.nres))

Let me know if this is a good idea and I can just open a pull request with the modified code.
Maybe I could also include a jupyter notebook with an example.
Thank you!

@ccaprani
Copy link
Owner

This would be a great addition, especially if coupled with a really practical use case. Is it that we're summing a patterned UDL for dead load for example, with the envelope for a live load perhaps?

@RoccoRaimo
Copy link
Contributor Author

Exactly!
Or in another scenario, maybe a superposition of multiple vehicle runs and a patterned UDL.

I will open a PR as soon as I'll be able to submit an example workbook (I'll put it right after the existing augment example).

RoccoRaimo added a commit to RoccoRaimo/pycba that referenced this issue May 16, 2024
As described in ccaprani#92, a new method has been implemented in class Envelopes to sum multiple envelopes. The example n.5 has been included to show a possible usage scenario.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants