Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Dear Friends

Do I want to know how to merge these two loops in one? how to apply if-else loop? help me in this regard. the source file is attached. Thank you! 

restart; M := 5;
for i1 while i1 <= M do N[i1, 0](u) = 1 end do;
                         N[1, 0](u) = 1
                         N[2, 0](u) = 1
                         N[3, 0](u) = 1
                         N[4, 0](u) = 1
                         N[5, 0](u) = 1
for k1 while k1 <= M do N[0, k1](u) = 0 end do;
                         N[0, 1](u) = 0
                         N[0, 2](u) = 0
                         N[0, 3](u) = 0
                         N[0, 4](u) = 0
                         N[0, 5](u) = 0

 

Lamba is meant to be reserved for liouville function plotting some data i just realized it isn't that, so if the people that make the numtheory package please unprotec lamba in the future, or protec it but changed its proc assignment to the liouville function
function that would really sweet thanks

I wanted to have 3 graphs in 1 coordinate system. The Maple command I used was,

restart;
g := x -> (10*x)/(3+x);

f := x -> (10*x)/(5+x);

h := x -> (8*x)/(5+x);

plots:-display(
  plot( [g(x),f(x), h(x)], x=0..30, color=[red,blue, green], legend = ["k=3,c=10", "k=5, c=10","k=5,c=8"]));


Warning, unable to evaluate 1 of the 3 functions to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

 

The error comes up. only f(x) and h(x) were shown. How do I fix this? Thank you.

 

Monod Growth Model.

The function given was f(x)= cx/k+x , where c is the saturation value and k is the half-saturation constant.

I wanted to have the 2 graphs in 1 coordinate system, where both have c=5 but k= 2 and 3.

Is there also a way to clearly label and show that c=5 and extrapolate the point where k=2 and 3?

 

Thank you.

I have multiple curves of the same function with different initial conditions, trying to find the most suitable initial condition (for initial cond's less than the optimal one the function breaks down at 0 and for ic's > the optimal value the function decreases to a minimum before blowing up to infinity) See below:

In trying to find this optimal initial condition (or there abouts) for lots of different curves of the same form, I've tried to store the minimum values of each curve somewhere using Minimize, but for the curves that break down I get the error

Error, (in Optimization:-NLPSolve) cannot evaluate the solution further right of xxxxx, maxfun limit exceeded (see ?dsolve,maxfun for details)

And the program exits the loop and doesn't move on to the next curve, I'd like to find a way for Minimize to just return zero or better NA (or equivalent) when it encounters this problem and move on. Is there any way to do this? My code is below

 

with(Optimization):

f1 := proc (r) options operator, arrow; (diff(p(r), r))/(r*p(r)) end proc:

f2 := proc (r) options operator, arrow; (1/4)*(diff(p(r), r))^2/p(r)^2 end proc:

f3 := proc (r) options operator, arrow; (1/2)*(diff(p(r), r, r))/p(r) end proc:

ode := 2*(diff(f1(r), r)-(diff(f2(r), r))+diff(f3(r), r))/r+diff(f1(r), r, r)-(diff(f2(r), r, r))+diff(f3(r), r, r)-mu(2*(diff(p(r), r))/r+diff(p(r), r, r)) = p(r):

ic3 := Array([seq(-.9 .. -.8, 0.1e-1)]):

curve := Array(1 .. 11):

for i to 11 do ics := p(0.1e-4) = 1, (D(p))(0.1e-4) = 0, ((D@@2)(p))(0.1e-4) = ic3[i], ((D@@3)(p))(0.1e-4) = 0; sol := dsolve({ics, ode}, p(r), numeric, output = listprocedure); curve[i] := rhs(sol[2]); mincurve[i] := Minimize(curve[i](r), assume = nonnegative) end do

Error, (in Optimization:-NLPSolve) cannot evaluate the solution further right of 3.7209455, maxfun limit exceeded (see ?dsolve,maxfun for details)

 

