# Items tagged with homeworkhomework Tagged Items Feed

### Solve by Newton Raphson Method...

February 24 2014
0 4

hi everybody

I want to solve this system of equations

t*((p-.764*z-2.194768)^2-1.170308549+.529948*(z-.382)^2)-(1-t)*p
t*((p+.382*z+.661624*y-1.907568)^2-1.018097144+.529984*(-.866*y-.5*z-.382)^2)+(1-t)*y
t*((p+.382*z-.661624*y-2.470348)^2-1.31636154+.529984*(.866*y-.5*z-.382)^2)+(1-t)*z

while t varies from 0 to 1 by 0.0001 interval. Using newton raphson method, the inital value for each step is the result of the previous step for y,z,p. the very initial values are y=1,z=1,p=1

### Adams–Moulton methods to solve ODE...

February 23 2014
0 3

Dear all

Is there any one can help me to find  the Maple code to solve ODE : y'(x)=f(x,y(x))  using n-step  Adams-Moulton Methods.

The code exist  with mathematica in this link:

there is also the code of this method with Matlab, see please:

http://www.math.mcgill.ca/gantumur/math579w10/matlab/abm4.m

But I want file.mw ( with maple)

Thank you very much for helping me.

### Midpoint Method using for solving Ordinary differe...

February 22 2014
1 16

Dear all;

Thanks ifor looking and help me in my work. Your remarks are welcome.Description:
This routine uses the midpoint method to approximate the solution of
the differential equation $y'=f(x,y)$ with the initial condition $y = y[0]$
at $x = a$ and recursion starting value $y = y[1]$ at $x = a+h$.  The values
are returned in $y[n]$, the value of $y$ evaluated at $x = a + nh$.

Arguments:
\begin{itemize}
\item  $f$  the integrand, a function of a two variables

\item $y[]$ On input $y[0]$ is the initial value of $y$ at $x = a$, and $y[1]$
is the value of $y$ at $x = a + h$,
\item on output for $i \geqslant 2$
$$y[i] = y[i-2] + 2h f(x[i],y[i]); \quad \quad x[i] = a + i h.$$
\end{itemize}

CODE USING MAPLE

Midpoint-Method=proc(f,a,b, N)

h:=(b-a)/N;
x[0]:=a;
y[0]:=1:

for n from 2 to N do
x[n] := a+n*h;
y[n+1] = y[n-1] +  2h f( x[n], y[n] );
od:
// Generate the sequence of approximations for the Improved Euler method
data_midpoint := [seq([x[n],y[n]],n=0..N)]:
//write the function;
F:=(t,y)-> value of function ;

//Generate plot which is not displayed but instead stored under the name out_fig for example
out_fig := plot(data_midpoint,style=point,color=blue)

Thanks

### IF then statement with nested loop....

February 19 2014
0 1

Rewrite the code that counts the number of primes less than using an if-then statement.  Implement    your code where j goes from 2 to 15.

j:=1;
1
for i from 2 to 10
while ithprime(j)<2^i do
j:=j+1
end:
print(2^i,primes=j-1):
2048, primes = 9

I need to edit this code to satisfy a IF then Statement. can any one help me out?

\

regards "Geordi"

### Infinite series and Pi Approximation....

February 13 2014
2 4

The value of Pi can be approximated by the infinite series 4-(4/3)+(4/5)-(4/7)+(4/9)-(4/11)+... . Write a procedure that takes as an input the integer n and uses a for-loop to return the decimal point approximation of using the nth partial sum of the infinite series. Determine the minimum value of n that gives the true value of to 5 decimal places.

the 99 bottles of beer on the wall for loop is alot easier than this one. can some one walk me through it? i only have a general idea how to implement it.

### introduction into loops....

February 13 2014
1 3

im having issues with a problem on my homework. we are supposed to find all primes between 1000 through 1015. using the for loop, for in loop and while loop.

the while loop seemed the easiest.

i:=1000;
1000
while i<=1015 do
i, "Is it a prime?", isprime(i);
i:=i+1;
end;

the for loop and the for in loop have gotten me abit comfused ive tried several times with each and nothing.

### Optimization hw 02 help...

February 09 2014
0 1

question 2 of my homework is actually abit more simple imo. i think i performed all the operations correctly but however my 3dplot shows just a flat plane. i dont think thats right. if someone could take a look at my code in reference to this question. it would be great.

Suppose that a baseball is hit from 5 feet off of the ground with an initial velocity of 40 feet per second at an angle of above the horizontal. Let the horizontal and vertical components of the position, velocity, and acceleration be denoted respectively by and . Assume that the only acceleration is due to gravity (i.e, ).

