Plotting a simple coverage equation

4 vues (au cours des 30 derniers jours)
Jason
Jason le 5 Mai 2018
I am by no means an experienced Matlab user and simply want to simulate the predictions of an expression 1/Rtot=(1-theta)/Ra + (theta/Rb) where theta is an array of coverages and Ra and Rb specified resistors. I am using Rtot=(Ra./(1-theta))+(Rb./(theta)) but this is giving wildly wrong Rtot values so the expression must be formulated incorrectly. Any advice hugely well one - have stared at this for way too long and cant see the fault

Réponse acceptée

Jason
Jason le 5 Mai 2018
OK, thats embarrassing....comes from staring at the screen too long...I am very grateful
  1 commentaire
Ameer Hamza
Ameer Hamza le 5 Mai 2018
You are welcome.

Connectez-vous pour commenter.

Plus de réponses (2)

Ameer Hamza
Ameer Hamza le 5 Mai 2018
This is not an error with MATLAB syntax. You are using the mathematics wrong. What you are trying to do means
if 1/c = 1/a + 1/b => c = a + b
does this equation look correct? The correct is
c = a*b/(a+b);
So to correct your equation in MATLAB use,
Rtot= 1./((1-theta)./Ra + (theta./Rb));

Jason
Jason le 6 Mai 2018
Hi - I am using this:
clear all theta=linspace(1e-10,1e-2,5e3) %an array of fractional coverage data points Rn=300 % resistance per unit surface area for the normal film hundreds kOhm cm2 Rd=3e-6 % resistance per unit area for defects 3 Ohms/cm2 Rct= 1./((1-theta)./Rn+(theta./Rd)); %for low theta Rct=Rn plot(theta,Rct,':r*') xlim([1e-8 1e-4]) ylim([0 400])
This is working fine in the sense that I think everything is correct mathematically BUT this should be displaying as a sigmoid and it is not. I cant seem to get the output I expect by changing either the xlim, ylim or linespace options.

Catégories

En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by