plot([curve[1](r), curve[2](r), curve[3](r), curve[4](r), curve[5](r), curve[6](r), curve[7](r), curve[8](r), curve[9](r), curve[10](r), curve[11](r)], r = 0 .. 10, y = 0 .. 1.05, labels = [r, rho])

 

``


 

Download checkmin.mw


Cheers!

 

EDIT the initial conditions were originally defined at 0.00001 as my previous function was undefined at zero, forgot to change this when I changed my function. However, with these now corrected the problem still stands.

Series 2:Hi i was wondering if someone could explain how i can get series like this to evaluate to infinity, or a float placeholder for i mean.

Series 1:Any then also explain the mathematics as to how the this series converges to a negative limit please.

seq(evalf[10](eval(sum(2^n*floor(2^n), n = 1 .. N), [N = 10^k])), k = 1 .. 3)

1398100., 0.2142584059e61, 0.1530840927e603

(1)

evalf[10](sum(2^n*floor(2^n), n = 1 .. infinity))

-1.333333333

(2)

``


 

Download WHY_NO_EVAL.mw


 

seq(evalf[10](eval(sum(5^(n-1)*floor((1/4)*5^n), n = 1 .. N), [N = 10^k])), k = 1 .. 3)

0.4967053121e13, 0.3241153791e139, 0.4536359279e1397

(1)

evalf[10](sum(5^(n-1)*floor((1/4)*5^n), n = 1 .. infinity))

sum(5^(n-1)*floor((1/4)*5^n), n = 1 .. infinity)

(2)

``


 

Download WHY_NO_EVAL.mw

We have a hessian matrix in which we want to substitute values of three variables and we are unable to do so...can someone pls help and we also want to calculate the value of the determinant of the matrix
 

A := 2500

2500

(1)

alpha := 4

4

(2)

beta := 0.2e-1

0.2e-1

(3)

c := 5

5

(4)

x[w] := 10

10

(5)

x[1] := 8

8

(6)

delta := 5

5

(7)

t[d] := .5

.5

(8)

a := 20

20

(9)

b := 25

25

(10)

theta := .5

.5

(11)

m := theta*(1-exp(-.5*xi))

.5-.5*exp(-.5*xi)

(12)

TC(t[1], t[2], xi) := (A+alpha*((1/2)*a*t[d]^2+(1/3)*a*t[d]^3)+beta*((1/6)*a*t[d]^3+(1/8)*a*t[d]^4)+t[d]*(a/(theta-m)+b*(t[d]-1/(theta-m))/(theta-m)-exp((theta-m)*(t[1]-t[d]))*(a/(theta-m)+b*(t[1]-1/(theta-m))/(theta-m)))-a*(-6*beta*b-(6*(theta-m))*(-a*beta+alpha*b)+6*(theta-m)^2*(a*beta*t[1]+alpha*b*t[d])+3*b*beta*(theta-m)^2*(-t[1]^2+t[d]^2)+6*a*alpha*(theta-m)^2+2*b*beta*(theta-m)^3*(t[1]^3-t[d]^3)+3*a*beta*(theta-m)^3*(t[1]^2-t[d]^2)+3*b*alpha*(theta-m)^3*(t[1]^2-t[d]^2)+6*a*alpha*(theta-m)^3*(t[1]-t[d])+6*exp((theta-m)*(t[1]-t[d]))*((6*(theta-m))*(-a*beta+alpha*b)-6*b*beta*(theta-m)*(t[1]-t[d])-6*((theta-m)^2*(-b*beta*t[1]*t[d]+a*beta*t[d]+alpha*b*t[1]+a*alpha)+beta*b)))/(6*(theta-m)^4)+x[1]*(2*a*t[2]*delta^2+2*b*t[1]*t[2].(delta^2)+b*t[2]*delta-2*a*delta*ln(delta*t[2]+1)-2*b*ln(delta*t[2]+1)-2*b*t[1]*delta*ln(delta*t[2]+1)-2*b*t[2]*delta*ln(delta*t[2]+1)+2*b*t[2]*delta)/(2*delta^2)+x[w]*(2*a*t[2]*delta^2+b*t[2]^2*delta^2+2*b*t[1]*t[2].(delta^2)+2*a*delta*t[2]+2*b*t[2]*delta*ln(1/(delta*t[2]+1))+2*b*ln(1/(delta*t[2]+1))+2*a*delta*ln(1/(delta*t[2]+1))+2*b*t[1]*delta*ln(1/(delta*t[2]+1)))/(2*delta^3)+c*(a*t[d]+(1/2)*b*t[d]^3+a/(theta-m)+b*(t[d]-1/(theta-m))/(theta-m)-exp((theta-m)*(t[1]-t[d]))*(a/(theta-m)+b*(t[1]-1/(theta-m))/(theta-m))-a*ln(1/(delta*t[2]+1))/delta-b*(1+delta*(t[1]+t[2]))*ln(delta*t[2]+1)/delta^2-b*t[2]/delta))/(t[1]+t[2])

