Last change
on this file since 465 was 465, checked in by Eric.Larour, 16 years ago |
New sub analysis type field in all solutions. New thermal solution sequence
|
File size:
763 bytes
|
Line | |
---|
1 | function J =objectivefunctionC(search_scalar,m,inputs,p_g,u_g_obs,grad_g,n,analysis_type,sub_analysis_type);
|
---|
2 |
|
---|
3 | %recover some parameters
|
---|
4 | optscal=m.parameters.optscal(n);
|
---|
5 | fit=m.parameters.fit(n);
|
---|
6 | control_type=m.parameters.control_type;
|
---|
7 |
|
---|
8 | %Update along gradient using scalar supplied by fmincon optimization routine
|
---|
9 | parameter=p_g+search_scalar*optscal*grad_g;
|
---|
10 |
|
---|
11 | %Plug parameter into inputs
|
---|
12 | inputs=add(inputs,m.parameters.control_type,parameter,'doublevec',2,m.parameters.numberofnodes);
|
---|
13 |
|
---|
14 | %Run diagnostic with updated parameters.
|
---|
15 | u_g=diagnostic_core_nonlinear(m,inputs,analysis_type,sub_analysis_type);
|
---|
16 |
|
---|
17 | %Compute misfit for this velocity field.
|
---|
18 | J=Misfit(m.elements,m.nodes,m.loads,m.materials,m.parameters, u_g, u_g_obs,inputs,analysis_type,sub_analysis_type);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.