0

Equation is as shown:

Ii=7.5-1.1e-06*exp((Vv+0.3*Ii)/2)+(1.1e-06)-(Vv+0.3*Ii)/271;

How can I plot a graph of Ii vs Vv, given Vv with a step size of:

Vv=0:1.5:35; 

Would really appreciate any help thanks

rst
  • 2,510
  • 4
  • 21
  • 47
  • You need a nonlinear system solver: http://ch.mathworks.com/help/optim/ug/fsolve.html – rst Jan 28 '16 at 08:10
  • Can you explain more how to do it? I have problem because i would like to plot it over a range of Vv from 0-35 with a step size of 1.5, and I have only one equation. – user5850017 Jan 28 '16 at 08:19
  • 1
    For each Vv you need to solve the equation, store the result in a vector and then plot it using the `plot` function. Do you even have the `fsolve` function? – rst Jan 28 '16 at 08:28

1 Answers1

0

You can use solve method:

Vv_arr = 0:1.5:35;
res_arr = [];

syms Ii

for Vv=Vv_arr
    sol = solve(7.5-1.1e-06*exp((Vv+0.3*Ii)/2)+(1.1e-06)-(Vv+0.3*Ii)/271 - Ii == 0);
    res = eval(vpa(sol));
    res_arr = [res_arr res];
end

plot(Vv_arr, res_arr, 'LineWidth', 2);
grid on;
xlabel('Vv');
ylabel('Ii');

solution for a non-linear equation

Anton
  • 4,544
  • 2
  • 25
  • 31