-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathintegral_calculator.py
5186 lines (4753 loc) · 290 KB
/
integral_calculator.py
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
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
"""
Created on Sun May 8 15:27:36 2022
@author: vnavr
"""
import PySimpleGUI as sg
from sympy import latex
from sympy import symbols, diff, integrate, sqrt, sympify
from sympy import cos
from sympy import sin
from sympy.parsing.sympy_parser import parse_expr
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from sympy.plotting import plot3d, PlotGrid, plot
from sympy import plot_implicit, And
global language
language=1
sg.theme('LightGreen3')
help_int = ['ΑΠΛΟ ΟΛΟΚΛΗΡΩΜΑ','ΔΙΠΛΟ ΟΛΟΚΛΗΡΩΜΑ','ΤΡΠΛΟ ΟΛΟΚΛΗΡΩΜΑ','ΕΠΙΚΑΜΠΥΛΙΟ','ΕΠΙΦΑΝΕΙΑΚΟ','___________________','ΠΛΗΡΟΦΟΡΙΕΣ']
help_info = {help_int[0] :1,
help_int[1] :2,
help_int[2] :3,
help_int[3] :4,
help_int[4] :5,
help_int[5] :6,
help_int[6] :7
}
#ΛΙΣΤΕΣ ΜΕΝΟΥ
text_frame = ['ΥΠΟΛΟΓΙΣΜΟΣ ΟΛΟΚΛΗΡΩΜΑΤΩΝ', 'ΔΙΠΛΟ ΟΛΟΚΛΗΡΩΜΑ - ΚΑΡΤΕΣΙΑΝΕΣ ΣΥΝΤΕΤΑΓΜΕΝΕΣ','ΔΙΠΛΟ ΟΛΟΚΛΗΡΩΜΑ - ΠΟΛΙΚΕΣ ΣΥΝΤΕΤΑΓΜΕΝΕΣ','ΤΡΙΠΛΟ ΟΛΟΚΛΗΡΩΜΑ - ΚΑΡΤΕΣΙΑΝΕΣ ΣΥΝΤΕΤΑΓΜΕΝΕΣ','ΤΡΙΠΛΟ ΟΛΟΚΛΗΡΩΜΑ - ΣΦΑΙΡΙΚΕΣ ΣΥΝΤΕΤΑΓΜΕΝΕΣ','ΤΡΙΠΛΟ ΟΛΟΚΛΗΡΩΜΑ - ΕΛΛΕΙΠΤΙΚΕΣ ΣΥΝΤΕΤΑΓΜΕΝΕΣ','ΤΡΙΠΛΟ ΟΛΟΚΛΗΡΩΜΑ - ΚΥΛΙΝΔΡΙΚΕΣ ΣΥΝΤΕΤΑΓΜΕΝΕΣ','ΕΠΙΚΑΜΠΥΛΙΟ ΟΛΟΚΛΗΡΩΜΑ - ΒΑΘΜΩΤΗ ΣΥΝΑΡΤΗΣΗ','ΕΠΙΚΑΜΠΥΛΙΟ ΟΛΟΚΛΗΡΩΜΑ - ΔΙΑΝΥΣΜΑΤΙΚΗ ΣΥΝΑΡΤΗΣΗ','ΕΠΙΦΑΝΕΙΑΚΟ ΟΛΟΚΛΗΡΩΜΑ - ΒΑΘΜΩΤΗ ΣΥΝΑΡΤΗΣΗ','ΕΠΙΦΑΝΕΙΑΚΟ ΟΛΟΚΛΗΡΩΜΑ - ΔΙΑΝΥΣΜΑΤΙΚΗ ΣΥΝΑΡΤΗΣΗ']
menu_kindf = ['ΒΑΘΜΩΤΗ','ΔΙΑΝΥΣΜΑΤΙΚΗ']
menu_kind_int = ['ΔΙΠΛΑ','ΤΡΙΠΛΑ','ΕΠΙΚΑΜΠΥΛΙΑ','ΕΠΙΦΑΝΕΙΑΚΑ']
menu_kind_coordinate = ['ΚΑΡΤΕΣΙΑΝΕΣ','ΠΟΛΙΚΕΣ','ΣΦΑΙΡΙΚΕΣ','ΕΛΛΕΙΠΤΙΚΕΣ','ΚΥΛΙΝΔΡΙΚΕΣ']
double_inputs1= ['doublef','doublex1','doublex2','doubley1','doubley2']
double_inputs2= ['doublef2','doubler1','doubler2','doubleth1','doubleth2']
triple_inputs1= ['triplef','triplex1','triplex2','tripley1','tripley2','triplez1','triplez2']
triple_inputs2= ['triplef2','tripler1','tripler2','tripleθ1','tripleθ2','tripleφ1','tripleφ2']
triple_inputs3= ['triplef3','3tripler1','3tripler2','3tripleθ1','3tripleθ2','3tripleφ1','3tripleφ2']
triple_inputs4= ['triplef4','4triplex1','4triplex2','4tripley1','4tripley2','4triplez1','4triplez2']
line_inputs1= ['linef','linext','lineyt','linezt','linet1','linet2']
line_inputs2= ['linef1','linef2','linef3','linext2','lineyt2','linezt2','2linet1','2linet2','linexa','linexb','lineya','lineyb','lineza','linezb']
surface_inputs1 = ['surfacef','surfacex','surfacey','surfacez','surfaceu1','surfaceu2','surfacev1','surfacev2']
surface_inputs2 = ['2surfacef1','2surfacef2','2surfacef3','2surfacex','2surfacey','2surfacez','2surfaceu1','2surfaceu2','2surfacev1','2surfacev2','2surfacefs','2surfacex1','2surfacex2','2surfacey1','2surfacey2','2surfacez1','2surfacez2']
keys = [double_inputs1, double_inputs2, triple_inputs1, triple_inputs2, triple_inputs3, triple_inputs4, line_inputs1, line_inputs2, surface_inputs1,surface_inputs2]
calculate = ['1a','2a','3a','4a','5a','6a','7a','8a','9a','10a']
clear = ['clear1','clear2','clear3','clear4','clear5','clear6','clear7','clear8','clear9','clear10']
#ΑΓΓΛΙΚΑ
help_int2 = ['SIMPLE INTEGRAL', 'DOUBLE INTEGRAL', 'TRIPLE INTEGRAL', 'LINE INTEGRAL', 'SURFACE INTEGRAL', '___________________','INFORMATIONS']
help_info2 = {help_int2[0] : 1,
help_int2[1] :2,
help_int2[2] :3,
help_int2[3] :4,
help_int2[4] :5,
help_int2[5] :6,
help_int2[6] :7
}
text_frame2=['INTEGRAL CALCULATOR', 'DOUBLE INTEGRAL - CARTESIAN COORDINATES','DOUBLE INTEGRAL - POLAR COORDINATES','TRIPLE INTEGRAL - CARTESIAN COORDINATES','TRIPLE INTEGRAL - SPHERICAL COORDINATES','TRIPLE INTEGRAL - ELEPTIC COORDINATES','TRIPLE INTEGRAL - CYLINDRICAL COORDINATES','LINE INTEGRAL - GRADE FUNCTION','LINE INTEGRAL - VECTOR FUNCTION','SURFACE INTEGRAL - GRADE FUNCTION','SURFACE INTEGRAL - VECTOR FUNCTION' ]
menu_kindf2 = ['GRADE','VECTOR']
menu_kind_int2 = ['DOUBLE','TRIPLE','LINE','SURFACE']
menu_kind_coordinate2 = ['CARTESIAN','POLAR','SPHERICAL','ELEPTIC','CYLINDRICAL']
ΕΝ_double_inputs1= ['2doublef','2doublex1','2doublex2','2doubley1','2doubley2']
ΕΝ_double_inputs2= ['2doublef2','2doubler1','2doubler2','2doubleth1','2doubleth2']
ΕΝ_triple_inputs1= ['2triplef','2triplex1','2triplex2','2tripley1','2tripley2','2triplez1','2triplez2']
ΕΝ_triple_inputs2= ['2triplef2','2tripler1','2tripler2','2ripleθ1','2tripleθ2','2tripleφ1','2tripleφ2']
ΕΝ_triple_inputs3= ['2triplef3','23tripler1','23tripler2','23tripleθ1','23tripleθ2','23tripleφ1','23tripleφ2']
ΕΝ_triple_inputs4= ['2triplef4','24triplex1','24triplex2','24tripley1','24tripley2','24triplez1','24triplez2']
ΕΝ_line_inputs1= ['2linef','2linext','2lineyt','2linezt','2linet1','2linet2']
ΕΝ_line_inputs2= ['2linef1','2linef2','2linef3','2linext2','2lineyt2','2linezt2','22linet1','22linet2','2linexa','2linexb','2lineya','2lineyb','2lineza','2linezb']
ΕΝ_surface_inputs1 = ['2surfacef','2surfacex','2surfacey','2surfacez','2surfaceu1','2surfaceu2','2surfacev1','2surfacev2']
ΕΝ_surface_inputs2 = ['22surfacef1','22surfacef2','22surfacef3','22surfacex','22surfacey','22surfacez','22surfaceu1','22surfaceu2','22surfacev1','22surfacev2','22surfacefs','22surfacex1','22surfacex2','22surfacey1','22surfacey2','22surfacez1','22surfacez2']
keys2 = [ΕΝ_double_inputs1, ΕΝ_double_inputs2, ΕΝ_triple_inputs1, ΕΝ_triple_inputs2, ΕΝ_triple_inputs3, ΕΝ_triple_inputs4, ΕΝ_line_inputs1, ΕΝ_line_inputs2, ΕΝ_surface_inputs1, ΕΝ_surface_inputs2]
calculate2 = ['1b','2b','3b','4b','5b','6b','7b','8b','9b','10b']
clear2 = ['2clear1','2clear2','2clear3','2clear4','2clear5','2clear6','2clear7','2clear8','2clear9','2clear10']
def popuphelp(filename,filename2,filename3,num):
col1=[ [sg.Text('',size=(15, 1),background_color='light blue')], [sg.Text('',size=(15, 1),background_color='light blue')], [sg.Text('',size=(15, 1),background_color='light blue')], [sg.Text('',size=(15, 1),background_color='light blue')], [sg.Text('',size=(15, 1),background_color='light blue')], [sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],[sg.Text('',size=(15, 1),background_color='light blue')],
[sg.Button('ΠΡΟΗΓΟΥΜΕΝΟ', key='PREVIUS', expand_x=True,size=(20,1))],
[sg.Button('ΕΠΟΜΕΝΟ', key='ΝΕΧΤ', expand_x=True,size=(20,1))]]
layout = [[sg.Image(filename=filename,key='-IMGBOX-',background_color=('white'), expand_x=True, expand_y=True),sg.Column(col1,key='im1',visible=True,background_color='light blue',size=(230,700)),]]
window = sg.Window('ΒΟΗΘΕΙΑ', layout, border_depth=2, resizable=True, finalize=True, size=(700, 650))
counter=0
while True:
event, values = window.read()
# print(event, values)
if (event == sg.WIN_CLOSED):
break
if num==0:
window['im1'].update(visible=False)
elif num==1:
window['im1'].update(visible=True)
if event == 'ΝΕΧΤ':
if counter==0:
window['-IMGBOX-'].update(filename2)
counter=counter+1
elif num==2:
window['im1'].update(visible=True)
if event == 'ΝΕΧΤ':
if counter==0:
window['-IMGBOX-'].update(filename2)
counter=counter+1
elif counter==1:
window['-IMGBOX-'].update(filename3)
counter=counter+1
if num==1:
window['im1'].update(visible=True)
if event == 'PREVIUS':
if counter==1:
window['-IMGBOX-'].update(filename)
counter=counter-1
elif num==2:
window['im1'].update(visible=True)
if event == 'PREVIUS':
if counter==2:
window['-IMGBOX-'].update(filename2)
counter=counter-1
elif counter==1:
window['-IMGBOX-'].update(filename)
counter=counter-1
window.close()
def help_DEF(x):
if x == 1:
popuphelp('integral.png','','',0)
elif x ==2 :
popuphelp('double1.png','double2.png','',1)
elif x ==3 :
popuphelp('triple1.png','triple2.png','',1)
elif x ==4 :
popuphelp('line1.png','line2.png','line3.png',2)
elif x ==5 :
popuphelp('surface1.png','surface2.png','',1)
elif x ==6 :
print('')
elif x ==7 :
popuphelp('info.png','','',0)
#ΕΛΕΓΧΟΣ ΑΝ ΕΚΑΝΕ ΕΙΣΑΓΩΓΗ Ο ΧΡΗΣΤΗΣ
def check_inputs(array):
counter = 0
for x in array:
if x == '':
counter = counter+1
return counter
#end
def correction(a,language):
c=0
d=0
for i in range(len(a)):
if a[i] == "(":
c+=1
elif a[i] == ")":
d+=1
if c!=d and language==0:
sg.Popup("There is a missing parenthesis.",title='ΕΙΔΟΠΟΙΗΣΗ !!!')
return 0
elif c!=d and language==1:
sg.Popup("Λείπει μια παρένθεση.",title='ΕΙΔΟΠΟΙΗΣΗ !!!')
return 0
flag=0
for i in range(len(a)):
if a[i]=="e" and a[i+1]!="^":
a=a[:i]+"exp("+a[i+1]+")"+a[i:]
if a[i]=="e" and a[i+1]=="^" and a[i+2]!="(":
for j in range(i+2,len(a)):
if a[j] in "+*/-":
a=a[:i+2]+"("+a[i+2:j]+")"+a[j:]
flag = 1
break
if flag==1:
break
# print(a)
if "e^(" in a:
a = a.replace("e^" , "exp")
return a
def initialize(array):
i=0
print(array)
for x in array:
array[i]=0
i=i+1
return array
#end
def sym_compare(a,b):
d = a-b
if d.is_positive:
return 1
elif d.is_negative:
return -1
else:
return 0
def inputs_request(obj_to_check, out_str):
obj_to_check = symbols('obj_to_check')
T = obj_to_check.expr_free_symbols
if T:
a = 1
else:
a = 0
while(obj_to_check.is_number==0 and a==0):
#Check if f is symbolic
#Not symbolic
print("Type ""exit"" to exit imidiately.")
obj_to_check=input(out_str + " again: ")
if (obj_to_check=="exit"):
break
#end
#end
#ΔΙΠΛΑ ΚΑΡΤΕΣΙΑΝΕΣ
#ΜΕΤΑΤΡΟΠΗ ΑΛΦΑΡΙΘΜΗΤΙΚΩΝ ΤΙΜΩΝ ΣΕ ΣΥΜΒΟΛΙΚΕΣ
def inputs_call(array_inputs):
f = sympify(array_inputs[0])
#f = inputs_request(f,"Give the function f(x,y)")
x1 = sympify(array_inputs[1])
#x1 = inputs_request(f,"Give x1")
x2 = sympify(array_inputs[2])
#x2 = inputs_request(f,"Give x2")
y1 = sympify(array_inputs[3])
#y1 = inputs_request(f,"Give y1")
y2 = sympify(array_inputs[4])
#y2 = inputs_request(f,"Give y2")
return f, x1, x2, y1, y2
#end
#ΔΙΠΛΑ ΠΟΛΙΚΕΣ
#ΜΕΤΑΤΡΟΠΗ ΑΛΦΑΡΙΘΜΗΤΙΚΩΝ ΤΙΜΩΝ ΣΕ ΣΥΜΒΟΛΙΚΕΣ
def inputs_polar(array_polar):
f = sympify(array_polar[0])
r1 = sympify(array_polar[1])
r2 = sympify(array_polar[2])
theta1 = sympify(array_polar[3])
theta2 = sympify(array_polar[4])
return f,r1,r2,theta1,theta2
#end
def swap_values(a,b):
temp = a
a = b
b = temp
return a, b
#end
def warning_one(a,b):
if sym_compare(a,b) ==1:
print("\nWarning! \n\n Inverting Inputs ... \n\n")
a,b = swap_values(a,b)
#end
return a,b
#ΥΠΟΛΟΓΙΣΜΟΣ ΔΙΠΛΩΝ ΟΛΟΚΛΗΡΩΜΑΤΩΝ
def double_integral(array_inputs,pc,language):
#ΔΗΛΩΣΗ ΣΥΜΒΟΛΙΚΩΝ ΜΕΤΑΒΛΗΤΩΝ
x, y, r, theta = symbols('x y r theta')
x1, x2, y1, y2 = symbols('x1 x2 y1 y2')
f,r1,r2,theta1,theta2 = symbols('f r1 r2 theta1 theta2')
#ΜΕΤΑΤΡΟΠΗ ΑΛΦΑΡΙΘΜΗΤΙΚΩΝ ΤΙΜΩΝ ΑΠΟ ΤΟΝ ΧΡΗΣΤΗ ΣΕ ΣΥΜΒΟΛΙΚΕΣ
if (pc==0):
f,x1,x2,y1,y2 = inputs_call(array_inputs)
elif pc==1:
f,r1,r2,theta1,theta2 = inputs_polar(array_inputs)
#end
#ΥΠΟΛΟΓΙΣΜΟΣ ΟΛΟΚΛΗΡΩΜΑΤΟΣ
if (x1.is_number==1 and x2.is_number==1 and y1.is_number==1 and y2.is_number==1 and pc==0):
x1,x2 = warning_one(x1,x2)
y1,y2 = warning_one(y1,y2)
#1.
#Simple x and y
I1 = integrate(f,(x,x1,x2))
I = integrate(I1,(y,y1,y2))
if language == 1:
mathtext_demos = {
"Header demo":
"Εισαγάγατε:"+r"$ \int ^{"+latex(y2)+"} _{"+latex(y1)+"} \int ^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx dy$",
"Το πρώτο ολοκλήρωμα είναι:":
r"$I_1 = "
r"\int^{"+latex(x2)+"}_{"+latex(x1)+"} "+latex(f)+" dx $",
"Το οποίο μας δίνει:":
r"$I_1 = "+latex(I1)+"$",
"Το δεύτερο ολοκλήρωμα είναι: ":
r"$I_2 = "
r"\int^{"+latex(y2)+"}_{"+latex(y1)+"} "+latex(I1)+" dy $",
"Το οποίο μας δίνει το τελικό αποτέλεσμα:":
r"$I_2 = "+latex(I)+"$",
}
elif language == 0 :
mathtext_demos = {
"Header demo":
r"$You~entered: \int ^{"+latex(y2)+"} _{"+latex(y1)+"} \int ^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx dy$",
"First Integral is:":
r"$I_1 = \int^{"+latex(x2)+"}_{"+latex(x1)+"} "+latex(f)+" dx $",
"which gives:":
r"$I_1 = "+latex(I1)+"$",
"Second Integral is: ":
r"$I_2 = \int^{"+latex(y2)+"}_{"+latex(y1)+"} "+latex(I1)+" dy $",
"which gives final result:":
r"$I_2 = "+latex(I)+" $",
}
elif((x1.is_number==0 or x2.is_number==0) and y1.is_number==1 and y2.is_number==1 and pc==0):
y1,y2 = warning_one(y1,y2)
#2.
#Simple x
#display result...
I1 = integrate(f,(x,x1,x2))
I = integrate(I1,(y,y1,y2))
if language == 1:
mathtext_demos = {
"Header demo":
"Εισαγάγατε:"+r"$ \int ^{"+latex(y2)+"} _{"+latex(y1)+"} \int ^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx dy$",
"Το πρώτο ολοκλήρωμα είναι:":
r"$I_1 = "
r"\int^{"+latex(x2)+"}_{"+latex(x1)+"} "+latex(f)+" dx $",
"Το οποίο μας δίνει:":
r"$I_1 = "+latex(I1)+"$",
"Το δεύτερο ολοκλήρωμα είναι: ":
r"$I_2 = "
r"\int^{"+latex(y2)+"}_{"+latex(y1)+"} "+latex(I1)+" dy $",
"Το οποίο μας δίνει το τελικό αποτέλεσμα:":
r"$I_2 = "+latex(I)+"$",
}
elif language == 0:
mathtext_demos = {
"Header demo":
r"$You~entered: \int ^{"+latex(y2)+"} _{"+latex(y1)+"} \int ^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx dy$",
"First Integral is:":
r"$I_1 = \int^{"+latex(x2)+"}_{"+latex(x1)+"} "+latex(f)+" dx $",
"which gives:":
r"$I_1 = "+latex(I1)+"$",
"Second Integral is: ":
r"$I_2 = \int^{"+latex(y2)+"}_{"+latex(y1)+"} "+latex(I1)+" dy $",
"which gives final result:":
r"$I_2 = "+latex(I)+" $",
}
elif(pc==0):
x1,x2 = warning_one(x1,x2)
#3.
#Simple y
#display result...
I1 = integrate(f,(y,y1,y2))
I = integrate(I1,(x,x1,x2))
if language == 1:
mathtext_demos = {
"Header demo":
"Εισαγάγατε:"+r"$ \int ^{"+latex(x2)+"} _{"+latex(x1)+"} \int ^{"+latex(y2)+"} _{"+latex(y1)+"} "+latex(f)+" dy dx$",
"Το πρώτο ολοκλήρωμα είναι:":
r"$I_1 = "
r"\int^{"+latex(y2)+"}_{"+latex(y1)+"} "+latex(f)+" dy $",
"Το οποίο μας δίνει:":
r"$I_1 = "+latex(I1)+"$",
"Το δεύτερο ολοκλήρωμα είναι: ":
r"$I_2 = "
r"\int^{"+latex(x2)+"}_{"+latex(x1)+"} "+latex(I1)+" dx $",
"Το οποίο μας δίνει το τελικό αποτέλεσμα:":
r"$I_2 = "+latex(I)+"$",
}
elif language == 0:
mathtext_demos = {
"Header demo":
r"$You~entered: \int ^{"+latex(x2)+"} _{"+latex(x1)+"} \int ^{"+latex(y2)+"} _{"+latex(y1)+"} "+latex(f)+" dy dx$",
"First Integral is:":
r"$I_1 = \int^{"+latex(y2)+"}_{"+latex(y1)+"} "+latex(f)+" dy $",
"which gives:":
r"$I_1 = "+latex(I1)+"$",
"Second Integral is: ":
r"$I_2 = \int^{"+latex(x2)+"}_{"+latex(x1)+"} "+latex(I1)+" dx $",
"which gives final result:":
r"$I_2 = "+latex(I)+" $",
}
elif(pc==1):
fp = f.subs([(x, r*cos(theta)),(y, r*sin(theta))])
I1 = integrate(fp*r,(r,r1,r2))
I = integrate(I1,(theta,theta1,theta2))
if language == 1:
mathtext_demos = {
"Header demo":
"Εισαγάγατε:"+r"$ \int ^{"+latex(x2)+"} _{"+latex(x1)+"} \int ^{"+latex(y2)+"} _{"+latex(y1)+"} "+latex(f)+" dy dx$",
"Αλλαγή μεταβλητών, με χρήση πολικών συντεταγμένων.":
"Αντικαθιστώ "r"$x$"" με "r"$r \cdot cos( \theta)$"" και "r"$y$"" με "r"$r \cdot sin( \theta)$",
"Η νέα συνάρτηση είναι: ":
r"$ f(r , \theta) = "+latex(fp)+"$",
"Το πρώτο ολοκλήρωμα είναι:":
r"$I_1 = "
r"\int^{"+latex(r2)+"} _{"+latex(r1)+"} "+latex(fp)+" dr $",
"Το οποίο μας δίνει:":
r"$I_1 = "+latex(I1)+"$",
"Το δεύτερο ολοκλήρωμα είναι: ":
r"$I_2 = "
r"\int^{"+latex(theta2)+"}_{"+latex(theta1)+"} "+latex(I)+" d $"
r"$ \theta $",
"Το οποίο μας δίνει το τελικό αποτέλεσμα:":
r"$I_2 = "+latex(I)+"$",
}
elif language == 0:
mathtext_demos = {
"Header demo":
r"$You~entered: \int ^{"+latex(theta2)+"} _{"+latex(theta1)+"} \int ^{"+latex(r2)+"} _{"+latex(r1)+"} "+latex(fp)+" \cdot r dr d $"
r"$ \theta$",
"Change of variables, using polar coordinates:":
"Replace: "
r"$ x $"" with "r"$ r \cdot cos( \theta ) + K_x $"
" and "r"$ y $"" with "r"$ r \cdot sin( \theta ) + K_y $",
"The new function is: ":
r"$ f(r, \theta) = "+latex(fp)+" $",
"First Integral is:":
r"$I_1 = \int^{"+latex(r2)+"}_{"+latex(r1)+"} "+latex(fp)+" \cdot r dr $",
"which gives:":
r"$I_1 = "+latex(I1)+"$",
"Second Integral is: ":
r"$I_2 = \int^{"+latex(theta2)+"}_{"+latex(theta1)+"} "+latex(I1)+" d$"
r"$ \theta $",
"which gives final result:":
r"$I_2 = "+latex(I)+" $",
}
n_lines = len(mathtext_demos)
# Colors used in Matplotlib online documentation.
mpl_grey_rgb = (51 / 255, 51 / 255, 51 / 255)
# Creating figure and axis.
fig = plt.figure(figsize=(7, 7))
ax = fig.add_axes([0.01, 0.01, 0.98, 0.90],
facecolor="white", frameon=False)
ax.set_xlim(0, 1)
ax.set_ylim(0, 1)
if language == 1:
title= "Υπολογισμός διπλού ολοκληρώματος..."
elif language == 0:
title = "Double integral calculation ..."
ax.set_title(title,color=mpl_grey_rgb, fontsize=14, weight='bold')
ax.set_xticks([])
ax.set_yticks([])
# Gap between lines in axes coords
line_axesfrac = 1 / n_lines
# Plot header demonstration formula.
full_demo = mathtext_demos['Header demo']
ax.annotate(full_demo,
xy=(0.5, 1. - 0.59 * line_axesfrac),
color='tab:grey', ha='center', fontsize=20)
# Plot feature demonstration formulae.
for i_line, (title, demo) in enumerate(mathtext_demos.items()):
#print(i_line, demo)
if i_line == 0:
continue
baseline = 1 - i_line * line_axesfrac
baseline_next = baseline - line_axesfrac
fill_color = ['white', 'tab:blue'][i_line % 2]
ax.fill_between([0, 1], [baseline, baseline],
[baseline_next, baseline_next],
color=fill_color, alpha=0.2)
ax.annotate(f'{title}',
xy=(0.06, baseline - 0.3 * line_axesfrac),
color=mpl_grey_rgb, weight='bold')
ax.annotate(demo,
xy=(0.04, baseline - 0.75 * line_axesfrac),
color=mpl_grey_rgb, fontsize=16)
plt.show(block=False)
#"Γραφική παράσταση της"+
"""
fig, axs = plt.subplots(1, 2)
axs[0].p1 = plot3d(f,show=False)
axs[0].set_title('Γραφική παράσταση της f(x,y)')
fig.suptitle('Γραφικές παραστάσεις!', fontsize=16)
axs[1].p8 = plot_implicit(And( x > x1, x < x2, y >y1, y < y2),show=False)
axs[1].set_title('Γραφική παράσταση του χωρίου ολοκλήρωσης D')
p2 = plot(x1,show=False)
p3 = plot(x2,show=False)
p2.extend(p3)
p4 = plot(y1,show=False)
p2.extend(p4):
p5 = plot(y2,show=False)
p2.extend(p5)
"""
p1 = plot3d(f,show=False)
#plt.p1
#p1.set_title('Γραφική παράσταση της f(x,y)')
p2 = plot_implicit(And( x > x1, x < x2, y >y1, y < y2),show=False,adaptive=True)
#plt.set_title('Γραφική παράσταση του χωρίου ολοκλήρωσης D')
#plt.show() ,(x, x1-2, x2+2), (y, y1-2, y2+2)
PlotGrid(1, 2, p1, p2)
#end
#ΥΠΟΛΟΓΙΣΜΟΣ ΤΡΙΠΛΩΝ ΟΛΟΚΛΗΡΩΜΑΤΩΝ
def my_has_sym(B):
A,x,y,z = symbols('A x y z')
A = parse_expr(B)
if A.is_Number == 0:
T1 = A.has(x)
T2 = A.has(y)
T3 = A.has(z)
if (T1==1 and T2==1 and T3==1):
O = -1
#A has x,y,z
elif (T1==1 and T2==1 and T3==0):
O = 12
#A does not have z but has x,y
elif (T1==1 and T2==0 and T3==1):
O = 13
#A does not have y but has x,z
elif (T1==0 and T2==1 and T3==1):
O = 23
#A does not have x but has y,z
elif (T1==1 and T2==0 and T3==0):
O = 1
#A does not have y,z but has x
elif (T1==0 and T2==1 and T3==0):
O = 2
#A does not have x,z but has y
elif (T1==0 and T2==0 and T3==1):
O = 3
#A does not have x,y but has z
elif (T1==0 and T2==0 and T3==0):
O = 0
#A does not have x,y,z
else:
sg.Popup("Error! Something whent wrong!")
#Label(window,text="Error! Something whent wrong!").place(x=0,y=0)
O = 'NaN'
#Any other case will return NaN to indicate that it is not possible to calculate
#end
elif A.is_Number==1:
O = 0;
#is a number
#end
return O
def checker(A):
#this function is no longer being used
#output: [c,p]
c = [0,0,0,0,0]
p = [0,0,0,0,0,0]
for i in range(0,6,1):
if A[i] == 1:
c[0] = c[0] + 1
p[i] = 0
elif (A[i] - 0.5) == 0:
c[1]= c[1] + 1
p[i] = 0
elif A[i] == 0:
c[2] = c[2] + 1
p[i] = 1
elif (A[i] + 0.5) == 0:
c[3] = c[3] + 1
p[i] = 0
elif (A[i]+1)==0:
c[4] = c[4] + 1
p[i] = 1
else:
sg.Popup("ERROR")
#Label(window,text="ERROR").place(x=1,y=1)
#end
#end
return c,p
#end
#ΤΡΙΠΛΑ ΚΑΡΤΕΣΙΑΝΕΣ
def ti_cc_main_func(array,language):
x, y, z = symbols('x y z')
x1, x2, y1, y2, z1, z2 = symbols('x1 x2 y1 y2 z1 z2')
f=sympify(array[0])
x1=sympify(array[1])
x2=sympify(array[2])
y1=sympify(array[3])
y2=sympify(array[4])
z1=sympify(array[5])
z2=sympify(array[6])
#Input Arguments:
# function f(x,y,z)
# x1 <= x <= x2 , y1 <= y <= y2 , z1 <= z <= z2
T = [0,1,2,3,4,5]
T[0] = my_has_sym(str(x1))
T[1] = my_has_sym(str(x2))
T[2] = my_has_sym(str(y1))
T[3] = my_has_sym(str(y2))
T[4] = my_has_sym(str(z1))
T[5] = my_has_sym(str(z2))
#print(T)
a = -1 in T
b = T[0]==1 or T[1]==1 or T[2]==2 or T[3]==2 or T[4]==3 or T[5]==3 or T[0] == 12 or T[1]==12 or T[0]==13 or T[1]==13 or T[2]==12 or T[2]==23 or T[3]==12 or T[3]==23 or T[4]==13 or T[4]==23 or T[5]==13 or T[5]==23
if b==False and a==False:
#print("ok")
c1 = 12 in T and 13 not in T and 23 not in T
c2 = 13 in T and 12 not in T and 23 not in T
c3 = 23 in T and 12 not in T and 13 not in T
c4 = 12 not in T and 13 not in T and 23 not in T
if c1 == True or c2 == True or c3 == True:
#print("case 1")
if T[4] == 12 or T[5] == 12:
#print("z1(x,y) and/or z2(x,y)")
if T[2] == 3 or T[3] == 3 or T[0] == 3 or T[1] == 3:
#print("wrong input")
I1 = 0
I2 = 0
I3 = 0
g = ""
else:
#print("ok")
if (T[0] == 2 or T[1] == 2) and (T[2] == 0 and T[3] == 0):
#print("x1(y) and/or x2(y) and y1 and y2 : const")
g = "dz dx dy"
I1 = integrate(f,(z,z1,z2))
I2 = integrate(I1,(x,x1,x2))
I3 = integrate(I2,(y,y1,y2))
elif (T[2] == 1 or T[3] == 1) and (T[0] == 0 and T[1] == 0):
#print("y1(x) and/or y2(x) and x1 and x2 : const")
g = "dz dy dx"
I1 = integrate(f,(z,z1,z2))
I2 = integrate(I1,(y,y1,y2))
I3 = integrate(I2,(x,x1,x2))
elif (T[0] == 0 and T[1] == 0 and T[2] == 0 and T[3] == 0):
#print("dz dx dy or dz dy dx")
g = "dz dx dy"
I1 = integrate(f,(z,z1,z2))
I2 = integrate(I1,(x,x1,x2))
I3 = integrate(I2,(y,y1,y2))
else:
#print("cannot calculate")
I1 = 0
I2 = 0
I3 = 0
g=""
elif T[2] == 13 or T[3] == 13:
#print("y1(x,z) and/or y2(x,z)")
if T[4] == 2 or T[5] == 2 or T[0] == 2 or T[1] == 2:
#print("wrong input")
I1 = 0
I2 = 0
I3 = 0
g=""
else:
#print("ok")
if (T[0] == 3 or T[1] == 3) and (T[4] == 0 and T[5] == 0):
#print("x1(z) and/or x2(z) and z1 and z2 : const")
g ="dy dx dz"
I1 = integrate(f,(y,y1,y2))
I2 = integrate(I1,(x,x1,x2))
I3 = integrate(I2,(z,z1,z2))
elif (T[4] == 1 or T[5] == 1) and (T[0] == 0 and T[1] == 0):
#print("z1(x) and/or z2(x) and x1 and x2 : const")
g = "dy dz dx"
I1 = integrate(f,(y,y1,y2))
I2 = integrate(I1,(z,z1,z2))
I3 = integrate(I2,(x,x1,x2))
elif (T[0] == 0 and T[1] == 0 and T[4] == 0 and T[5] == 0):
g = "dy dz dx"
I1 = integrate(f,(y,y1,y2))
I2 = integrate(I1,(z,z1,z2))
I3 = integrate(I2,(x,x1,x2))
else:
#print("cannot calculate")
I1 = 0
I2 = 0
I3 = 0
g=""
elif T[0] == 23 or T[1] == 23:
#print("x1(y,z) and/or x2(y,z)")
if T[2] == 1 or T[3] == 1 or T[4] == 1 or T[5] == 1:
#print("wrong input")
I1 = 0
I2 = 0
I3 = 0
g=""
else:
#print("ok")
if (T[2] == 3 or T[3] == 3) and (T[4] == 0 and T[5] == 0):
#print("y1(z) and/or y2(z) and z1 and z2 : const")
g = "dx dy dz"
I1 = integrate(f,(x,x1,x2))
I2 = integrate(I1,(y,y1,y2))
I3 = integrate(I2,(z,z1,z2))
elif (T[4] == 2 or T[5] == 2) and (T[2] == 0 and T[3] == 0):
#print("z1(y) and/or z2(y) and y1 and y2 : const")
g = "dx dz dy"
I1 = integrate(f,(x,x1,x2))
I2 = integrate(I1,(z,z1,z2))
I3 = integrate(I2,(y,y1,y2))
elif (T[2] == 0 and T[3] == 0 and T[4] == 0 and T[5] == 0):
g = "dx dy dz"
I1 = integrate(f,(x,x1,x2))
I2 = integrate(I1,(y,y1,y2))
I3 = integrate(I2,(z,z1,z2))
else:
#print("cannot calculate")
I1 = 0
I2 = 0
I3 = 0
g = ""
elif c4 == True:
#print("case 2")
d1 = (T[0] == 2 or T[1] == 2) and (T[2] == 1 or T[3] == 1)
d2 = (T[0] == 3 or T[1] == 3) and (T[4] == 1 or T[5] == 1)
d3 = (T[2] == 3 or T[3] == 2) and (T[4] == 2 or T[5] == 2)
if d1 == True or d2 == True or d3 == True:
#print("wrong input")
I1 = 0
I2 = 0
I3 = 0
g = ""
else:
#print("ok ...")
e1 = T[0]==0 and T[1]==0 and T[2]==0 and T[3]==0
e2 = T[0]==0 and T[1]==0 and T[4]==0 and T[5]==0
e3 = T[2]==0 and T[3]==0 and T[4]==0 and T[5]==0
if e1 == True:
#print("x1,x2,y1,y2 : const")
g = "dz dx dy"
I1 = integrate(f,(z,z1,z2))
I2 = integrate(I1,(x,x1,x2))
I3 = integrate(I2,(y,y1,y2))
elif e2 == True:
#print("x1,x2,z1,z2 : const")
g = "dy dx dz"
I1 = integrate(f,(y,y1,y2))
I2 = integrate(I1,(x,x1,x2))
I3 = integrate(I2,(z,z1,z2))
elif e3 == True:
#print("y1,y2,z1,z2 : const")
g = "dx dy dz"
I1 = integrate(f,(x,x1,x2))
I2 = integrate(I1,(y,y1,y2))
I3 = integrate(I2,(z,z1,z2))
else:
if T[0]==0 and T[1]==0:
#print("x1 and x2 : const")
if T[2]==3 or T[3]==3:
#print("y1(z) and/or y2(z)")
g = "dy dz dx"
I1 = integrate(f,(y,y1,y2))
I2 = integrate(I1,(z,z1,z2))
I3 = integrate(I2,(x,x1,x2))
elif (T[2]==1 or T[3]==1) and T[2]!=3 and T[3]!=3:
#print("y1(x) and/or y2(x)")
g = "dz dy dx"
I1 = integrate(f,(z,z1,z2))
I2 = integrate(I1,(y,y1,y2))
I3 = integrate(I2,(x,x1,x2))
elif T[4]==2 or T[5]==2:
#print("z1(y) and/or z2(y)")
g = "dz dy dx"
I1 = integrate(f,(z,z1,z2))
I2 = integrate(I1,(y,y1,y2))
I3 = integrate(I2,(x,x1,x2))
elif (T[4]==1 or T[5]==1) and T[2]!=2 and T[3]!=2:
#print("z1(x) and/or z2(x)")
g = "dy dz dx"
I1 = integrate(f,(y,y1,y2))
I2 = integrate(I1,(z,z1,z2))
I3 = integrate(I2,(x,x1,x2))
else:
#print("??? 1")
I1 = 0
I2 = 0
I3 = 0
g = ""
elif T[2]==0 and T[3]==0:
#print("y1 and y2 : const")
if T[0]==3 or T[1]==3:
#print("x1(z) and/or x2(z)")
g ="dx dz dy"
I1 = integrate(f,(x,x1,x2))
I2 = integrate(I1,(z,z1,z2))
I3 = integrate(I2,(y,y1,y2))
elif (T[0]==2 or T[1]==2) and T[0]!=3 and T[1]!=3:
#print("x1(y) and/or x2(y)")
g ="dz dx dy"
I1 = integrate(f,(z,z1,z2))
I2 = integrate(I1,(x,x1,x2))
I3 = integrate(I2,(y,y1,y2))
elif T[4]==1 or T[5]==1:
#print("z1(x) and/or z2(x)")
g = "dz dx dy"
I1 = integrate(f,(z,z1,z2))
I2 = integrate(I1,(x,x1,x2))
I3 = integrate(I2,(y,y1,y2))
elif (T[4]==2 or T[5]==2) and T[2]!=1 and T[3]!=1:
#print("z1(y) and/or z2(y)")
g = "dx dz dy"
I1 = integrate(f,(x,x1,x2))
I2 = integrate(I1,(z,z1,z2))
I3 = integrate(I2,(y,y1,y2))
else:
#print("??? 2")
I1 = 0
I2 = 0
I3 = 0
g = ""
elif T[4]==0 and T[5]==0:
#print("z1 and z2 : const")
if T[0]==2 or T[1]==2:
#print("x1(y) and/or x2(y)")
g = "dx dy dz"
I1 = integrate(f,(x,x1,x2))
I2 = integrate(I1,(y,y1,y2))
I3 = integrate(I2,(z,z1,z2))
elif (T[0]==3 or T[1]==3) and T[0]!=2 and T[1]!=2:
#print("x1(z) and/or x2(z)")
g = "dy dx dz"
I1= integrate(f,(y,y1,y2))
I2 = integrate(I1,(x,x1,x2))
I3 = integrate(I2,(z,z1,z2))
elif T[2]==1 or T[3]==1:
#print("y1(x) and/or y2(x)")
g = "dy dx dz"
I1= integrate(f,(y,y1,y2))
I2 = integrate(I1,(x,x1,x2))
I3 = integrate(I2,(z,z1,z2))
elif (T[2]==3 or T[3]==3) and T[2]!=1 and T[3]!=1:
#print("y1(z) and/or y2(z)")
g = "dx dy dz"
I1= integrate(f,(x,x1,x2))
I2 = integrate(I1,(y,y1,y2))
I3 = integrate(I2,(z,z1,z2))
else:
#print("??? 3")
I1 = 0
I2 = 0
I3 = 0
g = ""
else:
#print("wrong input")
I1=0
I2=0
I3=0
g = ""
else:
#print("not ok")
I1=0
I2=0
I3=0
g = ""
#print(I1)
#print(I2)
#print(I3)
if g =="dx dy dz":
#Label(window, text="A is Simple z.").place(x=csx,y=csy+30)
if language == 1:
mathtext_demos = {
"Header demo":
"Εισαγάγατε:"+r"$ \int ^{"+latex(z2)+"} _{"+latex(z1)+"} \int ^{"+latex(y2)+"} _{"+latex(y1)+"} \int ^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx dy dz$",
"Το πρώτο ολοκλήρωμα είναι:":
r"$I_1 = \int^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx $",
"Το οποίο δίνει το I1:":
r"$I_1 = "+latex(I1)+"$",
"Το δεύτερο ολοκλήρωμα είναι:":
r"$I_2 = \int^{"+latex(y2)+"}_{"+latex(y1)+"} "+latex(I1)+" dy $",
"Το οποίο δίνει το I2:":
r"$I_2 = "+latex(I2)+"$",
"Το τρίτο ολοκλήρωμα είναι:":
r"$I_3 = \int ^{"+latex(z2)+"} _{"+latex(z1)+"} "+latex(I2)+"dz $",
"Το οποίο δίνει το I3, το τελικό αποτέλεσμα:":
r"$I_3 = "+latex(I3)+"$"
}
elif language == 0:
mathtext_demos = {
"Header demo":
r"$You~entered: \int ^{"+latex(z2)+"} _{"+latex(z1)+"} \int ^{"+latex(y2)+"} _{"+latex(y1)+"} \int ^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx dy dz$",
"First Integral is:":
r"$I_1 = \int^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx $",
"which gives I1:":
r"$I_1 = "+latex(I1)+"$",
"Second Integral is: ":
r"$I_2 = \int^{"+latex(y2)+"}_{"+latex(y1)+"} "+latex(I1)+" dy $",
"which gives I2:":
r"$I_2 = "+latex(I2)+"$",
"Third Integral is:":
r"$I_3 = \int ^{"+latex(z2)+"} _{"+latex(z1)+"} "+latex(I2)+"dz $",
"which gives I3, the final result:":
r"$I_3 = "+latex(I3)+"$"
}
elif g =="dx dz dy":
if language == 1:
mathtext_demos = {
"Header demo":
"Εισαγάγατε:"+r"$ \int ^{"+latex(y2)+"} _{"+latex(y1)+"} \int ^{"+latex(z2)+"} _{"+latex(z1)+"} \int ^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx dz dy$",
"Το πρώτο ολοκλήρωμα είναι:":
r"$I_1 = \int^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx $",
"Το οποίο δίνει το I1:":
r"$I_1 = "+latex(I1)+"$",
"Το δεύτερο ολοκλήρωμα είναι:":
r"$I_2 = \int^{"+latex(z2)+"}_{"+latex(z1)+"} "+latex(I1)+" dz $",
"Το οποίο δίνει το I2:":
r"$I_2 = "+latex(I2)+"$",
"Το τρίτο ολοκλήρωμα είναι:":
r"$I_3 = \int ^{"+latex(y2)+"} _{"+latex(y1)+"} "+latex(I2)+"dy $",
"Το οποίο δίνει το I3, το τελικό αποτέλεσμα:":
r"$I_3 = "+latex(I3)+"$"
}
elif language == 1:
mathtext_demos = {
"Header demo":
r"$You~entered: \int ^{"+latex(y2)+"} _{"+latex(y1)+"} \int ^{"+latex(z2)+"} _{"+latex(z1)+"} \int ^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx dz dy$",
"First Integral is:":
r"$I_1 = \int^{"+latex(x2)+"} _{"+latex(x1)+"} "+latex(f)+" dx $",
"which gives I1:":
r"$I_1 = "+latex(I1)+"$",
"Second Integral is: ":
r"$I_2 = \int^{"+latex(z2)+"}_{"+latex(z1)+"} "+latex(I1)+" dz $",
"which gives I2:":
r"$I_2 = "+latex(I2)+"$",
"Third Integral is:":
r"$I_3 = \int ^{"+latex(y2)+"} _{"+latex(y1)+"} "+latex(I2)+"dy $",
"which gives I3, the final result:":
r"$I_3 = "+latex(I3)+"$"
}
elif g =="dy dx dz":
if language == 1:
mathtext_demos = {
"Header demo":
"Εισαγάγατε:"+r"$ \int ^{"+latex(z2)+"} _{"+latex(z1)+"} \int ^{"+latex(x2)+"} _{"+latex(x1)+"} \int ^{"+latex(y2)+"} _{"+latex(y1)+"} "+latex(f)+" dy dx dz$",
"Το πρώτο ολοκλήρωμα είναι:":
r"$I_1 = \int^{"+latex(y2)+"} _{"+latex(y1)+"} "+latex(f)+" dy $",
"Το οποίο δίνει το I1:":
r"$I_1 = "+latex(I1)+"$",
"Το δεύτερο ολοκλήρωμα είναι:":
r"$I_2 = \int^{"+latex(x2)+"}_{"+latex(x1)+"} "+latex(I1)+" dx $",
"Το οποίο δίνει το I2:":
r"$I_2 = "+latex(I2)+"$",
"Το τρίτο ολοκλήρωμα είναι:":
r"$I_3 = \int ^{"+latex(z2)+"} _{"+latex(z1)+"} "+latex(I2)+"dz $",
"Το οποίο δίνει το I3, το τελικό αποτέλεσμα:":
r"$I_3 = "+latex(I3)+"$"