one more. not at all cpu-friendly but a real msd. m.
Andy Farnell wrote:
You're a hero Chuck. This tallys well with the equations in Perrys book. What I was missing is the step where you get the transfer function.
I made (attached) a little test rig. What isn't looking right is the underdamped behaviour. I was expecting to see a decaying oscillation around the top point. Maybe my test has errors.
a.
On Sat, 15 Mar 2008 19:16:29 -0500 "Charles Henry" czhenry@gmail.com wrote:
Note, when c goes to 0, we get a harmonic oscillator at angular frequency w=k/m rad/sec, which is correct. When we increase the damping, we get terms of e^(-0.5*c/m*t) which damps the solution.
made a typo here:
angular frequency w=sqrt(k/m) rad/sec and f=sqrt(k/m)/2pi Hz
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
#N canvas 114 22 1068 663 10; #X obj 209 212 cnv 15 100 40 empty empty empty 20 12 0 14 -96960 -66577 0; #X obj 334 211 cnv 15 100 40 empty empty empty 20 12 0 14 -96960 -66577 0; #X obj 458 212 cnv 15 100 40 empty empty empty 20 12 0 14 -96960 -66577 0; #N canvas 335 49 771 605 subb 0; #X obj 86 308 msd; #X obj 156 558 outlet~; #X obj 86 351 unpack; #X obj 401 48 inlet; #X msg 59 283 bang , get massesPos 1; #X obj 86 329 route massesPosNo; #X msg 370 213 forceX 1 $1; #X obj 370 142 moses 20; #X obj 370 164 * 0.05; #X floatatom 478 65 5 0 0 0 - - -; #X obj 478 118 /; #X msg 478 96 1; #X obj 478 44 inlet; #X obj 571 44 inlet; #X obj 86 258 spigot; #X obj 370 272 spigot; #X floatatom 133 256 5 0 0 0 - - -; #X obj 119 234 r $0-frommet; #X floatatom 423 265 5 0 0 0 - - -; #X obj 403 239 r $0-fromnoi; #X obj 232 350 0; #X msg 247 327 0; #X obj 178 415 tabwrite $0-bu; #X obj 232 372 t f f; #X obj 232 392 + 1; #X obj 179 436 table $0-bu 64; #X obj 676 36 block~ 1; #X text 309 386 hack hack hack...; #X obj 370 122 random 10000; #N canvas 166 43 493 434 bang-64-sub 0; #X obj 94 77 bang~; #X obj 94 229 delay 0.0226757; #X obj 56 278 outlet; #X obj 272 274 outlet; #X obj 94 149 t b b b; #X obj 196 229 bang; #X msg 113 172 stop; #X connect 0 0 4 0; #X connect 1 0 5 0; #X connect 1 0 2 0; #X connect 4 0 2 0; #X connect 4 0 1 0; #X connect 4 1 6 0; #X connect 4 2 3 0; #X connect 5 0 1 0; #X connect 6 0 1 0; #X restore 59 26 pd bang-64-sub; #X obj 156 536 tabread~ $0-bu; #X obj 156 494 phasor~ 689.062; #X msg 243 472 0; #X obj 156 514 *~ 64; #X obj 86 211 inlet; #X floatatom 570 71 5 0 0 0 - - -; #X obj 370 187 * 0.01; #X connect 0 0 5 0; #X connect 2 1 22 0; #X connect 3 0 0 0; #X connect 4 0 0 0; #X connect 5 0 2 0; #X connect 6 0 15 0; #X connect 7 0 8 0; #X connect 8 0 36 0; #X connect 9 0 7 1; #X connect 9 0 10 1; #X connect 9 0 11 0; #X connect 10 0 8 1; #X connect 11 0 10 0; #X connect 12 0 9 0; #X connect 13 0 35 0; #X connect 13 0 36 1; #X connect 14 0 0 0; #X connect 15 0 0 0; #X connect 17 0 14 1; #X connect 17 0 16 0; #X connect 19 0 15 1; #X connect 19 0 18 0; #X connect 20 0 23 0; #X connect 21 0 20 1; #X connect 23 0 24 0; #X connect 23 1 22 1; #X connect 24 0 20 1; #X connect 28 0 7 0; #X connect 29 0 4 0; #X connect 29 0 20 0; #X connect 29 0 28 0; #X connect 29 1 21 0; #X connect 29 1 32 0; #X connect 30 0 1 0; #X connect 31 0 33 0; #X connect 32 0 31 1; #X connect 33 0 30 0; #X connect 34 0 14 0; #X connect 36 0 6 0; #X restore 101 461 pd subb; #X obj 102 559 dac~; #X obj 101 110 metro 400; #X obj 101 88 tgl 15 0 $0-frommet $0-tomet empty 17 7 0 10 -262144 -1 -1 0 1; #X msg 101 408 forceX 1 $1; #X floatatom 136 384 5 0 0 0 - - -; #X floatatom 153 87 5 0 0 0 - - -; #X msg 221 394 setK l $1; #X text 463 209 change damping; #X msg 244 420 setD l $1; #X obj 204 338 pack 1 1 0; #X text 336 209 change rigidity; #X text 228 184 ~ 1; #X text 605 217 (rigidity + damping together should not exceed double of mass...); #X text 180 531 can get very loud otherwise..; #X text 360 185 keep low , maybe 0.2; #X obj 614 335 hsl 151 15 0 1000 0 0 empty $0-noise empty -2 -8 0 10 -262144 -1 -1 4300 1; #X obj 614 358 hsl 151 15 0 1 0 0 empty $0-amount empty -2 -8 0 10 -262144 -1 -1 250 1; #X text 775 333 noise; #X text 775 353 amount of force; #N canvas 125 455 583 331 presets 0; #X obj 70 197 s $0-rigidity; #X obj 80 217 s $0-damping; #X obj 100 237 s $0-noise; #X obj 110 257 s $0-amount; #X obj 60 177 s $0-mass; #X obj 332 94 r $0-frommet; #X obj 422 95 r $0-fromnoi; #X obj 332 114 sel 1; #X obj 422 114 sel 1; #X msg 332 135 0; #X obj 332 160 s $0-tonoi; #X msg 422 135 0; #X obj 422 160 s $0-tomet; #X obj 60 147 unpack 0 0 0 0 0 0; #X obj 187 177 sel 1; #X msg 187 198 1; #X obj 251 232 s $0-tonoi; #X obj 185 232 s $0-tomet; #X msg 218 198 1; #X obj 77 26 inlet; #X obj 77 47 sel 0 1 2; #X msg 77 76 1 100 30 0 0 1; #X msg 94 101 1 25 30 60 0.05 0; #X msg 110 124 1 400 30 700 0.07 0; #X connect 5 0 7 0; #X connect 6 0 8 0; #X connect 7 0 9 0; #X connect 8 0 11 0; #X connect 9 0 10 0; #X connect 11 0 12 0; #X connect 13 0 4 0; #X connect 13 1 0 0; #X connect 13 2 1 0; #X connect 13 3 2 0; #X connect 13 4 3 0; #X connect 13 5 14 0; #X connect 14 0 15 0; #X connect 14 1 18 0; #X connect 15 0 7 0; #X connect 15 0 17 0; #X connect 18 0 8 0; #X connect 18 0 16 0; #X connect 19 0 20 0; #X connect 20 0 21 0; #X connect 20 1 22 0; #X connect 20 2 23 0; #X connect 21 0 13 0; #X connect 22 0 13 0; #X connect 23 0 13 0; #X restore 614 167 pd presets; #X obj 215 232 nbx 5 14 -1e+37 1e+37 0 0 empty $0-mass empty 0 -8 0 10 -262144 -1 -1 4.78 256; #X text 215 209 change mass; #X obj 345 232 nbx 5 14 -1e+37 1e+37 0 0 empty $0-rigidity empty 0 -8 0 10 -262144 -1 -1 1502 256; #X obj 475 232 nbx 5 14 -1e+37 1e+37 0 0 empty $0-damping empty 0 -8 0 10 -262144 -1 -1 1.11 256; #X obj 611 308 tgl 15 0 $0-fromnoi $0-tonoi empty 17 7 0 10 -262144 -1 -1 1 1; #X text 633 306 use noise instead of metro; #X msg 204 364 reset , mass m0 0 $1 0 , mass m1 1 $1 0 , link l 0 1 $2 $3; #X obj 541 487 dsp~; #X floatatom 541 512 5 0 0 0 - - -; #X obj 475 256 * 0.0001; #X obj 345 255 * 1e-05; #X obj 614 148 hradio 15 1 0 3 empty empty empty 0 -8 0 10 -262144 -1 -1 2; #X obj 101 388 1; #X connect 3 0 4 0; #X connect 3 0 4 1; #X connect 5 0 36 0; #X connect 6 0 5 0; #X connect 7 0 3 0; #X connect 8 0 36 1; #X connect 9 0 5 1; #X connect 10 0 3 1; #X connect 12 0 3 1; #X connect 13 0 30 0; #X connect 19 0 3 2; #X connect 20 0 3 3; #X connect 24 0 13 0; #X connect 26 0 34 0; #X connect 27 0 33 0; #X connect 30 0 3 1; #X connect 31 0 32 0; #X connect 33 0 12 0; #X connect 33 0 13 2; #X connect 34 0 13 1; #X connect 34 0 10 0; #X connect 35 0 23 0; #X connect 36 0 7 0;