Skip to content

Navigation Menu

Global navigation

Home

Issues

Pull requests

Projects

Discussions

Codespaces

Copilot

Explore

Marketplace

Loading

© 2025 GitHub, Inc.

About Blog Terms Privacy Security Status

jinhanxie  / Ulysses

Navigate back to

jinhanxie

Ulysses

jinhanxie / Ulysses /

Type / to search

Search code, repositories, users, issues, pull requests...

Search

Clear

Search syntax tips

Give feedback

Provide feedback

We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted

Cancel Submit feedback

Saved searches

Use saved searches to filter your results more quickly

Name

Query

To see all available qualifiers, see our documentation.

Cancel Create saved search

Chat with Copilot Open Copilot…

Create new... Your issues Your pull requests
Notifications

Code

Issues 0

Pull requests 0

Actions

Projects 0

Wiki

Security

Insights

Settings

Additional navigation options

Code

Issues

Pull requests

Actions

Projects

Wiki

Security

Insights

Settings

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

Open in github.dev Open in a new github.dev tab Open in codespace

Files

Files

main

Add file

t

README.md

SF_SW_single_case_nlfit_ypym_new.m

collect_plot_t600_errorbar_new.m

forcing_injection_pdf_ytot_t600.m

injection_pcolor_t600.m

Breadcrumbs

Ulysses

/
collect_plot_t600_errorbar_new.m

Copy path

Blame

Blame

Latest commit

History
History

521 lines (458 loc) · 22.1 KB

Code 55% faster with GitHub Copilot

Breadcrumbs

Ulysses

/
collect_plot_t600_errorbar_new.m

Top

File metadata and controls

Code

Blame

521 lines (458 loc) · 22.1 KB

Code 55% faster with GitHub Copilot

Raw

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

459

460

461

462

463

464

465

466

467

468

469

470

471

472

473

474

475

476

477

478

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

496

497

498

499

500

501

502

503

504

505

506

507

508

509

510

511

512

513

514

515

516

517

518

519

520

521

load('energy_sw_tot_nlfit_ytot_Nf_6_t600.mat')

tt = time_tot_ytot;

einj6 = sum(max(e_inj_tot_ytot,0),2);

edis6 = sum(min(e_inj_tot_ytot,0),2);

Fup6 = e_up_tot_ytot;

Fdown6 = einj6+edis6-Fup6;

load('energy_sw_tot_nlfit_ytot_Nf_7_t600.mat')

einj7 = sum(max(e_inj_tot_ytot,0),2);

edis7 = sum(min(e_inj_tot_ytot,0),2);

Fup7 = e_up_tot_ytot;

Fdown7 = einj7+edis7-Fup7;

einj = (einj6+einj7)/2/7e5;

edis = (edis6+edis7)/2/7e5;

Fup = (Fup6+Fup7)/2/7e5;

Fdown = (Fdown6+Fdown7)/2/7e5;

%

% einj = [einj6; einj7]/7e5;

% edis = [edis6; edis7]/7e5;

% Fup = [Fup6; Fup7]/7e5;

% Fdown = [Fdown6; Fdown7]/7e5;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% four cases

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

N = length(einj);

einj_dual = NaN(1,N);

edis_dual = NaN(1,N);

Fup_dual = NaN(1,N);

Fdown_dual = NaN(1,N);

H_dual = zeros(1,N);

for j=1:N

if Fup(j)>0 && Fdown(j)>0

einj_dual(j) = einj(j);

edis_dual(j) = edis(j);

Fup_dual(j) = Fup(j);

Fdown_dual(j) = Fdown(j);

H_dual(j)=1;

end

end

einj_dual = einj_dual(~isnan(einj_dual));

edis_dual = edis_dual(~isnan(edis_dual));

Fup_dual = Fup_dual(~isnan(Fup_dual));

Fdown_dual = Fdown_dual(~isnan(Fdown_dual));

N = length(einj);

einj_ndual = NaN(1,N);

edis_ndual = NaN(1,N);

Fup_ndual = NaN(1,N);

Fdown_ndual = NaN(1,N);

for j=1:N

if Fup(j)<0 && Fdown(j)<0

einj_ndual(j) = einj(j);

edis_ndual(j) = edis(j);

Fup_ndual(j) = Fup(j);

Fdown_ndual(j) = Fdown(j);

end

end

einj_ndual = einj_ndual(~isnan(einj_ndual));

edis_ndual = edis_ndual(~isnan(edis_ndual));

Fup_ndual = Fup_ndual(~isnan(Fup_ndual));

