text:
# zbMATH — the first resource for mathematics

## Li, Yanan

Compute Distance To:
 Author ID: li.yanan Published as: Li, Y.; Li, Y.-N.; Li, Ya Nan; Li, Ya’nan; Li, Ya-Nan; Li, Ya-nan; Li, Yanan
 Documents Indexed: 100 Publications since 1991
all top 5

#### Co-Authors

 2 single-authored 7 Wang, Yuguang 7 Yang, Zhijian 5 Sun, Shurong 5 Wang, Weidong 4 Ge, Shuzhi Sam 4 Han, Zhenlai 4 Yang, Chenguang 2 Deng, Dayong 2 Ding, Pengyan 2 Fu, Yongqing 2 Li, Guang 2 Li, Xingyuan 2 Liu, Leipo 2 Liu, Lily Li 2 Meng, Fanwei 2 Na, Jing 2 Sun, Yuangong 2 Wang, Wenshuai 2 Zhong, Junpei 1 Cai, Jinyang 1 Chen, Dongxiang 1 Chen, Guolan 1 Da, Fang 1 Deng, Yuxin 1 Ding, Jieyu 1 Feng, Guangqing 1 Feng, Hanwen 1 Feng, Jianwen 1 Feng, Na 1 Gao, Shoulan 1 Guo, Junyi 1 Guo, Xuebin 1 Hu, Yueqing 1 Huang, Houkuan 1 Jiang, Yiming 1 Lee, Tong Heng 1 Li, Bingxian 1 Li, Bowen 1 Li, Qiuping 1 Li, Yunzhang 1 Liu, Dong 1 Liu, JianWei 1 Liu, Jing 1 Liu, Ying 1 Lu, Hongling 1 Lu, Junan 1 Lu, Senkui 1 Lu, Zhiqi 1 Ma, Dan 1 Shen, Zhonghuan 1 Song, Hailiang 1 Sui, Meizhen 1 Tee, Keng Peng 1 Tian, Yazhou 1 Wang, Chen 1 Wang, Xingcheng 1 Wang, Yuquan 1 Wang, Zheng Joyce 1 Wang, Zizhong John 1 Wei, Juan 1 Wu, Qianhong 1 Wu, Xiaoqun 1 Xie, Yongqin 1 Xue, Huanhuan 1 Yang, Dianwu 1 Yang, Wei 1 Zeng, Ye 1 Zhang, Lin 1 Zhao, Junchan 1 Zhao, Ping 1 Zhao, Yige
all top 5

#### Serials

 4 Mathematics in Practice and Theory 3 International Journal of Control 2 Journal of the Franklin Institute 2 Applied Mathematics Letters 2 Complexity 2 Discrete and Continuous Dynamical Systems 2 Mathematical Problems in Engineering 2 Journal of Inequalities and Applications 2 Journal of Sichuan Normal University. Natural Science 1 Computers and Fluids 1 Computers & Mathematics with Applications 1 Journal of Mathematical Analysis and Applications 1 Applied Mathematics and Computation 1 Journal of Differential Equations 1 Journal of Mathematics. Wuhan University 1 Chinese Annals of Mathematics. Series A 1 Acta Automatica Sinica 1 Journal of Fudan University. Natural Science 1 International Journal of Bifurcation and Chaos in Applied Sciences and Engineering 1 Applied Mathematics. Series A (Chinese Edition) 1 The Electronic Journal of Combinatorics 1 Abstract and Applied Analysis 1 Taiwanese Journal of Mathematics 1 Chaos 1 Acta Mathematica Sinica. English Series 1 Communications in Nonlinear Science and Numerical Simulation 1 Discrete and Continuous Dynamical Systems. Series B 1 Journal of Henan Normal University. Natural Science 1 Journal of Applied Mathematics and Computing 1 Journal of Software 1 Journal of Shandong University. Natural Science 1 Advances in Difference Equations 1 Journal of Zhejiang Normal University. Natural Sciences 1 Boundary Value Problems 1 Acta Mathematica Sinica. Chinese Series 1 Communications in Computational Physics 1 Nonlinear Analysis. Hybrid Systems 1 Journal of Combinatorics and Number Theory 1 Acta Scientiarum Naturalium Universitatis Nankaiensis 1 Journal of Nonlinear Science and Applications 1 Evolution Equations and Control Theory 1 Journal of Function Spaces
all top 5

#### Fields

 13 Systems theory; control (93-XX) 12 Ordinary differential equations (34-XX) 9 Partial differential equations (35-XX) 7 Biology and other natural sciences (92-XX) 5 Dynamical systems and ergodic theory (37-XX) 5 Convex and discrete geometry (52-XX) 5 Computer science (68-XX) 4 Operator theory (47-XX) 3 Combinatorics (05-XX) 3 Calculus of variations and optimal control; optimization (49-XX) 3 Operations research, mathematical programming (90-XX) 3 Game theory, economics, finance, and other social and behavioral sciences (91-XX) 3 Information and communication theory, circuits (94-XX) 2 Number theory (11-XX) 2 Real functions (26-XX) 2 Harmonic analysis on Euclidean spaces (42-XX) 2 Fluid mechanics (76-XX) 1 General and overarching topics; collections (00-XX) 1 Linear and multilinear algebra; matrix theory (15-XX) 1 Nonassociative rings and algebras (17-XX) 1 Differential geometry (53-XX) 1 Probability theory and stochastic processes (60-XX) 1 Statistics (62-XX) 1 Numerical analysis (65-XX) 1 Mechanics of particles and systems (70-XX)

#### Citations contained in zbMATH

