Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

You have a subscription input field on a client’s website and need a method to ensure that any email address and username in the client's database is unique. What should you use to achieve this?
4. a)Write to ask the user input the width and length of a rectangle and then the area and the perimeter of this rectangle.
b) do the input validation to make sure that the user will not input a negative number.
Use for loops to produce the following array

import numpy as np
n = 5
A = np.zeros((n,n))

[0 0 0 0 0
1 0 0 0 0
4 9 0 0 0
16 25 36 0 0
49 64 81 100 0]
Define a function, forward_euler, that uses forward Euler to solve ODEs of the form: y'+py=q and accepts the following arguments in order specified: p is the coefficient of y(x), q is right-hand side of differential equation, y0 is the initial value of y at t = 0 (default should be 0.0), N is the number of equally-spaced times after t = 0 to be used for the approximation (default should be 25), and t_max is the end point for approximation (default should be 10.0). The function should return y, an np.array of the approximate y(t) values, and t, an np.array of the correspond times at which y(t) is evaluated.
Consider the finite-difference approximation
df/d x ≈ −f (x + 2∆) + 8f (x + ∆) − 8f (x − ∆) + f (x − 2∆)/(12∆)
(1)1. Write a function finite_difference(f, x, Delta) that approximates d f /d x for a given Python
function f, point x, and perturbation Delta using Eq. (1).
2. Compute df/dx |x=1 for f (x ) = cos(x ) using your function and ∆ = 0.4, ∆ = 0.2, and ∆ = 0.1.
3. Compute the corresponding absolute errors (i.e., |y' appx − y' actual |). Name these error_0_4, error_0_2, and error_0_1.
4. Use these errors, and the corresponding ∆’s to estimate the order of this method. Name this order.
Write a function called bisection_root(f, a, b, tol) that uses the bisection
method for solving f (x ) = 0. Feel free to compare it to scipy.optimize.bisect for testing (which
is what we’ll use behind the scenes).
A simple, undamped spring mass system (think m1 from the previous problem if the springs below it were detatched) can be modeled by the following differential equation: mx¨ = −g m − k x .
1. Solve the differential equation for x (t ). Assign the symbolic, sympy expression to x_sl30.

2. Given the initial values x (0) = a0 and x'(0) = b0, solve for the constants C1 and C2. Substitute the constants into your solution and assign your new result to x_sl31
You have a unique ID number, which is represented by the variable id, containing a string of numbers. Write a program that continuously takes strings to standard input. If the string is not your ID number, print "This is not your ID number." If it is, print "This is your ID number: " followed by the number, and terminate the loop.
How would I go about creating code for a Pez dispenser through Python? In my college class I'm taking we have never discussed Perl and I've tried browsing for an explanation but haven't found anything.
You have a unique ID number, which is represented by the variable id, containing a string of numbers. Write a program that continuously takes strings to standard input. If the string is not your ID number, print "This is not your ID number." If it is, print "This is your ID number: " followed by the number, and terminate the loop.
LATEST TUTORIALS
APPROVED BY CLIENTS