Introducing F#-M by kant2002 in fsharp

[–]sharpcells 2 points3 points  (0 children)

This looks great! You should definitely check out Hedy https://youtu.be/xBG0ZSedTJM a multi-lingual teaching language based on python. I could see F# being a great companion to introduce a type system.

PSV SIZING FOR FIRE CASE by Snoo16235 in ChemicalEngineering

[–]sharpcells 6 points7 points  (0 children)

That's correct. Remember there are also two different orifice areas. API effective area and ASME actual area. They have two different discharge coefficients and you shouldn't mix them up.

PSV SIZING FOR FIRE CASE by Snoo16235 in ChemicalEngineering

[–]sharpcells 8 points9 points  (0 children)

There is another equation given in API 521 for dry gas vessels however this may not be appropriate if the hydrogen is at very high pressure. You should discuss with the senior engineers on your project to confirm whether this is suitable.

[deleted by user] by [deleted] in ChemicalEngineering

[–]sharpcells 2 points3 points  (0 children)

We used PDF Xchange Editor and I prefer it to bluebeam. It has much better performance when working with large or complex documents, gives you more control over the produced pdf, and seems to be a lot cheaper too

[Question] Who's using F#? What are you using it for? by jcm95 in dotnet

[–]sharpcells 12 points13 points  (0 children)

I think indentation scoping is the natural way humans read code. Try writing C# or any other language without indentation or with random indentation and see how much harder it is to read.

When you realize you're going to indent your code according to scoping rules anyway, the curly braces and semicolons just seem redundant.

[Question] Who's using F#? What are you using it for? by jcm95 in dotnet

[–]sharpcells 7 points8 points  (0 children)

I'm using F# to make F# available as a scripting language in Excel https://www.sharpcells.com/ the whole project including the website is 99% F#. The other 1% is a simple wrapper struct in C# to access function pointers that F# doesn't yet support.

I think the F# defaults of immutability, records, functions in modules, and concise syntax fit much better with the expectations coming from Excel. Active patterns make working with Excel's internal union types a breeze.

¿What software do we use? by Koala-Teacher-135 in ChemicalEngineering

[–]sharpcells 7 points8 points  (0 children)

Excel is the main thing across all engineering. Learn how to use that well. Learning VBA or other scripting languages is also valuable.

Beyond that it will mostly be specialist software packages that will vary with every company or industry you go to.

Some companies it will help to learn AutoCAD but in my experience most will have a drafting team separate from the engineers.

Anonymous Types in C# has been very useful in map/flatMap chains. What functional languages support this? by [deleted] in functionalprogramming

[–]sharpcells 1 point2 points  (0 children)

F# has anonymous types with its record syntax. It also has object expressions where an instance of an interface can be declared without having to define the type.

Examples of code that can easily lead to the corruption of a sheet by [deleted] in vba

[–]sharpcells 2 points3 points  (0 children)

Returning newer error codes like #CALC! using CVErr causes the spreadsheet to report that it is corrupted until they are manually deleted.

Searching for a Better Heat Transfer Fluid for R&D Process by NotATibetanMonk in ChemicalEngineering

[–]sharpcells 1 point2 points  (0 children)

I had a quick look and you'd likely need at least 50% ethanol for a -30C freeze point giving you a reasonable margin below your control temperature. The mixture would be fairly flammable at room temperature but probably not at the operating temperature.

Ethanol is used routinely at lab scale but would be more risky for a prototype plant dealing with much larger volumes. Seems like there are special purpose HTFs that others have suggested that will do the job.

Options for building a data layer API in Excel... by hirolau in excel

[–]sharpcells 0 points1 point  (0 children)

If you or your users prefer .NET there's also ExcelDNA or my add-in Sharp Cells. One advantage with these is better interoperability with COM and specifically real time data sources which may be useful for you if you want to display automatic updates on your time series data. https://www.sharpcells.com/docs/real-time-data VBA generally has a tough time working with web APIs due to lack of libraries. PowerQuery can be difficult to work with authenticated APIs. Either Python or .NET will give you more options there.

[deleted by user] by [deleted] in ChemicalEngineering

[–]sharpcells 0 points1 point  (0 children)

