diff --git a/dist/diagrams/mathaven.html b/dist/diagrams/mathaven.html
index 442c49ea..b492fc50 100644
--- a/dist/diagrams/mathaven.html
+++ b/dist/diagrams/mathaven.html
@@ -12,8 +12,8 @@
mathaven diagrams
-
-
+
+
diff --git a/dist/mathaven.js b/dist/mathaven.js
index 8e15930e..1fcc276f 100644
--- a/dist/mathaven.js
+++ b/dist/mathaven.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkbilliards=self.webpackChunkbilliards||[]).push([[893],{"./src/mathaven.ts":(t,i,e)=>{var s=e("./src/model/physics/claude/constants.ts");function o(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}var n=new/*#__PURE__*/(function(){var t;function i(t,e,s,n){!function(t,i){if(!(t instanceof i))throw TypeError("Cannot call a class as a function")}(this,i),o(this,"P",0),o(this,"WzI",0),o(this,"vx",void 0),o(this,"vy",void 0),o(this,"ωx",void 0),o(this,"ωy",void 0),o(this,"ωz",void 0),o(this,"s",void 0),o(this,"φ",void 0),o(this,"sʹ",void 0),o(this,"φʹ",void 0),o(this,"history",[]),o(this,"iter",void 0),this.vx=t*Math.cos(e),this.vy=t*Math.sin(e),this.ωx=-n*Math.sin(e),this.ωy=n*Math.cos(e),this.ωz=s,this.updateSlipSpeedsAndAngles()}return t=[{key:"updateSlipSpeedsAndAngles",value:function(){this.s=Math.sqrt(Math.pow(this.vx+s.R*(this.ωy*s.Z3-this.ωz*s.o5),2)+Math.pow(-this.vy*s.Z3-s.R*this.ωx,2)),this.φ=Math.atan2(-this.vy*s.Z3-s.R*this.ωx,this.vx+s.R*(this.ωy*s.Z3-this.ωz*s.o5)),this.sʹ=Math.abs(this.vx-s.R*this.ωy),this.φʹ=this.vx-s.R*this.ωy>0?this.φ:Math.PI+this.φ}},{key:"compressionPhase",value:function(){for(var t=(1+s.ee)*s.M*this.vy/s.N;this.vy>0;)this.updateSingleStep(t)}},{key:"restitutionPhase",value:function(t){for(var i=(1+s.ee)*s.M*this.vy/s.N;this.WzI2e3)throw"Solution not found"}},{key:"updateVelocity",value:function(t){this.vx-=1/s.M*(s._m*Math.cos(this.φ)+s.oV*Math.cos(this.φʹ)*(s.Z3+s._m*Math.sin(this.φ)*s.o5))*t,this.vy-=1/s.M*(s.o5-s._m*s.Z3*Math.sin(this.φ)+s.oV*Math.sin(this.φʹ)*(s.Z3+s._m*Math.sin(this.φ)*s.o5))*t}},{key:"updateAngularVelocity",value:function(t){this.ωx+=-(5/(2*s.M*s.R))*(s._m*Math.sin(this.φ)+s.oV*Math.sin(this.φʹ)*(s.Z3+s._m*Math.sin(this.φ)*s.o5))*t,this.ωy+=-(5/(2*s.M*s.R))*(s._m*Math.cos(this.φ)*s.Z3-s.oV*Math.cos(this.φʹ)*(s.Z3+s._m*Math.sin(this.φ)*s.o5))*t,this.ωz+=5/(2*s.M*s.R)*(s._m*Math.cos(this.φ)*s.o5)*t}},{key:"updateWorkDone",value:function(t){var i=t/2*(this.vy+this.vy);this.WzI+=i}},{key:"solve",value:function(){this.compressionPhase();var t=(1-s.ee*s.ee)*this.WzI;this.restitutionPhase(t)}}],function(t,i){for(var e=0;e{e.d(i,{Hm:()=>a,M:()=>s,N:()=>v,R:()=>o,Z3:()=>c,_m:()=>r,ee:()=>n,o5:()=>u,oV:()=>h,ye:()=>l});var s=.1406,o=.02625,n=.98,h=.212,r=.14,a=.4,c=.4,l=Math.sqrt(21)/5,u=l,v=1e3}},t=>{t(t.s="./src/mathaven.ts")}]);
\ No newline at end of file
+"use strict";(self.webpackChunkbilliards=self.webpackChunkbilliards||[]).push([[893],{"./src/mathaven.ts":(t,i,e)=>{var o=e("./src/model/physics/claude/constants.ts");function s(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}var n=new/*#__PURE__*/(function(){var t;function i(t,e,o,n){!function(t,i){if(!(t instanceof i))throw TypeError("Cannot call a class as a function")}(this,i),s(this,"P",0),s(this,"WzI",0),s(this,"vx",void 0),s(this,"vy",void 0),s(this,"ωx",void 0),s(this,"ωy",void 0),s(this,"ωz",void 0),s(this,"s",void 0),s(this,"φ",void 0),s(this,"sʹ",void 0),s(this,"φʹ",void 0),s(this,"history",[]),s(this,"iter",void 0),this.vx=t*Math.cos(e),this.vy=t*Math.sin(e),this.ωx=-n*Math.sin(e),this.ωy=n*Math.cos(e),this.ωz=o,this.updateSlipSpeedsAndAngles()}return t=[{key:"updateSlipSpeedsAndAngles",value:function(){this.s=Math.sqrt(Math.pow(this.vx+o.R*(this.ωy*o.Z3-this.ωz*o.o5),2)+Math.pow(-this.vy*o.Z3-o.R*this.ωx,2)),this.φ=Math.atan2(-this.vy*o.Z3-o.R*this.ωx,this.vx+o.R*(this.ωy*o.Z3-this.ωz*o.o5)),this.sʹ=Math.abs(this.vx-o.R*this.ωy),this.φʹ=this.vx-o.R*this.ωy>0?this.φ:Math.PI+this.φ}},{key:"compressionPhase",value:function(){var t=(1+o.ee)*o.M*this.vy/o.N;for(console.log(t);this.vy>0;)this.updateSingleStep(t)}},{key:"restitutionPhase",value:function(t){for(var i=(1+o.ee)*o.M*this.vy/o.N;this.WzI2e3)throw"Solution not found"}},{key:"updateVelocity",value:function(t){this.vx-=1/o.M*(o._m*Math.cos(this.φ)+o.oV*Math.cos(this.φʹ)*(o.Z3+o._m*Math.sin(this.φ)*o.o5))*t,this.vy-=1/o.M*(o.o5-o._m*o.Z3*Math.sin(this.φ)+o.oV*Math.sin(this.φʹ)*(o.Z3+o._m*Math.sin(this.φ)*o.o5))*t}},{key:"updateAngularVelocity",value:function(t){this.ωx+=-(5/(2*o.M*o.R))*(o._m*Math.sin(this.φ)+o.oV*Math.sin(this.φʹ)*(o.Z3+o._m*Math.sin(this.φ)*o.o5))*t,this.ωy+=-(5/(2*o.M*o.R))*(o._m*Math.cos(this.φ)*o.Z3-o.oV*Math.cos(this.φʹ)*(o.Z3+o._m*Math.sin(this.φ)*o.o5))*t,this.ωz+=5/(2*o.M*o.R)*(o._m*Math.cos(this.φ)*o.o5)*t}},{key:"updateWorkDone",value:function(t){var i=t/2*(this.vy+this.vy);this.WzI+=i,this.P+=t}},{key:"solve",value:function(){this.compressionPhase();var t=(1-o.ee*o.ee)*this.WzI;this.restitutionPhase(t)}}],function(t,i){for(var e=0;e{e.d(i,{Hm:()=>a,M:()=>o,N:()=>v,R:()=>s,Z3:()=>c,_m:()=>h,ee:()=>n,o5:()=>u,oV:()=>r,ye:()=>l});var o=.1406,s=.02625,n=.98,r=.212,h=.14,a=.4,c=.4,l=Math.sqrt(21)/5,u=l,v=1e3}},t=>{t(t.s="./src/mathaven.ts")}]);
\ No newline at end of file
diff --git a/src/mathaven.ts b/src/mathaven.ts
index f891cf74..44ff2ef9 100644
--- a/src/mathaven.ts
+++ b/src/mathaven.ts
@@ -72,15 +72,23 @@ function createTrace(x: number[], y: number[], name: string, color: string) {
const vals = (selector: (s: Mathaven) => number): number[] => extractValues(calc.history, selector)
-const impulse = vals(h => h.P).map((_,i)=>i)
-const data = [
- createTrace(impulse, vals(h=>h.s), 's', color(0)),
- createTrace(impulse, vals(h=>h.φ), 'φ', color(1)),
- createTrace(impulse, vals(h=>h.sʹ), "s'", color(2)),
- createTrace(impulse, vals(h=>h.φʹ), "φʹ", color(3)),
- ];
+const impulse = vals(h => h.P)
-window.Plotly.newPlot("mathaven-div", data, layout, config)
+window.Plotly.newPlot("mathaven-impulse", [
+ createTrace(impulse, vals(h => h.s), 's', color(0)),
+ createTrace(impulse, vals(h => h.φ), 'φ', color(1)),
+ createTrace(impulse, vals(h => h.sʹ), "s'", color(2)),
+ createTrace(impulse, vals(h => h.φʹ), "φʹ", color(3)),
+ ], layout, config)
+
+const index = vals(h => h.P).map((_,i)=>i)
+
+window.Plotly.newPlot("mathaven-vel", [
+ createTrace(index, vals(h => h.vx), 'vx', color(0)),
+ createTrace(index, vals(h => h.vy), 'vy', color(1)),
+ createTrace(index, vals(h => h.ωx), "ωx", color(2)),
+ createTrace(index, vals(h => h.ωy), "ωy", color(3)),
+], layout, config)
diff --git a/src/model/physics/claude/qwen.ts b/src/model/physics/claude/qwen.ts
index bb66ab10..00df637a 100644
--- a/src/model/physics/claude/qwen.ts
+++ b/src/model/physics/claude/qwen.ts
@@ -42,6 +42,7 @@ export class Mathaven {
public compressionPhase(): void {
const ΔP = ((1 + ee) * M * this.vy) / N;
+ console.log(ΔP)
while (this.vy > 0) {
this.updateSingleStep(ΔP);
}
@@ -60,6 +61,7 @@ export class Mathaven {
this.updateAngularVelocity(ΔP);
this.updateWorkDone(ΔP);
this.history.push({ ...this });
+ console.log(this.vy)
if (this.iter++ > 2000) {
throw "Solution not found"
}
@@ -79,6 +81,7 @@ export class Mathaven {
private updateWorkDone(ΔP: number): void {
const ΔWzI = ΔP / 2 * (this.vy + this.vy);
this.WzI += ΔWzI;
+ this.P += ΔP;
}
public solve(): void {