i don't get why this guy doesn't just use box2d and unity smh
@Lemmskii Жыл бұрын
ikr smh
@Blitz_Protogen Жыл бұрын
Exactly bro!!!
@Stork2204 Жыл бұрын
Cause ange only trusts his own incredible coding brain
@notanengineer Жыл бұрын
Yeh fr that would solve everything
@melonenstrauch1306 Жыл бұрын
Also he pronounced Seidel wrong, I'm probably the only one who noticed tho
@oblivion_2852 Жыл бұрын
Bruh... not too much to show?? This is HUGE. Please don't undersell your adventures into simulation and also your educational content. Love the explanation of different types of solvers. I now know where to look if I wanna get into this.
@rebus_x5313 Жыл бұрын
He: *not too much to show* Me: dude i wish i could do this stuff in 5 years if i started like now
@w花b Жыл бұрын
@@rebus_x5313 I wonder what we would get if he considered something as a lot to show
@senboy9002 Жыл бұрын
@@w花b Accurate simulation of the entire Earth
@jakobbb6405 Жыл бұрын
8:55 This is actually a really common thing in engineering regarding basically everything. If you have a simple axle and it is held in place with 2 bearings one of them is fixed on the axle and the "casing" whie the other needs to be a floating bearing to compensate for any sort of length changes due to for example heat. Its a huge pain if you are currently studying this lol.
@racercowan Жыл бұрын
In relations to truss's specifically, I believe that bridges (especially longer ones) are even designed with a "floating" end that can move by a small amount.
@JorgetePanete Жыл бұрын
It's*
@jakobbb6405 Жыл бұрын
@@racercowan i think not even small. I ain't no bridge man but I think they can move about 10m or something. It's really interesting
@gabrielenitti3243 Жыл бұрын
@@racercowan most bridges are built in "small" pieces to allow room for expansion and contraction due to temperature. The same applies to cement pours, they have relief cuts to allow for it.
@dovos8572 Жыл бұрын
@@racercowan the only bridges that don't have the floating end are bridges with a bowed pavement like old river bridges out of stone. these bridges don't need the floating end becaus they expand up into the bow and not to the side.
@Chillin4030 Жыл бұрын
I'm so glad the Beam devs are in on it. I cant wait to see what that entails.
@orthodynamicstereonails Жыл бұрын
I love it when computer science youtubers talk about optimization! Both you and Acerola do a great job talking about it.
@nixel1324 Жыл бұрын
Have you checked out Kaze Emanuar? He's doing incredible things to optimize the Super Mario 64 source code. He's making a rom hack (which he tests on actual hardware), and the things he can get the N64 to render interactively in real time are insane.
@oliverer3 Жыл бұрын
I'm terrible at it and hate doing it but it's so fascinating watching other people do it and explain their motivations.
@actuallydaneel Жыл бұрын
This really does remind me of polybridge, and i'm so into it. physics visualizations are just so satisfying
@cpli7783 Жыл бұрын
Whilst i love reinventing the wheel, there's an old passage that one can take from all the other physics engines i.e. that: "linear algebra? that belongs on the GPU". using a compute shader to do your SIMD for you every frame could possibly allow for much more complex simulations.
@AngeTheGreat Жыл бұрын
I'll leave that to a future video lol but yes, offloading some of the physics to GPU would be very interesting to try
@felixurbanov3438 Жыл бұрын
You are awesome Ange!
@AngeTheGreat Жыл бұрын
You're awesome 🙏
@cemgecgel4284 Жыл бұрын
You meant great.
@finneggers6612 Жыл бұрын
I have written my own FEM simulation software for 3d problems and I figured out that iterative methods for solving sparse systems at low degrees of freedom (anything below 500k) is actually way way slower than direct methods. I recommend direct methods. Since your problem is probably symmetric positive definite, this should be simple.
@AngeTheGreat Жыл бұрын
Thanks for the suggestion. Do you know of any papers/sources about these methods?
@finneggers6612 Жыл бұрын
@@AngeTheGreat Yes sure. I think the list of solution strategies is almost infinite here. I also thought abou tthis once more. So. Using direct solvers is 100% faster for your problems here. We are talking about magnitudes. For 1000 DOF the direct methods are magnitudes faster (maybe a factor 100-1000). Now when using iterative methods like CG, you never ever want to use plain CG. CG converges faster the better the condition number of your problem is. The condition number is basically a scalar describing how difficult it is to numerically solve your problem. for linear symmetric positive definite systems it is k = max(lambda) / min(lambda) (IIRC). Multiple things. The higher k, the longer CG will take to converge. I am 90% sure your k value is absurdly high. One method if you want to stick with indirect methods is using preconditioning. Sadly preconditioning is hard to implement yourself. (technically preconditioning is a direct solver which you just stop in the middle). A common preconditioner here is the incomplete cholesky (again, hard to implement yourself). When using direct methods for these type of problems, the probably best way is doing a simple LDL* decomposition. Understanding the decomposition is easy. Implementing it is stupidly hard. I have tried some of these and it gets incredibly complex for sparse matrices. There are a few things to consider here: A) what sparse matrix format you use, CSR may not be the best B) For C/C++ there are free libraries. At some point I was so annoying by implementing this myself, that I went with Eigen. I can give you a link where I used Eigen for: LDLT: github.com/Luecx/FFES/blob/main/src/solver/LDLT.cpp PCG: github.com/Luecx/FFES/blob/main/src/solver/CG.cpp Eigen: eigen.tuxfamily.org/index.php?title=Main_Page If you really want to write this yourself: condition number: en.wikipedia.org/wiki/Condition_number pcg: en.wikipedia.org/wiki/Conjugate_gradient_method (scroll down to pcg) positive definite: en.wikipedia.org/wiki/Definite_matrix I can give you more resources. Its easier to read on this on wikipedia initially.
@jfyllipy Жыл бұрын
Hello! I’m a structural engineer and that is exactly what we do. It’s called finite element method and we solve pretty much a very similar matrix (but the global matrix elements are in bar’s terms (based on elastic properties of material and it's geometry) and not about the nodes, although we solve it for nodes displacements). The matrix is called “stiffener matrix”. Polybridge uses this very same method (as far as I’m concerned). I even developed an web app for structure (we call it frame) solution (first and second order solver. P-Delta for the win!). I don’t know if I can post the link here but if I can please let me know. (It’s is in my mother tong (Portuguese) however. But it’s very intuitive and I’m planing to release an English version).
@jbritain Жыл бұрын
You can absolutely put links in KZbin comments as far as I know
@Inf1e Жыл бұрын
Most populat CADs (AutoCAD, SolidWorks, etc) use this very method to simulate.
@jfyllipy Жыл бұрын
@@Inf1e I dont know if CAD does simulation but definitely Solidworks, ANsys, Catia, Abaqus, etc uses it. However they do it with another technic. While I (and AngeTheGreat uses a variation of) use a technic called "Displacement Method", all these simulations softwares discretize the elements even more, where a mesh can have thousands and thousands of nodes (called vertices), solving for a matrix of order 6*n (n is the number of vertices). They even compute results in between vertices solving, by many iterations, an equation that needs to converge (the convergence is a very important measurement for accuracy). This means that a normal model (2000 vertices) can have a matrix of 144 millions elements and need to be solved multiple times to converge! It requires a good computer indeed. This technic is not used only for mechanics, however. CFD, magnetism, heat transfer, soil mechanics... All of them uses this technic, changing only the way they build the global matrix.
@annakquinn7084 Жыл бұрын
This is not FEM, this is Matrix Stiffness Method. In FEA we use shape functions to approximate discrete displacements at the elements.
@jfyllipy Жыл бұрын
@@annakquinn7084 ooooops. You are completely right
@first9279 Жыл бұрын
I love that you've written "Danke" at the end of the thing with "Seidel", Im a native German speaker and I dont mind it when you pronounce it wrong :)
@seritools Жыл бұрын
Since I can't comment on the wrong pronounciation anymore imma replace it with "um actually, it's '3 fewer instructions', not '3 less instructions'"
@kem0n0.kokomo Жыл бұрын
@hello Skill issue
@dieSpinnt Жыл бұрын
The correct pronunciation of "Seidel" is only important when visiting the Oktoberfest. That's what the stone beer mugs are called, hehehe. With Philipp Ludwig von Seidel, Ritter von Seidel it is simpler: he has been DEAD since 1896 and can no longer defend himself against the butchering of his name. But I would be careful with living people. "We're Americans(for example) and that's how we pronounce XYZ here ...", like Ange told in the video, is far from good manners or respect. Just by the way;) And yes, all of this doesn't matter here. It's a video about science and not a love letter:) Danke auch!:)
@mrkosmos9421 Жыл бұрын
This man started with engines and is going with PolyBridge... But the progress is incredible, can't wait to see what's next Anyway, the licensing options are endless, from engine sound simulation for EVs to games to anything else And the trebuchet just takes me back to old flash games about destroying medieval castles... ah, good times Makes me wonder if there is the possibility of making a puzzle sandbox game about creating your own engine under a certain budget/limitation for a certain purpose, like PolyBridge, KSP or Besiege to name a few You know what, maybe I'll make something like that
@perplxxd Жыл бұрын
this man is singlehandedly changing the history of racing videogames edit: just videogames in general tbh
@ChaoticNeutralMatt Жыл бұрын
Writing history?
@enorazza Жыл бұрын
Geoff Crammond. Robert Scawen. May be it is time for a new one ;)
@MedicMainDave Жыл бұрын
3:04 as a german I am very happy you wrote this, not because I really mind that much about how something is pronounced, cause I'd also say it the same way when speaking english, but rather because of the "Danke" you put there lol Danke mein Friend :)
@Propulus Жыл бұрын
Playing BeamNG while watching the last couple of videos and seeing them support you and show interest is just insane levels of hype. It's already my driving sim of choice, but if it get's even a fraction of your engine sound simulation too, it'd probably become THE driving sim for just driving. I love the work that team does, and it keeps getting better so all of this is fantastic news.
@HiImKyle Жыл бұрын
Wow BeamNG is supporting you? The official BeamNG? That's pog. Would love to see the engine sim in BeamNG.
@AuxenceF Жыл бұрын
yes that's the real one
@MetroidChild Жыл бұрын
Probably partially the reason they support it, since it sounds like Ange will be going to GDC alongside BeamNG.
@notarobotto Жыл бұрын
they're supporting a lot of people doing this kindof stuff, i'm happy seeing that they're supporting others and not suppressing competitors
@EJM07 Жыл бұрын
Yes. Beam team really loves what ange is doing. I could actually could see them hiring him.
@hi_its_jerry Жыл бұрын
engine sim + beamng confirmed??? im drooling at the thought
@YannickBo Жыл бұрын
And now we can even play Poly Bridge in Engine Sim :P
@zachogdahl210 Жыл бұрын
The integration discussion is interesting, Having the audio simulation working natively in unreal would be incredible. Excellent work as always
@AngeTheGreat Жыл бұрын
When I get the time I'll probably look into implementing something into Unreal, or I might find someone with more Unreal skills than I have to help lol
@orthodynamicstereonails Жыл бұрын
i guess you could say it would be... unreal
@Avetho Жыл бұрын
@@orthodynamicstereonails Darn you beat me to it!
@EPICGameGuy493 Жыл бұрын
I've been working on integrating Engine Simulator inside of unreal, and I uploaded a video on my account demonstrating it. Everything works natively but the audio is unfiltered, and I'm working on getting it working with Metasounds rn
@MihaiZavoian Жыл бұрын
someone also integrated it into assetto
@felipeferreira00 Жыл бұрын
@RealCivilEngineerGaming This, this is the future, and i love it.
@Alexander_Sannikov Жыл бұрын
in my experience the converge that you gain from conjugated gradients applied to linearized system of your constraints should be less than convergence (and stability) of nonlinear gauss seidel. in your examples nonlinear gauss seidel with a simple verlet integrator should be unconditionally stable and should converge in microseconds, not milliseconds. i suggest trying nonlinear gauss seidel, that amounts to simply solving each individual distance constraint multiple times: there's no matrix to be stored, no fancy maths involved, it's so simple that getting anything to converge better is extremely hard.
@AngeTheGreat Жыл бұрын
Do you know any good papers/sources about this? I find that getting decent information on this is the most challenging part for me
@Alexander_Sannikov Жыл бұрын
@@AngeTheGreat in literature this approach is simply callex position-based dynamics. you literally just satisfy constraints in random order independently from each other. just push particles of each constraint to their resting position closest to the current configuration. it's the dumbest thing you can do and it works annoyingly well when coupled with verlet integrator. unconditionally stable for rigid link constraints. the reason why it works is because it's a projection-based relaxation scheme. the reason why it works better than anything linear is because each constraint keeps its nonlinearity during the entire solving process: contrast this to conjugated gradients where you have to linearize constraints in the beginning of a time step and then crucially assume that constraints don't rotate during the entire time step. the test case where everything linearized will fail (including analytical solution) is just a rigid rope with a 100 links sustaining a heavy weight: it will develop zigzag-shaped instabilities regardless of your solver, as long as you linearize your system.
@AngeTheGreat Жыл бұрын
@@Alexander_Sannikov hmm I've implemented a system like that in the past and I didn't find that it worked very well for precise machines, maybe I missed something
@Alexander_Sannikov Жыл бұрын
@@AngeTheGreat systems like in this video should be trivial for it, however, there can be some dampening. i'm not sure how important energy conservation in your case is, but often in game physics some amount of dampening is desirable.
@AngeTheGreat Жыл бұрын
@@Alexander_Sannikov For my use-case, dampening and energy-loss in general is extremely undesirable. I might play around with position-based dynamics again but based on experiments I've done in the past, I don't think it would be the best option when simulating engines since I need very precise object positions and velocities even at high engine speeds
@emirozturk3462 Жыл бұрын
Good job! As a side note, you might consider Newton-Raphson or Fast Decoupled methods to solve non-linear equations. For Newton-raphson, computation time won’t be increasing as much as Gauss-Seidel as the size of the matrix increases and it is very robust. However, Fast decoupled will be the fastest but It won’t be as robust. These options might help you. As an electrical engineer, we are using these methods to solve power flow equations on large systems.
@BI4ck_J Жыл бұрын
this is getting more and more exciting as time pass by!
@scrambledmandible Жыл бұрын
Thank you Beamng for chipping in, you're really cool for that!
@danielpalecek4090 Жыл бұрын
shaking explosions or "kraken attack" are in every physics game on every physics setting, you won't avoid it
@nac5605 Жыл бұрын
i hope you can get fat stacks from selling this technology to racing game studios, not even counting the standalone game on steam. you deserve it 100% man.
@saar5947 Жыл бұрын
You should do a collab with Sebastian Lague
Жыл бұрын
As a mechanical engineer it's a joy to watch this video. I work with fluid simulations, where approximation methods are a must. The stability is an issue as well, but depending on what program you use for the simulations it might be handled with an ever increasing relaxation factor. XD Keep up the awesome work!
@Velkanis Жыл бұрын
with the readmap out im never leaving this dev log train again, something tells me this will be real fun! also grats on getting dragged along beamNG to gdc! do have yourself a great load of fun there fam!
@dsagman Жыл бұрын
have you considered simplex for solving? it can work very well on sparse matrices and there are available libraries
@AngeTheGreat Жыл бұрын
I've heard of it but when I looked into it in the past I couldn't wrap my head around it lol. Maybe now I could actually understand it given the knowledge I've accumulated
@windowsxseven Жыл бұрын
@@AngeTheGreat holy fuck... you couldn't understand simplex?
@AngeTheGreat Жыл бұрын
@@windowsxseven Uh maybe? I never said I was smart lol
@windowsxseven Жыл бұрын
@@AngeTheGreat got DAMN
@ffff-od3jb Жыл бұрын
@@AngeTheGreat 🤓
@KanzakiZD Жыл бұрын
if your works will be included in beamng, that'll be extremely amazing 😳
@CharlesVanNoland Жыл бұрын
I've never been able to employ SIMD intrinsics in my code that performs better than what the compiler optimizations can do, especially when link-time optimizations and 'expensive optimizations' are enabled. GCC's auto-vectorization is legit, as long as pointer indirection and whatnot don't throw it off, which just means conforming code to the optimization 'templates' (that's how I think of them as) that it employs to determine when/where the vectorization should happen.
@AngeTheGreat Жыл бұрын
I can relate. I actually had a few hours of recordings showing how I did the SIMD optimization but I thought it would be too boring to watch for most people. After first adding SIMD, the code was actually 2x SLOWER. But by looking at the disassembly I was able to find the places where MSVC was not producing optimal SIMD code and guide the compiler by massaging the C++ code. Maybe GCC is better but I haven't really used it's auto-vectorization features much.
@empireempire3545 Жыл бұрын
I also work with GCC. I had a case at work, my colleague has rewritten one piece using intrinsics and got something like 2-3 times improvement. The thing about intrinsics is, they will only help you if you optimized memory access in the first place - most of the people don't know what that means, much less do that. And memory access is much more potent optimization anyway. Whether the compiler will or will not employ intrinsics is very, very hard to predict.
@luukvanoijen7082 Жыл бұрын
Holy shit I cannot tell you how excited I am that BeamNG is supporting you. I really hope something incredible will come out of this partnership :D
@sjeses Жыл бұрын
Please keep reinventing the wheel, and take as much time as the process needs. It's fascinating!
@ZeldaACFan17 Жыл бұрын
For the damage thing, maybe have it as an option that can be enabled or disabled 🙂 Some people might not want the damage simulation, like someone who is just starting with Engine Sim, or a returning user who's been away for a while and wants to gradually come back in, so they can refresh their memory on how Engine Sim works 😉
@AngeTheGreat Жыл бұрын
Good idea! I imagined having something like "unbreakable mode" in PolyBridge.
@ZeldaACFan17 Жыл бұрын
@@AngeTheGreat Thanks 😉 But I've noticed something about BeamNG too... The way I like to play it is like a standard driving or racing sim, not like the crash simulator type videos that I see a lot of... I think BeamNG should have a reduced damage mode or something like a damage sensitivity slider, so for racing scenarios like I like to do, the damage would be less sensitive globally, or even turned off entirely if I just want to drive for fun (I mostly play Beam for the driving physics portion, trying *not* to crash 😂)
@ZeldaACFan17 Жыл бұрын
Now don't get me wrong, I do like how realistic the crashes look in Beam. It's just that I don't only play it for the crashing itself. I play Beam for the driving aspect, and creating my own custom car configs to drive on my favorite maps, which are racing maps. Drag strips, offroad, or standard circuit style 🙂🏁🏎️
@logtrimmer Жыл бұрын
Your explanations go way over my head since I am not that familiar with coding, but I can understand the optimization thanks to the time it takes per iteration.
@amukh1_dev274 Жыл бұрын
I used to watch your videos in the past, and I never really understood the physics or math, but today I clicked on this video and was met with a pleasant surprise.
@ulyssesmoura4890 Жыл бұрын
My final course work in civil engineer i did a python program for construct a matrix like this one using cholesky decomposition to solve the equations. It's so cool watch this and remember my college years. Hello from Brazil
@iancunnyngham7120 Жыл бұрын
You know you want to just go ahead and build a complete racing simulator :D Get all the important physics extremely accurate, make it super mod-able, don't worry about it being pretty. Bonus for me and my few dozen closest friends: make it able to run just the physics as fast as possible headless so we can trail reinforcement learning drivers!!
@slightlyinsaneraf Жыл бұрын
So enjoyable to watch these videos
@DasParedes Жыл бұрын
maaan, this is incredible, Thank you for showing us that!
@gedaliakoehler6992 Жыл бұрын
Great video again! Fun stuff. One idea (could be interesting) is to save off some of your large sparse matrices and try different already implemented solvers on them in (with numpy or package you like) to play around with different techniques and their performance. Then once you know a technique is better for performance you can implement it.
@pafnutiytheartist Жыл бұрын
Polybridge 4 is looking good
@jakubpollak2067 Жыл бұрын
I hope you will make next gen Algodoo simulator with sounds I'll would definitely pay for that! Seeing these truss constructions reminds me of university :D
@CubeAtlantic Жыл бұрын
This looks kind of detailed but it's still alive & with optimized physics/engineering i like this honestly.
@ardaokay6862 Жыл бұрын
At least you said Danke at the end... I'll allow it 👍🏻 You are great
@stinkytoby Жыл бұрын
Hah When you mentioned the tension/compression right after stability, I immediately remembered how PolyBridge 2 had much more deterministic physics than its prequel
@erikziak1249 Жыл бұрын
Thank you for this video and all your work.
@louispender9347 Жыл бұрын
The method I cover in my degree is to remove parts of the structure (constraints or beams) until the structure can solved trivially. Then finding the orthogonal states of self stress representing unit forces in the locations where beams/constraints were removed. Virtual work is used to impose geometric constraints and solve for the self stress coefficients. This method, as far as I know, only works for static structures but may be worth looking at.
@PBOZAI Жыл бұрын
For linkages that are supposed to be perfectly rigid, you could use maximum cliques to group “trussed”/“triangluated” sturctures and treat them as a single object within the simulation.
@rwilson4073 Жыл бұрын
Babe wake up, new engine sim vid just dropped
@bbqgiraffe3766 Жыл бұрын
As a reinvent the wheel guy myself I totally understand, although my physics engines are usually way more janky
@fazbeark1ng Жыл бұрын
im really excited for the engine sim to be complete! it already awesome
@charliemw333 Жыл бұрын
I'm sure you already know about this, but you may want to look into the numerical methods that are used for computer fluid dynamics simulations or finite element method simulations. Sparse matrices pop up all the time, and you may be able to use some of the info you find in ur game.
@houseisforthesoul Жыл бұрын
oh my lord - this is a fantastic project
@草-t8i Жыл бұрын
impressive stuff. I should look into reinventing the wheel myself
@hfitfxhfhfufgugugu6589 Жыл бұрын
In Seidel (and many other german words like Sohn=son Sonne=sun Seide=silk Sieben=seven so=so Säge=saw Seife=soap.....) jus pronounce the s like a bee Zzzz (like in desining=deZzzzining, not like in signing) , we call it ein weiches s=a soft s. Ein Scharfes s=a sharp s would often, if not always be in st like in Stiefel=boot (the big shoe, not booting up your computer, that would be hochfahren as a verb). There is ß for a scharfes s as well. It is used to make sure it should be scharf eventhough, there is a vowel after it. In Was=What it is scharf btw. I think that is because it is at the end. PS: Sch=sh
@toyoboi Жыл бұрын
This is absolutely incredible. I spent a couple hours last weekend just playing around in engine sim and my girlfriend was very confused why I was spending time "playing a game" where nothing happens.
@hcmcnae Жыл бұрын
this is so sick. Found you today and I'm looking forward to seeing your progression!
@Teflora Жыл бұрын
idk how reasonable it is, but having a VST of this in the future would be awesome! Good work!
@MihaiZavoian Жыл бұрын
the Engine Fattner
@g.paudra8942 Жыл бұрын
You may get more real-time performance and lower computation cost using CUDA (GPU), there's a CUDA version of Gauss-Seidel method btw.
@AngeTheGreat Жыл бұрын
"Possibly" but there are costs to this as well and for smaller matrices the performance advantages may not be that significant. In any case, I'd need to test this to confirm whether there are any real benefits to using the GPU.
@empireempire3545 Жыл бұрын
@@AngeTheGreat Be careful with the test. One of the biggest bottlenecks for GPU is transfer of data between RAM and VRAM. So, for small systems, CPU implementation may be better simply because of the latency of just shuttling the data to/from the GPU memory. But for bigger systems the raw computational power of the GPU may take over.
@Danger_N00dle3 ай бұрын
That reminds me of games like Sinking Simulator or Floating Sandbox I think they used the deformation of each string to calculate the total stress on parts.
@sterlingmakara Жыл бұрын
I just had an idea while in the bathroom. A slider that can change the spark timing. You can slide it to the left to delay the timing a bit and slide it right to advance the timing. This will especially play a big role in how a diesel engine sounds when you get around to that. Would be neat to see.
@WoolieOG Жыл бұрын
fascinating video, loved dive into algorithm and their flaws
@fasogoss Жыл бұрын
I get performance aware programming vibes here, Great work man!
@chrismofer Жыл бұрын
there may be plenty of times in simulating the physics of an engine where a simple look up table or curve fitting function is as good as a more complex calculation but saves runtime
@doct Жыл бұрын
4 days after this video released I started a Numerical Analysis class here at uni. I (thought) I had no idea what it was but then they mentioned the Gauss-Seidel method, and I was like oooooooooooooooh so that's what this is about lol
@DrNabeel20 Жыл бұрын
This actually amazing! great video
@tensevo Жыл бұрын
Great, i cant fully appreciate what is going on but will look forward to seeing the final product and maybe integrating in other sims.
@turbinia Жыл бұрын
8:40 The reason for needing a roller support instead of two fixed supports is that it makes the truss statically determinate. It's much more difficult to analyse the internal forces of a truss if you can't assume that the sums of forces and moments are zero. If it is statically determinate, you can use basic statics equations to get the forces in each member. A statically determinate structure should agree with the equation M + R = 2J, where M is the number of members in the truss, R is the number of external reaction forces, and J is the number of joints. If M + R < 2J, the structure is unstable (effectively a mechanism), and if M + R > 2J, the structure is statically indeterminate and cannot be analysed just by geometry alone and you need to start taking material properties and member design into account. Note that while the equation being satisfied is a necessary condition for stability, it is not sufficient in itself, as the members of the truss also need to be arranged properly. In your example truss there, you have 21 members, 3 external reactions, (x and y at the pin joint, y only at the roller) and 12 joints, so that is statically determinate. Changing the roller joint for a pin joint adds a reaction force in the x axis, and M + R becomes 25 which is greater than 2 x 12 =24, so it becomes statically indeterminate.
@AngeTheGreat Жыл бұрын
Yep, you know your stuff!
@redship7532 Жыл бұрын
this is crazy, very good job!
@johannesssssssss Жыл бұрын
First time seeing a dev optimizing before release 😳
@lorenzodiambra52104 ай бұрын
2:56 1700s' gauss: "I don't think that this stupiod fuckinog algorithm will ever be of any use" 2000s youtube developer: 🌚🌚 🧑🏻💻
@raztaz826 Жыл бұрын
You could also try the XPBD method which is on the 10 Minute Physics channel
@MetroidChild Жыл бұрын
It's actually fairly similar, both uses conjugate gradients (edit: you don't need to, but most implementations do). The main difference is that XPBD can produce a vastly more stable result for low iteration counts and stiffness coefficients (but costs the same as increasing iterations). For problems which can be simplified to pure rigid bodies such as simulating the engine itself it doesn't make that much of a difference, except perhaps valve springs if they are not programed as their own special entities.
@_general_error Жыл бұрын
Man, you became my idol. You are a proof, that when I quit my demanding life, I might be able to give my life a purpose and start coding what really matters!
@shanegonzales Жыл бұрын
this reminds me of that bridge builder cellphone game. so much fun.
@amirsayfiddinov Жыл бұрын
Love the ending. "Watch me reinvent the wheal" 😂
@Johnnyynf Жыл бұрын
hear me out, this game engine in the style of "DreamCar Builder"(the game), with engine simulator, maybe some ways to have gears like the game "Gear Blocks". Would be pretty poggers
@MetroidChild Жыл бұрын
10x speed improvement will be a pleasant performance surprise on my awful laptop, can't wait!
@raptorjeezus2607 Жыл бұрын
man its like you read my comment on compute intensity for a beamng implementation. Great work!
@danielmachado4389 Жыл бұрын
Not sure if could be of help, but for that stiffness of the transmission you could use the value of a beam like element in tortion: k=G*pi(R^4-r^4)/2/L where G id the shear modulus of the material (steel or whatever), R is the outer radius of the shaft, r is the inner radius of a hollowed shaft (typically r=0) and L is the shaft length
@davidvargas7651 Жыл бұрын
You should check out algebraic multigrid (AMG) for solving the linear system. I think it could work well for your systems, and it is super fast. You can also use AMG as a precondioner for CG and it can greatly reduce the number of iterations required.
@Radi0he4d1 Жыл бұрын
Looking forward to the gdc talk!
@microcolonel Жыл бұрын
It's kinda fun that popular games and toys are now based on nonlinear finite element analysis.
@sebleaf8433 Жыл бұрын
Really cool. You could also experiment using gauss seidel as a preconditioner for your conjugate solver
@MrHaggyy Жыл бұрын
CPU's are cool but if you want really fast calculations with matricies you want to use the GPU for calculation as well. Also you can (LU or QR) factor your matrix into two smaller once. Helps with the O(n^3) as well as storing and moving the matrix around in memory.
@blanchbacker Жыл бұрын
So exciting that you are in talks with the BeamNG devs
@GuildOfCalamity Жыл бұрын
Awesome video and very educational!
@codesymphony Жыл бұрын
nice. keep me updated
@pavelperina7629 Жыл бұрын
Quite interesting. I would likely use Eigen library for this, but it's always good to know there are other methods and when they are more useful than first one that comes into mind (despite both are in Eigen). Sometimes experimenting and deeply understanding the problem is better than using any library. Sometimes it's arguable, cause spending extra four months on problem that's already solved costs a lot - more than double of your income.
@sera359 Жыл бұрын
if you like doing it that way, then go for it I'm very interested in what you make, I'll look forward for your next update 😊
@joshdingle930 Жыл бұрын
i want to have this physics engine to just mess around in it sounds so fun
@Benlucky13 Жыл бұрын
Stoked to see you working with the beamng devs on this
@sebastianojeda5283 Жыл бұрын
bro this is the best channel ever, love this, keep the good work, somehow you are doing God's job
@Gimble_Gamble Жыл бұрын
Your content is so cool! I am really inspired by you, keep up the good work!
@AngeTheGreat Жыл бұрын
Thanks man 🙏
@kevindormaconsulting4763 Жыл бұрын
Have you considered a direct solver with sparse LU decomposition? I have used old FORTRAN code for sparse matrices in my CFD applications.
@AngeTheGreat Жыл бұрын
If you know of some good sources/papers I'd be interested to learn more about it
@kevindormaconsulting4763 Жыл бұрын
@@AngeTheGreat Harwell MA28 code is in FORTRAN. For C++ I think Eigen might be ok. I can’t remember which C library but that was almost 30 years ago.
@castin5244 Жыл бұрын
It would be really cool if this some day turned into a more powerful and stable version of Algodoo. Like a "modern" Algodoo of sorts. You can build some incredibly complex things in that 2D physics sandbox, but its very limited by things like hinge joints being unstable at high loads. I've always dreamed somebody would be able to build a similar physics sandbox without those kinds of limitations.
@joancasals4365 Жыл бұрын
Very interesting video, keep going!
@aSpyIntheHaus7 ай бұрын
Oh i love this idea!
@fiery_transition Жыл бұрын
Honest question, would you normally use a math library (NOT game libraries/engines) which does the numerical and linear solving? EVEN when you are implementing things like this from scratch? It's more a question of, is it necessary to have complete control of the simulation, all the way to the numerical methods, or could a fast math library be used at the cost of it being blackboxed, and would that create issues further down wrt. mismatches in how the numerical methods behave?
@AngeTheGreat Жыл бұрын
As I said in this video, this is 100% about gaining knowledge and not necessarily about having complete control. I would barely even understand what a linear equation solver even is if I hadn't implemented one myself and having this knowledge would allow someone to use third party libraries more effectively since you'd actually understand it. Would I consider using one? If it was really a slam dunk performance-wise and I was under time pressure, possibly. But at the end of the day both of those things are not really true, I'd like to create entertaining and engaging content for people to watch and I personally enjoy the process of writing things from scratch and that's ultimately the most important thing to me
@fiery_transition Жыл бұрын
@@AngeTheGreat I totally can get behind just doing it for learning, one of my great memories of learning was implementing numerical solving methods for integral equations. Sometimes the different numerical methods converge differently or lose precision at an earlier or later stage in the iteration count. I thought it might be hard to debug making your own physics engine, while at the same time, using a blackbox math library which might have all sorts of behavior which one does not know about, due to not having implemented it yourself, and then having problems when the solvers converge and behave differently, in the same program. So I was wondering if it even was realistic using another library, since it could create all sorts of weird issues, since the solver math might be different? But I totally get the educational/learning perspective, and do really enjoy your videoes!