49 Publications have been cited 321 times in 288 Documents Cited by Year
Existence and uniqueness of solutions for a coupled system of multi-term nonlinear fractional differential equations. Zbl 1268.34028
Sun, Shurong; Li, Qiuping; Li, Yanan
2012
The existence of solutions for boundary value problem of fractional hybrid differential equations. Zbl 1352.34011
Sun, Shurong; Zhao, Yige; Han, Zhenlai; Li, Yanan
2012
New criteria for exponential stability of switched time-varying systems with delays and nonlinear disturbances. Zbl 1373.93271
Li, Yanan; Sun, Yuangong; Meng, Fanwei
2017
Computing the cover array in linear time. Zbl 0995.68189
Li, Yan; Smyth, W. F.
2002
Adaptive control of a class of discrete-time MIMO nonlinear systems with uncertain couplings. Zbl 1213.93108
Yang, Chenguang; Li, Yanan; Ge, Shuzhi Sam; Lee, Tong Heng
2010
Busemann-Petty problems for general $$L_p$$-intersection bodies. Zbl 1333.52010
Wang, Wei Dong; Li, Ya Nan
2015
Designable integrability of the variable coefficient nonlinear Schrödinger equations. Zbl 1220.35158
He, J.; Li, Y.
2011
Smale horseshoes and symbolic dynamics in perturbed nonlinear Schrödinger equations. Zbl 0960.37031
Li, Y.
1999
Lower bounds for the minimal sum coloring problem. Zbl 1237.90267
Moukrim, A.; Sghiouer, K.; Lucet, C.; Li, Y.
2010
Crossdocking - JIT scheduling with time windows. Zbl 1088.90026
Li, Y.; Lim, A.; Rodrigues, B.
2004
Exponential stabilization of switched time-varying systems with delays and disturbances. Zbl 1426.34101
Li, Yanan; Sun, Yuangong; Meng, Fanwei; Tian, Yazhou
2018
General $$L_p$$-intersection bodies. Zbl 1357.52012
Wang, Weidong; Li, Yanan
2015
An explicit series solution of the squeezing flow between two infinite plates by means of the homotopy analysis method. Zbl 1221.76158
Ran, X. J.; Zhu, Q. Y.; Li, Y.
2009
Smoothed point interpolation method for elastoplastic analysis. Zbl 1359.74455
Zhang, G. Y.; Li, Y.; Gao, X. X.; Hui, D.; Wang, S. Q.; Zong, Z.
2015
Li, Y.; Ramesh, K. T.; Chin, E. S. C.
2001
The precise finite strip method. Zbl 0967.74597
Zhong, W. X.; Cheung, Y. K.; Li, Y.
1998
A priori and a posteriori evaluations of sub-grid scale models for the Burgers’ equation. Zbl 1390.76185
Li, Yanan; Wang, Z. J.
2016
Learning impedance control for physical robot-environment interaction. Zbl 1282.93188
Li, Yanan; Ge, Shuzhi Sam; Yang, Chenguang
2012
Global attractor of the Kirchhoff wave models with strong nonlinear damping. Zbl 1378.35037
Ding, Pengyan; Yang, Zhijian; Li, Yanan
2018
Finite integration method with radial basis function for solving stiff problems. Zbl 1402.65051
Li, Yan; Hon, Yiu-Chung
2017
A brief review of neural networks based learning and control and their applications for robots. Zbl 1377.93079
Jiang, Yiming; Yang, Chenguang; Na, Jing; Li, Guang; Li, Yanan; Zhong, Junpei
2017
Multi-point boundary value problems for a class of Riemann-Liouville fractional differential equations. Zbl 1417.34015
Li, Bingxian; Sun, Shurong; Li, Yanan; Zhao, Ping
2014
The $$L_p$$-dual mixed geominimal surface area for multiple star bodies. Zbl 1335.52009
Li, Yanan; Wang, Weidong
2014
Three-point boundary value problems of fractional functional differential equations with delay. Zbl 1301.47102
Li, Yanan; Sun, Shurong; Yang, Dianwu; Han, Zhenlai
2013
Diffeomorphic matching and dynamic deformable surfaces in 3D medical imaging. Zbl 1283.49029
Azencott, R.; Glowinski, R.; He, J.; Jajoo, A.; Li, Y.; Martynenko, A.; Hoppe, R. H. W.; Benzekry, S.; Little, S. H.; Zoghbi, W. A.
2010
Port space allocation with a time dimension. Zbl 1177.90267
Fu, Z.; Li, Y.; Lim, A.; Rodrigues, B.
2007
Neural network for complex systems: theory and applications. Zbl 1390.00127
Yang, Chenguang (ed.); Na, Jing (ed.); Li, Guang (ed.); Li, Yanan (ed.); Zhong, Junpei (ed.)
2018
Towards industrial large eddy simulation using the FR/CPR method. Zbl 1390.76236
Wang, Zhi Jian; Li, Yanan; Jia, Feilin; Laskowski, G. M.; Kopriva, Jim; Paliath, U.; Bhaskaran, Rathakrishnan
2017
Evolutionary behavior of generalized zero-determinant strategies in iterated prisoner’s dilemma. Zbl 1400.91051
Liu, Jie; Li, Y.; Xu, C.; Hui, P. M.
2015
Impedance adaptation for optimal robot-environment interaction. Zbl 1317.93191
Ge, Shuzhi Sam; Li, Yanan; Wang, Chen
2014
The multi-axial deformation behavior of bulk metallic glasses at high homologous temperatures. Zbl 1183.74049
Ekambaram, R.; Thamburaja, P.; Yang, H.; Li, Y.; Nikabdullah, N.
2010
An experimental study of fixed points and chaos in the motion of spheres in a Stokes flow. Zbl 1136.76305
Mullin, T.; Li, Y.; Del Pino, C.; Ashmore, J.
2005
Criteria on the existence and stability of pullback exponential attractors and their application to non-autonomous Kirchhoff wave models. Zbl 1398.37085
Yang, Zhijian; Li, Yanan
2018
The existence of positive solutions for boundary value problem of the fractional Sturm-Liouville functional differential equation. Zbl 1295.34086
Li, Yanan; Sun, Shurong; Han, Zhenlai; Lu, Hongling
2013
Numerical simulation of the transient heat and liquid moisture transfer through porous textiles with consideration of electric double layer. Zbl 1183.80085
Zhu, Q. Y.; Li, Y.
2010
On analogues of the Hilbert’s inequality. Zbl 1165.26326
He, B.; Li, Y.; Qian, Y.
2008
Simulations of nonlinear fracture process zone in cementitious material - A boundary element approach. Zbl 0731.73068
Liang, R. Y. K.; Li, Y.-N.
1991
Robust attractors for a perturbed non-autonomous extensible beam equation with nonlinear nonlocal damping. Zbl 1440.37074
Li, Yanan; Yang, Zhijian; Da, Fang
2019
Upper semicontinuity of pullback attractors for non-autonomous Kirchhoff wave equations. Zbl 1422.37058
Yang, Zhijian; Li, Yanan
2019
The $$U(n)$$ Gelfand-Zeitlin system as a tropical limit of Ginzburg-Weinstein diffeomorphisms. Zbl 1407.53092
Alekseev, A.; Lane, J.; Li, Y.
2018
$$L_p$$-dual geominimal surface areas for the general $$L_p$$-intersection bodies. Zbl 1412.52004
Shen, Zhonghuan; Li, Yanan; Wang, Weidong
2017
A mathematical analysis of scale similarity. Zbl 1373.76051
Wang, Z. J.; Li, Yanan
2017
Uniform attractors for nonclassical diffusion equations with memory. Zbl 1343.35038
Xie, Yongqin; Li, Yanan; Zeng, Ye
2016
Existence results for boundary value problems of fractional functional differential equations with delay. Zbl 1347.47053
Han, Zhenlai; Li, Yanan; Sui, Meizhen
2016
Chaos $$M$$-ary modulation and demodulation method based on Hamilton oscillator and its application in communication. Zbl 1319.94010
Fu, Yongqing; Li, Xingyuan; Li, Yanan; Yang, Wei; Song, Hailiang
2013
Identification of pleonastic it using the web. Zbl 1182.68320
Li, Y.; Musilek, P.; Reformat, M.; Wyard-Scott, L.
2009
A desired load distribution model for scheduling of unrelated parallel machines. Zbl 1095.90043
Li, Y.; Shen, Weiming; Ghenniwa, H.; Wang, C.
2005
Turbulence modeling for computing viscous high-Reynolds-number flows on unstructured meshes. Zbl 1172.76331
Liu, C. H.; Li, Y.
2001
Tables of critical values for two group interim analyses. Zbl 0850.62940
Hewett, J. E.; Petroski, G. F.; Li, Y.
1995
Robust attractors for a perturbed non-autonomous extensible beam equation with nonlinear nonlocal damping. Zbl 1440.37074
Li, Yanan; Yang, Zhijian; Da, Fang
2019
Upper semicontinuity of pullback attractors for non-autonomous Kirchhoff wave equations. Zbl 1422.37058
Yang, Zhijian; Li, Yanan
2019
Exponential stabilization of switched time-varying systems with delays and disturbances. Zbl 1426.34101
Li, Yanan; Sun, Yuangong; Meng, Fanwei; Tian, Yazhou
2018
Global attractor of the Kirchhoff wave models with strong nonlinear damping. Zbl 1378.35037
Ding, Pengyan; Yang, Zhijian; Li, Yanan
2018
Neural network for complex systems: theory and applications. Zbl 1390.00127
Yang, Chenguang (ed.); Na, Jing (ed.); Li, Guang (ed.); Li, Yanan (ed.); Zhong, Junpei (ed.)
2018
Criteria on the existence and stability of pullback exponential attractors and their application to non-autonomous Kirchhoff wave models. Zbl 1398.37085
Yang, Zhijian; Li, Yanan
2018
The $$U(n)$$ Gelfand-Zeitlin system as a tropical limit of Ginzburg-Weinstein diffeomorphisms. Zbl 1407.53092
Alekseev, A.; Lane, J.; Li, Y.
2018
New criteria for exponential stability of switched time-varying systems with delays and nonlinear disturbances. Zbl 1373.93271
Li, Yanan; Sun, Yuangong; Meng, Fanwei
2017
Finite integration method with radial basis function for solving stiff problems. Zbl 1402.65051
Li, Yan; Hon, Yiu-Chung
2017
A brief review of neural networks based learning and control and their applications for robots. Zbl 1377.93079
Jiang, Yiming; Yang, Chenguang; Na, Jing; Li, Guang; Li, Yanan; Zhong, Junpei
2017
Towards industrial large eddy simulation using the FR/CPR method. Zbl 1390.76236
Wang, Zhi Jian; Li, Yanan; Jia, Feilin; Laskowski, G. M.; Kopriva, Jim; Paliath, U.; Bhaskaran, Rathakrishnan
2017
$$L_p$$-dual geominimal surface areas for the general $$L_p$$-intersection bodies. Zbl 1412.52004
Shen, Zhonghuan; Li, Yanan; Wang, Weidong
2017
A mathematical analysis of scale similarity. Zbl 1373.76051
Wang, Z. J.; Li, Yanan
2017
A priori and a posteriori evaluations of sub-grid scale models for the Burgers’ equation. Zbl 1390.76185
Li, Yanan; Wang, Z. J.
2016
Uniform attractors for nonclassical diffusion equations with memory. Zbl 1343.35038
Xie, Yongqin; Li, Yanan; Zeng, Ye
2016
Existence results for boundary value problems of fractional functional differential equations with delay. Zbl 1347.47053
Han, Zhenlai; Li, Yanan; Sui, Meizhen
2016
Busemann-Petty problems for general $$L_p$$-intersection bodies. Zbl 1333.52010
Wang, Wei Dong; Li, Ya Nan
2015
General $$L_p$$-intersection bodies. Zbl 1357.52012
Wang, Weidong; Li, Yanan
2015
Smoothed point interpolation method for elastoplastic analysis. Zbl 1359.74455
Zhang, G. Y.; Li, Y.; Gao, X. X.; Hui, D.; Wang, S. Q.; Zong, Z.
2015
Evolutionary behavior of generalized zero-determinant strategies in iterated prisoner’s dilemma. Zbl 1400.91051
Liu, Jie; Li, Y.; Xu, C.; Hui, P. M.
2015
Multi-point boundary value problems for a class of Riemann-Liouville fractional differential equations. Zbl 1417.34015
Li, Bingxian; Sun, Shurong; Li, Yanan; Zhao, Ping
2014
The $$L_p$$-dual mixed geominimal surface area for multiple star bodies. Zbl 1335.52009
Li, Yanan; Wang, Weidong
2014
Impedance adaptation for optimal robot-environment interaction. Zbl 1317.93191
Ge, Shuzhi Sam; Li, Yanan; Wang, Chen
2014
Three-point boundary value problems of fractional functional differential equations with delay. Zbl 1301.47102
Li, Yanan; Sun, Shurong; Yang, Dianwu; Han, Zhenlai
2013
The existence of positive solutions for boundary value problem of the fractional Sturm-Liouville functional differential equation. Zbl 1295.34086
Li, Yanan; Sun, Shurong; Han, Zhenlai; Lu, Hongling
2013
Chaos $$M$$-ary modulation and demodulation method based on Hamilton oscillator and its application in communication. Zbl 1319.94010
Fu, Yongqing; Li, Xingyuan; Li, Yanan; Yang, Wei; Song, Hailiang
2013
Existence and uniqueness of solutions for a coupled system of multi-term nonlinear fractional differential equations. Zbl 1268.34028
Sun, Shurong; Li, Qiuping; Li, Yanan
2012
The existence of solutions for boundary value problem of fractional hybrid differential equations. Zbl 1352.34011
Sun, Shurong; Zhao, Yige; Han, Zhenlai; Li, Yanan
2012
Learning impedance control for physical robot-environment interaction. Zbl 1282.93188
Li, Yanan; Ge, Shuzhi Sam; Yang, Chenguang
2012
Designable integrability of the variable coefficient nonlinear Schrödinger equations. Zbl 1220.35158
He, J.; Li, Y.
2011
Adaptive control of a class of discrete-time MIMO nonlinear systems with uncertain couplings. Zbl 1213.93108
Yang, Chenguang; Li, Yanan; Ge, Shuzhi Sam; Lee, Tong Heng
2010
Lower bounds for the minimal sum coloring problem. Zbl 1237.90267
Moukrim, A.; Sghiouer, K.; Lucet, C.; Li, Y.
2010
Diffeomorphic matching and dynamic deformable surfaces in 3D medical imaging. Zbl 1283.49029
Azencott, R.; Glowinski, R.; He, J.; Jajoo, A.; Li, Y.; Martynenko, A.; Hoppe, R. H. W.; Benzekry, S.; Little, S. H.; Zoghbi, W. A.
2010
The multi-axial deformation behavior of bulk metallic glasses at high homologous temperatures. Zbl 1183.74049
Ekambaram, R.; Thamburaja, P.; Yang, H.; Li, Y.; Nikabdullah, N.
2010
Numerical simulation of the transient heat and liquid moisture transfer through porous textiles with consideration of electric double layer. Zbl 1183.80085
Zhu, Q. Y.; Li, Y.
2010
An explicit series solution of the squeezing flow between two infinite plates by means of the homotopy analysis method. Zbl 1221.76158
Ran, X. J.; Zhu, Q. Y.; Li, Y.
2009
Identification of pleonastic it using the web. Zbl 1182.68320
Li, Y.; Musilek, P.; Reformat, M.; Wyard-Scott, L.
2009
On analogues of the Hilbert’s inequality. Zbl 1165.26326
He, B.; Li, Y.; Qian, Y.
2008
Port space allocation with a time dimension. Zbl 1177.90267
Fu, Z.; Li, Y.; Lim, A.; Rodrigues, B.
2007
An experimental study of fixed points and chaos in the motion of spheres in a Stokes flow. Zbl 1136.76305
Mullin, T.; Li, Y.; Del Pino, C.; Ashmore, J.
2005
A desired load distribution model for scheduling of unrelated parallel machines. Zbl 1095.90043
Li, Y.; Shen, Weiming; Ghenniwa, H.; Wang, C.
2005
Crossdocking - JIT scheduling with time windows. Zbl 1088.90026
Li, Y.; Lim, A.; Rodrigues, B.
2004
Computing the cover array in linear time. Zbl 0995.68189
Li, Yan; Smyth, W. F.
2002
Li, Y.; Ramesh, K. T.; Chin, E. S. C.
2001
Turbulence modeling for computing viscous high-Reynolds-number flows on unstructured meshes. Zbl 1172.76331
Liu, C. H.; Li, Y.
2001
Smale horseshoes and symbolic dynamics in perturbed nonlinear Schrödinger equations. Zbl 0960.37031
Li, Y.
1999
The precise finite strip method. Zbl 0967.74597
Zhong, W. X.; Cheung, Y. K.; Li, Y.
1998
Tables of critical values for two group interim analyses. Zbl 0850.62940
Hewett, J. E.; Petroski, G. F.; Li, Y.
1995
Simulations of nonlinear fracture process zone in cementitious material - A boundary element approach. Zbl 0731.73068
Liang, R. Y. K.; Li, Y.-N.
1991
all top 5

#### Cited by 616 Authors

 13 Wang, Weidong 11 Sun, Shurong 10 Han, Zhenlai 10 Iliopoulos, Costas S. 10 Li, Yanan 10 Sun, Yuangong 8 Radoszewski, Jakub 7 Meng, Fanwei 7 Pissis, Solon P. 7 Rytter, Wojciech 7 Waleń, Tomasz 6 Kociumaka, Tomasz 5 Crochemore, Maxime 5 Ntouyas, Sotiris K. 5 Smyth, William F. 5 Wang, Jinrong 5 Yu, Miao 4 Amir, Amihood 4 Christou, Michalis 4 Li, Y. Charles 4 Sun, Ying 4 Yan, Rian 4 Zhao, Yulin 3 Ahmad, Bashir 3 Arguillère, Sylvain 3 Benchohra, Mouffak 3 Hao, Jin-Kao 3 Huang, Deqing 3 Islam, Saeed 3 Khan, Hamid 3 Kubica, Marcin 3 Liu, Yanjun 3 Lu, Hongling 3 Ur Rehman, Mujeeb 3 Wu, Ranchao 3 Yang, Zhijian 3 Younes, Laurent 3 Yu, Fajun 3 Zhai, Chengbo 3 Zhang, Yuruo 3 Zhao, Yige 3 Zhu, Xingao 2 Afrouzi, Ghasem Alizadeh 2 Akhlaghi, Mehdi 2 Bhaskaran, Rathakrishnan 2 Boukamel, Adnane 2 Bouriah, Soufyane 2 Bouziri, Hend 2 Boysen, Nils 2 Cai, Jingwei 2 Caristi, Giuseppe 2 Carlo, Héctor J. 2 Chai, Yingbin 2 Chen, Haibo 2 Chen, Weisheng 2 Fečkan, Michal 2 Feng, Wenquan 2 Feng, Yibin 2 Fu, Ke 2 Ge, Shuzhi Sam 2 Gong, Zhixiong 2 Guo, Qing 2 Guth, Ondrej 2 He, Jingsong 2 Heidarkhani, Shapour 2 Hon, Yiu-Chung 2 Hu, Dongpo 2 Hu, Wei 2 Ichinose, Genki 2 Jia, Feilin 2 Jin, Yan 2 Laskowski, Gregory M. 2 Lejeunes, Stéphane 2 Levy, Avivit 2 Li, Dongjuan 2 Li, Jing 2 Li, Tian 2 Li, Tianyun 2 Li, Zhaofeng 2 Liu, Yuji 2 Lubin, Ronit 2 Lucet, Corinne 2 Miao, Zhaowei 2 Moradi, Shahin 2 Niazi, Azmat Ullah Khan 2 Nieto Roig, Juan Jose 2 Paliath, Umesh 2 Pei, Yanni 2 Qiu, Jianlong 2 Rahman, Mohammad Sohel 2 Rashidi, Mohammad Mehdi 2 Sam, C. N. 2 Shah, Inayat Ali 2 Shen, Zhonghuan 2 Sun, Jianhua 2 Sun, Liying 2 Szreder, Bartosz 2 Tariboon, Jessada 2 Thamburaja, Prakash 2 Tian, Yazhou ...and 516 more Authors