(2571.157291+220.0000000/exp(-.5*xi)+275.0000000*(.5-2.000000000/exp(-.5*xi))/exp(-.5*xi)-5.5*exp(.5*exp(-.5*xi)*(t[1]-.5))*(40.00000000/exp(-.5*xi)+50.00000000*(t[1]-2.000000000/exp(-.5*xi))/exp(-.5*xi))-53.33333334*(-3.00-298.800*exp(-.5*xi)+1.50*(exp(-.5*xi))^2*(.40*t[1]+50.0)+.3750*(exp(-.5*xi))^2*(-t[1]^2+.25)+120.00*(exp(-.5*xi))^2+.12500*(exp(-.5*xi))^3*(t[1]^3-.125)+37.65000*(exp(-.5*xi))^3*(t[1]^2-.25)+60.000*(exp(-.5*xi))^3*(t[1]-.5)+6*exp(.5*exp(-.5*xi)*(t[1]-.5))*(298.800*exp(-.5*xi)-1.500*exp(-.5*xi)*(t[1]-.5)-1.50*(exp(-.5*xi))^2*(99.750*t[1]+80.200)-3.00))/(exp(-.5*xi))^4+243*t[2]+250*t[1]*t[2]-40*ln(5*t[2]+1)-40*t[1]*ln(5*t[2]+1)-40*t[2]*ln(5*t[2]+1)+25*t[2]^2+10*t[2]*ln(1/(5*t[2]+1))-10*ln(1/(5*t[2]+1))+10*t[1]*ln(1/(5*t[2]+1))-5*(1+5*t[1]+5*t[2])*ln(5*t[2]+1))/(t[1]+t[2])

(13)

H := Matrix(3, 3, {(1, 1) = diff(TC(t[1], t[2], xi), t[1], t[1]), (1, 2) = diff(TC(t[1], t[2], xi), t[1], t[2]), (1, 3) = diff(TC(t[1], t[2], xi), t[1], xi), (2, 1) = diff(TC(t[1], t[2], xi), t[1], t[2]), (2, 2) = diff(TC(t[1], t[2], xi), t[2], t[2]), (2, 3) = diff(TC(t[1], t[2], xi), t[2], xi), (3, 1) = diff(TC(t[1], t[2], xi), xi, t[1]), (3, 2) = diff(TC(t[1], t[2], xi), xi, t[2]), (3, 3) = diff(TC(t[1], t[2], xi), xi, xi)})

Matrix(%id = 18446746207931281886)

(14)

t[1] := -64.35385218

-64.35385218

(15)

t[2] := -.1999803

-.1999803

(16)

xi := 8.906818845

8.906818845

(17)

eval(H, {xi = 8.906818845, t[1] = -64.35385218, t[2] = -.1999803})

Error, invalid sequence

"eval(H,{ t[1]:=-64.35385218, t[2]:=-0.1999803, xi:=8.906818845});"

 

``

``


 

Download 1.mw

I 'm solving asystem of equations and one of the result are Hfloat what does it means and how i convert it to number???

add, floats, and Kahan sum

 

I found an intresting fact about the Maple command add for floating point values.
It seems that add in this case uses a summation algorithm in order to reduce the numerical error.
It is probably the Kahan summation algorithm (see wiki), but I wonder why this fact is not documented.

Here is a simple Maple procedure describing and implementing the algorithm.

 

 

restart;

Digits:=15;

15

(1)

KahanSum := proc(f::procedure, ab::range)  
local S,c,y,t, i;      # https://en.wikipedia.org/wiki/Kahan_summation_algorithm
S := 0.0;              # S = result (final sum: add(f(n), n=a..b))
c := 0.0;              # c = compensation for lost low-order bits.
for i from lhs(ab) to rhs(ab) do
    y := f(i) - c;     
    t := S + y;              
    c := (t - S) - y;        
    S := t;                  
od;                         
return S
end proc:

 

Now, a numerical example.

 

 

f:= n ->  evalf(1/(n+1/n^3+1) - 1/(n+1+1/(n+1)^3+1));

proc (n) options operator, arrow; evalf(1/(n+1/n^3+1)-1/(n+2+1/(n+1)^3)) end proc

(2)

n := 50000;
K := KahanSum(f, 1..n);

50000

 

.333313334133301

(3)

A := add(f(k),k=1..n);

.333313334133302

(4)

s:=0.0:  for i to n do s:=s+f(i) od:
's' = s;

s = .333313334133413

(5)

exact:=( 1/3 - 1/(n+1+1/(n+1)^3+1) );

6250249999999900000/18751875067501050009

(6)

evalf( [errK = K-exact, errA = A-exact, err_for=s-exact] );

[errK = 0., errA = 0.1e-14, err_for = 0.112e-12]

(7)

evalf[20]( [errK = K-exact, errA = A-exact, err_for=s-exact] );

[errK = -0.33461e-15, errA = 0.66539e-15, err_for = 0.11166539e-12]

(8)

 


Download KahanSum.mw

Hi,

 

I am trying to make Maple replace some expressions with variables so that I'll be able to get the coefficients of the resulting polynomial. 

I have the following piece of code:

h := map(proc(x) convert(x,parfrac,s,complex) end proc,convert(f,parfrac,t,complex));

for sub_var in subs do
               h:=applyrule(sub_var[1]=1/sub_var[2],h);

end do;

subs is a list automatically generated in a different procedure, here is a sample list:

[[t-3*I, a1], [t+3*I, b1], [s-3*I, c1], [s+3*I, d1], [t-.4948716594-.4285714286*I, a2], [t-.4948716594+.4285714286*I, b2], [s-.4948716594-.4285714286*I, c2], [s-.4948716594+.4285714286*I, d2], [t+.4948716594-.4285714286*I, a3], [t+.4948716594+.4285714286*I, b3], [s+.4948716594-.4285714286*I, c3], [s+.4948716594+.4285714286*I, d3]]

f is a rational function that breaks up nicely into partial fraction due to theoretical reasons. here is a sample:
f: = (1/2)*(3969*I)*(35*s^3*t^3+21*s^3*t-9*s^2*t^2+21*s*t^3+45*s^2+63*s*t+45*t^2+27)*(t^2+1)*(s^2+1)/(((27*I)*t^2+7*t^3-9*I-21*t)*((27*I)*s^2-7*s^3-9*I+21*s)*((27*I)*s^2+7*s^3-9*I-21*s)*((27*I)*t^2-7*t^3-9*I+21*t))
These particular samples have algebraic numbers in them. and that makes apply rule fail, it seems to only work if the numbers are rational. Any idea on how can I fix that? Alternatively, replace applyrule all together with something that actually works?

Thanks

Dear Maple users, m

I am willing to convert a Matlab text into Maple and create a Maple procedure that can compute the same, but since I never used Matlab I have no idea of the input.

I used the: Matlab[FromMFile]("covMarket.m", "mapleout.mpl"); to convert. But there is nothing converted actually, 

