Kitonum

21475 Reputation

26 Badges

17 years, 49 days

MaplePrimes Activity


These are answers submitted by Kitonum

Your system only has a zero solution:


 

restart; with(LinearAlgebra)

M := Matrix(Matrix(7, 7, {(1, 1) = -mu, (1, 2) = a[1]*beta[x]*k[1]*PI[h]/mu, (1, 3) = omega[o]*beta[x]*a[1]*PI[h]/mu, (1, 4) = sigma, (1, 5) = -beta[2]*PI[h]/mu, (1, 6) = 0, (1, 7) = a[1]*beta[x]*k[2]*PI[h]/mu, (2, 1) = 0, (2, 2) = -(mu+r[o]+alpha[o])*a[1]*beta[x]*k[1]*PI[h]/mu, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = a[1]*beta[x]*k[2]*PI[h]/mu, (3, 1) = 0, (3, 2) = 0, (3, 3) = -(mu+r[1]+alpha[1]+k[o])*a[1]*beta[x]*k[1]*PI[h]/mu, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = omega[o]*beta[x]*a[1]*k[2]*PI[h]/mu, (4, 1) = 0, (4, 2) = r[o], (4, 3) = r[1], (4, 4) = -mu-sigma, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (5, 1) = 0, (5, 2) = alpha[o], (5, 3) = alpha[1], (5, 4) = 0, (5, 5) = -e[o], (5, 6) = 0, (5, 7) = 0, (6, 1) = 0, (6, 2) = -a[2]*beta[y]*k[1]*PI[m]/mu[b], (6, 3) = -a[2]*beta[y]*k[2]*PI[m]/mu[b], (6, 4) = 0, (6, 5) = -a[2]*beta[y]*PI[m]/mu[b], (6, 6) = -mu[b], (6, 7) = 0, (7, 1) = 0, (7, 2) = a[2]*beta[y]*k[2]*PI[m]/mu[b], (7, 3) = a[2]*beta[y]*k[2]*PI[m]/mu[b], (7, 4) = m[7, 4], (7, 5) = a[2]*beta[y]*PI[m]/mu[b], (7, 6) = 0, (7, 7) = -mu[b]})); V := Vector([`$`(0, 7)])

Matrix(7, 7, {(1, 1) = -mu, (1, 2) = a[1]*beta[x]*k[1]*PI[h]/mu, (1, 3) = omega[o]*beta[x]*a[1]*PI[h]/mu, (1, 4) = sigma, (1, 5) = -beta[2]*PI[h]/mu, (1, 6) = 0, (1, 7) = a[1]*beta[x]*k[2]*PI[h]/mu, (2, 1) = 0, (2, 2) = -(mu+r[o]+alpha[o])*a[1]*beta[x]*k[1]*PI[h]/mu, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = a[1]*beta[x]*k[2]*PI[h]/mu, (3, 1) = 0, (3, 2) = 0, (3, 3) = -(mu+r[1]+alpha[1]+k[o])*a[1]*beta[x]*k[1]*PI[h]/mu, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = omega[o]*beta[x]*a[1]*k[2]*PI[h]/mu, (4, 1) = 0, (4, 2) = r[o], (4, 3) = r[1], (4, 4) = -mu-sigma, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (5, 1) = 0, (5, 2) = alpha[o], (5, 3) = alpha[1], (5, 4) = 0, (5, 5) = -e[o], (5, 6) = 0, (5, 7) = 0, (6, 1) = 0, (6, 2) = -a[2]*beta[y]*k[1]*PI[m]/mu[b], (6, 3) = -a[2]*beta[y]*k[2]*PI[m]/mu[b], (6, 4) = 0, (6, 5) = -a[2]*beta[y]*PI[m]/mu[b], (6, 6) = -mu[b], (6, 7) = 0, (7, 1) = 0, (7, 2) = a[2]*beta[y]*k[2]*PI[m]/mu[b], (7, 3) = a[2]*beta[y]*k[2]*PI[m]/mu[b], (7, 4) = m[7, 4], (7, 5) = a[2]*beta[y]*PI[m]/mu[b], (7, 6) = 0, (7, 7) = -mu[b]})

 

Vector[column](%id = 18446745476990704686)

(1)

LinearSolve(M, V)

Vector[column](%id = 18446745477001216958)

(2)

 


 

Download trc_new.mw

 

Here is the procedure to write explicitly this double sum:

restart;
S:=n->sum(sum(a[i,j]*x^i*y^j, j=0..n-i), i=0..n);

# Example
S(3);