all top 5

#### Cited in 115 Serials

 21 Advances in Difference Equations 12 Mathematical Problems in Engineering 10 Applied Mathematics and Computation 10 Complexity 10 Nonlinear Dynamics 9 Theoretical Computer Science 9 Journal of Applied Mathematics and Computing 9 Boundary Value Problems 8 International Journal of Control 7 Engineering Analysis with Boundary Elements 7 Journal of Inequalities and Applications 6 Abstract and Applied Analysis 5 Journal of the Franklin Institute 5 Computers & Operations Research 4 Computers and Fluids 4 Journal of Computational Physics 4 Chaos, Solitons and Fractals 4 Information Sciences 3 Discrete Applied Mathematics 3 Journal of Fluid Mechanics 3 Journal of Computational and Applied Mathematics 3 Algorithmica 3 International Journal of Adaptive Control and Signal Processing 3 International Journal of Bifurcation and Chaos in Applied Sciences and Engineering 3 Discrete Dynamics in Nature and Society 3 International Journal of Computational Methods 3 Journal of Mathematical Inequalities 2 Acta Mechanica 2 Journal of Mathematical Analysis and Applications 2 Journal of Mathematical Physics 2 Journal of Differential Equations 2 Studies in Applied Mathematics 2 Journal of Scientific Computing 2 Annals of Operations Research 2 International Journal of Foundations of Computer Science 2 Applied Mathematical Modelling 2 European Journal of Operational Research 2 International Journal of Computer Mathematics 2 Archive of Applied Mechanics 2 Wuhan University Journal of Natural Sciences (WUJNS) 2 Journal of Nonlinear Mathematical Physics 2 OR Spectrum 2 Journal of Discrete Algorithms 2 SIAM Journal on Imaging Sciences 2 Journal of Nonlinear Science and Applications 2 Journal of Theoretical Biology 2 Evolution Equations and Control Theory 2 Journal of Function Spaces 1 Applicable Analysis 1 Computers & Mathematics with Applications 1 International Journal of Heat and Mass Transfer 1 International Journal of Solids and Structures 1 Information Processing Letters 1 Journal of the Mechanics and Physics of Solids 1 Mathematical Methods in the Applied Sciences 1 Physica A 1 Acta Universitatis Palackianae Olomucensis. Facultas Rerum Naturalium. Mathematica 1 Automatica 1 International Journal of Mathematics and Mathematical Sciences 1 Meccanica 1 Memoirs of the American Mathematical Society 1 Proceedings of the American Mathematical Society 1 Quaestiones Mathematicae 1 Quarterly of Applied Mathematics 1 European Journal of Combinatorics 1 Circuits, Systems, and Signal Processing 1 International Journal of Production Research 1 Applied Numerical Mathematics 1 Journal of Computer Science and Technology 1 Computational Mechanics 1 COMPEL 1 Numerical Methods for Partial Differential Equations 1 Mathematical and Computer Modelling 1 Neural Networks 1 Aequationes Mathematicae 1 Journal de Mathématiques Pures et Appliquées. Neuvième Série 1 Computational Statistics and Data Analysis 1 Continuum Mechanics and Thermodynamics 1 SIAM Journal on Scientific Computing 1 Communications in Numerical Methods in Engineering 1 Russian Journal of Mathematical Physics 1 Physics of Fluids 1 Computational and Applied Mathematics 1 Bulletin des Sciences Mathématiques 1 Transformation Groups 1 Mathematical Physics, Analysis and Geometry 1 Chaos 1 European Journal of Mechanics. A. Solids 1 Communications in Nonlinear Science and Numerical Simulation 1 Engineering Computations 1 RAIRO. Operations Research 1 Qualitative Theory of Dynamical Systems 1 Archives of Computational Methods in Engineering 1 Dynamics of Continuous, Discrete & Impulsive Systems. Series A. Mathematical Analysis 1 Dynamical Systems 1 Journal of Applied Mathematics 1 Acta Mathematica Scientia. Series B. (English Edition) 1 JMMA. Journal of Mathematical Modelling and Algorithms 1 Journal of Intelligent and Fuzzy Systems 1 Journal of Industrial and Management Optimization ...and 15 more Serials
all top 5

#### Cited in 35 Fields

 77 Ordinary differential equations (34-XX) 58 Systems theory; control (93-XX) 43 Computer science (68-XX) 35 Partial differential equations (35-XX) 28 Mechanics of deformable solids (74-XX) 28 Fluid mechanics (76-XX) 27 Dynamical systems and ergodic theory (37-XX) 25 Operations research, mathematical programming (90-XX) 21 Numerical analysis (65-XX) 17 Operator theory (47-XX) 17 Convex and discrete geometry (52-XX) 11 Biology and other natural sciences (92-XX) 10 Real functions (26-XX) 9 Combinatorics (05-XX) 8 Calculus of variations and optimal control; optimization (49-XX) 7 Global analysis, analysis on manifolds (58-XX) 5 Difference and functional equations (39-XX) 4 Integral equations (45-XX) 4 Probability theory and stochastic processes (60-XX) 4 Information and communication theory, circuits (94-XX) 3 Classical thermodynamics, heat transfer (80-XX) 3 Quantum theory (81-XX) 3 Game theory, economics, finance, and other social and behavioral sciences (91-XX) 2 Special functions (33-XX) 2 Approximations and expansions (41-XX) 2 Differential geometry (53-XX) 2 Statistics (62-XX) 2 Mechanics of particles and systems (70-XX) 1 History and biography (01-XX) 1 Algebraic geometry (14-XX) 1 $$K$$-theory (19-XX) 1 Geometry (51-XX) 1 General topology (54-XX) 1 Optics, electromagnetic theory (78-XX) 1 Statistical mechanics, structure of matter (82-XX)


text:
## AravindG Group Title find the no: of integral solutions of inequation x+y+z+u<=65 2 years ago 2 years ago

1. FoolForMath Group Title

0 is included?

2. FoolForMath Group Title

I can do this using binomial coefficients.

3. AravindG Group Title

i dont know tht fool

4. FoolForMath Group Title

Using stars and bars, the answer is given by $\huge \sum \limits_{n=0}^{65} \binom{n+3}{3}$

5. satellite73 Group Title

can't wait to see this

6. satellite73 Group Title

stars and bars??

7. AravindG Group Title

hw?

8. FoolForMath Group Title
9. moneybird Group Title

this question is like putting three bookmarks in a book

10. satellite73 Group Title

how cool is that? stars and bars, nice visual!

11. FoolForMath Group Title

Yeah it's coool :D

12. AravindG Group Title

coool

13. shaan_iitk Group Title

One can also think logically and get the solution .. say you have x+y+z+u <= k (some integer) and you have to find the number of solutions then it is like finding the number of ways where k sweets can be distributed to 4 kids and total sweets distributed may not be equal to k. Now lets imagine a situation where we have 4 women and k men. How many ways of arranging them? (4+k)!/(4!*k!) Now say I say that all men who come to the left of any woman are given to that woman (not literally) .. then we have solved our distribution problem and hence our equation.. so I believe the answer should be 69!/(4!*65!)

14. FoolForMath Group Title

@shaan_iitk How do you think stars and bars work? That is exactly the same thing you elaborated.

15. shaan_iitk Group Title

means?

16. shaan_iitk Group Title

Sorry but I am not aware of stars and bars ..

17. FoolForMath Group Title

I have posted the url before.

18. shaan_iitk Group Title

okk .. I didn't look at that.. I only looked at your expression which was in summation form.. I thought logically we don't need that summation..

format: plain


text:
# Complexity

## Overview

• Complexity classes are a way of categorizing problems by difficulty
• There are two kind of problems: search and verification problems

### Example: Sorting

• Search version: input a list of numbers X and output same list in sorted order (call it Y)
• Verification version: input a list of numbers X and another list Y, and output "YES" if Y is sorted version of X, "NO" otherwise

## Classes

### P

• Problems are in this class, if there exists a PTIME (polynomial-time, runs in $$O(f(n))$$, where $$f$$ is polynomial) algorithm that solves the problem

### NP

• Problems are in this class, if there exists a PTIME algorithm, that verifies the problem, but are not necessarily solveable in PTIME

Reducibility: Given an instance of a hard problem, we can construct an instance of another problem, whose solution will also solve the first problem

#### NP-complete

• If two problems in NP can be reduced to each other, are in this class
• A solution for any of these would give us a solution to all of these problems

#### NP-hard

• These problems are at least as hard as the hardest problem in NP-complete

### P vs. NP

Is P=NP?

• Yes: $$P = NP$$ means that for every problem that has an efficiently verifiable solution, we can find that solution efficiently as well
• No: $$P \neq NP$$ means that it is impossible to find a general algorithm that will correctly and accurately solve an NP-complete problem all the time

## References

Last update: November 23, 2020


text:
# Rider optimization algorithm

Developed by Binu D[1] Metaheuristics[2][circular reference] 2019[1] IEEE[1] Matlab[3] 49[4]

The rider optimization algorithm (ROA)[1][5][6] is devised based on a novel computing method, namely fictional computing that undergoes series of process to solve the issues of optimizations using imaginary facts and notions. ROA relies on the groups of rider that struggle to reach the target. ROA employs rider groups that take a trip to reach common target in order to become winner. In ROA, the count of groups is four wherein equal riders are placed.

The four groups adapted in ROA are attacker, overtaker, follower, and bypass rider. Each group undergoes series of strategy to attain the target. The goal of bypass rider is to attain target by bypassing leader’s path. The follower tries to follow the position of leader in axis. Furthermore, the follower employs multidirectional search space considering leading rider, which is useful for algorithm as it improves convergence rate. The overtaker undergoes its own position to attain target considering nearby locations of leader. The benefit of overtaker is that it facilitates faster convergence with huge global neighbourhood. As per ROA, the global optimal convergence is function of overtaker, whose position relies on the position of the leader, success rate, and directional indicator. The attacker adapts position of leader to accomplish destination by using its utmost speed. Moreover, it is responsible for initializing the multidirectional search using fast search for accelerating search speed.

Despite the riders undergoes a specific method, the major factors employed for reaching the target are correct riding of vehicles and proper management of accelerator, steering, brake and gear. At each time instance, the riders alter its position towards target by regulating these factors and follow the prescribed method using current success rate. The leader is defined using the success rate at current instance. The process is repeated till the riders go into off time that is maximal instant provided to riders to attain intended location. After reaching off time, the rider at leading position is termed winner.

## Algorithm

The ROA[1][5][6] is motivated from riders, who contend to reach anticipated location. The steps employed in ROA algorithm are defined below:

### Initialization of Rider and other algorithmic parameters

The foremost step is the initialization of algorithm which is done using four groups of riders represented as $\displaystyle{ V }$, and initializations of its positions are performed in arbitrary manner. The initialization of group is given by,

$\displaystyle{ S_l=\{S_l(v,k)\};1\leq v \leq P , 1\leq k \leq W }$

(1)

where, $\displaystyle{ P }$ signifies count of riders, and $\displaystyle{ S_l(v,k) }$signifies position of $\displaystyle{ v^{th} }$ rider in $\displaystyle{ k^{th} }$ size at $\displaystyle{ l^{th} }$ time instant.

The count of riders is evaluated with count of riders of each group and is expressed as,

