Skip to content
Snippets Groups Projects
Commit 4e252dc6 authored by jcandrsn's avatar jcandrsn
Browse files

Additional modifications to allow for higher dimension response functions. Largely untested.

parent 505fd947
No related branches found
No related tags found
1 merge request!1Development
function [data, y] = uq_pce_mean(prob, data, u) function [data, y] = uq_pce_mean(prob, data, alphas)
%UQ_PCE_MEAN Summary of this function goes here %UQ_PCE_MEAN Summary of this function goes here
% Given an array of PCE coefficients return the mean value of the % Given an array of PCE coefficients return the mean value of the
% expansion (first term in the expansion) % expansion (first term in the expansion)
y = u(1,:); alphas = reshape(alphas, data.Nt, []);
y = alphas(1,:);
end end
\ No newline at end of file
function [data, J] = uq_pce_mean_dU(prob, data, u) function [data, J] = uq_pce_mean_dU(prob, data, alphas)
%UQ_PCE_MEAN Summary of this function goes here %UQ_PCE_MEAN Summary of this function goes here
% Given an array of PCE coefficients return the Jacobian of the mean value % Given an array of PCE coefficients return the Jacobian of the mean value
% with respect to the expansion coefficients % with respect to the expansion coefficients
alphas = reshape(alphas, data.Nt, []);
J = zeros(size(u')); J = zeros(size(alphas'));
J(1) = 1; J(:,1) = 1;
end end
...@@ -2,9 +2,9 @@ function [data, J] = uq_pce_variance_dU(prob, data, alphas) ...@@ -2,9 +2,9 @@ function [data, J] = uq_pce_variance_dU(prob, data, alphas)
%UQ_PCE_VARIANCE_DU Jacobian of the variance of a PCE w/r/t alphas %UQ_PCE_VARIANCE_DU Jacobian of the variance of a PCE w/r/t alphas
% Calculate the Jacobian of the variance of a Polynomial Chaos Expansion % Calculate the Jacobian of the variance of a Polynomial Chaos Expansion
% (PCE) with respect to the PCE coefficients. % (PCE) with respect to the PCE coefficients.
alphas = reshape(alphas, data.Nt, []);
J = 2*alphas'; J = 2*alphas';
J(1) = 0; J(:,1) = 0;
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment