Kitonum

21440 Reputation

26 Badges

17 years, 40 days

MaplePrimes Activity


These are answers submitted by Kitonum

Example:

select(s->s[2]="e" and s[4]="d", ["trend", "fends", "noods", "sends"]);

x:=<x1(t), x2(t)>;

A:=<1,1; 1,-1>;

sys:=diff~(x,t)=~A.x;

ic:=eval(x,t=0)=~<1, -1>;

dsolve(op~(convert~({sys,ic}, list)));

 

or using DEtools (shorter)

x:=<x1(t), x2(t)>;

A:=<1,1; 1,-1>;

DEtools[matrixDE](A, t, method = matrixexp);
x=%[1].<1,-1>;

Another workaround in 2d input  to use  seq  command:

A := Array(seq(1 .. 3, i = 1 .. 3));

P  procedure solves the problem for 3 equations with 3 variables  x, y, z:

P:=proc(f, g, h)
if (not depends(f, z) and not depends(g, z)) or (not depends(f, y) and not depends(h, y)) or (not depends(g, x) and not depends(h, x)) then false else true fi;
end proc:

 

Example of use:

P(x*y*theta[5]+x*theta[2], x*y*theta[15], x*theta[22]+y*theta[23]+z*theta[24]);

                                                            false

 

Addition. If you want the solution for an arbitrary number of variables and equations, it is necessary  more precisely determine that the procedure must return in the different cases.

 

To use  NumberTheory[RepeatingDecimal]  command a decimal must be specified as a fraction. The procedure  ToFraction  converts any decimal with a recurring part to a rational number. You can then use  RepeatingDecimal  command.

Procedure parameters: a - part of a recurring decimal before of the repeating part, R  is a repeating part defined as a string.

 

ToFraction := proc(a::float, R::string)

local m, n, b;

m := SFloatExponent(a);

n := length(R);

b := add(parse(R[i])*10^(n-i), i = 1 .. n);

convert(a, fraction)+sign(a)*10^(m-n)*(sum(b*10^(-n*(k-1)), k = 1 .. infinity));

end proc:

 

Examples of use:

ToFraction(0., "142857"); 
NumberTheory[RepeatingDecimal](%);

ToFraction(1.6, "12"); 
NumberTheory[RepeatingDecimal](%);

ToFraction(1., "0102"); 
NumberTheory[RepeatingDecimal](%);

 

 

Put braces or square brackets:

F1 := -e*u*w-d*u+h*u+r1*z:

F2 := e*u*w-a*v-s*v*y+(r2+r3)*z:

F3 := k*v-u*w:

F4 := r3*z-b*y-(r2+r1)*y:

F5 := s*v*y-r*z:

solve({F1, F2, F3, F4, F5}, {u, v, w, y, z});

restart;

with(plots):

pr := 0.72: p := 0: n := [2, 3, 4, 5]: s := 1: a := 0.2: b := 1: L:=[red,blue,green,gold]:

for j to nops(n) do R1 := 2*n[j]/(1+n[j]); R2 := 2*p/(1+n[j]);

sol1 := dsolve([diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta))+R1*(1-(diff(f(eta), eta))^2) = 0, diff(diff(theta(eta), eta), eta)+pr*s^f(eta)*(diff(theta(eta), eta))+R2*pr*s*(diff(f(eta), eta))*theta(eta)+2*(a*(diff(f(eta), eta))+b*theta(eta))/(n[j]-1) = 0, f(0) = 0, (D(f))(0) = 1+b*((D@@2)(f))(0), (D(f))(5) = 0, theta(0) = 1+s*(D(theta))(0), theta(5) = 0], numeric, method = bvp); fplt[j] := plots[odeplot](sol1, [eta, diff(diff(f(eta), eta), eta)], color=L[j], axes = boxed);

tplt[j] := plots[odeplot](sol1, [[eta, theta(eta)]], color=L[j], axes = boxed) end do:

 

plots:-display([seq(fplt[j], j = 1 .. nops(n))]);

plots:-display([seq(tplt[j], j = 1 .. nops(n))]);

Example:

P:=2+x^5+x*y^3+x^2*y^4:

map(t->degree(t,x)!*degree(t,y)!*t, P);

                                              48*x^2*y^4+120*x^5+6*x*y^3+2

In this example, you can also use oblique quotes (this method is also suitable for earlier versions of Maple):

`4 + sqrt(9) = x - 1`:

parse(%);

%;

x=solve(%);

                                 

 

You can also delay the calculation of  sqrt(9)  by using of direct quotes:

4 + 'sqrt(9)' = x - 1;

%;

x=solve(%);

                                  

 

Your code works correctly when to end each line with a semicolon or a colon:

schro := {diff(psi(x), x, x)-(alpha*x^4+x^2-energy)*psi(x) = 0};

ic := {psi(3) = 0, (D(psi))(3) = 1};

schro1 := subs(energy = 3.30687, alpha = .1, schro);

soln1 := dsolve(schro1 union ic, {psi(x)}, type = numeric);

with(plots):

odeplot(soln1, [x, psi(x)], -3 .. 3);

Example (vector-row of plots):

plots[display](<plot(sin(x), x=-Pi..2*Pi, color=red) | plot(cos(x), x=-Pi..2*Pi, color=blue)>);

          

 

 

 

In your equation a  is a parameter. Maple usually either do not solve the equation with a parameter or gives an incorrect answer. If  a  is a specific number then there is no problem:

solve({cos(x)=-1/3, x>Pi/2, x<3*(Pi/2)}, x, allsolutions, explicit);

                           {x = Pi-arccos(1/3)}, {x = arccos(1/3)+Pi}

Maple does not integrate  equations automatically. You can do it as follows:

                

 

 

 

If to make substitutions  c=1/(a*b), d=(b-1)/(a*b) , we get the correct result

restart;

Digits:=20:

relativní_tlak:=<0.063018,0.078419,0.119628,0.159668,0.199865>:

ads_mnozstvi:=<0.001467443666,0.001528693055,0.001659939952,0.001774105924,0.001883866808>:

bet:=x/(1-x)/(1/(a*b)+((b-1)/(a*b))*x):

bet1:=subs({1/(a*b)=c, (b-1)=d*(a*b)}, bet);

with(Statistics):

bet_nejmensi_ctverce:=NonlinearFit(bet1,relativní_tlak,ads_mnozstvi,x,parameternames=[c,d],output=parametervector);

solve({1/a/b=%[1], (b-1)/a/b=%[2]});

assign(%);

plots[display](plot(x/(1-x)/(1/(a*b)+(b-1)/(a*b)*x), x=0..0.2, color=blue), plot(relativní_tlak,ads_mnozstvi, style=point, color=red, symbolsize=12));

         

 

 

 

In  [1.56257913677048,108.232791649022]  You forgot the first value to divide by 1000.

 

Edited.

 

Just use  isolve  command:

isolve(178*x + 312*y = 14);

                               {x = -49-156*_Z1, y = 28+89*_Z1}

_Z1  is  any integer constant.

First 177 178 179 180 181 182 183 Last Page 179 of 289