$\displaystyle{ P=B+J+O+A+K }$

(2)

where, $\displaystyle{ B }$ signifies bypass rider, $\displaystyle{ J }$ represent follower, $\displaystyle{ O }$ signifies overtaker, $\displaystyle{ A }$ represent attacker, and $\displaystyle{ K }$ signifies rag bull rider. Hence, the relation amongst the aforementioned attributes is represented as,

$\displaystyle{ B+J+O+A+K=\frac{P}{5} }$

(3)

### Finding rate of success

After rider group parameters initialization, the rate of success considering each rider is evaluated. The rate of success is computed with distance and is measured between rider location and target and is formulated as,

$\displaystyle{ Success rate=\frac{1}{\|S_v-l_t\|} }$

(4)

where,$\displaystyle{ S_v }$ symbolize position of $\displaystyle{ v^{th} }$ rider and $\displaystyle{ l_t }$ indicate target position. To elevate rate of success, distance must be minimized and hence, distance reciprocal offers the success rate of rider.

### Determination of leading rider

The rate of success is employed as significant part in discovering leader. The rider that reside in near target location is supposed to contain highest rate of success.

### Evaluate the rider’s update position

The position of rider in each group is updated to discover rider at leading position and hence is winner. Thus, the rider update the position using the features of each rider defined on the definition. The update position of each rider is explained below:

The follower has an inclination to update position based on location of leading rider to attain target in quick manner and is expressed as,

$\displaystyle{ S_{l+1}^f(v,o)=S^G(G,o)+[cos(\varphi_{v,o}^l*S^G(G,o)*\partial_v^l)] }$

(5)

where, $\displaystyle{ o }$ signifies coordinate selector, $\displaystyle{ S^G }$ represent leading rider position, $\displaystyle{ G }$ indicate leader’s index, $\displaystyle{ \varphi_{v,o}^l }$signifies angle of steering considering $\displaystyle{ v^{th} }$ rider in $\displaystyle{ o^{th} }$coordinate, and $\displaystyle{ \partial_v^l }$ represent distance.

The overtaker’s update position is utilized to elevate rate of success by discovering overtaker position and is represented as,

$\displaystyle{ S_{l+1}^o(v,o)=S_l(v,o)+[D_l^*\bigl(v\bigr)*S^G(G,o)] }$

(6)

where, $\displaystyle{ D_l^*\bigl(v\bigr) }$signifies direction indicator.

The attacker contains an inclination to confiscate the leaders position by following the leader’s update process and is expressed as,

$\displaystyle{ S_{l+1}^a(v,\rho)=S^G(G,\rho)+[cos\varphi_{v,\rho}^l*S^G(G,\rho)]+\partial_v^l }$

(7)

Here, the update rule of bypass riders is exhibited wherein standard bypass rider is expressed as,

$\displaystyle{ S_{l+1}^b(v,\rho)=\lambda[S_l(\chi,\rho)*\delta(\rho)+S_l(\xi,\rho)*[1-\delta(\rho)]] }$

(8)

where, $\displaystyle{ \lambda }$ signifies random number, $\displaystyle{ \chi }$ symbolize random number between 1 to $\displaystyle{ P }$ , $\displaystyle{ \xi }$ indicate a random number ranging between 1 to $\displaystyle{ P }$ and $\displaystyle{ \delta }$ represent random number between 0 and 1.

### Finding success rate

After executing process of update, the rate of success considering each rider is computed.

### Update of Rider parameter

The parameter of rider’s update is important to discover an effective solution. Moreover, the steering angle, gears are updated with activity counter, and are updated with success rate.

### Off time of rider

The procedure is iterated repeatedly till $\displaystyle{ L_{OFF} }$ wherein, leader is discovered. After race completion, the leading rider is considered as winner.

The pseudo code of ROA is portrayed in table 1.

 Input: $\displaystyle{ S_l }$:Arbitrary rider position, $\displaystyle{ l }$: iteration, $\displaystyle{ L }$:maximum iteration Output: Leading rider $\displaystyle{ S^G }$ Begin Initialize solution set Initialize other parameter of rider. Find rate of success using equation (4) While $\displaystyle{ l\lt L_{OFF} }$ For $\displaystyle{ v=1 to P }$ Update position of follower using equation (5) Update position of overtaker with equation (6) Update position of attacker with equation (7) Update position of bypass rider with equation (8) Rank the riders based on success rate using equation (4) Select the rider with high success rate Update rider parameters Return $\displaystyle{ S^G }$ $\displaystyle{ l=l+1 }$ End for End while End

## Applications

The applications of ROA are noticed in several domains that involve: Engineering Design Optimization Problems,[7] Diabetic retinopathy detection,[8] Document clustering,[9] Plant disease detection,[10] Attack Detection,[11] Enhanced Video Super Resolution,[12] Clustering,[13] Webpages Re-ranking,[14] Task scheduling,[15] Medical Image Compression,[16] Resource allocation,[17] Multihop routing[18] and E-khool Learning Management System Software.[19][20] Figure 1 displays the application of ROA.

Applications of ROA

## References

1. Binu D and Kariyappa BS (2019). "RideNN: A new rider optimization algorithm based neural network for fault diagnosis of analog circuits". IEEE Transactions on Instrumentation & Measurement 68 (1): 2–26. doi:10.1109/TIM.2018.2836058.
2. Binu D and Kariyappa BS (2020). "Multi-Rider Optimization-based Neural Network for Fault Isolation in Analog Circuits". Journal of Circuits, Systems and Computers. doi:10.1142/S0218126621500481.
3. Binu D and Kariyappa BS (2020). "Rider Deep LSTM Network for Hybrid Distance Score-based Fault Prediction in Analog Circuits". IEEE Transactions on Industrial Electronics: 1. doi:10.1109/TIE.2020.3028796.
4. Wang G., Yuan Y. and Guo W (2019). "An Improved Rider Optimization Algorithm for solving Engineering Optimization Problems". IEEE Access 7: 80570–80576. doi:10.1109/ACCESS.2019.2923468.
5. Jadhav AS., Patil PB. and Biradar S (2020). "Optimal feature selection-based diabetic retinopathy detection using improved rider optimization algorithm enabled with deep learning". Evolutionary Intelligence: 1–18.
6. Yarlagadda M., Rao KG. and Srikrishna A (2019). "Frequent itemset-based feature selection and Rider Moth Search Algorithm for document clustering". Journal of King Saud University-Computer and Information Sciences. doi:10.1016/j.jksuci.2019.09.002.
7. Cristin R., Kumar BS., Priya C and Karthick K (2020). "Deep neural network based Rider-Cuckoo Search Algorithm for plant disease detection". Artificial Intelligence Review: 1–26.
8. Sarma, S.K (2020). "Rider Optimization based Optimized Deep-CNN towards Attack Detection in IoT". In Proceedings of 4th International Conference on Intelligent Computing and Control Systems (ICICCS): 163–169.
9. Jagdale RH and Shah SK (2020). "Modified Rider Optimization-based V Channel Magnification for Enhanced Video Super Resolution". International Journal of Image and Graphics. doi:10.1142/S0219467821500030.
10. Poluru RK and Ramasamy LK (2020). "Optimal cluster head selection using modified rider assisted clustering for IoT". IET Communications 14 (13): 2189–2201.
11. Sankpal LJ and Patil SH (2020). "Rider-Rank Algorithm-Based Feature Extraction for Re-ranking the Webpages in the Search Engine". The Computer Journal 63 (10): 1479–1489. doi:10.1093/comjnl/bxaa032.
12. Alameen A and Gupta A (2020). "Fitness rate-based rider optimization enabled for optimal task scheduling in cloud". Information Security Journal: A Global Perspective: 1–17.
13. Sreenivasulu P and Varadharajan S (2020). "Algorithmic Analysis on Medical Image Compression Using Improved Rider Optimization Algorithm". In Proceedings of Innovations in Computer Science and Engineering. Lecture Notes in Networks and Systems (Springer) 103: 267–274. doi:10.1007/978-981-15-2043-3_32. ISBN 978-981-15-2042-6.
14. Vhatkar KN and Bhole GP (2020). "Improved rider optimization for optimal container resource allocation in cloud with security assurance". International Journal of Pervasive Computing and Communications 16 (3): 235–258. doi:10.1108/IJPCC-12-2019-0094.
15. Augustine S and Ananth JP (2020). "A modified rider optimization algorithm for multihop routing in WSN". International Journal of Numerical Modelling: Electronic Networks, Devices and Fields: 2764.
16. Binu, D; Rajakumar, B.R (2021). Artificial Intelligence in Data Mining: Theories and Applications, 1st edition. Academic Press. ISBN 9780128206010.
17. Amol V Dhumane (2020). "Examining User Experience of eLearning Systems using EKhool Learners". Journal of Networking and Communication Systems 3 (4): 26-34.


text:
# Fortran: Lesson 6

# 1 # 2 # 3 # 4
# 1 # 2 # 3 # 4

### Initializing Variables

Recall that in Basic the default value of a numeric variable is always zero - that is, if you introduce a numeric variable but do not specify its value, Basic automatically gives it the value zero. In GNU Fortran the situation is more confused. A real variable with no value specified will be given a value - but usually a very small value that is not precisely zero, and sometimes a value that is not even close to zero. An integer is given the default value 1. This strange behavior is hardly ever a problem, as usually when the variable is eventually used in the program it is given an appropriate value by some assignment statement. But trouble might arise if a forgetful programmer proceeds on the assumption that the default value is zero, or perhaps neglects to include an assignment statement. If you are worried about the problem, you can assign values to all your variables at the beginning of your program - a procedure called "initializing variables". The easiest way to do this is with ordinary assignment statements, such as "x = 0", or "y = 2.61", etc. (For programs with a large number of variables a more efficient method is to use DATA statements; we will discuss these later.)

### Mod

In Fortran the expression mod(n,m) gives the remainder when n is divided by m; it is meant to be applied mainly to integers. Examples are
mod(8,3) = 2   ,   mod(27,4) = 3   ,   mod(11,2) = 1   ,   mod(20,5) = 0  .

### Subroutines

A subroutine in Fortran works like a subprogram in Basic, except that you do not declare a subroutine. Subroutines are typed in the source file after the main program. A subroutine must have a name, followed by a list of variables in parentheses. A variable may be of any type, including a character variable, and can be an array. A subroutine begins with variable declaration statements, just as the main program.
The main program uses a call statement to call the subroutine. The call statement has also a list of variables, which are substituted for the subroutine variables. The subroutine executes, modifying some or all of its variables, which are then substituted back for the original call variables in the main program. The variables in the call statement must match the variables in the subroutine according to number, type, and dimension. (Oversights lead to type-mismatch error messages by the compiler.)
Here is a simple program named average that prompts the user for two real numbers, calls a subroutine named avg to average the numbers, and then prints the average.
								program average
real x, y, z
print *, "What are the two numbers you want to average?"
call avg(x,y,z)
print *, "The average is", z
end

subroutine avg(a,b,c)
real a, b, c
c = (a + b)/2.
end
When the subroutine is called it substitutes x for a, y for b, and z for c. (Although the user does not input z, GNU Fortran will have given it some default value.) After the subroutine does its calculations, the new values of a, b, c are substituted back into the main program for x, y, z. (In this particular subroutine only c changes, so x and y retain their original values.) After the subroutine completes its run, action is returned to the statement in the main program immediately following the call statement.
Just remember that, except for the first statement naming the subroutine and listing the variables, a subroutine has the same general structure as a main program. It begins with type and dimension statements, has a main body carrying out the action, and concludes with an end statement.
The advantage of using subroutines is that the main program can be kept relatively simple and easy to follow, while nitty-gritty calculations and complex procedures are shuffled off to various subroutines, each performing a specific task. A well-written subroutine can be saved in a subroutine "library", to be inserted into other main programs as the need arises.
A subroutine can call another subroutine, and it can also access a function subprogram.
A subroutine need not depend on any variables - in which case no parentheses follow the subroutine name. Here is a simple subroutine involving no variables:
									subroutine bluesky
print *, "The sky is blue."
end
The call statement for this subroutine,
									call bluesky
likewise lists no variables.
The following subroutine computes the product of a 2 x 2 matrix A with a 2 x 1 vector x, according to the formula

It accepts as variables a 2 x 2 array A and one-dimensional arrays x and y, each indexed from 1 to 2. The array y represents the product y = Ax.
									subroutine prod(A,x,y)
