You are Here: Home

# MatLab help needed. Watch

1. The problem is to find the intersection of two straight lines.

Namely, im working out the critical currenty density of corrosion in metal. But in any case, its a matter of solving for 1 unknown and I need your help.

Equations:
Vf1=Vf+Bflog(ic/if)
Vh1=Vh+Bhlog(ic/ih)

where,
Vf=-0.44
Bf=0.10
if=10exp-8
Vh=0
Bh=-0.08
ih=10exp-10

and we need to find ic,

can anyone help?
2. anyone?
3. Try the Maths forum

http://www.thestudentroom.co.uk/forumdisplay.php?f=38
4. have you actually written anything in matlab so far?
5. Give me a minute to do this.

And 10 mins to load matlab on my laptop
6. (Original post by Nick Longjohnson)
Give me a minute to do this.

And 10 mins to load matlab on my laptop
7. (Original post by Peace0fM1nd)
What range of ic are we looking at?
8. (Original post by didgeridoo12uk)
have you actually written anything in matlab so far?
YEs, but need more practice. i realised how i could use matlab to help me solve some corrosion problems, so im like using it on my own initiative - but i quickly found out how much practice i still need!! plus its amazing how many uses matlab actualy has!
9. (Original post by Nick Longjohnson)
What range of ic are we looking at?
10exp-4<ic>10exp4 (on logarithmic scale)
10. (Original post by Peace0fM1nd)
10exp-4<ic>10exp4 (on logarithmic scale)
My drunk/tired ass is having difficulty doing them now.

Im thinking of just making a function of Vf1-Vh1, and then using the fzero function to find where the difference is zero

Edit: I just plotted it to check, and it doesnt seem to cross within that range, unless im doing something wrong :s
11. (Original post by Nick Longjohnson)
My drunk/tired ass is having difficulty doing them now.

Im thinking of just making a function of Vf1-Vh1, and then using the fzero function to find where the difference is zero
If it helps, i know that critical current density log(ic)= -2.446, i need to visualise the solution and. y axis will show V, x axis whill show ic. thanks for your help dude
12. (Original post by Peace0fM1nd)
If it helps, i know that critical current density log(ic)= -2.446, i need to visualise the solution and. y axis will show V, x axis whill show ic
I just did this to plot it, and it doesnt seem to cross (called if idotf so it doesnt interpret it as an 'if' statement :P):

Spoiler:
Show
clear

Vf=-0.44;
Bf=0.10;
idotf=10^(-8);
Vh=0;
Bh=-0.08;
ih=10^(-10);

ic=linspace(10^(-4),10^4,10000);
Vf1=Vf+Bf*log(ic/idotf);
Vh1=Vh+Bh*(log(ic/ih));

plot(ic,Vf1,ic,Vh1)
xlim([0 0.01])

Fzero is saying it goes into complex numbers:

root = fzero(@(ic)((-0.44+0.1*log(ic/(10^(-8))))-(0.08*log(ic/(10^(-10))))),0.01)

be advised: I havnt done matlab in a while and am very tired
13. (Original post by Nick Longjohnson)
I just did this to plot it, and it doesnt seem to cross (called if idotf so it doesnt interpret it as an 'if' statement :P):

Spoiler:
Show
clear

Vf=-0.44;
Bf=0.10;
idotf=10^(-8);
Vh=0;
Bh=-0.08;
ih=10^(-10);

ic=linspace(10^(-4),10^4,10000);
Vf1=Vf+Bf*log(ic/idotf);
Vh1=Vh+Bh*(log(ic/ih));

plot(ic,Vf1,ic,Vh1)
xlim([0 0.01])

Fzero is saying it goes into complex numbers:

root = fzero(@(ic)((-0.44+0.1*log(ic/(10^(-8))))-(0.08*log(ic/(10^(-10))))),0.01)

be advised: I havnt done matlab in a while and am very tired
LOL. in any case, thanks for your help. its not how the graph should appear, but i'l work on your script and see what i can do.

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: December 27, 2010
Today on TSR

### Degrees to get rich!

... and the ones that won't

### Women equal with Men?

Discussions on TSR

• Latest
• ## See more of what you like on The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

• Poll
Useful resources

## Articles:

Debate and current affairs forum guidelines

## Groups associated with this forum:

View associated groups
Discussions on TSR

• Latest
• ## See more of what you like on The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

• The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.