Ramakrishnan

Ramakrishnan Vaidyanathan

399 Reputation

13 Badges

11 years, 88 days

Social Networks and Content at Maplesoft.com

With twenty years of Industrial experience and twenty years of teaching experience, I am now as retired Professor, using Maple to teach mathematics subject for students studying X to XII standards. Published XII Mathematics books.

MaplePrimes Activity


These are replies submitted by Ramakrishnan

@tomleslie 

Yes. Copy paste (No cut paste) may be the culprit. Also from your document (with subscripted like data 1,2 variables in place of indexed variables like data[1][2] in my doc), i suspect i have faulted in atomic variable option selection (I donot know much about it and typesetting). I understand it is my problem only tofind out the culprit text by comparing the original and this one. Unfortunately I am more worried about the old original doc (and the time and tension it generates i cannot stand at my age). Hence i will do by retyping the codes all and check. Thanks for the trouble taken by you and CarlLove.

Cheers.

Another excellent solution I got from Dr.Robert, to do it in single loop,
 

restart

R1 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 2.36; BTE := .271; sfc := .308; Data[1, 1] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]
NULL

R2 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 2.75; BTE := .298; sfc := .282; Data[1, 2] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R3 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 3.14; BTE := .318; sfc := .264; Data[1, 3] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

``

R1 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 2.37; BTE := .323; sfc := .258; Data[2, 1] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R2 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 2.76; BTE := .350; sfc := .239; Data[2, 2] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R3 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 3.15; BTE := .369; sfc := .229; Data[2, 3] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

``

Try doing it the following way:

NULL

NULL

for i to 2 do N[i] := seq(Data[i, k][4], k = 1 .. 3) end do

2.37, 2.76, 3.15

(1)

``

N[1] = 2.36, 2.75, 3.14 

N[2] = 2.37, 2.76, 3.15 

 

NULL

``


 

Download ExcellentAnswer_A_ReactantValues.mw

ExcellentAnswer_A_ReactantValues.mw

is attached.

 

 

restart

R1 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 2.36; BTE := .271; sfc := .308; Data[1, 1] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]
NULL

R2 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 2.75; BTE := .298; sfc := .282; Data[1, 2] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R3 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 3.14; BTE := .318; sfc := .264; Data[1, 3] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

``

R1 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 2.36; BTE := .323; sfc := .258; Data[2, 1] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R2 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 2.75; BTE := .350; sfc := .239; Data[2, 2] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R3 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 3.14; BTE := .369; sfc := .229; Data[2, 3] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

``

``

``

for i to 2 do N[i] := NULL; for j to 3 do N[i] := N[i], Data[i, j][4] end do end do

Error, `,` unexpected

 

N[1]

2.36, 2.75, 3.14

(1)

N[2]

2.36, 2.75, 3.14

(2)


If I change NULL to [NULL], the Error, `,` unexpected does not show, but N[1] and N[2] has fisrt value as empty cell. that is [], 2.36, 2.75, 3.14

I want the error to be removed and output as it is 2.36, 2.75, 3.14 and not as
"[],2.36,2.75,3.14  Can you help please"?""


 

Download Doubt_A_ReactantValues.mw

@Carl Love 

ok Thanks

 


 

eq1 := 3*x^2+x+2

HERE BRING THE MOUSE and PRESS CTRL+DELETE buttons.

if diff(eq1(x), x) = 6*x+1 then print(yes) else print(no) end if

yes

(1)

"Another command Prompt(>). HERE BRING THE MOUSE and PRESS CTRL+DELETE buttons."

eq1 := 3*x^2+x+2


 

Download where.mw

where.mw

an empty cell. Where does it show? Thannks.

 

If it is command pronpts with no commands in the line, then what CarlLove is correct. I used to cut the next command lines and paste there!!
 

 

@Carl Love 

I hv attached the doc and copied from edit menu the startup code in the worksheet. Hope this helps to you to guide me. However module output is not used by me in this doc. The first loop can be removed to prevent module function to perform.

If i use [NULL], then the error goes, but [ ] is assed in the list as first value.

Thanks.Doubt_A_ReactantValues.mw
 

Data made for Data[i,j] [k] where i =1,2; j=1..8. Each Data has 6 values. k = 1..6

For each data i got an output list of 6 values using a module;

I made a for do statement which performs but gives an error "unexpected ','.

Can any onr help to find my mistake. Thanks.

 

restart

R1 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 2.36; BTE := .271; sfc := .308; Data[1, 1] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]
``

R2 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 2.75; BTE := .298; sfc := .282; Data[1, 2] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R3 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 3.14; BTE := .318; sfc := .264; Data[1, 3] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R4 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 3.53; BTE := .330; sfc := .253; Data[1, 4] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R5 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 3.88; BTE := .334; sfc := .249; Data[1, 5] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R6 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 3.93; BTE := .334; sfc := .249; Data[1, 6] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R7 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 4.32; BTE := .330; sfc := .253; Data[1, 7] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R8 := "SE2"; BP__ref := 3.93; BTE__optimum := .334; BP := 4.71; BTE := .318; sfc := .264; Data[1, 8] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

