MCE226L, Mini-Project

Verified

Added on  2022/11/13

|8
|544
|433
AI Summary
This document explains the Mittag-Leffler function with parameters α, β and its approximation using C programming. It includes a flowchart and C program for the same.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Running head: MCE226L, Mini-Project
Type equation here .
MCE226L, Mini-Project
Name of the Student
Name of the University
Author Note

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
1MCE226L, Mini-Project
The Mittag-Leffler function with parameters α, β are given by the following expression.
M L ( α , β ) ( z )=
k=0
zk
Γ ( αk+ β )
The Γ symbol is the gamma function which is defined by,
Γ ( n)=(n1)!
The infinite sum of M-L function is approximated by certain number of terms in which the
error between current and next iteration is less than the tolerance which is En =0.0001. The
values of α, β are considered positive integers here. The values of M-L function for different
z in a user-defined range are printed using C programming.
Flowchart of algorithm:
Document Page
2MCE226L, Mini-Project
C programme:
#include <stdio.h>
#include <conio.h>
Document Page
3MCE226L, Mini-Project
#include <math.h>
#include <stdlib.h>
int gammafunc(int num);
int main()
{
// initialization of paramters
float zstart;
float zend;
float inc;
float z;
int alpha;
int beta;
printf("Enter positive value of starting z: ");
scanf("%f",&zstart);
while (zstart<0)
{

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
4MCE226L, Mini-Project
printf("You must enter positive value of starting z: ");
scanf("%f",&zstart);
}
printf("Enter positive value of ending z: ");
scanf("%f",&zend);
while (zend<0)
{
printf("You must enter positive value of ending z: ");
scanf("%f",&zend);
}
printf("Enter positive value of increment: ");
scanf("%f",&inc);
printf("Enter value of alpha which is integer: ");
scanf("%d",&alpha);
printf("Enter value of beta which is integer: ");
scanf("%d",&beta);
Document Page
5MCE226L, Mini-Project
for (z=zstart;z<zend;z=z+inc)
{
float out1; int k;float out2; k=0;
out1= 0;
out2 = pow(z,k)/gammafunc(alpha*(k) + beta);
// Calculation loop
while (fabs(out2 - out1)>=0.0001) // tolerance is 1e-4
{
out1 = out1 + pow(z,k)/gammafunc(alpha*k + beta);
out2 = out1 + pow(z,k+1)/gammafunc(alpha*(k+1) + beta);
k=k+1;
}
printf("The value of the Mittag-Leffler function for the input %.4f is %.4f \n",z,out2);
}
return 0;
}
int gammafunc(int num) // function definition
{
Document Page
6MCE226L, Mini-Project
{
int fact=1,i;
for (i=1;i<=num-1;i++)
{
fact = fact*i;
}
return fact;
} // return statement
}
Sample Output:

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7MCE226L, Mini-Project
1 out of 8
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]