real A(2,2), x(2), y(2)
y(1) = A(1,1) * x(1) + A(1,2) * x(2)
y(2) = A(2,1) * x(1) + A(2,2) * x(2)
end
A call statement for this subroutine might be something like
									call prod(B,u,v)

where B and u are arrays known to the main program and the product v is to be computed by the subroutine. Of course the main program will have appropriately dimensioned these arrays. After the subroutine completes its task and returns control to the main program, the array v will represent the product Bu.

### Return (in Subroutines)

A return statement in a subroutine instructs Fortran to terminate the subroutine and return to the main program at the point where it departed. Thus it works like a stop statement in the main program, halting the program prematurely before the final end statement. A subroutine may have several returns, but only one end statement.
Here is a subroutine, using a return statement, that decides whether a positive integer n is a prime number:
									subroutine check(n,result)
integer n, i, root
character result*9
if (n .eq. 1) then
result = "not prime"
return
end if
root = sqrt(real(n))
do i = 2, root
if (mod(n,i) .eq. 0) then
result = "not prime"
return
end if
end do
result = "prime"
end
The subroutine begins by checking whether n = 1, and if true it sets result = "not prime" and returns to the main program. If n > 1 the DO LOOP looks at integers from 2 up to the square root of n, checking whether each is a divisor of n. If and when it finds such a divisor, it sets result = "not prime" and returns to the main program. But if no divisor of n is found, the subroutine completes the entire loop and sets result = "prime". After the subroutine ends, the main program need only look at the value of result to find out whether n is prime or not prime.

### Variable Substitution in Subprograms

We look in more detail at how variables are substituted for one another in the calling and execution of a subroutine or function subprogram. Let us suppose for example that a certain subroutine named "demo" depends on three variables, say a, b, and c, so that the first line of the subroutine is
									subroutine demo(a,b,c)

Let us assume also that the main program's call statement for this subroutine is

									call demo(x,y,z)

where x, y, and z are variables from the main program. The types and dimensions of x, y, and z will have been declared in the main program, and these must match the types and dimensions of a, b, and c, respectively, as declared in the subroutine.

The values of x, y, and z will have been stored by Fortran in certain memory locations, designated in the diagram below as triangles:
 x → Δ y → Δ z → Δ

When the subroutine "demo" is called, Fortran assigns the variable a the same memory location as x, b the same location as y, and c the same as z:
 x → Δ ← a y → Δ ← b z → Δ ← c

(This explains why the types and dimensions must match!) Now, as the subroutine "demo" runs, the variables a, b and c might change to new values. But since x, y, and z share memory locations with a, b, and c, the values of x, y, and z of course will have to change simultaneously along with a, b, and c. When the subroutine terminates and returns control to the main program, a, b, and c then are no longer active variables, but x, y, and z retain the final values of a, b, and c at the conclusion of the subroutine.
There is a way to fool Fortran into not changing the value of a calling variable when the subroutine runs. In the above example, suppose we change the call statement to
call demo(x,(y),z)    .

When the variable y is enclosed in parentheses, Fortran treats (y) as a new expression and assigns it a different memory location than that of y, but with the save value as y. The last diagram changes to
 x → Δ ← a y → Δ (y) → Δ ← b z → Δ ← c

Now, as b changes values during the execution of the subroutine, y is unaffected, so that at the conclusion of the subroutine y has its original value.
The above analysis applies to function subprograms as well as to subroutines. Changes in the function variables during execution of a function subprogram induce corresponding changes in the variables used to call the function subprogram.

# Fortran: Lesson 5

# 1 # 2 # 3
# 1 # 2 # 3

### Arrays

There are only a few minor differences in the way Fortran and Basic treat arrays. Array declarations in Fortran go at the beginning of the program, before any executable statement. Arrays can be declared with either a dimension statement or a type declaration. The latter way is preferred, because it is best anyway to declare the type of the array. Here are examples of arrays introduced by type declarations:
 real a(10), b(5) one-dimensional arrays a and b of real variables, indexed from 1 to 10 and from 1 to 5, respectively integer n(3:8), m one-dimensional array n of integers, indexed from 3 to 8, and an integer variable m double precision c(4,5) two-dimensional array c of double precision real numbers, the first index running from 1 to 4, and the second from 1 to 5 character student(30)*20 one-dimensional array student of strings, indexed from 1 to 30, each string up to 20 symbols long real num(0:5,1:10,-3:3) three-dimensional array num of single precision real numbers, the first index running from 0 to 5, the second from 1 to 10, and the third from -3 to 3

In Fortran the default lower limit of the range of a subscript is 1, rather than 0 as in Basic. A colon separates the lower and upper limits whenever both are specified.
Because arrays are declared at the beginning of the program, they must be given a fixed size - i.e., the limits must be constants rather than variables. (In this respect Fortran is less flexible than Basic, in that Basic allows the dimension of an array to be a variable whose value can be input by the user, thereby ensuring that exactly the right amount of storage space is reserved.) You don't have to use the full size of the array specified in the declaration statements; that is, you may reserve space for more entries in the array than you will need.
If you use a dimension statement to declare an array, you should precede it with a type declaration. Here is one way to introduce a real array weights, indexed from 1 to 7:
 real weights dimension weights(7)

But the same can be accomplished more briefly with the single statement
real weights(7)   .

Although the upper and lower limits of an array cannot be variables, they can be constants declared in parameter statements. The sequence of statements
 integer max parameter (max = 100) character names(max)*30 real scores(max)

instructs Fortran to set aside storage space for a list of at most 100 names, each a string of length no longer than 30 symbols, as well as a list of at most 100 scores, each a real number.
As in Basic, in Fortran you may input and print arrays with do loops. But you can sometimes more efficiently do the same with single statements. For instance, the above array weights can be input with only the statement

This read statement pauses the program to allow the user to enter all seven entries of the array. The user can either enter the seven weights one-by-one separated by returns, or alternatively, can enter all seven weights separated only by commas, and then a single return. If you want to input say only the first five weights, you can do so with the statement

Analogously, the single print statement
print *, weights

prints the seven entries of weights to the screen, while the statement
print *, (weights(i), i=p,q)

prints only the weights indexed from p to q.
There are various formatting tricks useful in printing two-dimensional arrays. Here is one example demonstrating how to print a matrix A having 5 rows and 6 columns of real numbers, with each row of the matrix printed on its own line :
 do i = 1, 5 write (*,10) (A(i,j), j = 1, 6) end do 10 format (6f7.3)

More precise formatting can be accomplished with double loops and tab indicators.

### Function Subprograms

Function subprograms in Fortran define functions too complicated to describe in one line. Here is a function subprogram defining the factorial function, fact(n) = n! :
 function fact(n) integer fact, n, p p = 1 do i = 1, n p = p * i end do fact = p end

The first line of the function subprogram specifies the name of the function, and lists in parentheses the variables upon which the function depends. The subprogram has its own type statements, declaring the type of the function itself, as well as the types of the variables involved in computing the function. Somewhere in the subprogram there must be a line giving the value of the function. (Above it is the line "fact = p".) The subprogram concludes with an end statement. In Fortran, function subprograms do not have to be declared as they do in Basic. The entire function subprogram appears in the source file after the final end statement of the main program.
The above factorial subprogram, with variables of integer type, works only for nonnegative integers no larger than 12, as 13! = 6,227,020,800 exceeds the Fortran upper limit of 2,147,483,647 for integers. To handle larger integers, the types can be changed to real or double precision. In GNU Fortran, single precision real type handles factorials of integers as large as 34, and double precision as large as 170.
The main program (or in fact any subprogram) utilizing a function subprogram should likewise specify the type of the function. Here is a simple main program using the above factorial function "fact":
 program demofactorial integer fact, n print *, "What is n?" read *, n print *, "The value of", n, " factorial is", fact(n) end

Because n is declared an integer in the function subprogram defining fact(n), it must also be an integer in the main program when fact(n) is evaluated; if it is of a different type the compiler displays a type mismatch error message.
A function subprogram may depend on several variables, and it may use an already defined statement function or a function defined by another function subprogram. Following is a function subprogram utilizing the above factorial function subprogram; it computes the Poisson probability function, defined as
P(n,t) = tn e- t / n!   ,

where n is a nonnegative integer and t any positive number:
 function poisson(n,t) real poisson, t integer n, fact poisson = (t ** n) * exp(-t) / fact(n) end

Note that, as this subprogram references the function "fact", it must declare its type. Both this subprogram and the factorial subprogram will appear in the source file following the end statement for the main program. (The order in which the subprograms are typed makes no difference - just as long as they both follow the main program.)
Again, in referencing function subprograms one must respect types; for example, if the main program is to compute poisson(m,s) for some variables m and s, then, in order to conform to the type declarations in the function poisson, m must first be declared an integer and s of real type. Oversights will lead to compiler type-mismatch messages.

### Arrays in Function Subprograms

An array can be listed as a variable of a function defined by a function subprogram - but you just write the array name, with no parentheses after the name as in Basic. The type and dimension of the array must be specified in the function subprogram.
Following is a program called "mean" that computes the mean, or average, of a list containing up to 100 numbers. The main program prompts for the list of numbers, and then references a function subprogram named "avg" that computes the average.
 program mean real numbers(100), avg integer m print *, "How many numbers are on your list?" print *, "(no more than 100, please)" read *, m do i =1, m print *, "Enter your next number:" read *, numbers(i) end do print *, "The average is", avg(m,numbers) end function avg(n,list) real avg, list(100), sum integer n sum = 0 do i = 1, n sum = sum + list(i) end do avg = sum/n end

Note that both the main program and the subprogram declare the type of the function "avg". The main program calls the function subprogram with the arguments "m" and "numbers", and these are substituted into the function subprogram for the variables "n" and "list". The main program specifies the dimension of the array "numbers", while the subprogram specifies the dimension of the array "list". The subprogram does its calculations and returns the value of "avg" to the main program. For this procedure to work, the types of the variables "m" and "n" must agree, as well as the types of "numbers" and "list".

### Return (in Function Subprograms)

A return statement in a function subprogram acts like a stop statement in the main program; the subprogram is terminated and Fortran returns to where it left off in the main program. Here is a function subprogram defined on integers n; the value of the function "demo" is 0 if n ≤ 0, and if n > 0 it is the sum of the squares of the integers from 1 to n:
 function demo(n) integer demo, n demo = 0 if (n .le. 0) return do i =1, n demo = demo + i * i end do end

# Fortran: Lesson 4

#### Lesson topics

##### View Demos
# 1 # 2 # 3 # 4 # 5 # 6
# 1 # 2 # 3 # 4 # 5 # 6

### Statement Functions

A statement function in Fortran is like a single line function definition in Basic. These are useful in defining functions that can be expressed with a single formula. A statement function should appear before any executable statement in the program, but after any type declaration statements. The format is simple - just type
f(x,y,z,…) = formula   .

You may replace f with any name you like for your function, and x, y, z, … with your own variable names. Instead of formula type the formula for your function.
Examples :
 area(r) = pi * r * r vol(r,h) = pi * r * r * h f(x,y,z) = sqrt(x / y) * cos(z)

You should declare a type for the function in a declaration statement. Here is a program using a statement function, named "area", to compute areas of circles; the program computes in double precision the area of an annulus of inner radius a and outer radius b:
									program annulus
double precision r, area, pi, a, b
parameter (pi = 3.1415926535897932D0)
area(r) = pi * r * r
print *, "Enter the inner and outer radii of the annulus: "
write (*,10) "The area of the annulus is ", area(b) - area(a)
10	format (a,f25.15)
end
In the type declaration statement just include the name of the function - do not include the parentheses or the function variables.
Observe that variables plugged into the function need not be the same variables used in defining the function.
It is possible to use a previous statement function in the definition of another. In the above program, for example, we have already defined the function area(r), so we could define further a second function "annarea", giving the area of the annulus as
								  annarea(a,b) = area(b) - area(a)

But this second function definition must appear later in the program than the first one.

### Continuation Lines

Sometimes a Fortran statement will not all fit into columns 7-72. In such a case you may continue the statement onto the next line by placing a character in column 6 of that next line. Although any character is allowed, most programmers use "+", "&", or a digit (using 2 for the first continuation line, 3 for another if necessary, and so on).
Example :
 det = a(1,1) * a(2,2) * a(3,3) + a(1,2) * a(2,3) * a(3,1) & + a(2,1) * a(3,2) * a(1,3) - a(3,1) * a(2,2) * a(1,3) & - a(2,1) * a(1,2) * a(3,3) - a(1,1) * a(3,2) * a(2,3)

