Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W2D nonlin transmission tested: uses it at low minal but not high since inertia+stiffness has a peak close to high stroke #100

Merged
merged 25 commits into from
Nov 22, 2019

Conversation

avikde
Copy link
Owner

@avikde avikde commented Nov 15, 2019

Related to #91. Trying to get results like for MSD #99

  • two versions of the scaling plot: with tau2 allowed and not
  • check if there is a similar bkratio
  • another plot as a function of allowed tau2/tau1 ratio. perhaps other axis could be minal?
  • debug components plot - fix.
  • Try to demonstrate effect of bkratio on resonance intuition as in Different definitions of "resonance"; confirm param opt in MSD #96

@avikde
Copy link
Owner Author

avikde commented Nov 15, 2019

Finally seems to use nonlin when minal gets higher (1.0, 1.3)

1×6 Adjoint{Float64,Array{Float64,1}}:
 3.08866  29.3072  0.517894  4.38682  4.29565  0.0
1×6 Adjoint{Float64,Array{Float64,1}}:
 7.31868  13.1537  0.8929  34.8071  20.6706  26.3073

image

image

@avikde
Copy link
Owner Author

avikde commented Nov 15, 2019

Sweep ran but very slow. With max_iter=400 produced this plot

image

basically useless.

@avikde
Copy link
Owner Author

avikde commented Nov 15, 2019

Fixed debug components plot

image

@avikde
Copy link
Owner Author

avikde commented Nov 15, 2019

In the situation of debugging why the the opt does not select a tau2.

  • On this one, unlike MSD, it is possible that the passive dynamics matching causes infeasibility.
  • should take the same debugging steps of making up params and checking feasibility
  • unfortunately this will likely not work since delta y must be chosen.

update: I was being dumb - it does select tau2!

minal = 0.1, τ21ratiolim = 2.0 => [1.1867878424549736 19.092409989634863 0.9604238162275399 0.8571912878051705 2.6657638639533268 38.15722692436931]

@avikde
Copy link
Owner Author

avikde commented Nov 15, 2019

Scaling lift with and without tau2

UPDATE AFTER a541e72

With tau2 ratio=0

image

with ratio=2

image

Conclusion

  • it uses a lower T1 when T2 is enabled, as desired, but is still able to get the required stroke
  • however total required force is not changing?
  • unact error jump is simultaneous with the T2 -> 0 -- fixed in a541e72
  • the small unactErr "violations" are likely due to max iter exceeded (set to 4000). not a big deal, can run for longer later.

@avikde
Copy link
Owner Author

avikde commented Nov 21, 2019

Debugging what is going wrong between those
in scaleParams: 20.3874 40.7747 61.1621 81.5494 101.937 122.324 142.712 163.099
0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6
so between 81 -> 101 something goes wrong

  • minal = 0.8, τ21ratiolim = 2.0 => [4.503800300458969 14.220208766724625 1.1105590770476774 15.108976307489172 13.86259603969036 28.44040020262721]

0 8

  • minal = 1.0, τ21ratiolim = 2.0 => [5.629750354038765 15.42492351708406 0.7466687675592597 18.214086212196225 12.496204258206621 0.0]

1 0

Plotting unactErr results in this @ 1.0

image

@ 0.8

unactErr at 0 8

@avikde
Copy link
Owner Author

avikde commented Nov 21, 2019

Debugging large unactErr "constraint viol"

Delta y
image

constraint function breakdown

plot(plot(gg[1:N],ylabel="gunact"), plot(gg[N+1:N+2], ylabel="gpoly"), plot(gg[N+3:end], ylabel="gtransmission"))

image

glimsL,glimsU = [-0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -100000.0 -100000.0 -100000.0][0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.0 0.0 0.0]

i.e. constraint is fine for the last 3 elems. the poly second constraint is more negative; corresponding to choosing tau2=0

Cp = Float64[-1  0  0  0  0  0;
		0  -τ21ratiolim  0  0  0  1]

Conclusion:

  • the unactErr displayed was wrong
  • constraint satisfaction is fine
  • but it still does not use tau2
  • should rerun the plot above

@avikde
Copy link
Owner Author

avikde commented Nov 21, 2019

minal = 0.8, 1.0

image

