bearecinos / smith_glacier

Experiments with Fenics_ice over Smith, Pope, and Kohler Glaciers; three narrow ∼ 10 km wide, interconnected West Antarctic ice streams (Note: this repository documentation is still a work in progress).
1 stars 0 forks source link

files for better linearity test #51

Closed bearecinos closed 1 year ago

bearecinos commented 1 year ago

@jrmaddison @dngoldberg

Dan suggested to modify the linearity test so we do a small perturbation on alpha and beta. He suggested to re-run the forward stage using a new alpha and beta... so we keep the dot product as:

$$ \frac{\partial Q}{\partial \alpha_{I}} . \big( (\alpha_{I} - \alpha_{M})*(1/100)\big) $$ 
$$ \frac{\partial Q}{\partial \beta_{I}} . \big( (\beta_{I} - \beta_{M})*(1/100)\big) $$ 

and compute a new VAF trajectory using Q = slvr.timestep(adjoint_flag=1, qoi_func=qoi_func) Where the Q will come from

 \alpha_{new} =  \alpha_{I} + 1/100(\alpha_{M} - \alpha_{I})
 \beta_{new} =  \beta_{I} + 1/100(\beta_{M} - \beta_{I})

And we will be plotting this new $Q^{vaf}_{new}$

instead of

Q^{vaf}_{I} - Q^{vaf}_{M} 

The red dotted line in this plot image

For that we don't need to calculate sensitivities or run the adjoint... just do slvr.timestep and replace $\alpha$ and $\beta$ model objects with the new ones.

I think this is what I've done in run_linearity_fwd.py#L79-L93 Let me know if that script is correct or I need to change something. I'm not sure if I need to do function_update_state()? to replace the old alpha object with the new one?

Thanks!

bearecinos commented 1 year ago

Ok I did some changes to the script ... and improved the issue text... now the issue above reflects what we want to do ... I will wait for @jrmaddison input before testing this.. as I'm not sure if I'm replacing alpha and beta correctly...

bearecinos commented 1 year ago

I thought of fixing issue #32 while I have this PR open...

bearecinos commented 1 year ago

Thanks a lot @jrmaddison for the review !! ... I will work more on this script as it was done very fast and needs improving.. I shall commit the changes soon