Does anyone know how to convert this program from

pascal to matlab? The goto statement is really

confusing me. I just don't understand what the

actually flow is because of it. I would really

appreciate it.Thanks, Tina

Bhigh:= 1.5E+11;

Blow := 1.5E+2;

100:

B := (Bhigh + Blow)/2.0;

w[1] := Ts; {Surface Temperature}

w[2] := (Ts-T0)/(d1*d2) + L; {Surface

Temperature Slope}

y := 0.0;

repeat

If w[1] > 1.0 then begin

Blow := B;

goto 100;

end;

If w[2] < 0.0 then begin

Bhigh := B;

goto 100;

end;

Runge( Equations0, 2, 0.01, y, w );

{writeln(B:25:20,y:10:5);}

until Bhigh-Blow < 0.00000005;

You might want to repost in the programming forum. I don't remember enough of either to help. But it doesn't look like the program is complete. Ts, T0, D1, D2 and L are undefined (unless that's just part of the program) and Y is zero You're not really green until you're soylent green.

the GOTO is to recalculate the results with the changed

parameters. It doing an approximation to seek the final value.

Ask Your Question

Weekly Poll

Do you think cars with no steering wheels or pedals are safe for the road?

Discuss in The Lounge

Poll History