Fdown_ndual = Fdown_ndual(~isnan(Fdown_ndual));

N = length(einj);

einj_forw = NaN(1,N);

edis_forw = NaN(1,N);

Fup_forw = NaN(1,N);

Fdown_forw = NaN(1,N);

for j=1:N

if Fup(j)<0 && Fdown(j)>0

einj_forw(j) = einj(j);

edis_forw(j) = edis(j);

Fup_forw(j) = Fup(j);

Fdown_forw(j) = Fdown(j);

end

end

einj_forw = einj_forw(~isnan(einj_forw));

edis_forw = edis_forw(~isnan(edis_forw));

Fup_forw = Fup_forw(~isnan(Fup_forw));

Fdown_forw = Fdown_forw(~isnan(Fdown_forw));

N = length(einj);

einj_inv = NaN(1,N);

edis_inv = NaN(1,N);

Fup_inv = NaN(1,N);

Fdown_inv = NaN(1,N);

for j=1:N

if Fup(j)>0 && Fdown(j)<0

einj_inv(j) = einj(j);

edis_inv(j) = edis(j);

Fup_inv(j) = Fup(j);

Fdown_inv(j) = Fdown(j);

end

end

einj_inv = einj_inv(~isnan(einj_inv));

edis_inv = edis_inv(~isnan(edis_inv));

Fup_inv = Fup_inv(~isnan(Fup_inv));

Fdown_inv = Fdown_inv(~isnan(Fdown_inv));

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% line with error bar

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

n_count = 1000;

einj_edis_dual = [einj_dual; edis_dual];

