## 104 Reputation

17 years, 209 days

## Thank you very much for your...

Thank you very much for your answers. Why is there no need of a ";" at the end of evalf(sqrt(1/T*Int(iL^2, t = 0 .. T))), evalf(1/T*Int(iL, t = 0 .. T)) ? Could I write also [evalf(sqrt(1/T*Int(iL^2, t = 0 .. T))), evalf(1/T*Int(iL, t = 0 .. T))]; ?

## The trick with max is nice....

The trick with max is nice. How many values can a procedure return? Why do I need this time evalf and Int? When I want to plot iL_RMS and iL_AVG independently, how can I access the two return values. Before I have used the commands below to plot iL_AVG: iL_AVG_func_Ua_const:=(Ia_IaLGmax,Ua_Ue)->iL_RMS_AVG(1/Ua_Ue*Ua_input,Ua_input, Ia_IaLGmax*Ua_input/(2*L_input)*T_input,L_input,T_input,1); plot3d(iL_AVG_func_Ua_const, 0..2, 0..1, axes=normal, title="AVG current through the inductor with Ue variable and Ua constant", labels=["Ia_IaLGmax", "Ua_Ue", "iL_AVG_Ua_const"]); When can I use the return command in maple? Can I use it in a procedure somehow like this ... if Ia=50 then return -1 end if ...?

## The trick with max is nice....

The trick with max is nice. How many values can a procedure return? Why do I need this time evalf and Int? When I want to plot iL_RMS and iL_AVG independently, how can I access the two return values. Before I have used the commands below to plot iL_AVG: iL_AVG_func_Ua_const:=(Ia_IaLGmax,Ua_Ue)->iL_RMS_AVG(1/Ua_Ue*Ua_input,Ua_input, Ia_IaLGmax*Ua_input/(2*L_input)*T_input,L_input,T_input,1); plot3d(iL_AVG_func_Ua_const, 0..2, 0..1, axes=normal, title="AVG current through the inductor with Ue variable and Ua constant", labels=["Ia_IaLGmax", "Ua_Ue", "iL_AVG_Ua_const"]); When can I use the return command in maple? Can I use it in a procedure somehow like this ... if Ia=50 then return -1 end if ...?

## You got me there. I only...

You got me there. I only looked in my first comment off this thread. The procedure at the moment looks as follows: iL_RMS_AVG:=proc(Ue,Ua,Ia,L,T,art) > local io, iL_increase, iL_decrease, iL, returnvalue; > if Ia<=1/2*(Ue-Ua)/L*Ua/Ue*T then io:=0 else io:=Ia-1/2*(Ue-Ua)/L*Ua/Ue*T end if; > iL_increase:=io+(Ue-Ua)/L*t; > iL_decrease:=io+(Ue-Ua)/L*dutycycle(Ia,L,Ua,Ue,T)*T-Ua/L*(t-dutycycle(Ia,L,Ua,Ue,T)*T); > iL:=piecewise(t0), iL_decrease,0); > if art=0 then sqrt((1/T)*int(iL^2,t=0..T)) else 1/T*int(iL, t=0..T) end if; > end; > iL_RMS:=iL_RMS_AVG(Ue_input,Ua_input,Ia_input,L_input,T_input,0); > iL_AVG:=iL_RMS_AVG(Ue_input,Ua_input,Ia_input,L_input,T_input,1);

## You got me there. I only...

You got me there. I only looked in my first comment off this thread. The procedure at the moment looks as follows: iL_RMS_AVG:=proc(Ue,Ua,Ia,L,T,art) > local io, iL_increase, iL_decrease, iL, returnvalue; > if Ia<=1/2*(Ue-Ua)/L*Ua/Ue*T then io:=0 else io:=Ia-1/2*(Ue-Ua)/L*Ua/Ue*T end if; > iL_increase:=io+(Ue-Ua)/L*t; > iL_decrease:=io+(Ue-Ua)/L*dutycycle(Ia,L,Ua,Ue,T)*T-Ua/L*(t-dutycycle(Ia,L,Ua,Ue,T)*T); > iL:=piecewise(t0), iL_decrease,0); > if art=0 then sqrt((1/T)*int(iL^2,t=0..T)) else 1/T*int(iL, t=0..T) end if; > end; > iL_RMS:=iL_RMS_AVG(Ue_input,Ua_input,Ia_input,L_input,T_input,0); > iL_AVG:=iL_RMS_AVG(Ue_input,Ua_input,Ia_input,L_input,T_input,1);

