Items tagged with problem problem Tagged Items Feed

Dear mapleprimes users,

I have a problem concerning this function:

Naief := proc(A::integer,B::integer, p::posint)
local x, a:= A mod p, b:= B mod p;

 for x from 1 to p-1 do
    if a^x mod p = b then return x end if
end do;
print(¨No solution.¨)

end proc

It works fine for what it should do, finding x for a^x = b mod p by inserting x from 1 to p-1 until it finds an
apprioperate x.

My problem is concerning its computation time, which I like to calculate with:

Codetools:- Usage(Naief(a,b,p), output = [cputime], quiet, iterations= 2^12)

The problem is that keeps repeating

alot even when a,b and p are immensely huge. I don`t know how to fix it, because I need real CPUtimes which increase
a,b and p increase. I get the idea that the values of the CPUtime are not realistic.

 

Thanks for the help!

 

 

 

Hi I'm new to maple

I wanted to use dsolve to solve and equation but instead of getting an answer, maple returns an integration.

What could the promblem be?

Thanks

Hello, I am new user of Maple and I have simple problem. I have different results after pasting and typing text. Can you help me?different signs

Hi all,

I'm currently writing a code to solve the equations for a gravitational collapse of a star numerically. I'm using two dimensional Arrays for most of the physical quantities in my finite difference equations, with one index for the spatial dimension (I'm only considering spherically symmetric collapses) and one time index. I wrote two nested loops, where the inner one solves the equations from the centre of the star to the surface (with the exception of one quantitiy, where I have to integrate the other way around) and the outer loop advances the Arrays in time. My problem is, that Maple doesn't seems to evaluate the two dimensional Arrays. Instead for inserting the appropriate value for e.g. A[3,2], Maple just keeps on using A[3,2] which messes up some formulas, since I have to take roots of the numbers. At least that is what seems to be going on when I'm trying to debug the relevant part of the code and I check for the values, with whicih Maple calculates. I'm also using a one dimensional Array to store the timesteps, I'm using in the code and Maple doesn't seem to have problems evaluating them. Is anybody familiar with this problem? Does Maple have trouble with multidimensional Arrays in loops or have I just messed up my code? I have uploaded my code (I hope it worked). I apologize for my code being messy, but it's the first time I'm working with Maple and using numerical methods. The part which troubles me is labeled "# actual code".

Thank you all.

Oppenheimer-Snyder_Maple_3.mw

files.mw

From art of problem solving ws: "Jamal wants to save 30 files onto disks, each with 1.44 MB space. 3 of the files take up 0.8 MB, 12 of the files take up 0.7 MB, and the rest take up 0.4 MB. It is not possible to split a file onto 2 different disks. What is the smallest number of disks needed to store all 30 files?"

The answer is 13: 3*[0.4,0.8]+6*[0.7,0.7]+4*[0.4,0.4,0.4]

How to accomplish this in maple? my attempt doesnt work, unsurprisingly...

Dear Maple experts,

I want to solve the following problem with Maple. I appreciate if you can help.

 

n:=1+(2/Pi)*evalf(Int((x*0.187549975)/(x2-10.692), x=0..infinity));

Hi,

Thank you very much for your idea in previous discussion: this is the link.

http://www.mapleprimes.com/questions/202744-Calculs-Using-Maple

I asked how can I plot the phase portrait of this system

Sys1 := {diff(r(t),t) = r(t)^2*sin(theta(t)), diff(theta(t),t) = -r(t)^2*(-2*cos(theta(t))^2+1)};

I get this answer:

 

1) For me it's not necessary to give an initial condition to plot the pharse portrait.

2) What is the line in this phase portrait.

3) Here, I try a second method using Matlab code, I get:

 

and this is the code:

[r, theta] = meshgrid(0:pi/4:2*pi, 0:pi/4:2*pi);
rdot =r.^2.*sin(theta) ;
thetadot = r.^2.*(1-2*sin(theta).^2);
quiver(r,theta,rdot,thetadot)
xlabel('r')
ylabel('theta')

the arrow in the phase portrait are not the same.

Can someone give me more clear information about this problem.

Many thinks.

 

hi..i am a problem with solving following ....please help me ....thanks alot

dsys3 := {10*f2(x)+12*(diff(f1(x), x))+14*f3(x) = 0, 2*(diff(f1(x), x, x))+4*(diff(f2(x), x))+6*(diff(f3(x), x)) = 0, 16*(diff(f3(x), x, x, x, x))+19*(diff(f3(x), x, x))+22*(diff(f1(x), x))+25*f2(x)+27*f3(x)+29*f3(x)+31+32 = 0, f1(0) = 0, f1(1) = 0, f2(0) = 0, f2(1) = 0, f3(0) = 0, f3(1) = 0, ((D@@1)(f1))(0) = 0, ((D@@1)(f1))(1) = 0, ((D@@1)(f2))(0) = 0, ((D@@1)(f2))(1) = 0, ((D@@1)(f3))(0) = 0, ((D@@1)(f3))(1) = 0}; dsol5 := dsolve(dsys3, 'maxmesh' = 500, numeric, range = 0 .. 1, abserr = .1, output = listprocedure); fy3 := eval(f3(x), dsol5); fy2 := eval(f2(x), dsol5); fy1 := eval(f1(x), dsol5)

ERROR.mw

int(int(y, 0 <= y, x^2+y^2+z^2 <= 1));

Error, (in int) integration range or variable must be specified in the second argument, got 0 <= y

int(int(y, y = 0, x^2+y^2+z^2 = 1));

Error, (in int) integration range or variable must be specified in the second argument, got y = 0

Archimedes supposedlly, was asked to determine whether a crown made for the king consisted of pure gold. According to 

legend, he solved this problem by weighing the crown first in air and then in water. Suppose the scale read 7.84 N when the 

crown was in the air and 6.84 N when it was in water.

 

What should Archimedes have told the king ?

 

hi.i am a problem with following dsolve.please help me....thanks alot

dsys3 := {10*f2(x)+12*(diff(f1(x), x))+14*f3(x) = 0, 2*(diff(f1(x), x, x))+4*(diff(f2(x), x))+6*(diff(f3(x), x)) = 0, 16*(diff(f3(x), x, x, x, x))+19*(diff(f3(x), x, x))+22*(diff(f1(x), x))+25*f2(x)+27*f3(x)+29*f3(x)+31+32 = 0, f1(0) = 0, f1(1) = 0, f2(0) = 0, f2(1) = 0, f3(0) = 0, f3(1) = 0, ((D@@1)(f1))(0) = 0, ((D@@1)(f1))(1) = 0, ((D@@1)(f2))(0) = 0, ((D@@1)(f2))(1) = 0, ((D@@1)(f3))(0) = 0, ((D@@1)(f3))(1) = 0}; dsol5 := dsolve(dsys3, 'maxmesh' = 500, numeric, range = 0 .. 1, abserr = .1, output = listprocedure); fy3 := eval(f3(x), dsol5); fy2 := eval(f2(x), dsol5); fy1 := eval(f1(x), dsol5)ERROR.mw

Hi there,

I'm doing my first steps with Maple and am a little confused with a problem:
I want to solve something like

and expect the result to be z=-m*a. However I get empty brackets as result.
I tried to dig a little and I find that maple has problems isolating x1+x2+x3+x4


Error, (in isolate) x1*a+x2*a+x3*a+x4*a does not contain x1+x2+x3+x4


 

When I isolate it myself Maple even tells me they wouldn't be the same


false

I even reduced the problem to x1*a+x2*a and Maple still has problems with that. As this is a really simple problem I strongly assume the issue lies with the user. Can anyone help me there?

Thanks

 

 



This is my code for the Extended Euclidean Algorthim which should return integer l, polynomials pi,ri,si,ti for 0<=i<=l+1. And polynomial qi for 1<=i<=l such that si(f)+ti(g) = ri and sl(f)+tl(g)=rl=GCD(f,g).
The problem is, I keep getting division by zero. Also it evaluates pi = lcoeff(ri-1 - qiri) to be zero, everytime. Even when I remove this it still says there is a division of zero, which must be coming from qi:=quo(ri-1,ri, x); however I do not know why considering the requirements for the loop are that r[i] not equal zero. I really could use a fresh pair of eyes to see what I've done wrong. Any help would be greatly appreciated!!

Hi there,

 

I'd like to solve 7th order implicit simultaneous equation such as below, so I tried to do it by solve command.

However the calculation wasn't over although three hours passed.

 

eq1 := f1(a,b,c,d,e,f,g) = 0;

eq2 := f2(a,b,c,d,e,f,g) = 0;

.

.

.

eq7 := f7(a,b,c,d,e,f,g) = 0;

 

Just for your information, the eq1 and eq6 are written as follows specifically.

eq1 := -a-b-c-d-e-f-g+0.501857 = 0

eq6 := a*b*c*d*e*f+a*b*c*d*e*g+a*b*c*d*f*g+a*b*c*e*f*g+a*b*d*e*f*g+a*c*d*e*f*g+b*c*d*e*f*g+a*b*c*d*e+a*b*c*d*f+a*b*c*d*g+a*b*c*e*f+a*b*c*e*g+a*b*c*f*g+a*b*d*e*f+a*b*d*e*g+a*b*d*f*g+a*b*e*f*g+a*c*d*e*f+a*c*d*e*g+a*c*d*f*g+a*c*e*f*g+a*d*e*f*g+b*c*d*e*f+b*c*d*e*g+b*c*d*f*g+b*c*e*f*g+b*d*e*f*g+c*d*e*f*g-0.5281141885e-3+1.01894577*10^(-12)*I = 0

 

And the program code I used is:

solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7],[a,b,c,d,e,f,g]);

 

Here is the specification of my computer.

OS: Windows 7 Enterprise 64bit

CPU: Intel Core i7-3520M 2.90 GHz

Memory: 4.00 GB

 

How can I handle this problem? Is the specification not enough to solve the equation? Do I need to leave my computer more and more time?

Any help would be appriciated.

question: solve the direction field and curve that passes through each of indicated points.use different colours.

2)dy/dx=e^(-0.01xy^2)

(a) y(-6)=0

(b) y(0)=1

(c) y(0)=-4

(d) y(8)=-4

my answer:

> restart;
> with(DEtools);
> with(plots);
> a := diff(y(x), x) = exp(-0.1e-1*x*y(x)^2);
> g := dfieldplot(a, y(x), x = -8 .. 8, y(x) = -8 .. 8, color = exp(-0.1e-1*x*y(x)^2));

> ode := diff(y(x), x) = exp(-0.1e-1*x*y(x)^2);


> ics := y(0) = 1;
> dsolve({ics, ode});
  

it doesn't solve the ics n ode. actually i don't understand at all about dsolve bcoz this relating to exponential.

please do help me.thank you

 

btw before this someone do help me to solve my problem with this..here comes another problem..*sigh... thank you

1 2 3 4 5 6 7 Last Page 1 of 15