components @ 0.6
minal = 0.6, τ21ratiolim = 2.0 => [3.377850208423942 13.389983187734948 1.393959144299586 9.940646696340448 12.22507799955398 26.77996638536142]
image

components @ 1.0 minal = 1.0, τ21ratiolim = 2.0 => [5.6297503540387694 15.42492354174342 0.7466687648871052 18.21408617831352 12.496204214900663 0.0]

image

Observations:

  • Try moving params from the 1.0 ones according to linear tau1/2 approx
  • the actf peak seems to shift a bit from the drag peak. the bigger peak just to the right. ^^ this
  • check if the same shift happens with sim data
  • try to articulate in the language of frequency and resonance

…at it is near the peak stroke - obviously tau2 would not help
@avikde
Copy link
Owner Author

avikde commented Nov 21, 2019

With sim:

Requires a lot more iterations - get a lot more max iter exceeded. Also quite slow. That is the reason for the high unact error.

Optimal params:

 0.816975  17.0671  1.29954    0.745481   2.26297  34.1342        36.7946  0.0997441    2.93635
 1.57881   17.0671  1.27526    2.3554     4.30778  34.1342        36.5418  0.1          3.43813
 2.36822   17.0674  1.23644    4.86321    6.28281  34.1265        43.9484  4.00346      4.56177
 3.15762   17.5464  1.19901    8.12768    8.12688  18.1596        59.046   0.012414     5.95364
 3.94703   17.7631  1.14602   12.1552     9.73214  10.9347        67.9052  0.100179     7.27969
 4.73643   17.9954  1.04906   16.1018    10.5301    3.18974       86.7572  1.2804       8.57261
 5.5343    18.1152  0.936186  20.0874    10.8129    0.00560462    92.1719  0.00213217   9.97878
 6.31524   18.0911  0.808762  23.5936    10.3017    0.000240602  103.996   7.98244     11.2943 

image

  • different characteristic, in that tau2 slowly decreases
  • however, the same holds: at lower lift, tau2 is used, at higher, no.
  • TODO: return to sim later.
  • cbar going up, mwing going slightly down but Iwing probably going up. khinge, bhinge going up

@avikde
Copy link
Owner Author

avikde commented Nov 21, 2019

Peak actuator force shifting from drag phase: Try no Coriolis

0.6 minal = 0.6, τ21ratiolim = 2.0 => [3.3778502084244564 13.153659495445025 1.416035538713795 10.086725573023626 12.415177796286622 26.30731900078855]

image

0.7 minal = 0.7, τ21ratiolim = 2.0 => [3.9408252448275576 13.15365949571367 1.3547800946248818 13.365793060651002 14.27973682174933 26.30731900132359]

image

0.8 minal = 0.8, τ21ratiolim = 2.0 => [4.503800281451251 13.830152509127853 1.1712957120812801 15.747049941250076 14.59002632728499 27.660304929569126] -> Solved To Acceptable Level
image

0.9 minal = 0.9, τ21ratiolim = 2.0 => [5.066775317658655 14.37254587132714 0.9753835412095799 17.58266487901462 14.182763054373522 28.745091717281987] -> Max iter exceeded
image

1.0 -> Infeasible

Scale to 0.8:

image

image

Compare without and with tau2

image

minliftsmg = collect(0.4:0.1:0.8) .* 1000/9.81
res0 = [ 2.2519   18.2287  1.04666   3.47175   5.84161  9.56754e-9  44.7283  0.1        3.36443
 2.81488  16.7403  1.1568    5.90021   8.27211  9.74855e-9  46.5957  0.1        3.69358
 3.37785  15.712   1.23365   8.98416  10.8473   9.82346e-9  51.7421  0.0999999  4.10182
 3.94083  15.3189  1.21875  12.2118   12.8336   9.83659e-9  55.2984  0.0999999  4.59143
 4.5038   15.3423  1.11191  15.0293   13.7794   9.79295e-9  57.291   0.0999999  5.19363]
 
