Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

Your line:

For[i=1, i<m+2, i++, w[i,1]=0; w[i,n+1]=0];

looks vaguely similar to the following C code:

for (i=1; i<m+2; i++) {
    w[i,1] = 0;
    w[i, n+1] = 0;
}

If that's what you really mean, then the Maple equivalent is:

for i from 1 to m+1 do   # note m+1, not m+2
    w[i, 1] := 0;        # note :=
    w[i, n+1] := 0;
end do;

 

Is this what you mean?

with(plots):  with(plottools):
Cone := cone([0,0,1], 1, -1, grid=[51,2], color=gold, transparency=0.4):
Cyls := display([seq(cylinder([0,0,0], 1-h, h, color=red, strips=50),
    h=0.01..1, 0.02)], insequence):
display([Cone, Cyls], style=surface, lightmodel=light1, axes=none);

 

I think what you are asking is how to solve the equation Av = 0, where A is a 4x4 matrix and v is a vector.

If so, then

LinearAlgebra:-NullSpace(A);

will give you what you want.

If you meant something else, then you will have to explain what your notation means.

 

It's easy to calculate the modulus.  It is also easy to verify that it is not always less than 1.  Why do you expect it to be less than 1?

z := coth(x+I*y);

Compute the (square of the) modulus:

z*conjugate(z):
expand(%) assuming x::real, y::real:
m := simplify(%);

(cosh(x)^2+cos(y)^2-1)/(cosh(x)^2-cos(y)^2)

Now m is the square of the modulus of z at any x and y.  Let's evaluate it at a point on the boundary of your square domain with n=0:

subs(x=(n+1/2)*Pi, y=0, n=0, m):
evalf(%);

The result is greater than 1.

Try with n=1:

subs(x=(n+1/2)*Pi, y=0, n=1, m):
evalf(%);

Again, the result is greater than 1.

 

At any given location the daylight fraction varies with the time of the year.  Days are longer in the summer and shorter in the winter.  The calculations in your worksheet do not account for that.

I have attached a worksheet which introduces a function Z(tau, lambda, t), where tau is the tilt of Earth's axis, lambda is the latitude of a location, and t is the time of the year.  In a full year t goes from 0 to 2*Pi.  The function Z is the fraction of daylight at a latitude lambda at time t of the year.

Here are the graphs of Z(Pi/6, Pi/4, t) and Z(Pi/6, lambda, Pi/2):

 

daylight2.mw

Note added on Dec 28:

I wasn't happy with the ugly calculations in the worksheet which I posted above.  I examined the details and saw that the complications were due to a non-optimal choice of basis vectors.  With a better choice of basis vectors we get a cleaner calculation.  See:

daylight3.mw

The differences between the two worksheets are cosmetic.  The resulting graphs are identical.

 

Perhaps this is what you are looking for:

http://www.mapleprimes.com/questions/208795-Periodic-Piecewise-Function

 

 

You may refer to the "normal" sum through :-sum, as in:

f := t,n -> :-sum(MyFunction(k,t),k=1..n);

Independently of this issue, you should parenthesize the "t,n" part:

f := (t,n) -> :-sum(MyFunction(k,t),k=1..n);

Optimization:-LSSolve gives a reasonably good answer:

PA = 0.279246445735439
PB = 0.072848034900520
PO = 0.648114970425358

See the worksheet for details.

mw.mw

 

There are very many ways of doing this.   Here is one:

    eval(D(y)(x)=sin(x-y(x)), y=(x->a*x+b));

Beware that your instructor may not be amused by a solution that goes beyond what was taught in class.

 

In ode1 you have a factor:

At z=0 you are setting T(0)=350, whereby the term above evaluates to

which is complex-valued.  Do you really want complex-valued solutions?

 

 

Code Edit Region, which you will find it under the Insert menu, may be of interest to you.  It inserts a editable block into the worksheet, within which the code that you type is autoindented.  (Well, forward indentation is automatic; for backward indentation hit the Backspace key.)  There are quite a few additional features as well; see the help page on Code Edit Region.  Hit Ctrl-E to execute the block's code.

plots:-implicitplot3d([y=x^2, x^2+4*y^2+4*z^2=16],
    x=-4..4, y=-3..3, z=-3..3, scaling=constrained,
    grid=[50,50,50], style=surface);

Alternatively, with parametrized surfaces:

plots:-display([
    plot3d([4*sin(t)*cos(s), 2*sin(t)*sin(s), 2*cos(t)], t=0..Pi, s=0..2*Pi),
    plot3d([x,x^2,z], x=-2..2, z=-3..3)
], scaling=constrained);

restart;
u := Heaviside;
f := t -> u(t);
g := t -> 2*((t-1)*u(t-1) - (t-4)*u(t-4));
int(f(t-q)*g(q), q=-2..10) assuming t>-2, t<10;

PS: You posted a picture of your code, therefore I had to retype the code myself which is a bother.  In consideration for people who may want to help you, post real code that can be copy/pasted, like what I have done above.

 

params := p=1, w[u]=0.8, w=0.5, v=0.5, D[A]=1000, D[B]=1000, H=2500;
plot3d(eval([Profit_A, Profit_B], [params]), P[A]=0..P[B]-0.01, P[B]=0..0.5);

Your eq5 is:

eq5 := diff(DD(t),t) = d1 E(t) + d2 In(t);

Introduce a new unknown, let's call it C(t), so that the derivative of C(t) equals DD(t), and therefore C(t) is the antiderivative of DD(t).  This appends the equation:

eq6 := diff(C(t),t) = DD(t);

to your system.  For the initial condition take Init6 := C(0) = 0. Then solve the system of 6 equations in 6 unknowns, and plot C(t) as you wish.

 

First 43 44 45 46 47 48 49 Last Page 45 of 53