einj_edis_dual_sort = sortrows(einj_edis_dual')';

N = length(einj_dual);

n = floor(N/n_count);

einj_dual_n=zeros(1,n);

edis_dual_n=zeros(1,n);

var_einj_edis_dual_n=zeros(1,n);

for j=1:n-1

einj_dual_n(j) = mean(einj_edis_dual_sort(1,(j-1)*n_count+1:j*n_count));

edis_dual_n(j)= mean(einj_edis_dual_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_edis_dual_n(j) = mean((einj_edis_dual_sort(2,(j-1)*n_count+1:j*n_count)-edis_dual_n(j)).^2)^0.5;

end

einj_dual_n(n) = mean(einj_edis_dual_sort(1,(n-1)*n_count+1:end));

edis_dual_n(n)= mean(einj_edis_dual_sort(2,(n-1)*n_count+1:end));

var_einj_edis_dual_n(n) = mean((einj_edis_dual_sort(2,(n-1)*n_count+1:end)-edis_dual_n(n)).^2)^0.5;

einj_edis_forw = [einj_forw; edis_forw];

einj_edis_forw_sort = sortrows(einj_edis_forw')';

N = length(einj_forw);

n = floor(N/n_count);

einj_forw_n=zeros(1,n);

edis_forw_n=zeros(1,n);

var_einj_edis_forw_n=zeros(1,n);

for j=1:n-1

einj_forw_n(j) = mean(einj_edis_forw_sort(1,(j-1)*n_count+1:j*n_count));

edis_forw_n(j)= mean(einj_edis_forw_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_edis_forw_n(j) = mean((einj_edis_forw_sort(2,(j-1)*n_count+1:j*n_count)-edis_forw_n(j)).^2)^0.5;

end

einj_forw_n(n) = mean(einj_edis_forw_sort(1,(n-1)*n_count+1:end));

edis_forw_n(n)= mean(einj_edis_forw_sort(2,(n-1)*n_count+1:end));

var_einj_edis_forw_n(n) = mean((einj_edis_forw_sort(2,(n-1)*n_count+1:end)-edis_forw_n(n)).^2)^0.5;

einj_edis_inv = [einj_inv; edis_inv];

einj_edis_inv_sort = sortrows(einj_edis_inv')';

N = length(einj_inv);

n = floor(N/n_count);

einj_inv_n=zeros(1,n);

edis_inv_n=zeros(1,n);

var_einj_edis_inv_n=zeros(1,n);

for j=1:n-1

einj_inv_n(j) = mean(einj_edis_inv_sort(1,(j-1)*n_count+1:j*n_count));

edis_inv_n(j)= mean(einj_edis_inv_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_edis_inv_n(j) = mean((einj_edis_inv_sort(2,(j-1)*n_count+1:j*n_count)-edis_inv_n(j)).^2)^0.5;

end

einj_inv_n(n) = mean(einj_edis_inv_sort(1,(n-1)*n_count+1:end));

edis_inv_n(n)= mean(einj_edis_inv_sort(2,(n-1)*n_count+1:end));

var_einj_edis_inv_n(n) = mean((einj_edis_inv_sort(2,(n-1)*n_count+1:end)-edis_inv_n(n)).^2)^0.5;

einj_edis_ndual = [einj_ndual; edis_ndual];

einj_edis_ndual_sort = sortrows(einj_edis_ndual')';

N = length(einj_ndual);

n = floor(N/n_count);

einj_ndual_n=zeros(1,n);

edis_ndual_n=zeros(1,n);

var_einj_edis_ndual_n=zeros(1,n);

for j=1:n-1

einj_ndual_n(j) = mean(einj_edis_ndual_sort(1,(j-1)*n_count+1:j*n_count));

edis_ndual_n(j)= mean(einj_edis_ndual_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_edis_ndual_n(j) = mean((einj_edis_ndual_sort(2,(j-1)*n_count+1:j*n_count)-edis_ndual_n(j)).^2)^0.5;

end

einj_ndual_n(n) = mean(einj_edis_ndual_sort(1,(n-1)*n_count+1:end));

edis_ndual_n(n)= mean(einj_edis_ndual_sort(2,(n-1)*n_count+1:end));

var_einj_edis_ndual_n(n) = mean((einj_edis_ndual_sort(2,(n-1)*n_count+1:end)-edis_ndual_n(n)).^2)^0.5;

figure

plot(einj_dual_n,-edis_dual_n,'o','linewidth',1.3)

hold on

plot(einj_forw_n,-edis_forw_n,'o','linewidth',1.3)

plot(einj_inv_n,-edis_inv_n,'o','linewidth',1.3)

plot(einj_ndual_n,-edis_ndual_n,'o','linewidth',1.3)

patch([einj_dual_n flip(einj_dual_n)], [-edis_dual_n-var_einj_edis_dual_n flip(-edis_dual_n+var_einj_edis_dual_n)],[0 0.4470 0.7410], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([einj_forw_n flip(einj_forw_n)], [-edis_forw_n-var_einj_edis_forw_n flip(-edis_forw_n+var_einj_edis_forw_n)],[0.8500 0.3250 0.0980], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([einj_inv_n flip(einj_inv_n)], [-edis_inv_n-var_einj_edis_inv_n flip(-edis_inv_n+var_einj_edis_inv_n)],[0.9290 0.6940 0.1250], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([einj_ndual_n flip(einj_ndual_n)], [-edis_ndual_n-var_einj_edis_ndual_n flip(-edis_ndual_n+var_einj_edis_ndual_n)],[0.4940 0.1840 0.5560], 'FaceAlpha',0.2, 'EdgeColor','none')

leg=legend('dual (divergent)','forward','inverse','dual (convergent)');

set(leg,'interpreter','latex')

xlabel('$$\epsilon_{inj}$$','interpreter','latex')

ylabel('$$\epsilon_{diss}$$','interpreter','latex')

set(gca,'FontSize',14,'FontName','Times')

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

einj_Fup_dual = [einj_dual; Fup_dual];

einj_Fup_dual_sort = sortrows(einj_Fup_dual')';

N = length(einj_dual);

n = floor(N/n_count);

einj_dual_n=zeros(1,n);

Fup_dual_n=zeros(1,n);

var_einj_Fup_dual_n=zeros(1,n);

for j=1:n-1

einj_dual_n(j) = mean(einj_Fup_dual_sort(1,(j-1)*n_count+1:j*n_count));

Fup_dual_n(j)= mean(einj_Fup_dual_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_Fup_dual_n(j) = mean((einj_Fup_dual_sort(2,(j-1)*n_count+1:j*n_count)-Fup_dual_n(j)).^2)^0.5;

end

einj_dual_n(n) = mean(einj_Fup_dual_sort(1,(n-1)*n_count+1:end));

Fup_dual_n(n)= mean(einj_Fup_dual_sort(2,(n-1)*n_count+1:end));

var_einj_Fup_dual_n(n) = mean((einj_Fup_dual_sort(2,(n-1)*n_count+1:end)-Fup_dual_n(n)).^2)^0.5;

einj_Fup_forw = [einj_forw; Fup_forw];

einj_Fup_forw_sort = sortrows(einj_Fup_forw')';

N = length(einj_forw);

n = floor(N/n_count);

einj_forw_n=zeros(1,n);

Fup_forw_n=zeros(1,n);

var_einj_Fup_forw_n=zeros(1,n);

for j=1:n-1

einj_forw_n(j) = mean(einj_Fup_forw_sort(1,(j-1)*n_count+1:j*n_count));

Fup_forw_n(j)= mean(einj_Fup_forw_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_Fup_forw_n(j) = mean((einj_Fup_forw_sort(2,(j-1)*n_count+1:j*n_count)-Fup_forw_n(j)).^2)^0.5;

end

einj_forw_n(n) = mean(einj_Fup_forw_sort(1,(n-1)*n_count+1:end));

Fup_forw_n(n)= mean(einj_Fup_forw_sort(2,(n-1)*n_count+1:end));

var_einj_Fup_forw_n(n) = mean((einj_Fup_forw_sort(2,(n-1)*n_count+1:end)-Fup_forw_n(n)).^2)^0.5;

einj_Fup_inv = [einj_inv; Fup_inv];

einj_Fup_inv_sort = sortrows(einj_Fup_inv')';

N = length(einj_inv);

n = floor(N/n_count);

einj_inv_n=zeros(1,n);

Fup_inv_n=zeros(1,n);

var_einj_Fup_inv_n=zeros(1,n);

for j=1:n-1

einj_inv_n(j) = mean(einj_Fup_inv_sort(1,(j-1)*n_count+1:j*n_count));

Fup_inv_n(j)= mean(einj_Fup_inv_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_Fup_inv_n(j) = mean((einj_Fup_inv_sort(2,(j-1)*n_count+1:j*n_count)-Fup_inv_n(j)).^2)^0.5;

end

einj_inv_n(n) = mean(einj_Fup_inv_sort(1,(n-1)*n_count+1:end));

Fup_inv_n(n)= mean(einj_Fup_inv_sort(2,(n-1)*n_count+1:end));

var_einj_Fup_inv_n(n) = mean((einj_Fup_inv_sort(2,(n-1)*n_count+1:end)-Fup_inv_n(n)).^2)^0.5;

einj_Fup_ndual = [einj_ndual; Fup_ndual];

einj_Fup_ndual_sort = sortrows(einj_Fup_ndual')';

N = length(einj_ndual);

n = floor(N/n_count);

einj_ndual_n=zeros(1,n);

Fup_ndual_n=zeros(1,n);

var_einj_Fup_ndual_n=zeros(1,n);

for j=1:n-1

einj_ndual_n(j) = mean(einj_Fup_ndual_sort(1,(j-1)*n_count+1:j*n_count));

Fup_ndual_n(j)= mean(einj_Fup_ndual_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_Fup_ndual_n(j) = mean((einj_Fup_ndual_sort(2,(j-1)*n_count+1:j*n_count)-Fup_ndual_n(j)).^2)^0.5;

end

einj_ndual_n(n) = mean(einj_Fup_ndual_sort(1,(n-1)*n_count+1:end));

Fup_ndual_n(n)= mean(einj_Fup_ndual_sort(2,(n-1)*n_count+1:end));

var_einj_Fup_ndual_n(n) = mean((einj_Fup_ndual_sort(2,(n-1)*n_count+1:end)-Fup_ndual_n(n)).^2)^0.5;

figure

plot(einj_dual_n,Fup_dual_n,'o','linewidth',1.3)

hold on

plot(einj_forw_n,Fup_forw_n,'o','linewidth',1.3)

plot(einj_inv_n,Fup_inv_n,'o','linewidth',1.3)

plot(einj_ndual_n,Fup_ndual_n,'o','linewidth',1.3)

patch([einj_dual_n flip(einj_dual_n)], [Fup_dual_n-var_einj_Fup_dual_n flip(Fup_dual_n+var_einj_Fup_dual_n)],[0 0.4470 0.7410], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([einj_forw_n flip(einj_forw_n)], [Fup_forw_n-var_einj_Fup_forw_n flip(Fup_forw_n+var_einj_Fup_forw_n)],[0.8500 0.3250 0.0980], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([einj_inv_n flip(einj_inv_n)], [Fup_inv_n-var_einj_Fup_inv_n flip(Fup_inv_n+var_einj_Fup_inv_n)],[0.9290 0.6940 0.1250], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([einj_ndual_n flip(einj_ndual_n)], [Fup_ndual_n-var_einj_Fup_ndual_n flip(Fup_ndual_n+var_einj_Fup_ndual_n)],[0.4940 0.1840 0.5560], 'FaceAlpha',0.2, 'EdgeColor','none')

leg=legend('dual (divergent)','forward','inverse','dual (convergent)');

set(leg,'interpreter','latex')

xlabel('$$\epsilon_{inj}$$','interpreter','latex')

ylabel('$$F_{up}$$','interpreter','latex')

set(gca,'FontSize',14,'FontName','Times')

einj_Fdown_dual = [einj_dual; Fdown_dual];

einj_Fdown_dual_sort = sortrows(einj_Fdown_dual')';

N = length(einj_dual);

n = floor(N/n_count);

einj_dual_n=zeros(1,n);

Fdown_dual_n=zeros(1,n);

var_einj_Fdown_dual_n=zeros(1,n);

for j=1:n-1

einj_dual_n(j) = mean(einj_Fdown_dual_sort(1,(j-1)*n_count+1:j*n_count));

Fdown_dual_n(j)= mean(einj_Fdown_dual_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_Fdown_dual_n(j) = mean((einj_Fdown_dual_sort(2,(j-1)*n_count+1:j*n_count)-Fdown_dual_n(j)).^2)^0.5;

end

einj_dual_n(n) = mean(einj_Fdown_dual_sort(1,(n-1)*n_count+1:end));

Fdown_dual_n(n)= mean(einj_Fdown_dual_sort(2,(n-1)*n_count+1:end));

var_einj_Fdown_dual_n(n) = mean((einj_Fdown_dual_sort(2,(n-1)*n_count+1:end)-Fdown_dual_n(n)).^2)^0.5;

einj_Fdown_forw = [einj_forw; Fdown_forw];

einj_Fdown_forw_sort = sortrows(einj_Fdown_forw')';

N = length(einj_forw);

n = floor(N/n_count);

einj_forw_n=zeros(1,n);

Fdown_forw_n=zeros(1,n);

var_einj_Fdown_forw_n=zeros(1,n);

for j=1:n-1

einj_forw_n(j) = mean(einj_Fdown_forw_sort(1,(j-1)*n_count+1:j*n_count));

Fdown_forw_n(j)= mean(einj_Fdown_forw_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_Fdown_forw_n(j) = mean((einj_Fdown_forw_sort(2,(j-1)*n_count+1:j*n_count)-Fdown_forw_n(j)).^2)^0.5;

end

einj_forw_n(n) = mean(einj_Fdown_forw_sort(1,(n-1)*n_count+1:end));

Fdown_forw_n(n)= mean(einj_Fdown_forw_sort(2,(n-1)*n_count+1:end));

var_einj_Fdown_forw_n(n) = mean((einj_Fdown_forw_sort(2,(n-1)*n_count+1:end)-Fdown_forw_n(n)).^2)^0.5;

einj_Fdown_inv = [einj_inv; Fdown_inv];

einj_Fdown_inv_sort = sortrows(einj_Fdown_inv')';

N = length(einj_inv);

n = floor(N/n_count);

einj_inv_n=zeros(1,n);

Fdown_inv_n=zeros(1,n);

var_einj_Fdown_inv_n=zeros(1,n);

for j=1:n-1

einj_inv_n(j) = mean(einj_Fdown_inv_sort(1,(j-1)*n_count+1:j*n_count));

Fdown_inv_n(j)= mean(einj_Fdown_inv_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_Fdown_inv_n(j) = mean((einj_Fdown_inv_sort(2,(j-1)*n_count+1:j*n_count)-Fdown_inv_n(j)).^2)^0.5;

end

einj_inv_n(n) = mean(einj_Fdown_inv_sort(1,(n-1)*n_count+1:end));

Fdown_inv_n(n)= mean(einj_Fdown_inv_sort(2,(n-1)*n_count+1:end));

var_einj_Fdown_inv_n(n) = mean((einj_Fdown_inv_sort(2,(n-1)*n_count+1:end)-Fdown_inv_n(n)).^2)^0.5;

einj_Fdown_ndual = [einj_ndual; Fdown_ndual];

einj_Fdown_ndual_sort = sortrows(einj_Fdown_ndual')';

N = length(einj_ndual);

n = floor(N/n_count);

einj_ndual_n=zeros(1,n);

Fdown_ndual_n=zeros(1,n);

var_einj_Fdown_ndual_n=zeros(1,n);

for j=1:n-1

einj_ndual_n(j) = mean(einj_Fdown_ndual_sort(1,(j-1)*n_count+1:j*n_count));

Fdown_ndual_n(j)= mean(einj_Fdown_ndual_sort(2,(j-1)*n_count+1:j*n_count));

var_einj_Fdown_ndual_n(j) = mean((einj_Fdown_ndual_sort(2,(j-1)*n_count+1:j*n_count)-Fdown_ndual_n(j)).^2)^0.5;

end

einj_ndual_n(n) = mean(einj_Fdown_ndual_sort(1,(n-1)*n_count+1:end));

Fdown_ndual_n(n)= mean(einj_Fdown_ndual_sort(2,(n-1)*n_count+1:end));

var_einj_Fdown_ndual_n(n) = mean((einj_Fdown_ndual_sort(2,(n-1)*n_count+1:end)-Fdown_ndual_n(n)).^2)^0.5;

figure

plot(einj_dual_n,Fdown_dual_n,'o','linewidth',1.3)

hold on

plot(einj_forw_n,Fdown_forw_n,'o','linewidth',1.3)

plot(einj_inv_n,Fdown_inv_n,'o','linewidth',1.3)

plot(einj_ndual_n,Fdown_ndual_n,'o','linewidth',1.3)

patch([einj_dual_n flip(einj_dual_n)], [Fdown_dual_n-var_einj_Fdown_dual_n flip(Fdown_dual_n+var_einj_Fdown_dual_n)],[0 0.4470 0.7410], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([einj_forw_n flip(einj_forw_n)], [Fdown_forw_n-var_einj_Fdown_forw_n flip(Fdown_forw_n+var_einj_Fdown_forw_n)],[0.8500 0.3250 0.0980], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([einj_inv_n flip(einj_inv_n)], [Fdown_inv_n-var_einj_Fdown_inv_n flip(Fdown_inv_n+var_einj_Fdown_inv_n)],[0.9290 0.6940 0.1250], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([einj_ndual_n flip(einj_ndual_n)], [Fdown_ndual_n-var_einj_Fdown_ndual_n flip(Fdown_ndual_n+var_einj_Fdown_ndual_n)],[0.4940 0.1840 0.5560], 'FaceAlpha',0.2, 'EdgeColor','none')

leg=legend('dual (divergent)','forward','inverse','dual (convergent)');

set(leg,'interpreter','latex')

xlabel('$$\epsilon_{inj}$$','interpreter','latex')

ylabel('$$F_{down}$$','interpreter','latex')

set(gca,'FontSize',14,'FontName','Times')

edis_Fup_dual = [edis_dual; Fup_dual];

edis_Fup_dual_sort = sortrows(edis_Fup_dual')';

N = length(edis_dual);

n = floor(N/n_count);

edis_dual_n=zeros(1,n);

Fup_dual_n=zeros(1,n);

var_edis_Fup_dual_n=zeros(1,n);

for j=1:n-1

edis_dual_n(j) = mean(edis_Fup_dual_sort(1,(j-1)*n_count+1:j*n_count));

Fup_dual_n(j)= mean(edis_Fup_dual_sort(2,(j-1)*n_count+1:j*n_count));

var_edis_Fup_dual_n(j) = mean((edis_Fup_dual_sort(2,(j-1)*n_count+1:j*n_count)-Fup_dual_n(j)).^2)^0.5;

end

edis_dual_n(n) = mean(edis_Fup_dual_sort(1,(n-1)*n_count+1:end));

Fup_dual_n(n)= mean(edis_Fup_dual_sort(2,(n-1)*n_count+1:end));

var_edis_Fup_dual_n(n) = mean((edis_Fup_dual_sort(2,(n-1)*n_count+1:end)-Fup_dual_n(n)).^2)^0.5;

edis_Fup_forw = [edis_forw; Fup_forw];

edis_Fup_forw_sort = sortrows(edis_Fup_forw')';

N = length(edis_forw);

n = floor(N/n_count);

edis_forw_n=zeros(1,n);

Fup_forw_n=zeros(1,n);

var_edis_Fup_forw_n=zeros(1,n);

for j=1:n-1

edis_forw_n(j) = mean(edis_Fup_forw_sort(1,(j-1)*n_count+1:j*n_count));

Fup_forw_n(j)= mean(edis_Fup_forw_sort(2,(j-1)*n_count+1:j*n_count));

var_edis_Fup_forw_n(j) = mean((edis_Fup_forw_sort(2,(j-1)*n_count+1:j*n_count)-Fup_forw_n(j)).^2)^0.5;

end

edis_forw_n(n) = mean(edis_Fup_forw_sort(1,(n-1)*n_count+1:end));

Fup_forw_n(n)= mean(edis_Fup_forw_sort(2,(n-1)*n_count+1:end));

var_edis_Fup_forw_n(n) = mean((edis_Fup_forw_sort(2,(n-1)*n_count+1:end)-Fup_forw_n(n)).^2)^0.5;

edis_Fup_inv = [edis_inv; Fup_inv];

edis_Fup_inv_sort = sortrows(edis_Fup_inv')';

N = length(edis_inv);

n = floor(N/n_count);

edis_inv_n=zeros(1,n);

Fup_inv_n=zeros(1,n);

var_edis_Fup_inv_n=zeros(1,n);

for j=1:n-1

edis_inv_n(j) = mean(edis_Fup_inv_sort(1,(j-1)*n_count+1:j*n_count));

Fup_inv_n(j)= mean(edis_Fup_inv_sort(2,(j-1)*n_count+1:j*n_count));

var_edis_Fup_inv_n(j) = mean((edis_Fup_inv_sort(2,(j-1)*n_count+1:j*n_count)-Fup_inv_n(j)).^2)^0.5;

end

edis_inv_n(n) = mean(edis_Fup_inv_sort(1,(n-1)*n_count+1:end));

Fup_inv_n(n)= mean(edis_Fup_inv_sort(2,(n-1)*n_count+1:end));

var_edis_Fup_inv_n(n) = mean((edis_Fup_inv_sort(2,(n-1)*n_count+1:end)-Fup_inv_n(n)).^2)^0.5;

edis_Fup_ndual = [edis_ndual; Fup_ndual];

edis_Fup_ndual_sort = sortrows(edis_Fup_ndual')';

N = length(edis_ndual);

n = floor(N/n_count);

edis_ndual_n=zeros(1,n);

Fup_ndual_n=zeros(1,n);

var_edis_Fup_ndual_n=zeros(1,n);

for j=1:n-1

edis_ndual_n(j) = mean(edis_Fup_ndual_sort(1,(j-1)*n_count+1:j*n_count));

Fup_ndual_n(j)= mean(edis_Fup_ndual_sort(2,(j-1)*n_count+1:j*n_count));

var_edis_Fup_ndual_n(j) = mean((edis_Fup_ndual_sort(2,(j-1)*n_count+1:j*n_count)-Fup_ndual_n(j)).^2)^0.5;

end

edis_ndual_n(n) = mean(edis_Fup_ndual_sort(1,(n-1)*n_count+1:end));

Fup_ndual_n(n)= mean(edis_Fup_ndual_sort(2,(n-1)*n_count+1:end));

var_edis_Fup_ndual_n(n) = mean((edis_Fup_ndual_sort(2,(n-1)*n_count+1:end)-Fup_ndual_n(n)).^2)^0.5;

figure

plot(-edis_dual_n,Fup_dual_n,'o','linewidth',1.3)

hold on

plot(-edis_forw_n,Fup_forw_n,'o','linewidth',1.3)

plot(-edis_inv_n,Fup_inv_n,'o','linewidth',1.3)

plot(-edis_ndual_n,Fup_ndual_n,'o','linewidth',1.3)

patch([-edis_dual_n flip(-edis_dual_n)], [Fup_dual_n-var_edis_Fup_dual_n flip(Fup_dual_n+var_edis_Fup_dual_n)],[0 0.4470 0.7410], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([-edis_forw_n flip(-edis_forw_n)], [Fup_forw_n-var_edis_Fup_forw_n flip(Fup_forw_n+var_edis_Fup_forw_n)],[0.8500 0.3250 0.0980], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([-edis_inv_n flip(-edis_inv_n)], [Fup_inv_n-var_edis_Fup_inv_n flip(Fup_inv_n+var_edis_Fup_inv_n)],[0.9290 0.6940 0.1250], 'FaceAlpha',0.2, 'EdgeColor','none')

patch([-edis_ndual_n flip(-edis_ndual_n)], [Fup_ndual_n-var_edis_Fup_ndual_n flip(Fup_ndual_n+var_edis_Fup_ndual_n)],[0.4940 0.1840 0.5560], 'FaceAlpha',0.2, 'EdgeColor','none')

leg=legend('dual (divergent)','forward','inverse','dual (convergent)');

set(leg,'interpreter','latex')

xlabel('$$\epsilon_{diss}$$','interpreter','latex')

ylabel('$$F_{up}$$','interpreter','latex')

set(gca,'FontSize',14,'FontName','Times')

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

e_Fup_dual = [einj_dual+edis_dual; Fup_dual];

e_Fup_dual_sort = sortrows(e_Fup_dual')';

N = length(einj_dual);

n = floor(N/n_count);

e_dual_n=zeros(1,n);

Fup_dual_n=zeros(1,n);

var_e_Fup_dual_n=zeros(1,n);

for j=1:n-1

e_dual_n(j) = mean(e_Fup_dual_sort(1,(j-1)*n_count+1:j*n_count));

Fup_dual_n(j)= mean(e_Fup_dual_sort(2,(j-1)*n_count+1:j*n_count));

var_e_Fup_dual_n(j) = mean((e_Fup_dual_sort(2,(j-1)*n_count+1:j*n_count)-Fup_dual_n(j)).^2)^0.5;

end

e_dual_n(n) = mean(e_Fup_dual_sort(1,(n-1)*n_count+1:end));

Fup_dual_n(n)= mean(e_Fup_dual_sort(2,(n-1)*n_count+1:end));

var_e_Fup_dual_n(n) = mean((e_Fup_dual_sort(2,(n-1)*n_count+1:end)-Fup_dual_n(n)).^2)^0.5;

figure

plot(1e9*e_dual_n,1e9*Fup_dual_n,'o','linewidth',1.3)

hold on

patch(1e9*[e_dual_n flip(e_dual_n)], 1e9*[Fup_dual_n-var_e_Fup_dual_n flip(Fup_dual_n+var_e_Fup_dual_n)],[0 0.4470 0.7410], 'FaceAlpha',0.2, 'EdgeColor','none')

leg=legend('$$F_{large}$$');

set(leg,'interpreter','latex')

xlabel('$$\epsilon_{inj}-\epsilon_{dis}$$','interpreter','latex')

ylabel('$$F$$','interpreter','latex')

set(gca,'FontSize',14,'FontName','Times')

e_Fdown_dual = [einj_dual+edis_dual; Fdown_dual];

e_Fdown_dual_sort = sortrows(e_Fdown_dual')';

N = length(einj_dual);

n = floor(N/n_count);

e_dual_n=zeros(1,n);

Fdown_dual_n=zeros(1,n);

var_e_Fdown_dual_n=zeros(1,n);

for j=1:n-1

e_dual_n(j) = mean(e_Fdown_dual_sort(1,(j-1)*n_count+1:j*n_count));

Fdown_dual_n(j)= mean(e_Fdown_dual_sort(2,(j-1)*n_count+1:j*n_count));

var_e_Fdown_dual_n(j) = mean((e_Fdown_dual_sort(2,(j-1)*n_count+1:j*n_count)-Fdown_dual_n(j)).^2)^0.5;

end

e_dual_n(n) = mean(e_Fdown_dual_sort(1,(n-1)*n_count+1:end));

Fdown_dual_n(n)= mean(e_Fdown_dual_sort(2,(n-1)*n_count+1:end));

var_e_Fdown_dual_n(n) = mean((e_Fdown_dual_sort(2,(n-1)*n_count+1:end)-Fdown_dual_n(n)).^2)^0.5;

figure

plot(1e9*e_dual_n,1e9*Fdown_dual_n,'o','linewidth',1.3)

hold on

patch([1e9*e_dual_n flip(1e9*e_dual_n)], 1e9*[Fdown_dual_n-var_e_Fdown_dual_n flip(Fdown_dual_n+var_e_Fdown_dual_n)],[0.8500 0.3250 0.0980], 'FaceAlpha',0.2, 'EdgeColor','none')

leg=legend('$$F_{small}$$');

set(leg,'interpreter','latex')

xlabel('$$\epsilon_{inj}-\epsilon_{dis}$$','interpreter','latex')

ylabel('$$F$$','interpreter','latex')

set(gca,'FontSize',14,'FontName','Times')

figure

plot(1e9*e_dual_n,Fup_dual_n./Fdown_dual_n,'o','linewidth',1.3)

hold on

plot(1e9*e_dual_n,ones(1,length(e_dual_n)),'k--','linewidth',1.3)

patch([1e9*e_dual_n flip(1e9*e_dual_n)], [Fup_dual_n./Fdown_dual_n.*(1-var_e_Fup_dual_n./Fup_dual_n-var_e_Fdown_dual_n./Fdown_dual_n) flip(Fup_dual_n./Fdown_dual_n.*(1+var_e_Fup_dual_n./Fup_dual_n+var_e_Fdown_dual_n./Fdown_dual_n))],[0 0.4470 0.7410], 'FaceAlpha',0.2, 'EdgeColor','none')

% leg=legend('$$F_{small}$$');

% set(leg,'interpreter','latex')

xlabel('$$\epsilon_{inj}-\epsilon_{dis}\,(Jkg^{-1}s^{-1})$$','interpreter','latex')

ylabel('$$F_{large}/F_{small}$$','interpreter','latex')

set(gca,'FontSize',14,'FontName','Times')

Footer

© 2025 GitHub, Inc.

Footer navigation

Terms

Privacy

Security

Status

Docs

Contact

Manage cookies

Do not share my personal information

You can’t perform that action at this time.