res2 = [ 2.37552  15.329   1.20858   4.31649   7.09261  30.6579  44.737   0.100006   3.25661
 2.81488  13.4766  1.3923    6.8689    9.84314  26.9532  46.9845  0.116385   3.45118
 3.37785  13.1537  1.4165   10.0714   12.41     26.3073  48.5737  0.0999999  3.78203
 3.94083  13.1537  1.3553   13.3482   14.2725   26.3073  51.1719  0.0999999  4.27468
 4.5038   13.8584  1.16818  15.695    14.5487   27.7168  56.2874  0.0904211  4.94767]
np = length(param0)
p1 = plot(minliftsmg, [res0[:,POPTS.τinds[1]]  res2[:,POPTS.τinds[1]]], xlabel="min avg lift [mg]", ylabel="T1", linewidth=2, legend=:topleft)
p2 = plot(minliftsmg, [res0[:,POPTS.τinds[2]]  res2[:,POPTS.τinds[2]]], xlabel="min avg lift [mg]", ylabel="T2", linewidth=2, legend=:topleft)
# p2 = plot(minliftsmg, [res0[:,np+1]  res0[:,np+1]], xlabel="min avg lift [mg]", ylabel="umin [mN]", linewidth=2)
p3 = plot(minliftsmg, [res0[:,np+3]  res2[:,np+3]]/(opt.fixedδt), xlabel="min avg lift [mg]", ylabel="avg ||u|| [mN]", linewidth=2)

plot(p1, p2, p3)

Conclusion:

  • Not sure why there is so much trouble solving
  • tau2 is used without this term! -> what does that mean??

@avikde
Copy link
Owner Author

avikde commented Nov 22, 2019

Plotting coriolis force and actf definitely reveals that the bump to actf is due to this

image

@avikde
Copy link
Owner Author

avikde commented Nov 22, 2019

Trying hinge phase shift

Original

image

With shift=5; ID, Opt->1.0 -> local infeasibility minal = 1.0, τ21ratiolim = 2.0 => [6.277099592037808 13.962394842075799 0.5503802350727701 21.363464853831733 3.689824767889185 0.005644433590434095]

image

  • note negative lift
  • smaller total force

Opt -> 0.6 -> optimal minal = 0.6, τ21ratiolim = 2.0 => [3.7612490674120425 13.15365956078394 1.221945070768367 16.260966206521964 9.454596012787084 26.30731913105333]

image

@avikde
Copy link
Owner Author

avikde commented Nov 22, 2019

TODO: Need to keep trying this till the stroke force is aligned with the velocity.

@avikde
Copy link
Owner Author

avikde commented Nov 22, 2019

script to change shift and opt for each working. here shift=0,1

image

minal=0.6

image

minal=0.7

image

0.8

image

0.9

image

minal=1.0

image

@avikde
Copy link
Owner Author

avikde commented Nov 22, 2019

Made a param to generate the scaling plots in #100 (comment).

Just need to set bCoriolis in the def of m, and call pls = scaleParamsForlift(ret1, 0.4:0.1:0.8, 2)

Replicated the plots to confirm 9b1a1f0

With and without coriolis scaleParamsForLift

coriolis = false

image

Coriolis = true
image

Bigger range of minal

Coriolis = false

image

Coriolis = true

image

@avikde avikde changed the title W2D test nonlin transmission again W2D nonlin transmission tested: uses it without Coriolis term but not much with it, since peak force happens near high stroke position due to Coriolis Nov 22, 2019
@avikde
Copy link
Owner Author

avikde commented Nov 22, 2019

Something changed - now it seems like it uses T2 even without coriolis and the presence of coriolis or not is not making a huge difference. In both cases it seems like higher minal results in no T2.

  • need to investigate components at higher minal, no coriolis

Components at higher minal (1.0) no coriolis
image

with coriolis
image

Conclusions:

  • Second hump is indeed larger with Coriolis
  • inertia+stiffness (with and without coriolis) is the major contributor. The two added together is so large that it is not cancelled by inertia. That is why act force is needed in the same phase as stroke.

@avikde avikde changed the title W2D nonlin transmission tested: uses it without Coriolis term but not much with it, since peak force happens near high stroke position due to Coriolis W2D nonlin transmission tested: uses it at low minal but not high since inertia+stiffness has a peak close to high stroke Nov 22, 2019
@avikde avikde merged commit 7fafc3a into master Nov 22, 2019
@avikde avikde deleted the w2d-nonlinT branch November 22, 2019 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant