MaplePrimes Questions

I'm trying to solve an ODE system from an IVP problem, but the error occurs: "Error, (in ...) cannot evaluate the solution further left of ..., maxfun limit exceeded (see ?dsolve,maxfun for details)"

I've already tried modifying the maxfun value but this did not work. I would like some suggestion.

Thank you

ODE_System.mw

Hi,

If any one can tell me how to solve the nonlinear system sys:={x^2+y^2+z^2=4,x^2+y^2-z^2=4,x+y+z=0} by using fsolve command? I tried fsolve(sys,{x,y,z});, but there is no value returned. May I give fsolve an initial approxiamtaion of the solution ? If that is the case, what should I do?

 

Thanks in advance!

Hi all,

can anyone  indicate me how display  1O^-5 and not 1/100000 on the vertical axis?

Thanks in advance

Hello, 

 I created my own costum package and I want to edit this package: insert procedures or modules. Is there a way?

Thank you.

restart;

with(VectorCalculus);

with(LinearAlgebra);

r1 := Vector([0, 0, 1]);

r2 := Vector([sin(theta1), 0, cos(theta1)]);

r3 := Vector([VectorCalculus:-`*`(sin(theta2), cos(phi2)), VectorCalculus:-`*`(sin(theta2), sin(phi2)), cos(theta2)]);

M := Matrix([r1, r2, r3]); ex := `assuming`([simplify(VectorCalculus:-`*`(Determinant(M), 1/VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`+`(1, DotProduct(r1, r2)), DotProduct(r1, r3)), DotProduct(r2, r3))))], [theta1 > 0, theta2 > 0, phi2 > 0]);

dex := eval(simplify(diff(arctan(ex), phi2)), phi2 = t);

VectorCalculus:-`*`(2, Int(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(2, Int(dex, t = 0 .. phi2)), 1/VectorCalculus:-`*`(4, Pi)), VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(2, Pi), sin(theta1)), sin(theta2)), 1/VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(4, Pi), 4), Pi))), [phi2 = 0 .. Pi, theta2 = 0 .. Pi, theta1 = 0 .. Pi], method = _CubaCuhre, epsilon = 0.5e-2));

evalf(%)

 

 

Ok I deleted my other question, since there was a mistake. I actually want to integrate the following expression. The arctan is not every positive in my integral there, so I needed to go this way to make it continuous. The problem here is the nested integral inside Int(...,t=0..phi2) which leads to maple not being able to evaluate.

ψ =-0.09,-0.07,-0.04,-0.01,0,0.01,0.04,0.07,0.09

these are the ψ values.

then X=

here we can take eta =0..2 and X=-15..15
using this relation how to plot streamlines for eta against X.

Code:
restart; with(plots); fcns := {T(eta), f(eta)}; ep := .1; M := 1; kp := .5; n := 1; ec := .1; pr := 1; s := .1; N := 5; sys := diff(f(eta), eta, eta, eta)+f(eta)*(diff(f(eta), eta, eta))-(diff(f(eta), eta))*(diff(f(eta), eta))+ep*ep+(M+1/kp)*(ep-(diff(f(eta), eta))) = 0, diff(T(eta), eta, eta)+pr*(f(eta)*(diff(T(eta), eta))-n*(diff(f(eta), eta))*T(eta))+pr*(ec*(diff(f(eta), eta, eta))*(diff(f(eta), eta, eta))+ec*(M+1/kp)*(diff(f(eta), eta))^2+s*T(eta)) = 0; bc := f(0) = 0, (D(f))(0) = 1, (D(f))(N) = ep, T(0) = 1, T(N) = 0; R := dsolve(eval({bc, sys}), numeric, method = bvp[midrich], abserr = 0.1e-9, output = operator); psi = [-0.9e-1, -0.7e-1, -0.4e-1, -0.1e-1, 0, 0.1e-1, 0.4e-1, 0.7e-1, 0.9e-1]; for i to 9 do X[i] = psi[i]/f(eta); print(plots:-contourplot(X[i](X, eta), eta = 0 .. N, X = 0 .. 6)) end do

 


 

Hi, 

I am interested to find the primes in in field Zp which Have prime inverses.  In particular, for any prime p up to an arbitrary number N, the number of pairs (a,b) where a and b are mutually inverse primes <p in Zp. Obviously in this context (a,b) is the same as (b,a) so no need for double counting. What I have so far is the following simple code for finding the inverse of prime q<p, given a chosen value of p. I can then see which results are prime and which are composite.

N:=p:

for n from 1 to N do

X:=q*n-1;

if mod(X,p)=0 then print(n);

end if:

end do:

This “hand cranking” method works but is of course boring but I don’t know how to scale it up to a more efficient code as described above. I would be grateful to anyone  able to assist me with this.

Thanks in advance

David

I am currently implementing the math behind the McEliece Cryptosystem in Maple, and as such I need to do work in the Galois Field GF(2^m). In my working example I am working with p=2, k=4, and a=1+x (i.e. the rank of my polynomial is 1). Parameters are per documentation found at https://www.maplesoft.com/support/help/maple/view.aspx?path=GF.

 

When attempting to initialize this field, however, I am receiving an error that the rank is not 4=k as expected. It is, however, not a requirement for a field that the polynomial has to be of rank k. How do I go about this?

G16 := GF(2, 4, 1+x);
Error, (in GF) polynomial 1+x does not determine an extension of degree 4

Hello! 

I tried to find Killing vectors of a certain metric, but Maple gives an error, which is reproduced with the following piece of code (the metric which I need is more difficult, so I would like to refrain from using "Physics" package). Could anybody tell me what the problem is and how I should solve it, please?

 

exampleError.mw
 

restart

with(DifferentialGeometry); with(Tensor); with(LieAlgebras)

DGsetup([xi, chi, u1, u2, v1, v2], P)

`frame name: P`

(1)
P > 

g := evalDG(1/2*(`&t`(dxi, dxi)+`&tensor`(du1*v1+du2*v2+dchi, du1*v1+du2*v2+dchi)*exp(-2*xi)+`&t`(dv1, dv1)+`&t`(dv2, dv2)))

_DG([["tensor", P, [["cov_bas", "cov_bas"], []]], [[[1, 1], 1/2], [[2, 2], (1/2)*exp(-2*xi)], [[2, 3], (1/2)*exp(-2*xi)*v1], [[2, 4], (1/2)*exp(-2*xi)*v2], [[3, 2], (1/2)*exp(-2*xi)*v1], [[3, 3], (1/2)*exp(-2*xi)*v1^2], [[3, 4], (1/2)*exp(-2*xi)*v1*v2], [[4, 2], (1/2)*exp(-2*xi)*v2], [[4, 3], (1/2)*exp(-2*xi)*v1*v2], [[4, 4], (1/2)*exp(-2*xi)*v2^2], [[5, 5], 1/2], [[6, 6], 1/2]]])

(2)
P > 

KV := KillingVectors(g)

Error, (in DifferentialGeometry:-Tensor:-Christoffel) expected 1st argument to be a metric tensor. Received: _DG([["tensor", P, [["cov_bas", "cov_bas"], []]], [`...`]])

 
P > 

``


 

Download exampleError.mw

 

What's going on here? Am I missing something, or is it a bug? If it's a bug, then it's by far the deepest and most profound bug that I've ever found or seen in Maple (and I've seen thousands over the decades). And since that surprises me, my guess is that I'm missing something obvious.

restart:
Op:= (R,F)-> F(['R()'$2]):
Op(rand(1..9), [f,f]);
                     [f([7, 6]), f([2, 4])]

The expected output is [f([7,6]), f([7,6])]. The same thing happens if I replace with seq, or if I replace -> with proc.

make a program that generates 20 numbers between 1 and 100, calculate the sum and the average of even numbers

please help, I do not know how to do it and the teacher wants this with "for, do and an external accountant

Limit((2x-3)/(x-2),x=2)->

How type this expression?

Can anyone advise me on the difference between the Internally and Externally Standardized Residuals from the LinearFit procedure? 

 

Sincerely

 

Jo

Hi!

I am a relatively new user of Maple. I am trying to find the partial fractions of a polynomial expression. All the values are constants determined by an outside system (that I am trying to model). The function is in terms of s. The denominator was simplified via substitution (more combinations of constants) to see if I could find the problem. There is no other code in the file, so I don't know if I have to define the constants (Cdl, RL, R1, R2, C1, C2) separately.

f:=(V[0](s^3+(2 s^2)/(C[dl] R[L])+(s^2)/(C[2] R[L])+(s^2)/(C[2] R[2])-(s^2)/(C[1] R[L])+(s)/(C[dl] C[2] R[L]^2)+(2 s)/(C[dl] C[2] R[L] R[2])+(s)/(C[dl]^2 R[L]^2)-(s)/(C[dl] C[1] R[L]^2)+1/(C[dl]^2 C[2] R[L]^2 R[2])))/(s^4+as^3+bs^2+cs+d)

convert(f, parfrac, s)

Running convert parfrac gives me an error that the argument is not a rational function. Any help is greatly appreciated!

 

or am I missing something?

Consider:

A:=Matrix(2, 2, [1, 4, 5, 1]);
x0:=Vector([2,1]); #initial condition

sol := DETools:-matrixDE(A, t);

M:=(Matrix(convert(sol[1], listlist)));  #convert to modern day Matrix from array that is returned by matrixDE

#the solutoion according to the documentation:

x:=M.x0;

#should match x0 at t=0, but does not:

subs(t=0, x);

 

#using this instead seems to work. But the docs claim this is method is meant to work for constant coeffs.

sol := DETools:-matrixDE(A, t, method=matrixexp);

 

Am i missing something? or is matrixDE not to be trusted (especially in cases where method is not provided)?

as a side note, the documentation is very out of date; claims matrixDE returns Matrix and vector, but these are just the old array types; means LinearAlgebra operations do not work.

 

 

First 772 773 774 775 776 777 778 Last Page 774 of 2433