So I am wondering, can anybody help converting it and posting the converted maple text into the answers? If there are lots of work to be done, please at least show me what to do. Thanks in advance

Below is the Ledoit and Wolf, shrinkage estimator script in Matlab:

function [sigma,shrinkage]=covMarket(x,shrink)

% function sigma=covmarket(x)
% x (t*n): t iid observations on n random variables
% sigma (n*n): invertible covariance matrix estimator
%
% This estimator is a weighted average of the sample
% covariance matrix and a "prior" or "shrinkage target".
% Here, the prior is given by a one-factor model.
% The factor is equal to the cross-sectional average
% of all the random variables.

% The notation follows Ledoit and Wolf (2003)
% This version: 04/2014

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file is released under the BSD 2-clause license.

% Copyright (c) 2014, Olivier Ledoit and Michael Wolf 
% All rights reserved.

% Redistribution and use in source and binary forms, with or without
% modification, are permitted provided that the following conditions are
% met:

% 1. Redistributions of source code must retain the above copyright notice,
% this list of conditions and the following disclaimer.

% 2. Redistributions in binary form must reproduce the above copyright
% notice, this list of conditions and the following disclaimer in the
% documentation and/or other materials provided with the distribution.

% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
% IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
% THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
% PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
% CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
% EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
% PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
% PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
% LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
% NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% de-mean returns
t=size(x,1);
n=size(x,2);
meanx=mean(x);
x=x-meanx(ones(t,1),:);
xmkt=mean(x')';

sample=cov([x xmkt])*(t-1)/t;
covmkt=sample(1:n,n+1);
varmkt=sample(n+1,n+1);
sample(:,n+1)=[];
sample(n+1,:)=[];
prior=covmkt*covmkt'./varmkt;
prior(logical(eye(n)))=diag(sample);

if (nargin < 2 | shrink == -1) % compute shrinkage parameters
  c=norm(sample-prior,'fro')^2;
  y=x.^2;
  p=1/t*sum(sum(y'*y))-sum(sum(sample.^2));
  % r is divided into diagonal
  % and off-diagonal terms, and the off-diagonal term
  % is itself divided into smaller terms 
  rdiag=1/t*sum(sum(y.^2))-sum(diag(sample).^2);
  z=x.*xmkt(:,ones(1,n));
  v1=1/t*y'*z-covmkt(:,ones(1,n)).*sample;
  roff1=sum(sum(v1.*covmkt(:,ones(1,n))'))/varmkt...
      -sum(diag(v1).*covmkt)/varmkt;
  v3=1/t*z'*z-varmkt*sample;
  roff3=sum(sum(v3.*(covmkt*covmkt')))/varmkt^2 ...
      -sum(diag(v3).*covmkt.^2)/varmkt^2;
  roff=2*roff1-roff3;
  r=rdiag+roff;
  % compute shrinkage constant
  k=(p-r)/c;
  shrinkage=max(0,min(1,k/t))
else % use specified number
  shrinkage = shrink;
end

% compute the estimator
sigma=shrinkage*prior+(1-shrinkage)*sample;


 

how to find skin friction value below code

 

restart

PDEtools[declare]((U, W, T, C)(y), prime = y):

R1 := .1; R0 := .1; m := .1; a := .1; Ha := .1; Nt := .1; Nb := .1; Pr := 6.2; Le := .6; Bi := 1; Ec := .1; k := 1; r := .1; A := 1;

sys := diff(U(y), `$`(y, 2))+(R1*(diff(U(y), y))-2*R0*W(y))*exp(a*T(y))-a*(diff(U(y), y))*(diff(T(y), y))-Ha = 0, diff(W(y), `$`(y, 2))+(R1*(diff(W(y), y))+2*R0*U(y))*exp(a*T(y))-a*(diff(W(y), y)) = 0, diff(T(y), `$`(y, 2))+R1*Pr*(diff(T(y), y))+Pr*Ec*exp(-a*T(y))*((diff(U(y), y))*(diff(U(y), y))+(diff(W(y), y))*(diff(W(y), y)))+Pr*Ha*Ec*((U(y)+m*W(y))*(U(y)+m*W(y))+(W(y)-m*U(y))*(W(y)-m*U(y)))/(m^2+1)^2+Nb*(diff(T(y), y))*(diff(C(y), y))+Nt*(diff(T(y), y))*(diff(T(y), y)) = 0, diff(C(y), `$`(y, 2))+Pr*Le*R1*(diff(C(y), y))+Nt*(diff(C(y), `$`(y, 2)))/Nb = 0:

ba := {sys, C(0) = 0, C(1) = 1, T(1) = 0, U(0) = 0, U(1) = 0, W(0) = 0, W(1) = 0, (D(T))(0) = Bi*(T(0)-1)}:

r1 := dsolve(ba, numeric, output = Array([0., 0.5e-1, .10, .15, .20, .25, .30, .35, .40, .45, .50, .55, .60, .65, .70, .75, .80, .85, .90, .95, 1.00])):

with(plots); 

p1u := odeplot(r1, [y, U(y)], 0 .. 1, numpoints = 100, labels = ["y", "U"], style = line, color = green); 

plots[display]({p1u})

In the original worksheet that these were produced, upon closing the within set brackets they do not reduce to the unique elements. But in copying the output to a new worksheet as shown, they do reduce.


 

{Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -2}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 1, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = -1, (2, 2) = 1, (2, 3) = 0, (3, 1) = 1, (3, 2) = 2, (3, 3) = 1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = -1, (3, 2) = 0, (3, 3) = -2}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = -1, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (3, 1) = 0, (3, 2) = 0, (3, 3) = 2})}

{Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -2}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 1, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = -1, (2, 2) = 1, (2, 3) = 0, (3, 1) = 1, (3, 2) = 2, (3, 3) = 1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = -1, (3, 2) = 0, (3, 3) = -2}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = -1, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (3, 1) = 0, (3, 2) = 0, (3, 3) = 2})}