## Well, when I entered <= I...

Well, when I entered <= I had entered '<'=. There I had thought that you meant with '<' a special trick in Maple.

## Well, when I entered <= I...

Well, when I entered <= I had entered '<'=. There I had thought that you meant with '<' a special trick in Maple.

## Less Than...

Ups, I missunderstood you there. When I view this site with my Firefox browser from Germany everything but the starting > in the procedure looks like the one in Maple.

## Less Than...

Ups, I missunderstood you there. When I view this site with my Firefox browser from Germany everything but the starting > in the procedure looks like the one in Maple.

## Sorry, I forgot to mention...

Sorry, I forgot to mention that IaLG_boundary_condition was defined as follows: IaLG_boundary_condition:=1/2*(Ue-Ua)/L*Ua/Ue*T; Still, it didn't work. How do I use < (isn't it from HTML?)? Do I have to include some packages? How do I write >= (>=?)? I rewrote the whole procedure and now it works, but I don't understand why it didn't before. Now my procedure looks as follows: # art=0 returns RMS current and art=1 returns AVG current > > iL_RMS_AVG:=proc(Ue,Ua,Ia,L,T,art) > local io, iL_increase, iL_decrease, iL, returnvalue; > if Ia<=1/2*(Ue-Ua)/L*Ua/Ue*T then io:=0 else io:=Ia-1/2*(Ue-Ua)/L*Ua/Ue*T end if; > iL_increase:=io+(Ue-Ua)/L*t; > iL_decrease:=io+(Ue-Ua)/L*dutycycle(Ia,L,Ua,Ue,T)*T-Ua/L*(t-dutycycle(Ia,L,Ua,Ue,T)*T); > iL:=piecewise(t0), iL_decrease,0); > if art=0 then sqrt((1/T)*int(iL^2,t=0..T)) else 1/T*int(iL, t=0..T) end if; > end; > iL_RMS:=iL_RMS_AVG(Ue_input,Ua_input,Ia_input,L_input,T_input,0); > iL_AVG:=iL_RMS_AVG(Ue_input,Ua_input,Ia_input,L_input,T_input,1); Thanks for your help.

## Sorry, I forgot to mention...

Sorry, I forgot to mention that IaLG_boundary_condition was defined as follows: IaLG_boundary_condition:=1/2*(Ue-Ua)/L*Ua/Ue*T; Still, it didn't work. How do I use < (isn't it from HTML?)? Do I have to include some packages? How do I write >= (>=?)? I rewrote the whole procedure and now it works, but I don't understand why it didn't before. Now my procedure looks as follows: # art=0 returns RMS current and art=1 returns AVG current > > iL_RMS_AVG:=proc(Ue,Ua,Ia,L,T,art) > local io, iL_increase, iL_decrease, iL, returnvalue; > if Ia<=1/2*(Ue-Ua)/L*Ua/Ue*T then io:=0 else io:=Ia-1/2*(Ue-Ua)/L*Ua/Ue*T end if; > iL_increase:=io+(Ue-Ua)/L*t; > iL_decrease:=io+(Ue-Ua)/L*dutycycle(Ia,L,Ua,Ue,T)*T-Ua/L*(t-dutycycle(Ia,L,Ua,Ue,T)*T); > iL:=piecewise(t0), iL_decrease,0); > if art=0 then sqrt((1/T)*int(iL^2,t=0..T)) else 1/T*int(iL, t=0..T) end if; > end; > iL_RMS:=iL_RMS_AVG(Ue_input,Ua_input,Ia_input,L_input,T_input,0); > iL_AVG:=iL_RMS_AVG(Ue_input,Ua_input,Ia_input,L_input,T_input,1); Thanks for your help.

The disadvantage of this solution is that when you resize the plot the label of the color bar will most likely move to places where you don't want to have it. When you decrease the plot size the label of the color will move to the plot area of the density function.