questão 01 - matlab

7
Questão 01 Sol_analitica = dsolve('DQ = (0.120*15) - ((30)/(300+(15- 30)*t))*Q','Q(0) = 67.5','t') n = 30; % numero de pontos tinicial = 0; tfinal = 10; t1 = linspace(0,10,30); %definindo vetor tempo [t,Q] = ode45('f1',t1,67.5) QQ=36-(9/5).*t+(63/800).*((-20+t).^2); figure(1) plot (t,Q,'x',t1,QQ,'o'); xlabel ('tempo(min)'); ylabel ('Quantidade de sal (kg)'); legend('numerico','analitica'); y = 250*exp((1661*t)/10000) x = Columns 1 through 9 0 0.2449 0.4898 0.7347 0.9796 1.2245 1.4694 1.7143 1.9592 Columns 10 through 18 2.2041 2.4490 2.6939 2.9388 3.1837 3.4286 3.6735 3.9184 4.1633 Columns 19 through 27 4.4082 4.6531 4.8980 5.1429 5.3878 5.6327 5.8776 6.1224 6.3673 Columns 28 through 36 6.6122 6.8571 7.1020 7.3469 7.5918 7.8367 8.0816 8.3265 8.5714 Columns 37 through 45

Upload: marcoaurelio

Post on 06-Nov-2015

221 views

Category:

Documents


4 download

DESCRIPTION

Runge-kuta e afins...

TRANSCRIPT

Questo 01

Sol_analitica = dsolve('DQ = (0.120*15) - ((30)/(300+(15-30)*t))*Q','Q(0) = 67.5','t')n = 30; % numero de pontostinicial = 0;tfinal = 10;t1 = linspace(0,10,30); %definindo vetor tempo[t,Q] = ode45('f1',t1,67.5)QQ=36-(9/5).*t+(63/800).*((-20+t).^2);figure(1)plot (t,Q,'x',t1,QQ,'o');xlabel ('tempo(min)');ylabel ('Quantidade de sal (kg)');legend('numerico','analitica');y =

250*exp((1661*t)/10000)

x =

Columns 1 through 9

0 0.2449 0.4898 0.7347 0.9796 1.2245 1.4694 1.7143 1.9592

Columns 10 through 18

2.2041 2.4490 2.6939 2.9388 3.1837 3.4286 3.6735 3.9184 4.1633

Columns 19 through 27

4.4082 4.6531 4.8980 5.1429 5.3878 5.6327 5.8776 6.1224 6.3673

Columns 28 through 36

6.6122 6.8571 7.1020 7.3469 7.5918 7.8367 8.0816 8.3265 8.5714

Columns 37 through 45

8.8163 9.0612 9.3061 9.5510 9.7959 10.0408 10.2857 10.5306 10.7755

Columns 46 through 50

11.0204 11.2653 11.5102 11.7551 12.0000

t =y =61.224 0.6636

0 1.0e+03 *63.673 0.6912

0.2449 0.250066.122 0.7199

0.4898 0.260468.571 0.7498

0.7347 0.271271.020 0.7809

0.9796 0.282473.469 0.8133

12.245 0.294275.918 0.8471

14.694 0.306478.367 0.8822

17.143 0.319180.816 0.9189

19.592 0.332483.265 0.9570

22.041 0.346285.714 0.9967

24.490 0.360588.16310.381

26.939 0.375590.61210.812

29.388 0.391193.06111.261

31.837 0.407395.51011.729

34.286 0.424297.95912.216

36.735 0.4418100.40812.723

39.184 0.4602102.85713.251

41.633 0.4793105.30613.801

44.082 0.4992107.75514.374

46.531 0.5199110.20414.971

48.980 0.5415112.65315.592

51.429 0.5640115.10216.240

53.878 0.5874117.55116.914

56.327 0.6118120.00017.616

58.776 0.637218.347

>> q1

Sol_analitica =

(63*(t - 20)^2)/800 - (9*t)/5 + 36

Q1 =

-4.9500

Q1 =

-4.9391

Q1 =

-4.9337

Q1 =

-4.9065

Q1 =

-4.9017

Q1 =

-4.8957

Q1 =

-4.8957

Q1 =

-4.8639

Q1 =

-4.8484

Q1 =

-4.7696

Q1 =

-4.7553

Q1 =

-4.7378

Q1 =

-4.7382

Q1 =

-4.7063

Q1 =

-4.6909

Q1 =

-4.6120

Q1 =

-4.5977

Q1 =

-4.5803

Q1 =

-4.5807

Q1 =

-4.5488

Q1 =

-4.5334

Q1 =

-4.4545

Q1 =

-4.4402

Q1 =

-4.4227

Q1 =

-4.4232

Q1 =

-4.3913

Q1 =

-4.3760

Q1 =

-4.2970

Q1 =

-4.2826

Q1 =

-4.2651

Q1 =

-4.2657

Q1 =

-4.2338

Q1 =

-4.2185

Q1 =

-4.1395

Q1 =

-4.1250

Q1 =

-4.1076

Q1 =

-4.1082

Q1 =

-4.0763

Q1 =

-4.0610

Q1 =

-3.9819

Q1 =

-3.9674

Q1 =

-3.9500

Q1 =

-3.9507

Q1 =

-3.9187

Q1 =

-3.9035

Q1 =

-3.8244

Q1 =

-3.8098

Q1 =

-3.7923

Q1 =

-3.7932

Q1 =

-3.7612

Q1 =

-3.7460

Q1 =

-3.6669

Q1 =

-3.6521

Q1 =

-3.6347

Q1 =

-3.6357

Q1 =

-3.6036

Q1 =

-3.5885

Q1 =

-3.5093

Q1 =

-3.4944

Q1 =

-3.4770

Q1 =

-3.4782

Q1 =

-3.4573

Q1 =

-3.4472

Q1 =

-3.3955

Q1 =

-3.3861

Q1 =

-3.3746

Q1 =

-3.3750

t =

0

0.3448

0.6897

1.0345

1.3793

1.7241

2.0690

2.4138

2.7586

3.1034

3.4483

3.7931

4.1379

4.4828

4.8276

5.1724

5.5172

5.8621

6.2069

6.5517

6.8966

7.2414

7.5862

7.9310

8.2759

8.6207

8.9655

9.3103

9.6552

10.0000

Q =

67.5000

65.8025

64.1237

62.4636

60.8222

59.1996

57.5957

56.0106

54.4441

52.8964

51.3674

49.8572

48.3656

46.8928

45.4388

44.0034

42.5868

41.1889

39.8098

38.4493

37.1076

35.7846

34.4804

33.1949

31.9281

30.6800

29.4507

28.2400

27.0482

25.8750