## Get data from the initial data problem?

### Light (view profile)

on 6 Jun 2013

Hello. I wrote the code below. Now i wanna change that code to work in every initial data. Iteration operation code must get initial data and write code, calculate it.

`                                                                          % Initial Data`

S12=6+2*1i;

S01=10+5*1i;

U01=110;

U12=110;

R12 = 16.2+24*1i;

U0=115;

R01= 15.75+31.2*1i;

dx01=106.125;

dx12=81;

zoruu=0.001;

`                              % Iteration`

iteration_number = 0;

while true iteration_number = iteration_number + 1;

fprintf('Starting iteration #%d\n', iteration_number);

dQ12=dx12*U12.^2*10.^-6;

S12i=S12-complex(0,dQ12);

DS12 =((real(S12i).^2+imag(S12i).^2)/U12.^2)*R12;

S12ii=DS12+S12i;

dQ12i=dx12*U01.^2*10.^-6;

S12e=S12ii-complex(0,dQ12i);

S01i=S12e+S01;

dQ01=dx01*U01.^2*10.^-6;

S01ii=S01i-complex(0,dQ01);

DS01=((real(S01ii).^2+imag(S01ii).^2)/U01.^2)*R01;

dQ01i=dx01*U0.^2*10.^-6;

S01iii=S01ii+DS01;

S01e=S01iii-complex(0,dQ01i);

dU01i=(real(S01iii)*real(R01)+imag(S01iii)*imag(R01))./U0;

dU01ii=(real(S01iii)*imag(R01)-imag(S01iii)*real(R01))./U0;

U01t=sqrt((U0-dU01i).^2+dU01ii.^2);

dU12i=(real(S12ii)*real(R12)+imag(S12ii)*imag(R12))./U01t;

dU12ii=(real(S12ii)*imag(R12)-imag(S12ii)*real(R12))./U01t;

U02t=sqrt((U01t-dU12i).^2+dU12ii.^2);

Y=U01t-U01;

H=U02t-U12;

U01= U01t;

U12= U02t;

if max(Y,H)<zoruu; break; end; end

Please give me some structure...

Light

### Light (view profile)

on 6 Jun 2013

In iteration following 2 code refer: 1. dQ(K)=dx(K)*U(K).^2*10.^-6;

S(K)i=S(K)-complex(0,dQ(K));

DS(K) =((real(S(K)i).^2+imag(S(K)i).^2)/U(K).^2)*R(K);

S(K)ii=DS(K)+S(K)i;

dQ(K)i=dx(K)*U(K).^2*10.^-6;

S(K)e=S(K)ii-complex(0,dQ(K)i);

2.

dU(K)i=(real(S(K)ii2)*real(R(K))+imag(S(K)iii)*imag(R(K)))./U0;

dU(K)ii=(real(S(K)ii2)*imag(R(K))-imag(S(K)iii)*real(R(K)))./U0;

U(K)t=sqrt((U0-dU(K)i).^2+dU(K)ii.^2);

(k) is variable number of initial data

## Products

No products are associated with this question.