a) If , plot the parametric equations over the time period that the ball is in the air.

b) Clear in maple by typing theta:='theta'; Now, suppose that we write in Cartesian form by solving for t: t:=solve(rx=x,t); Typing in ry should now yield a function that involves only x and . Make a 3-dimensional plot of for ,

ax:=0;ay:=-32;
0
-32
vx:=int(ax,t)+C1;
C1
vy:=int(ax,t)+C2;
C2
v0:=40;
40
theta:=Pi/3;
1
- Pi
3
C1:=solve(subs(t=0,vx)=v0*cos(theta),C1);
20
C2:=solve(subs(t=0,vy)=v0*sin(theta),C2);
(1/2)
20 3
vx; vy;
20
(1/2)
20 3
rx:=int(vx,t)+C3;
20 t
ry:=int(vy,t)+C4;
(1/2)
20 3 t + 5
C3:=solve(subs(t=0,rx)=0,C3);
0
C4:=solve(subs(t=0,ry)=5,C4);
5

ry;
(1/2)
20 3 t + 5
plot([rx, ry, t = 0 .. infinity]);

### Optimization Homework Help...

February 08 2014
0 4

I want to begin by saying hello! im new to the forums i hope some one can give me a push in the right direction with some of my maple homework. im sort of stuck on a few of these questions and would be greatfull for some help.

Let .

a) Let g be the tangent line to f when x = c. Use Maple to find g as a function of c.

b) Use Maple to plot f and g(3) using view = [0..5, -25..100].

c) Define a function called plot_tan that plots both f and g(c) where f is blue and g(c) is red. Also use the same view as in part (b). Note that plot_tan is also a function of c.

d) Using your function plot_tan, the following all in one graph using the display command:

plot_tan(1), plot_tan(1.5), plot_tan(2), plot_tan(2.5), plot_tan(3), plot_tan(3.5), plot_tan(4), plot_tan(4.5), plot_tan(5).

e) Try using the option insequence = true in the display command. What does this option do? (You will need to click on the graph and play around with some buttons).

now it seems to me i have to use the point slope formula to get to a fuction g of c. thanks in advance! i hope you can help

### Points of Intersection...

February 04 2014
0 4

Find the points (both x and y coordinates) of intersection y=cosh(x) and y=x^2. Give the answers in numeric form. To find the y-coordinates define one of the functions as f(x) and use f(?).

### how to do isprime command in maple?...

January 31 2014
0 1

Find the product of the square root of all prime numbers less than 100.
Hint: The function isprime determines the primality of an integer.

### how to do exercises in maple?...

January 31 2014
1 14

Define a set with elements that are the powers of 13 modulo 100 for exponents ranging from 1 to 1000. Is 5 a member of the set? Why is it beneficial to use a set instead of a list?
Hint: You can determine the set by using one statement if you use the seq command.

### how to Contrast the behavior of functions and expr...

January 31 2014
0 3

Contrast the behavior of functions and expressions by performing the following commands.
a)Define a function f equal to x^3 and Define an expression g equal to x^3
b) Evaluate f and g at 2.
c) Evaluate f and g at y.
d )Assign the value 2 to x. Evaluate f and g.

January 25 2014
2 6

thanks

### forward difference method for PDE...

January 07 2014
2 4

I want to solve following PDE question with forward difference method inn Maple. Can you help me please?

du/dt=d^2u/dx^2, 0<x<2, t>0

u(x,0)=sin(2*pi*x)

u(0,t)=0, u(2,t)=0

Use h=0.4 and k=0.1. and compare your answers at  t=0.5 to the exact solution u(x,t)=exp(-4*pi^2*t)*sin(2pi*x). Then use h=0.4 and k=0.05,and compare the answers.

### how to solve exchange matrix in maple?...

December 11 2013
0 10

Three families grow vegetables in their backyards,and agree to form a small closed economy by sharing their produce. family andrews grow artichokes, family brown grows beans and family Cuthbert grows corn.Family Andrews receives 70% of its artichokes, 30% of the beans and 30% of the corn.Family Brown receives 20% of the artichokes,60% of the beans and 10% of thr corn.Family Cuthbert receives the remainder of the vegetables.

a) Write down the exchange matrix A.

b) If production is measured in doolars ,define the variables
x[1]
,
x[2]
,
x[3]
of the production vector X.

c) Find all solution of the Leontief closed with matrix equation (I-A)^-1¤X=0.

d) If family Cuthbert produces \$100 worth of corn, how much will familes Andrews and Brown need to produce (in dollars) in order foe the economy to be in equilibrium?

 2 3 4 5 6 7 8 Last Page 4 of 14
﻿