``

R1 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 2.36; BTE := .323; sfc := .258; Data[2, 1] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R2 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 2.75; BTE := .350; sfc := .239; Data[2, 2] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R3 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 3.14; BTE := .369; sfc := .229; Data[2, 3] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R4 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 3.53; BTE := .380; sfc := .219; Data[2, 4] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R5 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 3.88; BTE := .383; sfc := .217; Data[2, 5] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R6 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 3.88; BTE := .383; sfc := .217; Data[2, 6] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R7 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 4.32; BTE := .378; sfc := .221; Data[2, 7] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

R8 := "4S"; BP__ref := 3.88; BTE__optimum := .383; BP := 4.71; BTE := .365; sfc := .229; Data[2, 8] := [R1, BP__ref, BTE__optimum, BP, BTE, sfc]

 

NULL

Data[1, 8][4]

4.71

(1)

NULL

NULL

for i to 2 do for j to 8 do y[i, j] := action1:-Mproc(Data[i, j]); print(Data[i, j], y[i, j]) end do end do

["4S", 3.88, .383, 4.71, .365, .229], ["4S", .4311313490, 0.5411807293e-1, 0.3357509744e-1, .4235561571, 0.6183000001e-1]

(2)

``

N1 := NULL; for j to 8 do N1 := N1, Data[1, j][4] end do; print(N1)

2.36, 2.75, 3.14, 3.53, 3.88, 3.93, 4.32, 4.71

(3)

for i to 2 do N[i] := NULL; for j to 8 do N[i] := N[i], Data[i, j][4] end do end do; print(N[2])

Error, `,` unexpected

 

N[2]

2.36, 2.75, 3.14, 3.53, 3.88, 3.88, 4.32, 4.71

(4)

N[1]

2.36, 2.75, 3.14, 3.53, 3.88, 3.93, 4.32, 4.71

(5)

with(MathematicalFunctions); action1 := module () export Mproc, y;  Mproc := proc (Data) R7 := Data[1]; BP__ref := Data[2]; BTE__optimum := Data[3]; BP := Data[4]; BTE := Data[5]; sfc := Data[6]; sfcmoles := (1/114)*sfc; ea := .1; c1 := .1; c2 := .2; n__f := sfcmoles; `n__air,act` := 12.5*n__f*(1+ea)*sfcmoles/.21; f__ncg := combine(piecewise(BTE < .5, 1-2*BTE, .5 <= BTE, BTE)); f__cg := 1-f__ncg; f__nox := combine(piecewise(BP < BP__ref, c1*BP/BP__ref, BP__ref < BP, c1*BP/BP__ref)); f__co := combine(piecewise(BP < BP__ref, c2*BP/BP__ref, BP__ref < BP, c2*BP__ref/BP)); k__o2 := 12.5; k__co := 8; `n__o2,st` := n__f*k__o2; `n__air,st` := `n__o2,st`/.21; f__ea := ea; `n__air,act` := `n__o2,st`*(1+f__ea)/.21; n__7 := f__ncg*n__f; n__N2 := .79*`n__air,act`; n__O2 := .21*`n__air,act`; n__2 := n__f*f__cg*f__co*k__co; n__1 := 8*n__f-n__2-8*n__7; n__3 := 9*n__f-9*n__7; n__5 := f__cg*f__nox*n__N2; n__4 := (1/2)*.21*2*`n__air,act`-n__1-(1/2)*n__2-(1/2)*n__3-n__5; n__6 := (1/2)*.79*2*`n__air,act`-(1/2)*n__5; y := [R7, 44*n__1, 28*n__2, 32*n__4, 46*n__5, 114*n__7] end proc end module


 

Download Doubt_A_ReactantValues.mw

 

@Carl Love 

Yes. It works and i enclose the doc... Thanks. 

Ramakrishnan V

 

 

 


 

                                                                                         
with(DocumentTools); for i to 12 do SetProperty("RotaryGauge0", value, 6); print(SetProperty("RotaryGauge1", value, .66*GetProperty("RotaryGauge0", value))); time*[]; 3^100; GetProperty("RotaryGauge0", value); print(SetProperty("RotaryGauge0", value, 4)); print(SetProperty("RotaryGauge1", value, .7*GetProperty("RotaryGauge0", value))); time[real](); 3^100; print(SetProperty("RotaryGauge0", value, 2)); print(SetProperty("RotaryGauge1", value, .5*GetProperty("RotaryGauge0", value))); time[real](); 3^100 end do

(1)

NULL


 

Download varying_input.mw

varying_input.mw

@Ramakrishnan 

 "Say No to dialogue box "Do you wish To save these results"." (This does not affect the performance when opened again.)
Rightclick in Navigator window attach file fig1.bmp
Save as workbook (.maple file).

Saying Yes to save summary results generates the error because semicolons and colons are missing in our doc. After correction, it saves well. I attach pdf of workbook since workbooks are not uploaded.

Fig3.pdf

Fig2.maple

Fig2.pdf

@Carl Love 

A colon does completely supresses all outputs including the change in RotaryGauge0 (RG0) indication. Please send me doc corrected with output changing (or input changing in RG0)

