Skip to content

Commit

Permalink
md
Browse files Browse the repository at this point in the history
  • Loading branch information
tailuge committed Nov 16, 2024
1 parent edfa4ab commit f9194e0
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 7 deletions.
25 changes: 18 additions & 7 deletions dist/diagrams/mathaven.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,21 @@ numericalsolution.ts

import { M, R, ee, μs, μw, sinθ, cosθ, N } from "./constants"

export class NumericalSolution {
export class Mathaven {

P: number = 0;
WzI: number = 0;

// centroid velocity
vx: number;
vy: number;

//angualr velocity
ωx: number;
ωy: number;
ωz: number;

// slip speed and angles at I and C
s: number;
φ: number;
sʹ: number;
Expand All @@ -294,34 +300,39 @@ export class NumericalSolution {
thisx = -ω0S * Math.sin(α);
thisy = ω0S * Math.cos(α);
thisz = ω0T;
// initialise φ φ' and s s' based on the initial conditions
}

public compressionPhase(): void {
public compressionPhase() {
// Call updateSingleStep repeatedly until compression end condition
}

public restitutionPhase(targetWorkRebound): void {
// Call updateSingleStep repeatedly until restitution end condition
}

private updateSingleStep(ΔP: number): void {
private updateSingleStep(ΔP): void {
// Common function to update velocities, angular velocities, and work done
this.updateVelocitiesP);
this.updateAngularVelocitiesP);
this.updateVelocityP);
this.updateAngularVelocityP);
this.updateWorkDoneP);
}

private updateVelocitiesP: number): void {
private updateVelocityP) {
// Implement velocity updates based on equations 17a and 17b
}

private updateAngularVelocitiesP: number): void {
private updateAngularVelocityP) {
// Implement angular velocity updates based on equations 14d, 14e, and 14f
}

private updateWorkDone(ΔP: number): void {
// Compute work done based on equation 16a
}

public solve() {
// compression phase followed by restitution phase
}
}

```
62 changes: 62 additions & 0 deletions src/model/physics/claude/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { M, R, ee, μs, μw, sinθ, cosθ, N } from "./constants"

export class Mathaven {

P: number = 0;
WzI: number = 0;

// centroid velocity
vx: number;
vy: number;

//angualr velocity
ωx: number;
ωy: number;
ωz: number;

// slip speed and angles at I and C
s: number;
φ: number;
: number;
φʹ: number;

constructor(v0: number, α: number, ω0S: number, ω0T: number) {
this.vx = v0 * Math.cos(α);
this.vy = v0 * Math.sin(α);
this.ωx = -ω0S * Math.sin(α);
this.ωy = ω0S * Math.cos(α);
this.ωz = ω0T;
// initialise φ φ' and s s' based on the initial conditions
}

public compressionPhase() {
// Call updateSingleStep repeatedly until compression end condition
}

public restitutionPhase(targetWorkRebound): void {
// Call updateSingleStep repeatedly until restitution end condition
}

private updateSingleStep(ΔP): void {
// Common function to update velocities, angular velocities, and work done
this.updateVelocity(ΔP);
this.updateAngularVelocity(ΔP);
this.updateWorkDone(ΔP);
}

private updateVelocity(ΔP) {
// Implement velocity updates based on equations 17a and 17b
}

private updateAngularVelocity(ΔP) {
// Implement angular velocity updates based on equations 14d, 14e, and 14f
}

private updateWorkDone(ΔP: number): void {
// Compute work done based on equation 16a
}

public solve() {
// compression phase followed by restitution phase
}
}

0 comments on commit f9194e0

Please sign in to comment.