### Do While Loops

A do while loop in Fortran is similar to the same loop in Basic. However, in Fortran the test must be enclosed in parentheses, and the end of the loop is identified with either end do or a labeled continue statement. As in "if … then" constructions, in loop tests one uses letter abbreviations for relations such as "≤", ">", "=", etc. Here are two loops adding the squares of the integers from 1 to 10; they differ only in the way the loops are terminated:
 N = 1 | N = 1 S = 0 | S = 0 do while (N .le. 10) | do 5 while (N .le. 10) S = S + N ** 2 | S = S + N ** 2 N = N + 1 | N = N + 1 end do | 5 continue

### Sign Function

The function sign in Fortran is called the sign transfer function. It is a function of two variables, and its definition involves two cases:
 CASE 1:   If y ≥ 0 then sign(x,y) = abs(x)   , CASE 2:   If y < 0 then sign(x,y) = - abs(x)   .

The practical effect is that sign(x,y) has the same absolute value as x, but it has the same sign as y; thus the sign of y is transferred to x. (The case y = 0 is a little special - it gives sign(x,y) always a plus sign.)
Examples :
sign(2,3) = 2   ,   sign(2, -3) = - 2   ,   sign(-2,3) = 2   ,   sign(-2, -3) = - 2   .

The variables x and y in sign(x,y) may be integers or real numbers, and either single or double precision. (And x and y may even be of different types.)
If we substitute x = 1 in the sign transfer function, we get the sign of y; that is,
 CASE 1:   If y ≥ 0 then sign(1,y) = 1   , CASE 2:   If y < 0 then sign(1,y) = - 1   .

Thus, sign(1,y) in Fortran is essentially the same as the function SGN(y) in Basic (except when y = 0, when the Fortran value is + 1 but the Basic value is 0).

# Fortran: Lesson 3

#### Lesson topics

##### View Demos
# 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9
# 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9

In Fortran Lesson 1 we briefly looked at the types of variables in Fortran. To avoid mistakes in Fortran arithmetic you must pay close attention to rules regarding working with numbers of the various types. Whereas Basic is more lenient, allowing some flexibility in mixing variables and numbers of different types, Fortran is less forgiving and will make you pay for oversights. In this lesson we look more closely at some of the rules and conventions that must be observed.

### Integers

An integer in Fortran is a whole number; it cannot contain commas or a decimal point. Examples of numbers considered integers by Fortran are
12    ,     -1311     ,     0     ,     +43     ,     123456789     .

For positive integers the plus sign is optional, but negative integers must be preceded by a minus sign. Examples of numbers not considered integers by Fortran are
22,547     ,     3.     ,     4.0     ,     -43.57 .

Because of the decimal points, Fortran will regard 3. and 4.0 as real numbers.
An integer N in GNU Fortran must lie within the range
- 2,147,483,648 ≤ N ≤ 2,147,483,647  .

One idiosyncrasy of Fortran is that when it performs arithmetic on integers, it insists on giving an answer that is likewise an integer. If the answer is not really an integer, Fortran makes it one by discarding the decimal point and all digits thereafter. For example, Fortran will assert that
11/8 = 1    ,    15/4 = 3    ,    -4/3 = -1    ,    -50/6 = -8    ,    2/3 = 0   .

If you want Fortran to give you the correct value of 11/8, you tell it to compute 11./8., so that it interprets the numbers as real numbers and produces the correct value 1.375. Integer arithmetic in Fortran can lead to other weird surprises - for instance, the distributive law of division is invalid, as demonstrated by the example
(2 + 3)/4 = 5/4 = 1     but     (2/4) + (3/4) = 0 + 0 = 0   .

Most of the built-in functions in Fortran apply to real numbers, and attempts to apply them to integers result in compiler error messages. The compiler will protest if you ask Fortran to compute sqrt(5), but it has no problem with sqrt(5.). Likewise, if you declare N to be an integer variable and ask Fortran to compute sqrt(N) or cos(N) or log(N), your program will not compile since these functions cannot act on integers. One way around this problem is to use the intermediate function
real(x)   ,

which converts x to a real number (if it is not already one). Then, for example,
real(5) = 5.    ,    sqrt(real(5)) = sqrt(5.) = 2.23606801  .

The compiler will have no objection if N is an integer variable and you ask Fortran to compute a composition like sqrt(real(N)) or cos(real(N)).

If you declare that A is an integer and later make the assignment A = 3.45, Fortran will not complain but it will truncate 3.45 and assign A the value A = 3. Likewise, if you insert the statement A = sqrt (5.), Fortran will truncate sqrt (5.) = 2.23606801 and deduce that A = 2. But errors such as these are easily avoided if you are careful to make correct type declaration statements for all variables at the beginning of your program.

### Single Precision Real Numbers

A real number, or more precisely a single precision real number, is written with a decimal point by Fortran, even when it is a whole number. The sequence of statements

									real x
integer y
x = 3
y = 3
print *, "x = ", x, " but y = ", y, "  -  weird!"

produces the output

x = 3. but y = 3  -  weird!

GNU Fortran uses up to 9 digits, not counting the decimal point, to represent real numbers. It will report that
sqrt (3.) = 1.73205078   ,   sqrt (1100.) = 33.1662483   ,   sqrt (2.25) = 1.5   .

Fortran can use also scientific notation to represent real numbers. The sequence "En" attached to the end of a number, where n is an integer, means that the number is to be multiplied by 10n. Here are various ways of writing the number 12.345:
1.2345E1  ,  .12345E2  ,  .012345E3  ,  12.345E0  ,  12345E-3  .

In working in single precision it is futile to assign more than 9 or 10 nonzero digits to represent a number, as Fortran will change all further digits to 0. (The 10th digit can affect how Fortran does the truncation.) The assignments
									x = 123456789876543.
x = 123456789800000.
x = 1234567898E5

produce the same result if x already has been declared a single precision real number. Note that commas are not used in representing numbers; as helpful as they might be to humans, computers find them unnecessary.

### Double Precision Real Numbers

A double precision real number in GNU Fortran can be represented by up to 17 digits before truncation occurs. Double precision numbers are written in scientific notation but with D usurping the role of E. Some various ways of writing the number 12.345 as a double precision real number are

1.2345D1  ,  .12345D2  ,  .012345D3  ,  12.345D0  ,  12345D-3 .

When assigning a value to a double precision variable you should use this D-scientific notation, as otherwise the value will be read only in single precision. For example, if A is double precision and you want to assign A the value 3.2, you should write

									A = 3.2D0

instead of just A = 3.2. (See Base 2 Conversion Errors below for more explanation.)

When a number is input from the keyboard in response to a "read *" command, the user need not worry about types or input format. Suppose for example that x is single or double precision, and the user is to enter a value for x in response to the command "read *, x". If the user enters simply "3" (integer format), GNU Fortran will change 3 to the proper format (to 3. if x is single precision and to 3D0 if x is double precision) before assigning it to x. Likewise, if x is double precision and the user enters 3.1 (single precision format), Fortran converts 3.1 to 3.1D0 before assigning it to x. (However, with an ordinary assignment statement "x = 3.1" from within the program, the number is not changed to double precision format before being assigned to x.)
A number x can be converted to double precision by the function
dble(x)   .

### Base 2 Conversion Errors

Whereas humans, having 10 fingers, do arithmetic in base 10, computers have no fingers but do arithmetic with on-off switches and therefore use base 2. As we know, some numbers have infinite decimal representations in base 10, such as
1/3 = .33333 …       ,       2/7 = .285714285714 …   .

There is no way to represent such numbers in base 10 with a finite number of digits without making a round-off error. Computers have the same problem working in base 2. In general, the only numbers representable with a finite number of digits in base 2 can be written in the form m/n, where m and n are integers and n is an integral power of 2. Examples are
6 (= 6/20)   ,   5/2   ,   3/8   ,   29/16   ,   537/256   ,   -3/1024 .

When we ask computers to do arithmetic for us, there is an inevitable source of error. We give the computer the numbers in base 10, and the computer must change them all over to base 2. For most numbers there is a round-off error, as the computer can work with only a finite number of digits at a time, and most numbers do not have a finite representation in base 2. If the computer is working in single precision Fortran, it works in about 9 digits (base 10), and so the round-off error will occur in about the 8th or 9th base 10 digit. In double precision this error appears much later, in about the 16th or 17th base 10 digit. If the arithmetic the computer performs is very complicated, these round-off errors can accumulate on top of each other until the total error in the end result is much larger. After the computer has done its job in base 2, it converts all numbers back to base 10 and reports its results.
Even if the computer does no arithmetic at all, but just prints out the numbers, the base 2 conversion error still appears. Here is a program illustrating the phenomenon:
									program demo
real x
double precision y, z
x = 1.1
y = 1.1
z = 1.1D0
print *, "x =", x, " , y =", y, " , z =", z
end
The somewhat surprising output when this program is run in GNU Fortran is
x = 1.10000002   ,   y = 1.10000002   ,   z = 1.1   .

The variable x is single precision, and base 2 conversion round-off error shows up in the 9th digit. Although y is double precision, it has the same round-off error as x because the value 1.1 is assigned to y only in single precision mode. (What happens is Fortran converts 1.1 to base 2 before changing it to double precision and assigning it to y.) Since z is double precision, and it is assigned the value 1.1 in double precision mode, round-off error occurs much later, far beyond the nine digits in which the results are printed. Thus the value of z prints exactly as it is received. Using write and format statements (see below), it is possible to print z using 17 digits; if you do so, you will find that Fortran reports z = 1.1000000000000001, where the final erroneous 1 appears as the 17th digit.
Base 2 round-off error occurs in the preceding example because 1.1 = 11/10, and 10 is not a power of 2. If you modify the program by replacing 1.1 with 1.125 = 9/8, there will be no round-off error because 8 = 23 is a power of 2 - so the values of x, y, and z will print exactly as assigned. (Try it!!)

### Mixed Type Arithmetic

In general, arithmetic in Fortran that mixes numbers of different types should be avoided, as the rules are quickly forgotten and mistakes are easily made. If Fortran is asked in some arithmetic operation to combine an integer number with a real one, usually it will wait until it is forced to combine the two and then convert the integer to real mode. Here are some calculations illustrating the process followed by Fortran, and showing why you should stay away from this nonsense:
 5. * (3 / 4) = 5. * 0 = 5. * 0. = 0. (5. * 3) / 4 = (5. * 3.) / 4 = 15. / 4 = 15. / 4. = 3.75 5. + 3 / 4 = 5. + 0 = 5. + 0. = 5. 5 + 3. / 4 = 5 + 3. / 4. = 5 + .75 = 5. + .75 = 5.75

If x and y are declared as double precision variables, and you want to multiply x by a number, say 2.1 for example, to get y, you should write
								y = 2.1D0 * x
Writing just y = 2.1 * x will retain single precision when 2.1 is converted to base 2, thereby introducing a larger base 2 round-off error and defeating your efforts at double precision. Similar remarks apply to other arithmetic operations. Errors of this nature are easily made when working in double precision. The best way to avoid them is to follow religiously this general rule:
Do not mix numbers of different types in Fortran arithmetic!!

### Exponentials and Roots

Already we point out an exception to the above rule - it is OK to use integers as exponents of real numbers. That is because, when serving as an exponent, an integer acts more as a "counter of multiplications" rather than as an active participant in the arithmetic. For instance, when Fortran does the calculation 1.25, it performs the multiplications
1.2 * 1.2 * 1.2 *1.2 * 1.2   ,

and the integer 5 never enters into the calculations! Thus, although it may appear so at first glance, the computation of 1.25 does not really mix an integer with a real number in any arithmetic operation. The same can be said of negative integers as exponents. The calculation of 1.2-5 involves multiplying five factors of 1.2, and then taking the reciprocal of the result - so the number -5 is not involved in the actual arithmetic.
Rational exponents must be handled carefully. A common mistake of novice Fortran programmers is to write something like 5 ** (2/3) and expect Fortran to compute the value of 52/3. But Fortran will view 2 and 3 as integers and compute 2/3 = 0, and conclude that 5 ** (2/3) = 5 ** 0 = 1. The correct expression for computing 52/3 is
5. ** (2./3.)   ,

