The new forums will be named Coin Return (based on the most recent
vote)! You can check on the status and timeline of the transition to the new forums
here.
The Guiding Principles and New Rules
document is now in effect.
So i'm about to use Matlab for the first time in the first year of my PhD, and coming from a purely biomed background I have NO idea about the engineering/mathematic/computational side of this.
I'm going to be using it to create a math model for my biological system representing receptor-ligand interactions of the immune system in the cancer microenvironment.
So, i'm pretty scared. Terrified, actually.
Any advice on Matlab (breakdown of what it is, why used in biological systems, how to visualise it, good tutorials or textbooks for this purpose etc). I have some ideas, but i'd love to know others opinions more experienced than me!
Thanks!
0
Posts
Edit: I guess that was pretty vague and potentially not helpful but I'm not really sure how to answer your question. I do have a lot of experience with MATLAB though, so if you have some specific questions that you don't want to put in thread, feel free to PM me.
Some points:
-irrc Matlabs bundled manual is pretty okay and should explain the what
-There are lots of different numerical analysis software platforms out there, in my experience people use Matlab because the syntax is easier for the non-CS users, and the central control means it has less sprawling options than the open source stuff like R, its more straightforward to make pretty graphs, and the student license is pretty cheap.
-Your institution should have some sort of introductory course/be willing to send you to one elsewhere. It is really helpful to get to grips with stuff like this with someone actually physically present to give you advice.
-If you've never used anything like this before, pretty much any book in the library about Matlab will be worth a gander at, at least the first chapter or so .
If you are in a PhD program that recommends using Matlab, I think what you want is to talk to someone who's already used it for something similar and ask for their code. If this is a case of "my advisor thinks s/he's heard of of Matlab being a good thing for stuff," Goal One might be to define your problem a bit better and look for a class on numerical methods in your field (or the next closest field) at your school.
Beyond that it's sort of hard to say- can you program a bit in general? If so, you'll probably find Matlab easy to pick up. If not, well, if you're going to do a PhD with a simulation element, you'd have to learn it anyhow, and Matlab's a pretty gentle place to start- go to the library and get literally any book on Matlab. There are also a lot of people online with sample code for molecular dynamics, fluid dynamics, or integrating differential equations.
Matlab's great! It's great that you get to learn it as part of your degree; it'll be useful.
In general Matlab is designed for dealing with (large) matrices of numerical values. So as a comparison, in something like Perl it's very easy to deal with hashes (arrays of text strings), in Matlab it's much more of a pain to deal with strings; however, it's MUCH easier to do linear algebra / computation with matrices in Matlab (all of which are pre-coded in the language as just a single command) than in something like Perl.
If you're coming with no experience I'd highly suggest (as everyone else has) to just go find a Matlab tutorial somewhere online and give it a whirl - honestly, there'll be a couple hours of getting the hang of the interface, and once you understand that the important issues are more conceptual than anything else (with the major one being to start thinking about how to formulate your question as a set of data in a vector/matrix, and how to manipulate that matrix to do the calculations you want).
If that's the case, I would recommend (as others have) hunting down someone in your department who already does something similar to what you want to do. If they can't explain it to you then they can probably at least point you to the resources they used to learn it.
You're a PhD candidate, so obviously you're smart. Don't let some modeling frighten you; it's easier than you probably think it will be.
I'm aware my question was vague, and that is exactly my problem - I have NO coding experience. The PhD was only very vaguely set out when I accepted the offer (which was great for adaptability), however it has now been turned in this direction which is new to me!
So to be more specific, the aim of my course is to look at the changes that occur in Dendritic Cells (of the immune system) when they are activated by their appropriate ligand/target.
I'm going to need to know abundance of receptor, affinity for the ligand, which ligands are involved and the abundance of the cells themselves.
I then want to repleace this interaction with nanoparticles which should allow me to induce a larger scale response than would normally be seen, to detect activation and see what changes occur between the inactive and active state, and how many receptor ligand complexes are necessary to make this activation happen.
I have a book ordered from amazon for Matlab in biosystems, but as my supervisor has given me a two week gap to have a fairly solid grasp of this I thought this would be a good idea for some places to start!
This is an accurate statement; !)
If that's right, I would not focus on Matlab to begin with. The first thing to do is to identify a modeling framework to represent the physical system. If that's not something you can easily do/have already done, perhaps there are publications or collaborators that you can draw on. (This kind of biophysical modeling is very far from my own expertise, so I feel you.) Once that's complete, you can focus on what kind of software you need -- excel may be sufficient!
All that said, it will never hurt you to know some basic coding. It is so ridiculously easy to learn, and so few biologists make the effort, that it's definitely one of the best ways to stand out from your peers.
(Hopefully this doesn't come across as condescending. I am just sort of assuming that you have no modeling expertise from your earlier posts, though I'm not sure you actually said that.)
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-094-introduction-to-matlab-january-iap-2010/index.htm
There also may be some undergraduate classes being taught at your school that will be helpful (Electrical Engineering in particular).
Second: I have a few general suggestions that are probably more geared towards coding practice than matlab in particular, but I think they are just as important.
1) Write your code in small manageable chunks that are easy to test. Don't write out a giant script and try to run it all at once. You'll just be in for headaches.
A simple example would be: "I'm interested in calculating h( g(x) + f(x))". (where h,g,f are all functions you have to write). You could write a long script to do that all, but really you should write f(x), and test it. Write g(x), test it. Write h(y), test it. Then test h(g(x) + f(x)). This may sound obvious, but always try to break down things into manageable, TESTABLE chunks.
2) Understand the problem you're trying to solve and how you are going to approach it before you get plugging along in matlab. If you are seeing unexpected behavior, you need to know if: the model is wrong, your math is wrong, your implementation of the model is wrong, or your code is wrong. (or all of the above) Again, this lets you step through troubleshooting, rather than having a huge mess of things to test at once.
Last:
The "help" and "doc" commands are your friends. Use them if you're stuck. And make friends with someone more experienced in your lab. Don't bug them a lot, but if you get stuck, don't hesitate to talk to them.
Moreover, there are a bunch of geometrical considerations you must take into account to model a sphere binding (with many ligands) to a receptor.
I would start by clearly defining all your parameters and going from there.
Yeah basically this.
MATLAB is essentially just the means by which you let the computer interpret and produce results for the model you have already constructed.
As an analogy, the model is the blueprint- it contains (hopefully) all the biological interactions you want to capture. MATLAB is a hammer- you use it after the blueprint is done to bring to life what's in the blueprint.
There are so many built in features with MATLAB that depending on your model you may be able to solve it in only a few lines of code or just using the PDE toolbox.
I will look into my parameters more and keep picking at MatLab as I go, and speak to my supervisor this afternoon. Unfortunately because I am in a Biomed lab, no-one I have asked can provide any help or direction at the moment.
Thanks again, I'll post an update in a couple of weeks.
There are probably courses you can take, if not, everything is on the internet, just searching for "matlab manual" or "matlab basics" will give you a lot of excellent free pdfs with tutorials and whatnot. This tutorials will familiarize you with Malab and you will discover you are more than capable of handling it. Once you have that, and you know the model you want to use, it's all pretty straightforward.
I am getting there, slowly but surely! It's the pace that's bothering me! Can I ask how long it took you to get to grips with it, there abouts!?
Thanks!
i am almost new in Matlab.
I am trying to calculate the value af a and a' to satisfy the condition in which a(i+1)-a(i)<1e-5 and same for a';
i wrote this code but it doesn't work:
clc;
clear all;
% enter design parameters
z=input('Number of blades=');
R=input('radius of Rotor =');
J=input('tip speed ratio=');
l=input('chord lenght=');
rr=input('radius position, r/R=');
beta= input('pitching angle=');
% initializing
a=0;
a_prim=0;
epsa=1e-5; epsa_prim=1e-5;
i=0;
max_iteration=1000;
tola=20;
tola_prim=20;
while (tola > epsa || tola_prim > eps_aprim) && (i < max_iteration)
i=i+1;
phi=atand((1-a)/(rr*J*(1+a_prim)));
alpha=phi-beta;
Cl=0.1*alpha;
r=R*rr;
lambda=z*l*Cl/(8*pi*r);
a=1/(1+((sin(phi)*tan(phi))/lambda));
a_prim=1/((cos(phi)/lambda)-1);
tola=a1-a;
tola_prim=a_prim1-a_prim;
end
would you please help me?
truly
Majid