MTata94

45 Reputation

5 Badges

11 years, 63 days

MaplePrimes Activity


These are questions asked by MTata94

Another easy question from a newbie:

Say I have a procedure which, along the its execution, needs to pass a parameter to a different procedure (which, in this case, would be a subroutine) to be elaborated and returned to go on.

This process may happen a few times during the execution and the passing parameter, which may have the same name but different value, needs to be worked on by the subrooutine.

My question is: how do I invoke a procedure from a parent procedure passing one or more parameters and have them returned?

Thank you

Every time I try to write a procedure I get stuck.

This time is no different:

restart;

global a:=0.081819221, PI:=3.1415926535897932384626433832795;
Ecce:=proc(lt)
lat:=lt*(PI/180);
b:=((1-a*sin(lat))/(1+a*sin(lat)))^(a/2));
t:=ln((tan(PI/4)+lat/2));
d:=3437.7468*t*b;
return d;
end proc;

I digit the following to get a result
Ecce(45.2112);

and this is what I get (in blue)
Ecce(45.2112)

Every single time. I can never have a procedure that works right away. It's getting on my nerves

Very simple procedure:

Restart;

global a:=0.0065, R0:=1.225, T0:=273.16, gamma:=1.4, R:=287.04;

Spd :=proc(H, T1, IAS);

T:=T1+T0;

rho:=R0*(1-((a)/(T)*1000)^(4.26));

sigma:=T0/(T)*(1-(a/(T0)*H)^(5.26));

EAS:=sqrt((rho*IAS^(2))/(R0));

TAS:=EAS*sqrt(R0/(rho));

SpdSnd:=sqrt(gamma*R*T);

M:=TAS/(SpdSnd);

return M;

end proc;

Entering Spd(5000, 15, 400); with return I get

Spd(5000, 15, 400) in blue and not a numeric rsult.

Where am I wrong?

Martina

Hello,

I just bought and installed "The mathematical Survival Kit" but I can't figure out how does it work

Anybody can help?

 

Thanaks

Martina

As I stated in an earlier post, I'm new at this.

I'm trying to write a procedure to calculate what is called a "crescent latitude". The full formula can be seen here: https://db.tt/QAUzH5i0.

b is equal to 0.081819221; it takes a single parameter φ (latitude of a location in degrees)

 

I normally get errors like unable to parse, unable to match delimters, etc. and the result is the name of the procedure and whatevere value of the parameter I put in parenthesis, not the calculated value.

Anybody can help?

 

Thanlk you

Martina

1 2 3 Page 2 of 3