Question

In: Computer Science

2. Solve a function (e.g., y(x) = sin(x) / (sin(x/10) + x/10) for many different values...

2. Solve a function (e.g., y(x) = sin(x) / (sin(x/10) + x/10) for many different values of x between a user-defined min and max, and store the values in a list. Also, print the maximum value of y(x) for the given range.?

Solutions

Expert Solution

import math

#define your function here

#x will be in radians

def functio(x):

    return math.sin(x)/(math.sin(x/10)+x/10)

    

mi=int(input("Enter min: "))

ma=int(input("Enter max: "))

lis=[]

#storing in list "lis" from mi to ma (both inclusive)

for i in range(mi, ma+1):

    lis.append(functio(i))

    

print("The values in list are: ",end="")

print(lis)

print()

print("The maximum value in given range is: "+str(max(lis)))

PLEASE LIKE IT RAISE YOUR THUMBS UP
IF YOU ARE HAVING ANY DOUBT FEEL FREE TO ASK IN COMMENT SECTION


Related Solutions

1. Solve a function (e​ .g.​, y(x) = sin(x) / (sin(x/10) + x/10) for many different...
1. Solve a function (e​ .g.​, y(x) = sin(x) / (sin(x/10) + x/10) for many different values of x between a user-defined min and max, and store the values in a list. Also, print the maximum value of y(x) for the given range. 2. Find the list in a list-of-lists whose sum of elements is the highest, and print the sum and list to the user. e.g., [[1, 2], [2, 5], [3, 2]] → [2,5] with a sum of 7.
Use method of variation of parameters to solve y'' + y = sin^2(x)
Use method of variation of parameters to solve y'' + y = sin^2(x)
Solve the differential equation by variation of parameters. y''+ y = sin^2(x)
Solve the differential equation by variation of parameters. y''+ y = sin^2(x)
Solve differential equation: y'+y=sin(x)
Solve differential equation: y'+y=sin(x)
Write your own MATLAB code to solve the system 10 − x + sin(x + y)...
Write your own MATLAB code to solve the system 10 − x + sin(x + y) − 1 = 0 8y − cos2 (z − y) − 1 = 0 12z + sin(z) − 1 = 0 using a residual tolerance of 10^−6 and the initial guess, ~x 0 = [0.1, 0.25, 0.08]^T . Print out the values for x, y and z for each iteration in a table similar to the one you created for the problems of the...
f(x,y)=sin(2x)sin(y) intervals for x and y: -π/2 ≤ x ≤ π/2 and -π ≤ y ≤...
f(x,y)=sin(2x)sin(y) intervals for x and y: -π/2 ≤ x ≤ π/2 and -π ≤ y ≤ π find extrema and saddle points In the solution, I mainly interested how to findcritical points in case of the system of trigonometric equations (fx=0 and fy=0). ,
subject:engineering mathematics solve [cos(x+y)-sin(x+y)]dx-sin(x+y)dy=0,is the ODE exact?Find an integrating factor and solve the ODE.
subject:engineering mathematics solve [cos(x+y)-sin(x+y)]dx-sin(x+y)dy=0,is the ODE exact?Find an integrating factor and solve the ODE.
Let f ( x , y ) = x^ 2 + y ^3 + sin ⁡...
Let f ( x , y ) = x^ 2 + y ^3 + sin ⁡ ( x ^2 + y ^3 ). Determine the line integral of f ( x , y ) with respect to arc length over the unit circle centered at the origin (0, 0).
Solve the initial value problem dy/dx = −(2x cos(x^2))y + 6(x^2)e^(− sin(x^2)) , y(0) = −5...
Solve the initial value problem dy/dx = −(2x cos(x^2))y + 6(x^2)e^(− sin(x^2)) , y(0) = −5 Solve the initial value problem dy/dt = (6t^5/(1 + t^6))y + 7(1 + t^6)^2 , y(1) = 8. Find the general solution of dy/dt = (2/t)*y + 3t^2* cos3t
Solve the IVP by applying the Laplace transform:y''+y=sqrt(2)*sin[sqrt(2)t]; y(0)=10, y'(0)=0
Solve the IVP by applying the Laplace transform:y''+y=sqrt(2)*sin[sqrt(2)t]; y(0)=10, y'(0)=0
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT