I want to plot the following function, where Uin is the variable (that has to be on the x-axis):
y[Uin]:=2*fin*(2*T*Ud - ((Ud)/(fin)) + ((Uin*Sin[2*Pi*fin*T])/(2*Pi*fin)) +
c*Rb*(2*Ud - Uin)*(Exp[-((T)/(c*Rb))] - 1))
Now Ud,fin,Rb and care constants, for example
Ud = 0.7, fin = 50, Rb = 10 , c = 150*10^(-6)
But to find T I need to solve:
FindRoot[
Abs[Uin*Sin[2*Pi*fin*T - (Pi/2)]] - 2*Ud == (Uin - 2*Ud)*Exp[-T/(c*Rb)]
, {T, 1/(4*fin), 1/(2*fin)}
, WorkingPrecision -> 20
]
Now how can I plot the function y[Uin] while varying Uin?
My work, I programmed:
Ud = 0.7; fin = 50; Rb = 10; c = 150*10^(-6);
y[Uin_] =
2*fin*(2*T*Ud - ((Ud)/(fin)) + ((Uin*Sin[2*Pi*fin*T])/(2*Pi*fin)) +
c*Rb*(2*Ud - Uin)*(Exp[-((T)/(c*Rb))] - 1));
Teqn[Uin_] =
Abs[Uin*Sin[2*Pi*fin*T - (Pi/2)]] - 2*Ud == (Uin - 2*Ud)*
Exp[-T/(c*Rb)];
Tsol[Uin_?NumericQ] :=
FindRoot[Teqn[Uin], {T, 1/(4*fin), 1/(2*fin)}]; ListPlot[
Table[{Uin, y[Uin] /. Tsol[Uin]}, {Uin, 0, 10, 0.001}]]
But that produces a not correct result (it gives that y[Uin] stays $1.5$ for all Uin but that can not be possible).

Tspecification inFindRoot. Those are used as the first and second values in the iteration, in order to avoid the internal use of derivatives. Is that what you intended? Perhaps a better starting value and a search interval forTwould work better to avoid the warnings returned byFindRootin your current code. $\endgroup$