The Student Room Group

MatLab help needed.

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?
Reply 1
:confused: anyone?
have you actually written anything in matlab so far?
Give me a minute to do this.

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

And 10 mins to load matlab on my laptop


:yy:
Original post by Peace0fM1nd
:yy:


What range of ic are we looking at?
Reply 7
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!
Reply 8
Original post by Nick Longjohnson
What range of ic are we looking at?


10exp-4<ic>10exp4 (on logarithmic scale)
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
(edited 13 years ago)
Reply 10
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
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



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
(edited 13 years ago)
Reply 12
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



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. :cool:

Quick Reply

Latest

Trending

Trending