wherein all numbers are viewed as real numbers.
Roots of numbers are computed in the same manner. To compute the seventh root of 3 you would use the expression
3. ** (1./7.)   .

If N is an integer variable and you wish to compute the N-th root of the real variable x, do not write x ** (1/N), as Fortran will interpret 1/N as 0 when N > 1. Instead write x ** (1./real (N)), so that 1 and N are first converted to real variables.

### Write and Format Statements

Just as in Basic we use TAB and PRINT USING commands to more precisely control program output, in Fortran we can use write commands with format statements. While these can get complicated, the most commonly used options are pretty easy to use. A typical write statement is
									write (*,20) x, y, z
The "*" in the parentheses instructs Fortran to write to the screen, while "20" refers to the label of the format statement for this write command. The x, y, and z are the variables to be printed. A format statement for this write command might be
20      format (3f10.4)    .

Inside the parentheses, the "3" indicates that 3 entities will be printed, the "f" denotes that these will be floating point real numbers (not exponential notation), the "10" stipulates that 10 places will be used for printing (counting the sign, decimal point, and the digits), and ".4" mandates 4 digits after the decimal point. Some printouts formatted this way are
12345.6789    ,    -1234.5678    ,    10002.3400   .

The letter "f" in this context is a format code letter; here are some of the more commonly used format code letters, with their implications:
 f real number, floating point format e single precision real number, exponential notation d double precision real number, exponential notation i integer a text string (character) x space / vertical space (line feed) t tab indicator

Strings (in quotes) may be placed in format statements, separated by commas. Here are examples of write statements with corresponding format statements; at the right of each is a description of the corresponding output:
 write (*,10) n, x, y 10   format (i4,4x,f10.4,2x,f10.4) integer n printed using 4 places, then 4 spaces, then real numbers x and y printed with 2 spaces between, each using 10 places and 4 decimal places write (*,20) area 20   format ("The area is ",f8.5) string in quotes is printed, then the real number area is printed, using 8 places with 5 decimal places write (*,30) "The area is ", area 30   format (a,f8.5) same output as immediately above write (*,40) x, y, z 40   format (3d20.14) 3 double precision numbers x, y, z printed, each reserving 20 spaces, with 14 decimal places write (*,50) student, score 50   format (a20,4x,i3) student, a text string up to 20 characters, is printed, then 4 spaces, then score, an integer using a maximum of 3 places write (*,60) r, A 60   format (t10,f4.2,/,t10,f6.2) tabs to column 10, prints real number r, goes to next line, tabs to column 10, prints real number A

You can use loops with format statements to print arrays; here are examples:
 do i = 1, 10           write (*,70) a(i)        end do 70   format (f5.2) an array a of real numbers, indexed from 1 to 10, is printed; each entry occupies 5 places with 2 decimal places, and is printed on a separate line write (*,80) (a(i), i = 1, 10) 80   format (f5.2) same output as immediately above write (*,90) (a(i), i = 1, 10) 90   format (10f5.2) same output as above, except that all entries are printed on the same line do i = 1, 5            write (*,7) (m(i,j), j = 1, 6) 7         format (6i3)        end do prints a 5 x 6 two-dimensional array m of integers, with each integer entry m(i,j) occupying 3 places. Each row of the matrix appears on its own line.

Here are other useful things to know about formatting:

1. If you do not specify a format, GNU Fortran will print real numbers using about 9 digits, even if you do calculations in double precision. If you want to print in double precision you must use write and format statements. When double precision is used the maximum number of digits possible is 17. A format specifier something like format (fm.n), where m is at least 20, is required to take full advantage of double precision.
2. If a value is too large to be printed in the specified format, Fortran will just print a string of asterisks (eg: ********** ). If you get such an output, you have to fix your format statement.
3. Real numbers are rounded off (not truncated) to fit the specified formatting.
4. If your formatting specifies more positions than the number requires, blanks are inserted to the left of the number.
5. Format statements may appear anywhere in a program after the variable declarations and before the end statement.
6. Unless your format statement is very simple, the chances are that your output won't look like you want on the first try - just fiddle with the formatting until you get it right.
Following are examples of stored values, formatting specifications for printing the values, and resulting output. (The "^" symbol indicates a blank).
 Stored Value Format Specifier Output 1.234567 f8.2 ^^^^1.23 0.00001 f5.3 0.000 -12345 i5 ***** -12345 i6 -12345 12345 i6 ^12345 0.00001234 e10.3 ^0.123E-04 0.0001234 e12.4 ^^0.1234E-03 1234567.89 e9.2 ^0.12E+07 aloha a8 ^^^aloha 1.23456789123D0 d17.10 ^0.1234567891E+01


text:
Homework Help: Develop Model Emulating Given Wave Pattern

1. Jul 19, 2014

ausmate

Question:
Develop a model for producing a repeating pattern of 8 waves, with 6 smaller waves of approx. the same size and the second and sixth waves much larger. The sketch below gives a general indication of the eight wave pattern.

(Sorry for large image)

I would like to know how to "take a shot" at it, the solution must be a sine function. Can be generic, by that I mean no definite amplitude, only that the model clearly resemble the one given.

I have tried to emulate it by trial and error, combining functions such as in the form [y=sin x + 0.3sin3x] with no luck.

Thanks in advance,
-Ausmate

Last edited: Jul 19, 2014
2. Jul 20, 2014

Mentallic

All I could come up with was a relatively complicated solution which is of the form

$$y=sin(x)+k(x)s(x)$$

where k(x) is equal to 1 everywhere that you want the amplitude of sin(x) to be higher, and 0 everywhere else. s(x) is a function that uses $sin(x)^2$ because it has a derivative of 0 where it touches the x-axis.

$$k(x)=\frac{1}{2}\left(\frac{|r|}{r}+1\right)$$

where

$$r=\sin{\left(\frac{x+3\pi/2}{4}\right)}-\frac{1}{\sqrt{2}}$$

and I'll leave s(x) to you if you're interested in pursuing this further.

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted


text:
Proving Trigonometric Identities

Definition

To prove a trigonometric identity, you have to show that one side of the equation can be transformed into the other side.

Solved Exercises

Struggling with math?

Access detailed step by step solutions to thousands of problems, growing every day!


text:
SERVING THE QUANTITATIVE FINANCE COMMUNITY

Samsaveel
Topic Author
Posts: 436
Joined: April 20th, 2008, 5:47 am

### Capturing skew risk in IV swaption surface in VaR Framework

Guy'sany input on this from ,**EXPERIENCE**,articles,papers ,etc..... Thanks,

Martinghoul
Posts: 3256
Joined: July 18th, 2006, 5:49 am

### Capturing skew risk in IV swaption surface in VaR Framework

I have no idea what you're asking... Surely, there is historical data for skew, just like there is for any other mkt input. That should make things relatively straightforward, no?

Samsaveel
Topic Author
Posts: 436
Joined: April 20th, 2008, 5:47 am

### Capturing skew risk in IV swaption surface in VaR Framework

yeah.... no idea about the question,i guess it is relatively ill posed from a content perspective what is industry practice to determine non ATM swaption vols ,how to link the smile shape in caplet data to swaption vols all of this is in the context of HS VaR ?

Martinghoul
Posts: 3256
Joined: July 18th, 2006, 5:49 am

### Capturing skew risk in IV swaption surface in VaR Framework

Again, there's all sorts of methodologies that exist for non-ATM swaption vols. You can interpolate to your heart's content, you can use SABR or another model w/whatever set of parameters you like, etc etc etc...I am not really sure why you'd want to link caplet vol/skew to swaption vol/skew. If you wanted to do so, this wouldn't be a trivial exercise by any means.I am not at all sure how all of these are specifically related to VAR. Essentially, once you have chosen your model/methodology and have generated the historical data, your VAR process should be agnostic.My Z\$2c...

Samsaveel
Topic Author
Posts: 436
Joined: April 20th, 2008, 5:47 am

### Capturing skew risk in IV swaption surface in VaR Framework

thanks Martingoul.a position in a swaption 10y10y starting sometime in the past,is the 10 y par swap rate used for fair valuation purposes daily ?

Martinghoul
Posts: 3256
Joined: July 18th, 2006, 5:49 am

### Capturing skew risk in IV swaption surface in VaR Framework

No, you would use the appropriate fwd rate...

Diskiss
Posts: 74
Joined: September 28th, 2004, 8:51 am

### Capturing skew risk in IV swaption surface in VaR Framework

Samsaveel
Topic Author
Posts: 436
Joined: April 20th, 2008, 5:47 am

### Capturing skew risk in IV swaption surface in VaR Framework

"a set of logvols derived from SABR " ,which set would that be for the USD 5y10y 100 payer ?

pcaspers
Posts: 700
Joined: June 6th, 2005, 9:49 am

### Capturing skew risk in IV swaption surface in VaR Framework

I understood the original question as how to capture the smile risk, which has not been answeredE.g. if you use a SABR surface and suppose you use a naive historical VaR approach, would you just calculate scenarios based on the current $(\alpha, \beta, \nu, \rho)$ and stress these with historical relative (?) day to day changes ?Or would you go for a more geometric approach, looking at risk reversals and butterflies and stress these two smile characteristics ?Or something else ?

Samsaveel
Topic Author
Posts: 436
Joined: April 20th, 2008, 5:47 am

### Capturing skew risk in IV swaption surface in VaR Framework

QuoteOriginally posted by: pcaspersI understood the original question as how to capture the smile risk, which has not been answeredE.g. if you use a SABR surface and suppose you use a naive historical VaR approach, would you just calculate scenarios based on the current $(\alpha, \beta, \nu, \rho)$ and stress these with historical relative (?) day to day changes ?Or would you go for a more geometric approach, looking at risk reversals and butterflies and stress these two smile characteristics ?Or something else ?Thanks Pcaspers...how would you calculate scenarios on the current calibrated parameters $(\alpha ,\beta,\nu,\rho)$ ? could you shed some light on your last geometric approach ,looking at RR,BF and stressing these ?

pcaspers
Posts: 700
Joined: June 6th, 2005, 9:49 am

### Capturing skew risk in IV swaption surface in VaR Framework

I don't know, maybe calculate relative daily changes in alpha, bet, nu, rho and stress your current SABR parameters with these ? But I think (I did not try that), that wouldn't work, it would give non sensical scenarios. But I don't know really.

Samsaveel
Topic Author
Posts: 436
Joined: April 20th, 2008, 5:47 am

### Capturing skew risk in IV swaption surface in VaR Framework

what is market practice for checking the non-arbitragability of the IR volatility surface, after adding additive perturbations for scenario generation ?


text:
# Kinetic theory of gases

## Homework Statement

Two moles of an ideal gas expand to double the initial volume at a constant temperature of 400 K. Calculate the work done by the process.

## Homework Equations

W=2.303nRTlog(v2/v1)

## The Attempt at a Solution

i tried the formula and got 4613.959 J but the answer is 554.6 J

Last edited:

## Answers and Replies

hage567
Homework Helper
Are you sure it isn't log(V2/V1)? I'm used to the form W=nRTln(V2/V1). I can't get either of those answers. Can you show how you got that?

Are you sure it isn't log(V2/V1)? I'm used to the form W=nRTln(V2/V1). I can't get either of those answers. Can you show how you got that?

n=2; v2=2*v1;T=400 K; R=8.32

W=2.303nRTlog(v2/v1)
= 2.303*2*8.32*400*log(2v1/v1)
= 2.303*2*8.32*400*log(2)
= 2.303*2*8.32*400*0.3010
= 4613.959

we generally use logarithms and i dont know wat is "ln"


text:
# How can I use transformation properties to obtain the distribution of $h(\mathbf{s})$?

Let that $$\mathbf{s}=(s_1,s_2) \sim Unif(S)$$, where $$S$$ is some spatial area. Suppose $$y=h(\mathbf{s})=1-[exp(exp(\beta_0+\beta_1(\mathbf{s}-\mathbf{x})^T(\mathbf{s}-\mathbf{x})))]^{-1}$$. We have that $$\frac{\partial h}{\partial \mathbf{s}}=2\beta_1e^{\beta_0+\beta_1\cdot Tr[(\mathbf{s}-\mathbf{x})^T(\mathbf{s}-\mathbf{x})]}exp[-(\beta_0+\beta_1\cdot Tr[(\mathbf{s}-\mathbf{x})^T(\mathbf{s}-\mathbf{x})])](\mathbf{s}-\mathbf{x})$$. How can I obtain the distribution for $$h(\mathbf{s})$$ analytically?