Thanks.

Ramakrishnan V

varying_input.mw

@Preben Alsholm 

Thanks to the problem provided however it may look to any, and the final codes from Preben Alsholm  for check, gave many a lessons to me. I have learnt the art of using random numbers and function generators for checking typical situation like this. Thanks. Ramakrishnan V

A good post. Worth learning. Gives complex ideas. A detailed naration in awebinar will be useful to bright students. Congratulations to the author.

Ramakrishnan

@Ramakrishnan 

-2 on RHS with coef of x3 increased by 1 (i.e 42 to 43) gives a unique solution in maple.
 

restart
eq1 := 1752*x1+384*x2+384*x3+72*x4 = 0

1752*x1+384*x2+384*x3+72*x4 = 0

(1)

eq2 := 384*x1+366*x2+43*x3-144*x4 = -2

384*x1+366*x2+43*x3-144*x4 = -2

(2)

eq3 := 384*x1+42*x2+366*x3-144*x4 = 0

384*x1+42*x2+366*x3-144*x4 = 0

(3)

eq4 := 72*x1-144*x2-144*x3+216*x4 = 0

72*x1-144*x2-144*x3+216*x4 = 0

(4)

solve({eq1, eq2, eq3, eq4}, [x1, x2, x3, x4])

[[x1 = 1, x2 = -2, x3 = -2, x4 = -3]]

(5)

``

``


 

Download SimEquationsSolved.mwSimEquationsSolved.mw

@Kitonum 

is it because the frames chosen for solution (red) segments should be same as the plot frames for tandem operation (both visible on plot). I changed both frames to 120. It is ok. Only if they differ, one of them (graph or segment) disappears. Any other reason, please confirm

Hope i am correct.

Thanks.

Ramakrishnan V

@Kitonum 

Thank you. I will go through for frames = 121 and why not 120. Initial guess is so that 120/6 = 20, and therefore start afresh from a =1 ;

Thanks again. for response and clarification

Ramakrishnan V

@Kitonum 

I get a message output length exceeds for the first line alone where as it works in the programme. Any reason. Thanks for answer.

Ramakrishnan V

 

animate_
 

restart

plots:-animate(plot, [x^3+a*x+2, x = -4 .. 4, -15 .. 15, color = blue, thickness = 2], a = -6 .. 0, frames = 122)

 

restart; A := plots:-animate(plot, [x^3+a*x+2, x = -4 .. 4, -15 .. 15, color = blue, thickness = 2], a = -6 .. 0, frames = 120)

`[Length of output exceeds limit of 1000000]`

(1)

``


 

Download animate_assignment.mw

assignment.mw

@Kitonum 

The programme code displayed in your message is very good and appealing for a learner like me. It shows the usage of

procedure,

if command,

single plot,

display multiple plots,

plot options and]

animation.

A bright display of codes as well . Thank you very much.

Thanks also to Maxim for being a source to very interesting responses.

Ramakrishnan V

@_Maxim_ 

I followed your procedure to the extent i know. I got unque solution.

Hope it is correct as expected.
 

NULL``

y := seq(evalf[3](evalf[d]((exp((-1-I)*Pi))^(1+I))), d = 10 .. 3010, 300)

1.00-0.873e-10*I, 1.00-0.402e-310*I, 1.00+0.934e-610*I, 1.00-0.413e-910*I, 1.00+0.174e-1210*I, 1.00-0.116e-1510*I, 1.00+0.919e-1810*I, 1.00-0.925e-2110*I, 1.00-0.988e-2410*I, 1.00+0.412e-2710*I, 1.00+0.199e-3009*I

(1)

for i to 9 do printf("     %1.10Zg \n ", y[i]) end do

     1-8.73e-11I

      1-4.02e-311I
      1+9.34e-611I
      1-4.13e-911I
      1+1.74e-1211I
      1-1.16e-1511I
      1+9.19e-1811I
      1-9.25e-2111I
      1-9.88e-2411I
 

 

ABOVE ONE is OLD ANSWER

NULL
NEW*ANSWER; UNIQUE USING PROPER FORMAT SUGGESTED

 

y1 := seq(evalf[d](exp((-1-I)*Pi)), d = 10 .. 3010, 300)

y2 := seq(evalf[3](y1[i]^(1+I)), i = 1 .. 9)

1.00-0.323e-3*I, 1.00-0.323e-3*I, 1.00-0.323e-3*I, 1.00-0.323e-3*I, 1.00-0.323e-3*I, 1.00-0.323e-3*I, 1.00-0.323e-3*I, 1.00-0.323e-3*I, 1.00-0.323e-3*I

(2)

for i to 9 do printf("     %1.10Zg \n ", y2[i]) end do

     1-0.000323I
      1-0.000323I
      1-0.000323I
      1-0.000323I
      1-0.000323I
      1-0.000323I
      1-0.000323I
      1-0.000323I
      1-0.000323I
 

 

``


 

Download Unique_Answer.mw

Unique_Answer.mw

4 5 6 7 8 9 10 Page 6 of 13