专题软件开发实践报告

2021-09-24 18:06

教学实践报告

“反问题”的数值求解

学生姓名

专 业 信息与计算科学

班 级 1123202

指导教师

2014年9月5日

第一周实践报告

一、 任务安排

1.1 时间计划

本次实践共三周,又第二周上课时间只有两天,所以总共开发时间12天。经讨论小组将第一周开发最初的界面,第二周整合各组员的界面,第三周修改代码、程序调试、优化界面。

1.2 任务分工计划

小组成员,界面开发程序Filter_fn、Gen_data等六个,每人负责两个程序的界面开发,实现组员之间分工清晰、相互合作。

二、 熟悉“反问题”的数值解法研究

2.1 文献资料的翻译

通过指导老师及谷歌翻译得到资料的大致翻译,对研究问题有一个比较清晰的理解。

2.2 “反问题”数值解法

三、第一周所做:

3.1 反问题的理解及翻译

3.2 设置整体的界面及控件callback

3.3 把图形画到指定的区域

3.4 设置变量调用函数

四、程序理解:

function varargout = d(varargin)

% --- Executes on button press in pushbutton1.

function pushbutton1_Callback(hObject, eventdata, handles)%设置的控件反应

% hObject handle to pushbutton1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) fg;%调用函数

% --- Executes on button press in pushbutton2.

function pushbutton2_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) jiemian;

% --- Executes on button press in pushbutton3.

function pushbutton3_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton3 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) s1=str2double(get(handles.edit2,'String'))%从文本框中获得数据赋值给s1 s2=str2double(get(handles.edit3,'String'))%从文本框中获得数据赋值给s2

s3=str2double(get(handles.edit4,'String'))%从文本框中获得数据赋值给s3 h = 1/s1;

x = [h/2:h:1-h/2]';

% Compute matrix K corresponding to convolution with Gaussian kernel.

kernel = (1/sqrt(pi)/s2) * exp(-(x-h/2).^2/s2^2);

K = toeplitz(kernel)*h;

% Set up true solution f_true and data d = K*f_true + error.

f_true = .75*(.1<x&x<.25) + .25*(.3<x&x<.32) + (.5<x&x<1).*sin(2*pi*x).^4;

Kf = K*f_true;

eta = s3/100 * norm(Kf) * randn(s1,1)/sqrt(s1);

d = Kf + eta;

% Display the data.

% figure(2)

plot(x,f_true,'-', x,d,'o',x,Kf,'--')

xlabel('x axis')

axes(handles.axes1);%把图形画到指定的位置

% --- Executes on button press in pushbutton4.

function pushbutton4_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton4 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) s1=str2double(get(handles.edit2,'String'))

s2=str2double(get(handles.edit3,'String'))

s3=str2double(get(handles.edit4,'String'))

% Set up grid.

h = 1/s1;

x = [h/2:h:1-h/2]';

% Compute matrix K corresponding to convolution with Gaussian kernel. kernel = (1/sqrt(pi)/s2) * exp(-(x-h/2).^2/s2^2);

K = toeplitz(kernel)*h;

% figure(1)

mesh(K)

title('Mesh Plot Representation of Matrix K')

axes(handles.axes3);

% --- Executes on button press in pushbutton5.

function pushbutton5_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton5 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) s1=str2double(get(handles.edit2,'String'))

s2=str2double(get(handles.edit3,'String'))

s3=str2double(get(handles.edit4,'String'))

% Set up grid.

h = 1/s1;

x = [h/2:h:1-h/2]';

% Compute matrix K corresponding to convolution with Gaussian kernel.

kernel = (1/sqrt(pi)/s2) * exp(-(x-h/2).^2/s2^2);

K = toeplitz(kernel)*h;

% Set up true solution f_true and data d = K*f_true + error.

f_true = .75*(.1<x&x<.25) + .25*(.3<x&x<.32) + (.5<x&x<1).*sin(2*pi*x).^4;

Kf = K*f_true;

eta = s3/100 * norm(Kf) * randn(s1,1)/sqrt(s1);

d = Kf + eta;

% Display the data.

% Compute an eigendecomposition of K. K is symmetric, so this is % equivalent to an SVD.

[V,svals] = eig(K);

[svals,indx] = sort(-diag(svals)); % Sort -eigenvalues in decreasing order.

svals = -svals; % +eigs are in increasing order. V = V(:,indx); % Corresponding eigenvectors.

%figure(3)

semilogy(svals,'o')

xlabel('index i')

ylabel('\sigma_i')

title('Singular Values of K')

专题软件开发实践报告.doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:Unit 4 My Home A Let&39;s learn 说课稿

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: