foufa01

60 Reputation

2 Badges

11 years, 289 days

MaplePrimes Activity


These are replies submitted by foufa01

Please help, i didn't got any response for my problem

myproc := proc (r, x:=1, y:=0, dx := 0)
local s, i, k;
 option remember;
  s := 0;
if type(r, numeric) then
 if dx < r then
if dx = 0 then
for i from 0 to 100
do
s := s+myproc(r, x, y, dx+1)*5;
end do;
 return s
 else
  for k to 3
do
  s := s+myproc(r, x, y, dx+1)* 100;
end do;
return s
 end if
 else  
return 20
end if
 else return ('myproc')(r)
end if
end proc

 

 

That's it i think that it works well now.

Hello,

Sorry for the inconvinience another time.

Just remove dx from local variables.

This error occures cause it's not really the true verion of the procedure.

The one i have is too long, it just has the same structure.

And the one i have works correctly.
Thnaks.

Sorry for the inconvenience,

<begin proc>
myproc := proc (r, x:=1, y:=0, dx := 0)
local s, i, k,dx;
 option remember;
  s := 0;
if type(r, numeric) then
 if dx < r then
if dx = 0 then
for i from 0 to 100
do
s := s+myproc(r, x, y, dx+1)*5;
end do;
 return s
 else
  for k to 3
do
  s := s+myproc(r, x, y, dx+1)* 100;
end do;
return s
 end if
 else  
return 20
end if
 else return ('myproc')(r)
end if
end proc

</end proc>

 Thanks

 

Hello,

Thanks for all your help this is the general structure of my proc. it's definite with recurence
 

<begin proc>
myproc := proc (r, x:=1, y:=0, dx := 0)
local s, i, k;
 option remember;
global N, p, q;
 s := 0;
if type(r, numeric) then
 if dx < r then
if dx = 0 then
for i from 0 to 100
do
s := s+DotProduct(myproc(round, x, y, dx+1), 5)
end do;
 return s
 else
  for k to 3
do
  s := s+DotProduct(myproc(r, x, y, dx+1), 100)
end do;
return s
 end if
 else  
return 20
end if
 else return ('myproc')(r)
end if
end proc

</end proc>

 

And then i've done the following as suggested in this subject.

newproc := proc(x)
if not type(x,numeric) then return 'myproc'(args); end if

else return  myproc(args)

fi;

end proc;

This done, i've tried the following:

 >fsolve(newproc(x) = 0.38) ; (and it's a true value)

i've got this result

fsolve(newproc(x) = 0.38, x)

and then

>   evalf(%) the result is the same as previous
       fsolve(getUseProbUncol(x) = 0.38, x).

 

Help please

 

 

Hello,

The floating-point numeric result is not adequate, even though i know that the equation that i put have a solution. In fact i've done this myprox(2)=0.222 and then trying to solve this solve('myproc'(x),0.222).

I've also tryied this f: x->'myproc'(x) and then fsolve(f,x) or fsolve(f) nothing works.

The bust result i've got is "RootOf(myproc(_Z),1) something like this.

I cant't really post the procedure, it's long and related to others ones.

Waiting for your suggestions.

Thanks for your help, but don't know really if  i can do this.

in fact, myproc is a little bit complicated, and has multiple lines.

 

Sorry, but thougt that this forum is in french. Try to translate the upper message.

I'm working on maple and i found myself facing this problem decribed bellow.

I have a procedure named myproc, i want to resolve this equation myproc(x)=1,,

that causes me errors that i cannot resolved.

In fact, "myproc" containes an if statement.

I should then do solve('myproc'(x),x), that causes me soltions from RootOf

(n*myproc(_Z)) that i cannot evaluate.


Please help.

Non,j'ai essayé ça.

En fait, j'ai signalé que ma procédure contient une procedure if.

L'erreur mentionné dans ce cas cant compare if a > 0 or not.

Merci pour votre reponse

Page 1 of 1