My idea:

I was thinking of using Theorem 2.1.5 in Casella and Berger: $$f_y(y)=f_\mathbf{s}(h^{-1}(y))|\frac{d}{d\mathbf{s}}h^{-1}(y)|$$

However, I'm not sure if this theorem extends to the multivariate case that I have.

• Given that $S$ is only some vague "spatial area," could you explain what it might mean to write the distribution of $h(s)$ "analytically"? – whuber Jul 27 at 20:19
• The expression will be nasty even in that case, because level sets of $y$ are circles (concentric around $x$) while the boundaries are portions of lines. That makes this an unappetizing question. Sometimes the original statistical problem will suggest useful approximations. Could you provide some background? – whuber Jul 27 at 21:38
• How far is $x$ from $S$? The problem of approximating $h$ becomes three separate ones depending on whether $x$ is far from $S$ (compared to its diameter), near $S$, or within $S.$ – whuber Jul 27 at 22:11
• You will need to evaluate the integral numerically. – whuber Jul 28 at 13:44
• Clearly the integral depends on the details of the boundary of $S:$ in that sense it's obviously messy except, perhaps, when the boundary is a circle centered at $x.$ It remains possible that an analytical solution exists for the unit square case, but I doubt anyone would want to work it out. Your best bet would be to apply Mathematica to the problem to see if it can produce anything for a specific, extremely simple $x$ (such as the center of the square or one of its corners). If it can't even make progress in that case, the problem is hopeless. – whuber Jul 28 at 15:15


text:
# First Query¶

Let's write our first queries in RAW and along the way introduce some basic concepts in the system.

We start by initializing the RAW magic (the RAW client) for Jupyter.

Our first query uses public data stored on S3, available through https.

Note the use of %%rql, which is the RAW magic command to run an RQL query; RQL stands for the RAW Query Language

This query is reading a CSV file, projecting all columns in the file, and returning the first 5 rows.

The READ keyword tells RAW to read data from the given URL. This is common in RAW: data sources are specified in the query.

As the query starts to execute, RAW will infer the format and structure of the data. In this case, the data is a CSV file and RAW makes it available as expected: as a table. The column names are retrieved from the CSV file, which contains a header in the first line.

We can execute more complex queries using regular SQL language features. For example:

Here we see countries with most airports.

With the exception of the READ keyword, this query looks like normal SQL. The READ keyword, however, means users do not have to create tables and load data into them, or discover the schema. This is done automatically by RAW.

For performance, however, RAW will create caches of the data. We will discuss caching in RAW in more details later in this tutorial.

Next: Data Discovery


text:
# It may be complex

Algebra Level 4

Let $a$, $b$ and $c$ be roots of the polynomial $P(x)=x^3-2x^2+3x-4$. Determine

$\large \left(a+\dfrac{1}{a}\right)\left(b+\dfrac{1}{b}\right)\left(c+\dfrac{1}{c}\right).$

×


text:
# Calculating Power of Sinusoidal Term and a Convolution expression

The following is an excerpt from the book Statistical Digital Signal Processing and Modelling (Monson Hayes)

...consider a random process consisting of a random phase sinusoid in white noise $$x(n) = A\sin(n\omega_{0} + \phi) + v(n)$$ where $\phi$ is a random variable that is uniformly distributed over the interval $[-\pi, \pi]$, and $v(n)$ is white noise with a variance of $\sigma_{v}^{2}$. The power spectrum of $x(n)$ is

$$P_{x}(e^{j\omega}) = \sigma_{v}^{2} + \frac{1}{2}\pi A^{2}[u_{0}(\omega - \omega_{0}) + u_{0}(\omega + \omega_{0})]$$

Therefore it follows from Eq. (8.23) that the expected value of the periodogram is $$E\{{P_{per}(e^{j\omega})}\} = \frac{1}{2\pi}P_{x}(e^{j\omega})*W_{B}(e^{j\omega})$$ $$= \sigma_{v}^{2} + \frac{1}{4}A^{2}[W_{B}(e^{j(\omega - \omega_{0})}) + W_{B}(e^{j(\omega + \omega_{0})})]$$

1. I am unable to figure out how he obtained the expression for power of the sinusoidal term. Shouldn't it be just $\pi^{2}A^{2}$ multiplied by the bracket term?
2. Considering that $W_{B}$ represents fourier transform of Bartlett window, how is the convolution expression being evaluated here?

The power spectrum $$P(e^{j\omega})$$ is the Fourier transform of the autocorrelation function of $$x(n)$$:

$$R_x(k)=E\{x(n)x(n+k)\}\tag{1}$$

If you evaluate $$(1)$$ you should get

$$R_x(k)=\sigma_v^2\delta(k)+\frac{A^2}{2}\cos(k\omega_0)\tag{2}$$

Taking the Fourier transform of $$(2)$$ leads to the given expression for $$P(e^{j\omega})$$.

The convolution is obtained by noting that

$$u_0(\omega-\omega_0)\star W_B(e^{j\omega})=W_B(e^{j(\omega-\omega_0)})\tag{3}$$

and

$$\frac{1}{2\pi}\sigma_v^2\star W_B(e^{j\omega})=\sigma_v^2\frac{1}{2\pi}\int_{-\pi}^{\pi}W_B(e^{j\omega})d\omega=\sigma_v^2\tag{4}$$


text:
# Semi-synchronous orbit

A semi-synchronous orbit is an orbit with a period equal to half the average rotational period of the body being orbited, and in the same direction as that body's rotation.

For Earth, a semi-synchronous orbit is considered a medium Earth orbit, with a period of just under 12 hours. For circular orbits, the altitude is approximately 20,200 km.[1][2]

## References

1. ^ "NASA Technical Standard 8719.14 (draft)" (PDF). NASA Orbital Debris Program Office. 8 Aug 2006.
2. ^ "Catalog of Earth Satellite Orbits". 6 Sep 2012.


text:
Question

# Construct a quadrilateral PQRS where PQ = 4 cm, QR = 6 cm, ∠P = $$60\cdot$$ ∠Q = $$90\cdot$$ and ∠R = $$120^\cdot$$

Solution

## Steps of Construction:(i) Construct a line segment QR = 6 cm.(ii) At the point Q, construct a ray QX making an angle of $$90^\cdot$$ and cut off QP = 4 cm.(iii) At the point P, construct a ray making an angle of $$60^\cdot$$ and at R, a ray making an angle $$120^\cdot$$ which meets each other at the point S.Therefore, PQRS is the required quadrilateral.Mathematics

Suggest Corrections

0

Similar questions
View More

People also searched for
View More


text:
# What is another way to prove the least amount of pence, nickels, dimes and quarters that guarantees making any change exactly?

In United States, there are four common coins people carry,

\begin{align*} 1 \text{ Penny} &= \0.01 \\ 1 \text{ Nickel} &= \0.05 \\ 1 \text{ Dime} &= \0.10 \\ 1 \text{ Quarter} &= \0.25 \\ \end{align*}

Define making the exact change as not getting any coins back from the cashier, i. e., paying the fractional dollar in exact coins. E. g., one buys two gallons of milk for $$\10.19$$ then making the exact change here means paying the fractional dollar as a dime, a nickel and four pence.

Some people (like myself) always pay the ceiling of the total bill and end-up with an ever increasing pile of coins under the armrest of their cars. To remedy that, I started thinking if I could assure myself of making the exact change each time, I will be better encouraged to actually take some of those coins with me.

Clearly, the more random coins one carries, the greater the probability of making the exact change but,

What is the least amount of pence, nickels, dimes and quarters that guarantees making any change exactly?

Taking a greedy approach, you can conclude that you need 3 quarters since if you needed four then you are paying in a dollar, 2 dimes since three means you can use a quarter, 1 nickel since two of them mean you can use a dime and 4 pence since five would mean you can use a nickel.

Now I want to prove this in a more algebraic way where 4 pence, 1 nickel, 2 dimes and 3 quarters fall out as a solution of something. Let $$\lceil x_1\rceil, \lceil x_2\rceil, \lceil x_3\rceil, \lceil x_4\rceil$$ be the number of pence, nickels, dimes and quarters then,

1. Assume that we will on average need 2 of each type of coins.
2. The coins will have to sum up to more than $$\0.98$$ since otherwise we can't make $$\0.99$$.

One way I have done it is using this system,

\begin{align*} x_1+x_2+x_3+x_4 &> 8 && \text{By assumption 1}\\ x_1+5x_2+10x_3+25x_4 &> 98 && \text{By observation 2}\\ x_1+x_2 &> 4 && \text{By assumption 1}\\ x_1+5x_2 &> 6 && \text{By an observation similar to 2}\\ \end{align*}

Solving this system does yield,

$$\lceil x_1\rceil, \lceil x_2\rceil, \lceil x_3\rceil, \lceil x_4\rceil = 4, 1, 2, 3$$

But I find this proof to be kinda hand-wavy and obvious in its reverse-engineering. Does someone see a better, more elegant algebraic/combinatoric proof here? Maybe something with the binomials or a generating function?

• Please, use descriptive titles. "Is there a more elegant proof for this argument?" says nothing about the subject of the question, it's a useless title. See the "Choose a good title" section in How to ask a good question. Aug 4 at 10:32
• Is it better now? Aug 4 at 17:56
• Yes, that's better Aug 4 at 18:02
• "Assume that we will on average need 2 of each type of coins." Um... why? Aug 4 at 18:30
• I think the most elegant expression is a modulo proof. If $M\equiv p\pmod 5; 0\le p < 5$ then you need at least $p$ pennies (no american says "pence" BTW) but no more and $p\le 4$. If $M\equiv 5n + p\pmod {10};0\le 5n+p<10\implies n=0,1$ then we need $n$ nickles but no more $n\le 1$. If $M\equiv 10d + 5n+p\pmod{25};d\le 2$ then we need $d$ dimes and no more. If $M\equiv 25q + 10d + 5n + p\pmod{100};q< 4$ then we need $q$ quarters and no more. And all else are bills. Aug 4 at 18:38

The following MiniZinc model is a machine-wavy view on your problem:

int: TotalCoins = 10;

%  how many coins do wee keep per value?
array[1..4] of var 0..TotalCoins: x;

%  we don't want to keep more coins than necessary
constraint sum(x) == TotalCoins;

constraint forall(s in 1..99) (
exists(c1 in 0..x[1], c5 in 0..x[2], c10 in 0..x[3], c25 in 0..x[4]) (
s == (1*c1 + 5*c5 + 10*c10 + 25*c25)
)
);

For $$10$$ coins, it comes up with your solution. For less than $$10$$ coins, no solution exists.

A solution without Nickles:

x = [9, 0, 2, 3];

A solution without Dimes:

x = [4, 4, 0, 3];

A solution without Quarters:

x = [4, 1, 9, 0];

Inspired by @fleablood's comment, here is a proof using moduli,

Proof. Let $$t\in\mathbb{N}$$ be any dollar amount in cents and $$c \in \{5, 10, 25, 100\}$$. Define $$\max(\mathbb{Z}/c\mathbb{Z})$$ as the smallest element of the largest residue class in $$\mathbb{Z}/c\mathbb{Z}$$ then, $$\max(\mathbb{Z}/c\mathbb{Z}) = c-1$$ Observe that any $$t \mod c$$ can be paid entirely using only the coins worth less than $$c$$. Since we know that,

$$\max(t \mod c) = \max(\mathbb{Z}/c\mathbb{Z})$$ We list the needed minimum number of coins of each type to make $$\max(\mathbb{Z}/c\mathbb{Z})$$ for each $$c$$,

\begin{align*} \max(\mathbb{Z}/5\mathbb{Z}) = 5-1 &= 4 && \text{4 Pence.} \\ \max(\mathbb{Z}/10\mathbb{Z}) = 10-1 = 9 &= 5+4 && \text{1 Nickel, 4 Pence.} \\ \max(\mathbb{Z}/25\mathbb{Z}) = 25-1 = 24 &= 10+10+4 && \text{2 Dimes, 4 Pence.} \\ \max(\mathbb{Z}/100\mathbb{Z}) = 100-1 = 99 &= 25+25+25+10+10+4 && \text{3 Quarters,} \\ & && \text{2 Dimes, 4 Pence.} \\ \end{align*}

Therefore, any $$t$$ can be made exactly with 3 Quarters, 2 Dimes, 1 Nickel and 4 Pence. QED.