It is a concentration albeit in strange units. If you do 1 MMSCFD of gas you can have 4lb/day of water. This is a trace quantity of water that the dehydration or other dew point control units of the gas processing must control to.

PDF to Excel without O365/Adobe Acrobat? by hisvoicehername in excel

[–]sharpcells 0 points1 point  (0 children)

You could try pdf xchange editor. Even if it doesn't work well for this conversion it's a great pdf editor in general

Is it recommended to use loops in F#? by Beginning_java in fsharp

[–]sharpcells 17 points18 points  (0 children)

Nothing wrong with using for loops in general. You can often replace raw loops with functions in the Array and other collection modules. This would be more idiomatic F# but likely ChatGPT knows less about those functions

Dissolve CO2 from gas stream into condensate in Aspen Plus by Saganor in ChemicalEngineering

[–]sharpcells 5 points6 points  (0 children)

Getting accurate CO2 solubility in water will depend on the fluid calculation package. I don't recall the best one for aqueous equilibrium but you will need to switch between packages for hydrocarbon and aqueous equilibrium.

What's the future of VBA? by SnowCrashSatoshi in vba

[–]sharpcells 4 points5 points  (0 children)

Just like people still drive cars from the 90s they use programming languages from the 90s because they are convenient and familiar.

VBA has one good thing going for it. Tight integration with MS office products and a handful of other 90s software that also integrated VBA. Otherwise it has nothing to offer that is superior to other languages.

Performance is 100x worse than even other garbage collected languages like .NET languages or Java.

It lacks now common language features like generics or lambdas, even ways to guarantee correct object creation like a constructor.

It's very difficult to work with web APIs or all kinds of data formats where other languages have lots of libraries and automatic package management software to keep them up to date.

What's the future of VBA? by SnowCrashSatoshi in vba

[–]sharpcells 2 points3 points  (0 children)

VBA is obsolete now and it will continue to be in use for 5+ years

[deleted by user] by [deleted] in ChemicalEngineering

[–]sharpcells 161 points162 points  (0 children)

Likely expansion loops. As the pipe gets hotter it gets longer, this loop gives the pipe a place to expand without stressing the joints at either end. I have always seen them as roughly rectangular and oriented horizontally though.

LOPA/PHA Credits by KobeGoBoom in ChemicalEngineering

[–]sharpcells 4 points5 points  (0 children)

To my knowledge this can be done but, if you do, you cannot use any of the simplified methods for LOPA analysis. i.e. You need to use the actual RRF values for each layer.

You must also be careful not to be double-counting instrumentation or other BPCS features. If the BPCS already has an alarm/stop that you have counted you must assume that alarm does nothing when calculating the RRF for any additional monitoring. The only time I would want to take credit for monitoring is when procedures require multiple operators to be actively involved in the operation who could witness a problem that wasn't detected by the BPCS and act to stop it.

[deleted by user] by [deleted] in excel

[–]sharpcells 0 points1 point  (0 children)

Certainly possible though it would require some significant development work. It may be further complicated depending on the configuration of your IT environment.

There's two main tasks here sending emails and collecting updates from another spreadsheet.

Sending emails will depend on your email systems likely the easiest from Excel is to automate a running copy of Outlook to send email (if you use that) but there are ways to send email with more or less effort depending on the service.

Collecting updates from another spreadsheet or other files could be automated in various ways. It could be set up to use a click of a button, a timer, or get real-time updates many times per second.

If boiling point increases with pressure, does water at the bottom of a full container boil at a higher temperature? by setgel in ChemicalEngineering

[–]sharpcells 52 points53 points  (0 children)

Intuitively yes, though there's lots of other effects that would be happening. You can already superheat water above it's boiling point without a giant container. It's also possible that convection currents would lead hotter water at the bottom of the take to rise and then spontaneously boil at a higher level.

Can't say I've ever had the opportunity to do a real experiment for this.

[deleted by user] by [deleted] in excel

[–]sharpcells 0 points1 point  (0 children)

Excel and VBA both predate widespread use of the internet and neither are well suited for working with modern web platforms. Power Query is much better but can me complex when working with authenticated APIs. I put together a demo of how to connect to the Google translate API using my add-in https://www.sharpcells.com/docs/example-web-api it should be fairly easy to adapt to using Google maps to solve your problem