You need to, as usual, pay attention to proper use of units.Ok, I almost got it.
This is what I got:
\(
\displaystyle {v_{OUT} = \left\{\begin{matrix}
\frac{4}{7}\cdot v_{IN}+\frac{8}{7},\,\, v_{IN} > 12\\
\frac{2}{3}\cdot v_{IN},\,\, 9< v_{IN}< 12\\
\frac{1}{2}\cdot v_{IN}+\frac{3}{2},\,\, v_{IN}<9V\\
3 ,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, v_{IN}< 3
\end{matrix}\right.}
\)
These aren't mutually exclusive ranges. Your last two both apply for Vin < 3V. But I think this was a typo and you meant to say
\(
\displaystyle {v_{OUT} = \left\{\begin{matrix}
\frac{4}{7}\cdot v_{IN}+\frac{8}{7}V,\,\, 12V < v_{IN}\\
\frac{2}{3}\cdot v_{IN},\,\, 9V< v_{IN}< 12V\\
\frac{1}{2}\cdot v_{IN}+\frac{3}{2}V,\,\, 3V<v_{IN}<9V\\
3 ,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, v_{IN}< 3V
\end{matrix}\right.}
\)
On a strictly formatting note, you might consider this:
\(V_{OUT} = \left\{ \begin{array}{ccrcl}
\frac{4}{7}\(v_{IN}+2V\) & \mbox{;} & 12V \le & v_{IN} & \\
\frac{2}{3} v_{IN} & \mbox{;} & 9V \le & v_{IN} & \le 12V \\
\frac{1}{2}\( v_{IN}+3V) & \mbox{;} & 3V \le & v_{IN} & \le 9V \\
3V & \mbox{;} & & v_{IN} & \le 3V\\
\end{array}
\)
Notice the use of equality at the endpoints. Some would argue that this is incorrect because now the endpoints of each range are governed by two defining equations. Others argue that this is acceptable as long as both definitions produce the same result and point out that it has the utility of explicitly indicating that the two ranges are continuous at the boundary. I don't know what the rigorous mathematical answer is to that question.
Before we look at your work below, let's ask if this solution makes sense. The key is that we do expect the output voltage to be a continuous function of the input voltage since there is nothing in this circuit that we would expect to make a large change in output voltage for an infinitesimal change in input voltage. So are your ranges continuous?
At 12V the first equation yields 8V and the second equation yields 8V. (check)
At 9V the second equation yields 6V and the third equation yields 6V. (check)
At 3V the third equation yields 3V and the fourth equation yields 4V. (check)
So as long as your breakpoint voltages are correct and as long as your slopes in the first and last ranges are correct, this is correct. In looking at the original circuit the breakpoint appear correct. The slope of the last range is clearly correct. I worked out the slope in the first range and it is correct. So unless I am missing something or did something wrong (clearly always possible), this is the correct solution.
Ah, so it wasn't a typo and you really were trying to say that the last two equations both apply for Vin < 3V (since that satisfies Vin < 9V). So what is the voltage at Vin=0V? You third line says it is 1.5V while your last line says that it is 0V. Which is it? Always ask if the answer makes sense.The only one I couldn't get, I don't know what is wrong!
The situation where there are differences between my solution and teacher solution is situation 7 - D1 ON - D2 ON - D3 OFF
The conditions that makes diodes like that are:
Vout < Vin ^ Vout < 6V ^ Vout < 8V
<=> Vout < Vin ^ Vout < 6V
Then I say that I1 is the current across R1 = 2.5k, I2 is the current across R2 = 5k and I3 is the current across Rload.
So,
I1 = I2 + I3
(Vin -Vout)/R1 = (Vout - V1)/R2 + Vout/Rload
<=>(Vin - Vout)/(5/2) = (Vout - 6)/5 + Vout/5
<=>2(Vin - Vout)=Vout - 6 + Vout
<=> Vout = (1/2)Vin + 3/2
Then, replacing this equation in the conditions equation, I get:
(1/2)Vin + 3/2 < 6V
Vin < 9V
But our teacher has 3V < Vin < 9V which would have implied that the conditions of Vout for this situation (D1 ON, D2 ON and D3 OFF) would have to be something like x < Vout < y...
So let's take a look at your claims:
D1 = ON => Vout < Vin (check)Vout < Vin ^ Vout < 6V ^ Vout < 8V
D2 = ON => Vout < 6V (check)
D3 = OFF => Vout < 8V (check)
So I agree with you.
The second condition covers the third condition leaving you with
So I agree with you.<=> Vout < Vin ^ Vout < 6V
So you came up with the following equation
Which is correct.Vout = (1/2)Vin + 3/2
You then applied the condition that Vout < 6V
Which gives you Vin < 9V. Fine. But this inequality was only based on the requirement that Vout < 6V.(1/2)Vin + 3/2 < 6V
You still have to apply the requirement that Vin > Vout.