proc (n) options operator, arrow; sum(sum(a[i, j]*x^i*y^j, j = 0 .. n-i), i = 0 .. n) end proc

 

x^3*a[3, 0]+x^2*y*a[2, 1]+x*y^2*a[1, 2]+y^3*a[0, 3]+x^2*a[2, 0]+x*y*a[1, 1]+y^2*a[0, 2]+x*a[1, 0]+y*a[0, 1]+a[0, 0]

(1)

 


 

Download double_sum.mw

OP wrote "Never understood the proc() without parameters"

In fact, everything is clear here. Parameterless procedures are often used when the number of actual parameters (called arguments) is not known in advance. In this case they are referred with  args (argument sequence)  and  nargs (number of arguments) :

Your generalized example (finds the Euclidean norm for any dimension):

 norm:=proc()
sqrt(sum(args[i]^2,i=1..nargs)) end:

norm(3,4,5);

                                      

 

In the following example, we find the arithmetic mean of a sequence of numbers for any number of these numbers:

restart;
M:=proc()
`+`(args)/nargs;
end proc:

# Example:

M(2,3,5,6);

                                        4

Example:

convert(1.0*a+b, rational);

                           a + b

From the help:
"Important: The evalb command does not simplify expressions. It may return false for a relation that is true. In such a case, apply a simplification to the relation before using evalb."

Your example:

restart;
f := x + 1 = (x^2 - 1)/(x - 1):
evalb(simplify(f));

                                     true


See help for details.
 

This is not a surface but a curve as the intersection of two surfaces (the cylinder  (y-1)^2+z^2=1  and the plane  x=1 ):


 

restart;
plots:-intersectplot((y-1)^2+z^2=1, x=1, x=0..2, y=0..2, z=0..1, thickness=2, axes=normal, scaling=constrained);

 

 


 

Download plot.mw

I don't see any point in solving such a simple problem with Maple. We get the answer immediately only by looking at the drawing without any calculations. SK=KB, KO=1/3*KB so  cos(SKB) = 1/3 .

              

 

The code for the pic.

restart;
local O;
with(plottools): with(plots):
A:=[0,0,0]: B:=[1/2,sqrt(3)/2,0]: C:=[1,0,0]: S:=[1/2,sqrt(3)/6,sqrt(2/3)]: K:=[1/2,0,0]: O:=[1/2,sqrt(3)/6,0]:
AB:=line(A,B): BC:=line(C,B): AC:=line(A,C): AS:=line(A,S): BS:=line(B,S): CS:=line(C,S): KS:=line(K,S): SO:=line(S,O): KB:=line(K,B):
T:=textplot3d([[A[],"A"], [B[],"B"], [C[],"C"], [S[],"S"], [K[],"K"], [O[],"O"]], font=[times,bold,18], align={left,above}):  
display(AB,BC,AC,AS,BS,CS,KS,SO,KB,T, color=black, axes=none, orientation=[-50,75], scaling=constrained);

 

restart;
M:=2*p*q*r*s*t/(u*v*w); 
simplify(M, {p*q/(u*v)=K});

 

We can of course use  map , but the code will be a little more cumbersome:

A:=[1,2,3]:
B:=[7,8,9]:
map(f@op, [seq([A[i],B[i]],i=1..nops(A))]);

                        [f(1, 7), f(2, 8), f(3, 9)]

restart;
sum((-1)^n/n*x^n, n=1..infinity) assuming x>-1, x<=1;

                                         -ln(1+x)


Edit. You can use the  parametric  option as well:

restart;
sum((-1)^n/n*x^n, n=1..infinity, parametric);

                 

 

We can use splines for smoothing. You didn’t provide a list of 11 points for your curve, so I restored it by eye.


 

restart;
L:=[[0,0],[0.1,-0.0005],[0.2,-0.0025],[0.3,-0.007],[0.4,-0.013],[0.5,-0.02],[0.6,-0.03],[0.7,-0.04],[0.8,-0.043],[0.9,-0.032],[1,0]]:
P:=plot(L, color=red, axes=box);
CurveFitting:-Spline(L, x);
FineCurve:=plot(%, x=0..1, color=blue);
plots:-display(P, FineCurve);

 

