Thevenin and Norton equivalent sources have three parameters
Thevenin and Norton equivalent sources have three parameters, open-circuit voltage, short-circuit current, and resistance, but only two need to be specified and the third is a function of the other two. Write a script that allows the user to enter any two of the three (there are three possibile combinations) and computes and prints the Thevenin (voltage and resistance) and Norton (current and resistance) source parameters. The following is an example of what the script output might look like (this is only an example, feel free to come up with something better) Given open-circuit voltage = 6 V and short-circuit current = 3 A the equivalent sources are Thevenin: V = 6 V in series with R = 2 ohms Norton: I = 3 A in parallel with R = 2 ohms Show test results for each of the three possible input combinations.
Solution
%clearing window, variables and figures
 clear all;
 close all;
 clf;
 clc;
 c=0;
 while(c==0)
 ch=input(\'Enter 1 if you would like to enter open circuit voltage and short circuit current, 2 if you would like to enter open circuit voltage and resistance and 3 if you would like to enter short circuit current and resistance:\');
 if ch==1
 voc=input(\'\ Enter the open circuit voltage:\');
 isc=input(\'\ Enter the short circuit current:\');
 fprintf(\'\ V = %d in series with R = %d ohms and Norton: I = %d in parallel with R = %d ohms\',voc,voc/isc,isc,voc/isc);
 elseif ch==2
 
 voc=input(\'\ Enter the open circuit voltage:\');
 r=input(\'\ Enter the resistance:\');
 fprintf(\'\ V = %d in series with R = %d ohms and Norton: I = %d in parallel with R = %d ohms\',voc,r,voc/r,r);
 
 elseif ch==3
 isc=input(\'\ Enter the short circuit current:\');
 r=input(\'\ Enter the resistance:\');
 fprintf(\'\ V = %d in series with R = %d ohms and Norton: I = %d in parallel with R = %d ohms\',isc*r,r,isc,r);
 end
 c=input(\'\ Would you like to continue, press 0 if yes\');
 end
Result;
Enter 1 if you would like to enter open circuit voltage and short circuit current, 2 if you would like to enter open circuit voltage and resistance and 3 if you would like to enter short circuit current and resistance:1
Enter the open circuit voltage:5
Enter the short circuit current:1
V = 5 in series with R = 5 ohms and Norton: I = 1 in parallel with R = 5 ohms
 Would you like to continue, press 0 if yes0
 Enter 1 if you would like to enter open circuit voltage and short circuit current, 2 if you would like to enter open circuit voltage and resistance and 3 if you would like to enter short circuit current and resistance:2
Enter the open circuit voltage:5
Enter the resistance:5
V = 5 in series with R = 5 ohms and Norton: I = 1 in parallel with R = 5 ohms
 Would you like to continue, press 0 if yes0
 Enter 1 if you would like to enter open circuit voltage and short circuit current, 2 if you would like to enter open circuit voltage and resistance and 3 if you would like to enter short circuit current and resistance:3
Enter the short circuit current:1
Enter the resistance:5
V = 5 in series with R = 5 ohms and Norton: I = 1 in parallel with R = 5 ohms
 Would you like to continue, press 0 if yes1


