Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
import { useEffect } from 'react' import { useSelector } from 'react-redux' import { selectIsModeling, selectObjectModelm, selectObjectModelR, } from 'selectors' export const useModeling = () => { const isModeling = useSelector(selectIsModeling) const m = useSelector(selectObjectModelm) const r = useSelector(selectObjectModelR) const g = 9.8 const V0 = 0 const t = 0.1 const n = 0.0182 const C = 0.4 const S = Math.PI * r * r const p = 1.89 const k1 = 6 * Math.PI * r * n const k2 = (C * S * p) / 2 useEffect(() => { console.log('modeling') if (!isModeling) return let i = 100 let Vi = V0 const calculateVi = function () { console.log(123) if (!isModeling || --i === 0) return const CC = (m * g - k1 * Vi - k2 * Vi * Vi) / m const DD = Vi + t * CC const c = (m * g - k1 * CC - k2 * DD * DD) / m console.log(Vi) Vi = Vi + (t / 2) * (CC + c) calculateVi() } calculateVi() }, [isModeling]) }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)