piecewise(x < .1, -0.250185043220809e-2*x-.249814956779191*x^3, x < .2, 0.499629913558381e-3-0.999629913558381e-2*x-0.749444870337572e-1*(x-.1)^2-.250925216104047*(x-.1)^3, x < .3, 0.400259060509133e-2-0.325129530254567e-1*x-.150222051864971*(x-.2)^2+.253515821195379*(x-.2)^3, x < .4, 0.948556662877686e-2-0.549518887625895e-1*x-0.741673055063576e-1*(x-.3)^2+.236861931322531*(x-.3)^3, x < .5, 0.120717967696741e-1-0.626794919241851e-1*x-0.310872610959834e-2*(x-.4)^2-.700963546485501*(x-.4)^3, x < .6, 0.221650717703349e-1-0.843301435406698e-1*x-.213397790055249*(x-.5)^2+.566992254619472*(x-.5)^3, x < .7, 0.359999603478812e-1-.109999933913135*x-0.433001136694071e-1*(x-.6)^2+1.43299452800761*(x-.6)^3, x < .8, 0.129690845647519e-1-0.756701208067884e-1*x+.386598244732877*(x-.7)^2+.701029633350074*(x-.7)^3, x < .9, -0.611443337122314e-1+0.226804171402892e-1*x+.596907134737899*(x-.8)^2+2.76288693859209*(x-.8)^3, -.234453607021068+.224948452245632*x+1.42577321631553*(x-.9)^2-4.75257738771842*(x-.9)^3)

 

 

 

 


 

Download FineCurve.mw

For some reason  assuming  does not always work. Use  assume=even  instead:

restart;
expr := Sum((-1)^n - 1, n = 1 .. infinity):
simplify(op(1,expr), assume=even);

                                        0

 

Edit. Probably something related to the levels of calculations here. For example, the following option works:

restart;
expr := Sum((-1)^n - 1, n = 1 .. infinity):
op(1,expr);
simplify(%) assuming n::even;

 

What you want to do is easy using the commands  plottools:-rectangle , plots:-inequal  and  plots:-textplot :


 

restart;
with(plots): with(plottools):
P1:=rectangle([-1.5,1.5],[2.5,-1.5], style=line):
A:=x^2+y^2<=1: notA:=x^2+y^2>1:
B:=(x-1)^2+y^2<=1: notB:=(x-1)^2+y^2>=1:
AminusB:={A,notB}:
AorB:={{A},{B}}:
AandB:={A,B}:
AB:=textplot([[-0.5,1.2,"A"],[1.5,1.2,"B"]], font=[times,bold,16]):

display(P1, inequal(AorB, x=-1.5..3,y=-2..1.5, color="LightBlue"), AB, scaling=constrained, axes=none, title='A' union 'B', titlefont=[times,bold,16]);

 

display(P1, inequal(AandB, x=-1.5..3,y=-2..1.5, color="LightBlue"), AB, scaling=constrained, axes=none, title='A' intersect 'B', titlefont=[times,bold,16]);

 

display(P1, inequal(AminusB, x=-1.5..3,y=-2..1.5, color="LightBlue"), AB, scaling=constrained, axes=none, title='A' minus 'B', titlefont=[times,bold,16]);

 

 


 

Download Venn.mw

Use  style=line  option for the surfaces:

plots:-display(plot3d(2*(1-x^2-y^2), x=-2..2, y=-3..3, style=line, view=0..2, grid=[20,30]), plot3d(0, x=-2..2, y=-3..3, style=line, grid=[20,30]), plots:-spacecurve([cos(t),sin(t)+1/2,0],t=0..2*Pi, color=black, thickness=2), scaling=constrained, axes=none);

                     

Use additional graphic options that can significantly improve the quality of plotting. The plot size can be changed with  size  option, and the style (including size) of the legends is controlled by  legendstyle  option. As an example, look at the plotting 4 basic trigonometric functions on one plot by default and using additional options:


 

restart;
# By default
plot([sin(x),cos(x),tan(x),cot(x)], x=-2*Pi..2*Pi, y=-4..4, legend=[sin(x),cos(x),tan(x),cot(x)], scaling=constrained);

 

# With additional options
plot([sin(x),cos(x),tan(x),cot(x),seq([-2*Pi+Pi/2*k,t,t=-4..4],k=0..8)], x=-2*Pi..2*Pi, y=-4..4, legend=[sin(x),cos(x),tan(x),cot(x),"vertical asymptotes"$9], linestyle=[1$4,3$9], legendstyle=[font=[times,18]], color=[red,blue,green,gold, black$9], thickness=[2$4,0$9], discont, scaling=constrained, size=[900,600]);

 

 


Additionally, I replaced the vertical lines that Maple draws by default at break points with vertical dashed black lines and indicated them in the legends. The colors of the graphs have also been changed.

Download options.mw

First 53 54 55 56 57 58 59 Last Page 55 of 290