(1)

restart; with(LinearAlgebra)

{Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -2}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 1, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = -1, (2, 2) = 1, (2, 3) = 0, (3, 1) = 1, (3, 2) = 2, (3, 3) = 1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = -1, (3, 2) = 0, (3, 3) = -2}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = -1, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (3, 1) = 0, (3, 2) = 0, (3, 3) = 2})}

{Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -2}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 1, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = -1, (2, 2) = 1, (2, 3) = 0, (3, 1) = 1, (3, 2) = 2, (3, 3) = 1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = -1, (3, 2) = 0, (3, 3) = -2}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = -1, (3, 3) = -1}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (3, 1) = 0, (3, 2) = 0, (3, 3) = 2})}

(2)

``


 

Download JESUS_MATRIX.mw

I am attempting to find the surface area of a Torus. I can create a graph very easily, but am struggling with the SurfaceArea command. The code reads so far:

(Inputting the given function for the torus):

> r := (phi,theta) -> <(cos(phi)+3)*cos(theta),(cos(phi)+3)*sin(theta),sin(phi)>:

'r(phi,theta)' = r(phi,theta); 

(Generating a graph of the torus):

>plot3d(r(phi,theta),phi=0..2*Pi,theta=0..2*Pi,scaling=constrained);

(SurfaceArea command):

>SurfaceArea(r(phi,theta),phi=0..2*pi,theta=0..2*pi);

 

I am very new to the program so the solution may be obvious. Any suggestions on how to go about it?

Hello, I am attempting to plot a vector field in Maple. I have the following code so far:

 

SetCoordinates('cartesian'[x,y,z]):

F := VectorField(<y*z*e^(x*y*z)+3*x^(2),x*z*e^(x*y*z)+2*y*z+cos(y),x*y*e^(x*y*z)+y^(2)+1>);

 

I am struggling with the fieldplot3d commands, as I am supposed to plot it in the box -1<=x,y,z<=1. How do I go about inserting these bounds?

 

First 815 816 817 818 819 820 821 Last Page 817 of 2217